Class: Gusto::Token::TokenGetSystemAccessTokenResponse
- Inherits:
-
Object
- Object
- Gusto::Token::TokenGetSystemAccessTokenResponse
- Defined in:
- lib/fern_gusto/token/types/token_get_system_access_token_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#access_token ⇒ String
readonly
The system access token.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#created_at ⇒ Integer
readonly
Unix timestamp when the token was created.
-
#expires_in ⇒ Integer
readonly
Number of seconds until the token expires.
- #token_type ⇒ String readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::Token::TokenGetSystemAccessTokenResponse
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(access_token:, token_type:, created_at:, expires_in:, additional_properties: nil) ⇒ Gusto::Token::TokenGetSystemAccessTokenResponse constructor
- #to_json ⇒ String
Constructor Details
#initialize(access_token:, token_type:, created_at:, expires_in:, additional_properties: nil) ⇒ Gusto::Token::TokenGetSystemAccessTokenResponse
30 31 32 33 34 35 36 37 |
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 30 def initialize(access_token:, token_type:, created_at:, expires_in:, additional_properties: nil) @access_token = access_token @token_type = token_type @created_at = created_at @expires_in = expires_in @additional_properties = additional_properties @_field_set = { "access_token": access_token, "token_type": token_type, "created_at": created_at, "expires_in": expires_in } end |
Instance Attribute Details
#access_token ⇒ String (readonly)
Returns The system access token.
9 10 11 |
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 9 def access_token @access_token end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 17 def additional_properties @additional_properties end |
#created_at ⇒ Integer (readonly)
Returns Unix timestamp when the token was created.
13 14 15 |
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 13 def created_at @created_at end |
#expires_in ⇒ Integer (readonly)
Returns Number of seconds until the token expires.
15 16 17 |
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 15 def expires_in @expires_in end |
#token_type ⇒ String (readonly)
11 12 13 |
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 11 def token_type @token_type end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Token::TokenGetSystemAccessTokenResponse
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 42 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) access_token = parsed_json["access_token"] token_type = parsed_json["token_type"] created_at = parsed_json["created_at"] expires_in = parsed_json["expires_in"] new( access_token: access_token, token_type: token_type, created_at: created_at, expires_in: expires_in, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
69 70 71 72 73 74 |
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 69 def self.validate_raw(obj:) obj.access_token.is_a?(String) != false || raise("Passed value for field obj.access_token is not the expected type, validation failed.") obj.token_type.is_a?(String) != false || raise("Passed value for field obj.token_type is not the expected type, validation failed.") obj.created_at.is_a?(Integer) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.expires_in.is_a?(Integer) != false || raise("Passed value for field obj.expires_in is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
60 61 62 |
# File 'lib/fern_gusto/token/types/token_get_system_access_token_response.rb', line 60 def to_json @_field_set&.to_json end |