Class: WorkOS::AgentToken

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/workos/agents/agent_token.rb

Constant Summary collapse

HASH_ATTRS =
{
  access_token: :access_token,
  token_type: :token_type,
  expires_in: :expires_in,
  refresh_token: :refresh_token,
  agent_instance_id: :agent_instance_id,
  new_instance: :new_instance,
  agent_instance_session_id: :agent_instance_session_id,
  permissions: :permissions
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ AgentToken

Returns a new instance of AgentToken.



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/workos/agents/agent_token.rb', line 28

def initialize(json)
  hash = self.class.normalize(json)
  @access_token = hash[:access_token]
  @token_type = hash[:token_type]
  @expires_in = hash[:expires_in]
  @refresh_token = hash[:refresh_token]
  @agent_instance_id = hash[:agent_instance_id]
  @new_instance = hash[:new_instance]
  @agent_instance_session_id = hash[:agent_instance_session_id]
  @permissions = hash[:permissions] || []
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



18
19
20
# File 'lib/workos/agents/agent_token.rb', line 18

def access_token
  @access_token
end

#agent_instance_idObject

Returns the value of attribute agent_instance_id.



18
19
20
# File 'lib/workos/agents/agent_token.rb', line 18

def agent_instance_id
  @agent_instance_id
end

#agent_instance_session_idObject

Returns the value of attribute agent_instance_session_id.



18
19
20
# File 'lib/workos/agents/agent_token.rb', line 18

def agent_instance_session_id
  @agent_instance_session_id
end

#expires_inObject

Returns the value of attribute expires_in.



18
19
20
# File 'lib/workos/agents/agent_token.rb', line 18

def expires_in
  @expires_in
end

#new_instanceObject

Returns the value of attribute new_instance.



18
19
20
# File 'lib/workos/agents/agent_token.rb', line 18

def new_instance
  @new_instance
end

#permissionsObject

Returns the value of attribute permissions.



18
19
20
# File 'lib/workos/agents/agent_token.rb', line 18

def permissions
  @permissions
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



18
19
20
# File 'lib/workos/agents/agent_token.rb', line 18

def refresh_token
  @refresh_token
end

#token_typeObject

Returns the value of attribute token_type.



18
19
20
# File 'lib/workos/agents/agent_token.rb', line 18

def token_type
  @token_type
end