Class: KeycloakAdmin::CredentialRepresentation

Inherits:
Representation show all
Defined in:
lib/keycloak-admin/representation/credential_representation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Representation

#as_json, #to_json

Methods included from CamelJson

#camelize

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def algorithm
  @algorithm
end

#configObject

Returns the value of attribute config.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def config
  @config
end

#counterObject

Returns the value of attribute counter.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def counter
  @counter
end

#created_dateObject

Returns the value of attribute created_date.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def created_date
  @created_date
end

#deviceObject

Returns the value of attribute device.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def device
  @device
end

#digitsObject

Returns the value of attribute digits.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def digits
  @digits
end

#hashedSaltedValueObject

Returns the value of attribute hashedSaltedValue.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def hashedSaltedValue
  @hashedSaltedValue
end

#hashIterationsObject

Returns the value of attribute hashIterations.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def hashIterations
  @hashIterations
end

#periodObject

Returns the value of attribute period.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def period
  @period
end

#saltObject

Returns the value of attribute salt.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def salt
  @salt
end

#temporaryObject

Returns the value of attribute temporary.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def temporary
  @temporary
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def type
  @type
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 30

def self.from_hash(hash)
  credential = new
  hash.each do |key, value|
    property = "@#{key}".to_sym
    credential.instance_variable_set(property, value)
  end
  credential
end

.from_json(json) ⇒ Object



25
26
27
28
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 25

def self.from_json(json)
  attributes = JSON.parse(json)
  from_hash(attributes)
end

.from_password(password, temporary = false) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 17

def self.from_password(password, temporary=false)
  credential = new
  credential.value     = password
  credential.type      = "password"
  credential.temporary = temporary
  credential
end