class KeycloakAdmin::UserRepresentation

Attributes

attributes[RW]
created_timestamp[RW]
credentials[RW]
email[RW]
email_verified[RW]
enabled[RW]
federated_identities[RW]
first_name[RW]
id[RW]
last_name[RW]
origin[RW]
required_actions[RW]
totp[RW]
username[RW]

Public Class Methods

from_hash(hash) click to toggle source
# File lib/keycloak-admin/representation/user_representation.rb, line 18
def self.from_hash(hash)
  user                      = new
  user.id                   = hash["id"]
  user.created_timestamp    = 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

Public Instance Methods

add_credential(credential_representation) click to toggle source
# 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) click to toggle source
# 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