Class: TmdbApiClient::AuthCreateAccessTokenResponse
- Inherits:
-
Object
- Object
- TmdbApiClient::AuthCreateAccessTokenResponse
- Defined in:
- lib/tmdb_ryanstep/types/auth_create_access_token_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #access_token ⇒ String readonly
- #account_id ⇒ String readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #status_code ⇒ Integer readonly
- #status_message ⇒ String readonly
- #success ⇒ Boolean readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ TmdbApiClient::AuthCreateAccessTokenResponse
Deserialize a JSON object to an instance of AuthCreateAccessTokenResponse.
-
.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(account_id: OMIT, access_token: OMIT, success: OMIT, status_message: OMIT, status_code: OMIT, additional_properties: nil) ⇒ TmdbApiClient::AuthCreateAccessTokenResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AuthCreateAccessTokenResponse to a JSON object.
Constructor Details
#initialize(account_id: OMIT, access_token: OMIT, success: OMIT, status_message: OMIT, status_code: OMIT, additional_properties: nil) ⇒ TmdbApiClient::AuthCreateAccessTokenResponse
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 33 def initialize(account_id: OMIT, access_token: OMIT, success: OMIT, status_message: OMIT, status_code: OMIT, additional_properties: nil) @account_id = account_id if account_id != OMIT @access_token = access_token if access_token != OMIT @success = success if success != OMIT @status_message = if != OMIT @status_code = status_code if status_code != OMIT @additional_properties = additional_properties @_field_set = { "account_id": account_id, "access_token": access_token, "success": success, "status_message": , "status_code": status_code }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#access_token ⇒ String (readonly)
11 12 13 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 11 def access_token @access_token end |
#account_id ⇒ String (readonly)
9 10 11 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 9 def account_id @account_id end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 19 def additional_properties @additional_properties end |
#status_code ⇒ Integer (readonly)
17 18 19 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 17 def status_code @status_code end |
#status_message ⇒ String (readonly)
15 16 17 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 15 def @status_message end |
#success ⇒ Boolean (readonly)
13 14 15 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 13 def success @success end |
Class Method Details
.from_json(json_object:) ⇒ TmdbApiClient::AuthCreateAccessTokenResponse
Deserialize a JSON object to an instance of AuthCreateAccessTokenResponse
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 56 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) account_id = parsed_json["account_id"] access_token = parsed_json["access_token"] success = parsed_json["success"] = parsed_json["status_message"] status_code = parsed_json["status_code"] new( account_id: account_id, access_token: access_token, success: success, status_message: , status_code: status_code, 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.
87 88 89 90 91 92 93 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 87 def self.validate_raw(obj:) obj.account_id&.is_a?(String) != false || raise("Passed value for field obj.account_id is not the expected type, validation failed.") obj.access_token&.is_a?(String) != false || raise("Passed value for field obj.access_token is not the expected type, validation failed.") obj.success&.is_a?(Boolean) != false || raise("Passed value for field obj.success is not the expected type, validation failed.") obj.&.is_a?(String) != false || raise("Passed value for field obj.status_message is not the expected type, validation failed.") obj.status_code&.is_a?(Integer) != false || raise("Passed value for field obj.status_code is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AuthCreateAccessTokenResponse to a JSON object
77 78 79 |
# File 'lib/tmdb_ryanstep/types/auth_create_access_token_response.rb', line 77 def to_json(*_args) @_field_set&.to_json end |