Class: WorkOS::AuthenticateResponseOAuthToken

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

Constant Summary collapse

HASH_ATTRS =
{
  provider: :provider,
  refresh_token: :refresh_token,
  access_token: :access_token,
  expires_at: :expires_at,
  scopes: :scopes
}.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) ⇒ AuthenticateResponseOAuthToken

Returns a new instance of AuthenticateResponseOAuthToken.



22
23
24
25
26
27
28
29
# File 'lib/workos/user_management/authenticate_response_oauth_token.rb', line 22

def initialize(json)
  hash = self.class.normalize(json)
  @provider = hash[:provider]
  @refresh_token = hash[:refresh_token]
  @access_token = hash[:access_token]
  @expires_at = hash[:expires_at]
  @scopes = hash[:scopes] || []
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



15
16
17
# File 'lib/workos/user_management/authenticate_response_oauth_token.rb', line 15

def access_token
  @access_token
end

#expires_atObject

Returns the value of attribute expires_at.



15
16
17
# File 'lib/workos/user_management/authenticate_response_oauth_token.rb', line 15

def expires_at
  @expires_at
end

#providerObject

Returns the value of attribute provider.



15
16
17
# File 'lib/workos/user_management/authenticate_response_oauth_token.rb', line 15

def provider
  @provider
end

#refresh_tokenObject

Returns the value of attribute refresh_token.



15
16
17
# File 'lib/workos/user_management/authenticate_response_oauth_token.rb', line 15

def refresh_token
  @refresh_token
end

#scopesObject

Returns the value of attribute scopes.



15
16
17
# File 'lib/workos/user_management/authenticate_response_oauth_token.rb', line 15

def scopes
  @scopes
end