Class: OneLogin::Api::Models::User
- Inherits:
-
Object
- Object
- OneLogin::Api::Models::User
- Defined in:
- lib/onelogin/api/models/user.rb
Instance Attribute Summary collapse
-
#activated_at ⇒ Object
Returns the value of attribute activated_at.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#company ⇒ Object
Returns the value of attribute company.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#custom_attributes ⇒ Object
Returns the value of attribute custom_attributes.
-
#department ⇒ Object
Returns the value of attribute department.
-
#directory_id ⇒ Object
Returns the value of attribute directory_id.
-
#distinguished_name ⇒ Object
Returns the value of attribute distinguished_name.
-
#email ⇒ Object
Returns the value of attribute email.
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#firstname ⇒ Object
Returns the value of attribute firstname.
-
#group_id ⇒ Object
Returns the value of attribute group_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#invalid_login_attempts ⇒ Object
Returns the value of attribute invalid_login_attempts.
-
#invitation_sent_at ⇒ Object
Returns the value of attribute invitation_sent_at.
-
#last_login ⇒ Object
Returns the value of attribute last_login.
-
#lastname ⇒ Object
Returns the value of attribute lastname.
-
#locale_code ⇒ Object
Returns the value of attribute locale_code.
-
#locked_until ⇒ Object
Returns the value of attribute locked_until.
-
#manager_ad_id ⇒ Object
Returns the value of attribute manager_ad_id.
-
#manager_user_id ⇒ Object
Returns the value of attribute manager_user_id.
-
#member_of ⇒ Object
Returns the value of attribute member_of.
-
#openid_name ⇒ Object
Returns the value of attribute openid_name.
-
#password_changed_at ⇒ Object
Returns the value of attribute password_changed_at.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#role_ids ⇒ Object
Returns the value of attribute role_ids.
-
#samaccountname ⇒ Object
Returns the value of attribute samaccountname.
-
#state ⇒ Object
Returns the value of attribute state.
-
#status ⇒ Object
Returns the value of attribute status.
-
#title ⇒ Object
Returns the value of attribute title.
-
#trusted_idp_id ⇒ Object
Returns the value of attribute trusted_idp_id.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#username ⇒ Object
Returns the value of attribute username.
-
#userprincipalname ⇒ Object
Returns the value of attribute userprincipalname.
Instance Method Summary collapse
- #get_custom_attributes ⇒ Object
- #get_group_id ⇒ Object
- #get_role_ids ⇒ Object
- #get_user_data ⇒ Object
- #get_user_metadata ⇒ Object
- #get_user_params ⇒ Object
-
#initialize(data) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(data) ⇒ User
Returns a new instance of User.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/onelogin/api/models/user.rb', line 13 def initialize(data) @id = data['id'] @external_id = data['external_id'] @email = data['email'].to_s @username = data['username'].to_s @firstname = data['firstname'].to_s @lastname = data['lastname'].to_s @distinguished_name = data['distinguished_name'].to_s @phone = data['phone'].to_s @company = data['company'].to_s @department = data['department'].to_s @title = data['title'].to_s @status = data['status'] @state = data['state'] @member_of = data['member_of'].to_s @samaccountname = data['samaccountname'].to_s @userprincipalname = data['userprincipalname'].to_s @group_id = data['group_id']? data['group_id'].to_i : nil @role_ids = data['role_id']? data['role_id'] : [] @custom_attributes = data['custom_attributes'] ? data['custom_attributes'] : [] @openid_name = data['openid_name'].to_s @locale_code = data['locale_code'].to_s @comment = data['comment'].to_s @directory_id = data['directory_id'] @manager_ad_id = data['manager_ad_id'] @trusted_idp_id = data['trusted_idp_id'] @manager_user_id = data['manager_user_id'] @activated_at = data['activated_at']? Time.iso8601(data['activated_at']) : nil @created_at = data['created_at']? Time.iso8601(data['created_at']) : nil @updated_at = data['updated_at']? Time.iso8601(data['updated_at']) : nil @password_changed_at = data['password_changed_at']? Time.iso8601(data['password_changed_at']) : nil @invitation_sent_at = data['invitation_sent_at']? Time.iso8601(data['invitation_sent_at']) : nil @invalid_login_attempts = data['invalid_login_attempts'] @last_login = data['last_login']? Time.iso8601(data['last_login']) : nil @locked_until = data['locked_until']? Time.iso8601(data['locked_until']) : nil end |
Instance Attribute Details
#activated_at ⇒ Object
Returns the value of attribute activated_at.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def activated_at @activated_at end |
#comment ⇒ Object
Returns the value of attribute comment.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def comment @comment end |
#company ⇒ Object
Returns the value of attribute company.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def company @company end |
#created_at ⇒ Object
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def created_at @created_at end |
#custom_attributes ⇒ Object
Returns the value of attribute custom_attributes.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def custom_attributes @custom_attributes end |
#department ⇒ Object
Returns the value of attribute department.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def department @department end |
#directory_id ⇒ Object
Returns the value of attribute directory_id.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def directory_id @directory_id end |
#distinguished_name ⇒ Object
Returns the value of attribute distinguished_name.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def distinguished_name @distinguished_name end |
#email ⇒ Object
Returns the value of attribute email.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def email @email end |
#external_id ⇒ Object
Returns the value of attribute external_id.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def external_id @external_id end |
#firstname ⇒ Object
Returns the value of attribute firstname.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def firstname @firstname end |
#group_id ⇒ Object
Returns the value of attribute group_id.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def group_id @group_id end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def id @id end |
#invalid_login_attempts ⇒ Object
Returns the value of attribute invalid_login_attempts.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def invalid_login_attempts @invalid_login_attempts end |
#invitation_sent_at ⇒ Object
Returns the value of attribute invitation_sent_at.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def invitation_sent_at @invitation_sent_at end |
#last_login ⇒ Object
Returns the value of attribute last_login.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def last_login @last_login end |
#lastname ⇒ Object
Returns the value of attribute lastname.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def lastname @lastname end |
#locale_code ⇒ Object
Returns the value of attribute locale_code.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def locale_code @locale_code end |
#locked_until ⇒ Object
Returns the value of attribute locked_until.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def locked_until @locked_until end |
#manager_ad_id ⇒ Object
Returns the value of attribute manager_ad_id.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def manager_ad_id @manager_ad_id end |
#manager_user_id ⇒ Object
Returns the value of attribute manager_user_id.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def manager_user_id @manager_user_id end |
#member_of ⇒ Object
Returns the value of attribute member_of.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def member_of @member_of end |
#openid_name ⇒ Object
Returns the value of attribute openid_name.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def openid_name @openid_name end |
#password_changed_at ⇒ Object
Returns the value of attribute password_changed_at.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def password_changed_at @password_changed_at end |
#phone ⇒ Object
Returns the value of attribute phone.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def phone @phone end |
#role_ids ⇒ Object
Returns the value of attribute role_ids.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def role_ids @role_ids end |
#samaccountname ⇒ Object
Returns the value of attribute samaccountname.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def samaccountname @samaccountname end |
#state ⇒ Object
Returns the value of attribute state.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def state @state end |
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def status @status end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def title @title end |
#trusted_idp_id ⇒ Object
Returns the value of attribute trusted_idp_id.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def trusted_idp_id @trusted_idp_id end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def updated_at @updated_at end |
#username ⇒ Object
Returns the value of attribute username.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def username @username end |
#userprincipalname ⇒ Object
Returns the value of attribute userprincipalname.
7 8 9 |
# File 'lib/onelogin/api/models/user.rb', line 7 def userprincipalname @userprincipalname end |
Instance Method Details
#get_custom_attributes ⇒ Object
101 102 103 |
# File 'lib/onelogin/api/models/user.rb', line 101 def get_custom_attributes @custom_attributes end |
#get_group_id ⇒ Object
54 55 56 |
# File 'lib/onelogin/api/models/user.rb', line 54 def get_group_id @group_id end |
#get_role_ids ⇒ Object
50 51 52 |
# File 'lib/onelogin/api/models/user.rb', line 50 def get_role_ids @role_ids end |
#get_user_data ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/onelogin/api/models/user.rb', line 58 def get_user_data user_data = UserData.new user_data.id = @id user_data.external_id = @external_id user_data.email = @email user_data.username = @username user_data.firstname = @firstname user_data.lastname = @lastname user_data.distinguished_name = @distinguished_name user_data.phone = @phone user_data.company = @company user_data.department = @department user_data.title = @title user_data.status = @status user_data.state = @state user_data.member_of = @member_of user_data.samaccountname = @samaccountname user_data.userprincipalname = @userprincipalname user_data.openid_name = @openid_name user_data.locale_code = @locale_code user_data.directory_id = @directory_id user_data.manager_ad_id = @manager_ad_id user_data.trusted_idp_id = @trusted_idp_id user_data.manager_user_id = @manager_user_id return user_data end |
#get_user_metadata ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/onelogin/api/models/user.rb', line 85 def = UserMetadata.new .id = @id .activated_at = @activated_at .created_at = @created_at .updated_at = @updated_at .password_changed_at = @password_changed_at .invalid_login_attempts = @invalid_login_attempts .invitation_sent_at = @invitation_sent_at .last_login = @last_login .locked_until = @locked_until .comment = @comment return end |
#get_user_params ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/onelogin/api/models/user.rb', line 105 def get_user_params return { "external_id"=> self.external_id, "email"=> self.email, "username"=> self.username, "firstname"=> self.firstname, "lastname"=> self.lastname, "distinguished_name"=> self.distinguished_name, "phone"=> self.phone, "company"=> self.company, "department"=> self.department, "title"=> self.title, "status"=> self.status, "state"=> self.state, "member_of"=> self.member_of, "samaccountname"=> self.samaccountname, "invalid_login_attempts"=> self.invalid_login_attempts, "userprincipalname"=> self.userprincipalname, "group_id"=> self.group_id, "locale_code"=> self.locale_code, "openid_name"=> self.openid_name, "directory_id"=> self.directory_id, "manager_ad_id"=> self.manager_ad_id, "trusted_idp_id"=> self.trusted_idp_id, "manager_user_id"=> self.manager_user_id } end |