Class: WorkOS::CreateUserApiKey

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/user_management/create_user_api_key.rb

Constant Summary collapse

HASH_ATTRS =
{
  name: :name,
  organization_id: :organization_id,
  permissions: :permissions
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

normalize

Methods included from HashProvider

#inspect, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ CreateUserApiKey

Returns a new instance of CreateUserApiKey.



18
19
20
21
22
23
# File 'lib/workos/user_management/create_user_api_key.rb', line 18

def initialize(json)
  hash = self.class.normalize(json)
  @name = hash[:name]
  @organization_id = hash[:organization_id]
  @permissions = hash[:permissions] || []
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/workos/user_management/create_user_api_key.rb', line 13

def name
  @name
end

#organization_idObject

Returns the value of attribute organization_id.



13
14
15
# File 'lib/workos/user_management/create_user_api_key.rb', line 13

def organization_id
  @organization_id
end

#permissionsObject

Returns the value of attribute permissions.



13
14
15
# File 'lib/workos/user_management/create_user_api_key.rb', line 13

def permissions
  @permissions
end