Class: WorkOS::CreateUserOrganizationMembership

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

Constant Summary collapse

HASH_ATTRS =
{
  user_id: :user_id,
  organization_id: :organization_id,
  role_slug: :role_slug,
  role_slugs: :role_slugs
}.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) ⇒ CreateUserOrganizationMembership

Returns a new instance of CreateUserOrganizationMembership.



20
21
22
23
24
25
26
# File 'lib/workos/user_management/create_user_organization_membership.rb', line 20

def initialize(json)
  hash = self.class.normalize(json)
  @user_id = hash[:user_id]
  @organization_id = hash[:organization_id]
  @role_slug = hash[:role_slug]
  @role_slugs = hash[:role_slugs] || []
end

Instance Attribute Details

#organization_idObject

Returns the value of attribute organization_id.



14
15
16
# File 'lib/workos/user_management/create_user_organization_membership.rb', line 14

def organization_id
  @organization_id
end

#role_slugObject

Returns the value of attribute role_slug.



14
15
16
# File 'lib/workos/user_management/create_user_organization_membership.rb', line 14

def role_slug
  @role_slug
end

#role_slugsObject

Returns the value of attribute role_slugs.



14
15
16
# File 'lib/workos/user_management/create_user_organization_membership.rb', line 14

def role_slugs
  @role_slugs
end

#user_idObject

Returns the value of attribute user_id.



14
15
16
# File 'lib/workos/user_management/create_user_organization_membership.rb', line 14

def user_id
  @user_id
end