@@ -7,7 +7,7 @@ module WorkOS
7
7
class DirectoryUser < DeprecatedHashWrapper
8
8
include HashProvider
9
9
10
- attr_accessor :id , :idp_id , :emails , :first_name , :last_name , :job_title , :username , :state ,
10
+ attr_accessor :id , :idp_id , :email , : emails, :first_name , :last_name , :job_title , :username , :state ,
11
11
:groups , :role , :custom_attributes , :raw_attributes , :directory_id , :organization_id ,
12
12
:created_at , :updated_at
13
13
@@ -19,10 +19,20 @@ def initialize(json)
19
19
@directory_id = hash [ :directory_id ]
20
20
@organization_id = hash [ :organization_id ]
21
21
@idp_id = hash [ :idp_id ]
22
+ @email = hash [ :email ]
23
+ # @deprecated Will be removed in a future major version.
24
+ # Enable the `emails` custom attribute in dashboard and pull from customAttributes instead.
25
+ # See https://workos.com/docs/directory-sync/attributes/custom-attributes/auto-mapped-attributes for details.
22
26
@emails = hash [ :emails ]
23
27
@first_name = hash [ :first_name ]
24
28
@last_name = hash [ :last_name ]
29
+ # @deprecated Will be removed in a future major version.
30
+ # Enable the `job_title` custom attribute in dashboard and pull from customAttributes instead.
31
+ # See https://workos.com/docs/directory-sync/attributes/custom-attributes/auto-mapped-attributes for details.
25
32
@job_title = hash [ :job_title ]
33
+ # @deprecated Will be removed in a future major version.
34
+ # Enable the `username` custom attribute in dashboard and pull from customAttributes instead.
35
+ # See https://workos.com/docs/directory-sync/attributes/custom-attributes/auto-mapped-attributes for details.
26
36
@username = hash [ :username ]
27
37
@state = hash [ :state ]
28
38
@groups = hash [ :groups ]
@@ -42,6 +52,7 @@ def to_json(*)
42
52
directory_id : directory_id ,
43
53
organization_id : organization_id ,
44
54
idp_id : idp_id ,
55
+ email : email ,
45
56
emails : emails ,
46
57
first_name : first_name ,
47
58
last_name : last_name ,
@@ -57,6 +68,7 @@ def to_json(*)
57
68
}
58
69
end
59
70
71
+ # @deprecated Will be removed in a future major version. Use {#email} instead.
60
72
def primary_email
61
73
primary_email = ( emails || [ ] ) . find { |email | email [ :primary ] }
62
74
return primary_email [ :value ] if primary_email
0 commit comments