Class: KeycloakAdmin::UserRepresentation
- Inherits:
-
Representation
- Object
- Representation
- KeycloakAdmin::UserRepresentation
- Defined in:
- lib/keycloak-admin/representation/user_representation.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#created_timestamp ⇒ Object
Returns the value of attribute created_timestamp.
-
#credentials ⇒ Object
Returns the value of attribute credentials.
-
#email ⇒ Object
Returns the value of attribute email.
-
#email_verified ⇒ Object
Returns the value of attribute email_verified.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#federated_identities ⇒ Object
Returns the value of attribute federated_identities.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#required_actions ⇒ Object
Returns the value of attribute required_actions.
-
#totp ⇒ Object
Returns the value of attribute totp.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
- #add_credential(credential_representation) ⇒ Object
- #add_federated_identity(federated_identity_representation) ⇒ Object
Methods inherited from Representation
Methods included from CamelJson
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def attributes @attributes end |
#created_timestamp ⇒ Object
Returns the value of attribute created_timestamp.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def @created_timestamp end |
#credentials ⇒ Object
Returns the value of attribute credentials.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def credentials @credentials end |
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def email @email end |
#email_verified ⇒ Object
Returns the value of attribute email_verified.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def email_verified @email_verified end |
#enabled ⇒ Object
Returns the value of attribute enabled.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def enabled @enabled end |
#federated_identities ⇒ Object
Returns the value of attribute federated_identities.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def federated_identities @federated_identities end |
#first_name ⇒ Object
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def id @id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def last_name @last_name end |
#origin ⇒ Object
Returns the value of attribute origin.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def origin @origin end |
#required_actions ⇒ Object
Returns the value of attribute required_actions.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def required_actions @required_actions end |
#totp ⇒ Object
Returns the value of attribute totp.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def totp @totp end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 3 def username @username end |
Class Method Details
.from_hash(hash) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 18 def self.from_hash(hash) user = new user.id = hash["id"] user. = hash["createdTimestamp"] user.origin = hash["origin"] user.username = hash["username"] user.email = hash["email"] user.enabled = hash["enabled"] user.email_verified = hash["emailVerified"] user.first_name = hash["firstName"] user.last_name = hash["lastName"] user.attributes = hash["attributes"] user.required_actions = hash["requiredActions"] || [] user.totp = hash["totp"] || false user.credentials = hash["credentials"]&.map{ |hash| CredentialRepresentation.from_hash(hash) } || [] user.federated_identities = hash["federatedIdentities"]&.map { |hash| FederatedIdentityRepresentation.from_hash(hash) } || [] user end |
Instance Method Details
#add_credential(credential_representation) ⇒ Object
37 38 39 40 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 37 def add_credential(credential_representation) @credentials ||= [] @credentials.push(credential_representation) end |
#add_federated_identity(federated_identity_representation) ⇒ Object
42 43 44 45 |
# File 'lib/keycloak-admin/representation/user_representation.rb', line 42 def add_federated_identity(federated_identity_representation) @federated_identities ||= [] @federated_identities.push(federated_identity_representation) end |