Class: KeycloakAdmin::ClientAuthzResourceRepresentation

Inherits:
Representation
  • Object
show all
Defined in:
lib/keycloak-admin/representation/client_authz_resource_representation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Representation

#as_json, from_json, #to_json

Methods included from CamelJson

#camelize

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



4
5
6
# File 'lib/keycloak-admin/representation/client_authz_resource_representation.rb', line 4

def attributes
  @attributes
end

#display_nameObject

Returns the value of attribute display_name.



4
5
6
# File 'lib/keycloak-admin/representation/client_authz_resource_representation.rb', line 4

def display_name
  @display_name
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/keycloak-admin/representation/client_authz_resource_representation.rb', line 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/keycloak-admin/representation/client_authz_resource_representation.rb', line 4

def name
  @name
end

#owner_managed_accessObject

Returns the value of attribute owner_managed_access.



4
5
6
# File 'lib/keycloak-admin/representation/client_authz_resource_representation.rb', line 4

def owner_managed_access
  @owner_managed_access
end

#scopesObject

Returns the value of attribute scopes.



4
5
6
# File 'lib/keycloak-admin/representation/client_authz_resource_representation.rb', line 4

def scopes
  @scopes
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/keycloak-admin/representation/client_authz_resource_representation.rb', line 4

def type
  @type
end

#urisObject

Returns the value of attribute uris.



4
5
6
# File 'lib/keycloak-admin/representation/client_authz_resource_representation.rb', line 4

def uris
  @uris
end

Class Method Details

.from_hash(hash) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/keycloak-admin/representation/client_authz_resource_representation.rb', line 13

def self.from_hash(hash)
  resource                      = new
  resource.id                   = hash["_id"]
  resource.type                 = hash["type"]
  resource.name                 = hash["name"]
  resource.owner_managed_access = hash["ownerManagedAccess"]
  resource.uris                 = hash["uris"]
  resource.display_name         = hash["displayName"]
  resource.attributes           = hash.fetch("attributes", {}).map { |k, v| [k.to_sym, Array(v)] }.to_h
  resource.scopes               = (hash["scopes"] || []).map { |scope_hash| ClientAuthzScopeRepresentation.from_hash(scope_hash) }
  resource
end