Class: CandidApiClient::Auth::V2::Types::AuthGetTokenResponse
- Inherits:
-
Object
- Object
- CandidApiClient::Auth::V2::Types::AuthGetTokenResponse
- Defined in:
- lib/candidhealth/auth/v_2/types/auth_get_token_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #access_token ⇒ String readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#expires_in ⇒ Integer
readonly
Time in seconds.
- #token_type ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Auth::V2::Types::AuthGetTokenResponse
Deserialize a JSON object to an instance of AuthGetTokenResponse.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(access_token:, expires_in:, token_type:, additional_properties: nil) ⇒ CandidApiClient::Auth::V2::Types::AuthGetTokenResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AuthGetTokenResponse to a JSON object.
Constructor Details
#initialize(access_token:, expires_in:, token_type:, additional_properties: nil) ⇒ CandidApiClient::Auth::V2::Types::AuthGetTokenResponse
30 31 32 33 34 35 36 |
# File 'lib/candidhealth/auth/v_2/types/auth_get_token_response.rb', line 30 def initialize(access_token:, expires_in:, token_type:, additional_properties: nil) @access_token = access_token @expires_in = expires_in @token_type = token_type @additional_properties = additional_properties @_field_set = { "access_token": access_token, "expires_in": expires_in, "token_type": token_type } end |
Instance Attribute Details
#access_token ⇒ String (readonly)
12 13 14 |
# File 'lib/candidhealth/auth/v_2/types/auth_get_token_response.rb', line 12 def access_token @access_token end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/candidhealth/auth/v_2/types/auth_get_token_response.rb', line 18 def additional_properties @additional_properties end |
#expires_in ⇒ Integer (readonly)
Returns Time in seconds.
14 15 16 |
# File 'lib/candidhealth/auth/v_2/types/auth_get_token_response.rb', line 14 def expires_in @expires_in end |
#token_type ⇒ String (readonly)
16 17 18 |
# File 'lib/candidhealth/auth/v_2/types/auth_get_token_response.rb', line 16 def token_type @token_type end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Auth::V2::Types::AuthGetTokenResponse
Deserialize a JSON object to an instance of AuthGetTokenResponse
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/candidhealth/auth/v_2/types/auth_get_token_response.rb', line 42 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) access_token = struct["access_token"] expires_in = struct["expires_in"] token_type = struct["token_type"] new( access_token: access_token, expires_in: expires_in, token_type: token_type, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
68 69 70 71 72 |
# File 'lib/candidhealth/auth/v_2/types/auth_get_token_response.rb', line 68 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.expires_in.is_a?(Integer) != false || raise("Passed value for field obj.expires_in 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.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AuthGetTokenResponse to a JSON object
58 59 60 |
# File 'lib/candidhealth/auth/v_2/types/auth_get_token_response.rb', line 58 def to_json(*_args) @_field_set&.to_json end |