Class: TmdbApiClient::ListUpdateItemsResponse
- Inherits:
-
Object
- Object
- TmdbApiClient::ListUpdateItemsResponse
- Defined in:
- lib/tmdb_ryanstep/types/list_update_items_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #results ⇒ Array<TmdbApiClient::ListUpdateItemsResponseResultsItem> readonly
- #status_code ⇒ Integer readonly
- #status_message ⇒ String readonly
- #success ⇒ Boolean readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ TmdbApiClient::ListUpdateItemsResponse
Deserialize a JSON object to an instance of ListUpdateItemsResponse.
-
.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(status_message: OMIT, results: OMIT, success: OMIT, status_code: OMIT, additional_properties: nil) ⇒ TmdbApiClient::ListUpdateItemsResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ListUpdateItemsResponse to a JSON object.
Constructor Details
#initialize(status_message: OMIT, results: OMIT, success: OMIT, status_code: OMIT, additional_properties: nil) ⇒ TmdbApiClient::ListUpdateItemsResponse
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/tmdb_ryanstep/types/list_update_items_response.rb', line 31 def initialize(status_message: OMIT, results: OMIT, success: OMIT, status_code: OMIT, additional_properties: nil) @status_message = if != OMIT @results = results if results != OMIT @success = success if success != OMIT @status_code = status_code if status_code != OMIT @additional_properties = additional_properties @_field_set = { "status_message": , "results": results, "success": success, "status_code": status_code }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/tmdb_ryanstep/types/list_update_items_response.rb', line 18 def additional_properties @additional_properties end |
#results ⇒ Array<TmdbApiClient::ListUpdateItemsResponseResultsItem> (readonly)
12 13 14 |
# File 'lib/tmdb_ryanstep/types/list_update_items_response.rb', line 12 def results @results end |
#status_code ⇒ Integer (readonly)
16 17 18 |
# File 'lib/tmdb_ryanstep/types/list_update_items_response.rb', line 16 def status_code @status_code end |
#status_message ⇒ String (readonly)
10 11 12 |
# File 'lib/tmdb_ryanstep/types/list_update_items_response.rb', line 10 def @status_message end |
#success ⇒ Boolean (readonly)
14 15 16 |
# File 'lib/tmdb_ryanstep/types/list_update_items_response.rb', line 14 def success @success end |
Class Method Details
.from_json(json_object:) ⇒ TmdbApiClient::ListUpdateItemsResponse
Deserialize a JSON object to an instance of ListUpdateItemsResponse
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/tmdb_ryanstep/types/list_update_items_response.rb', line 51 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) = parsed_json["status_message"] results = parsed_json["results"]&.map do |item| item = item.to_json TmdbApiClient::ListUpdateItemsResponseResultsItem.from_json(json_object: item) end success = parsed_json["success"] status_code = parsed_json["status_code"] new( status_message: , results: results, success: success, 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.
83 84 85 86 87 88 |
# File 'lib/tmdb_ryanstep/types/list_update_items_response.rb', line 83 def self.validate_raw(obj:) obj.&.is_a?(String) != false || raise("Passed value for field obj.status_message is not the expected type, validation failed.") obj.results&.is_a?(Array) != false || raise("Passed value for field obj.results 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.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 ListUpdateItemsResponse to a JSON object
73 74 75 |
# File 'lib/tmdb_ryanstep/types/list_update_items_response.rb', line 73 def to_json(*_args) @_field_set&.to_json end |