Class: WorkOS::SSOTokenResponse
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::SSOTokenResponse
- Defined in:
- lib/workos/sso/sso_token_response.rb
Constant Summary collapse
- HASH_ATTRS =
{ token_type: :token_type, access_token: :access_token, expires_in: :expires_in, profile: :profile, oauth_tokens: :oauth_tokens }.freeze
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#expires_in ⇒ Object
Returns the value of attribute expires_in.
-
#oauth_tokens ⇒ Object
Returns the value of attribute oauth_tokens.
-
#profile ⇒ Object
Returns the value of attribute profile.
-
#token_type ⇒ Object
Returns the value of attribute token_type.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ SSOTokenResponse
constructor
A new instance of SSOTokenResponse.
Methods inherited from Types::BaseModel
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ SSOTokenResponse
Returns a new instance of SSOTokenResponse.
22 23 24 25 26 27 28 29 |
# File 'lib/workos/sso/sso_token_response.rb', line 22 def initialize(json) hash = self.class.normalize(json) @token_type = hash[:token_type] @access_token = hash[:access_token] @expires_in = hash[:expires_in] @profile = hash[:profile] ? WorkOS::Profile.new(hash[:profile]) : nil @oauth_tokens = hash[:oauth_tokens] ? WorkOS::SSOTokenResponseOAuthToken.new(hash[:oauth_tokens]) : nil end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
15 16 17 |
# File 'lib/workos/sso/sso_token_response.rb', line 15 def access_token @access_token end |
#expires_in ⇒ Object
Returns the value of attribute expires_in.
15 16 17 |
# File 'lib/workos/sso/sso_token_response.rb', line 15 def expires_in @expires_in end |
#oauth_tokens ⇒ Object
Returns the value of attribute oauth_tokens.
15 16 17 |
# File 'lib/workos/sso/sso_token_response.rb', line 15 def oauth_tokens @oauth_tokens end |
#profile ⇒ Object
Returns the value of attribute profile.
15 16 17 |
# File 'lib/workos/sso/sso_token_response.rb', line 15 def profile @profile end |
#token_type ⇒ Object
Returns the value of attribute token_type.
15 16 17 |
# File 'lib/workos/sso/sso_token_response.rb', line 15 def token_type @token_type end |