Class: TmdbApiClient::ListDetailsResponse
- Inherits:
-
Object
- Object
- TmdbApiClient::ListDetailsResponse
- Defined in:
- lib/tmdb_ryanstep/types/list_details_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #average_rating ⇒ Float readonly
- #backdrop_path ⇒ String readonly
- #comments ⇒ TmdbApiClient::ListDetailsResponseComments readonly
- #created_by ⇒ TmdbApiClient::ListDetailsResponseCreatedBy readonly
- #description ⇒ String readonly
- #id ⇒ Integer readonly
- #iso_3166_1 ⇒ String readonly
- #iso_639_1 ⇒ String readonly
- #item_count ⇒ Integer readonly
- #name ⇒ String readonly
- #object_ids ⇒ TmdbApiClient::ListDetailsResponseObjectIds readonly
- #page ⇒ Integer readonly
- #poster_path ⇒ String readonly
- #public ⇒ Boolean readonly
- #results ⇒ Array<TmdbApiClient::ListDetailsResponseResultsItem> readonly
- #revenue ⇒ Integer readonly
- #runtime ⇒ Integer readonly
- #sort_by ⇒ String readonly
- #total_pages ⇒ Integer readonly
- #total_results ⇒ Integer readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ TmdbApiClient::ListDetailsResponse
Deserialize a JSON object to an instance of ListDetailsResponse.
-
.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(average_rating: OMIT, backdrop_path: OMIT, results: OMIT, comments: OMIT, created_by: OMIT, description: OMIT, id: OMIT, iso_3166_1: OMIT, iso_639_1: OMIT, item_count: OMIT, name: OMIT, object_ids: OMIT, page: OMIT, poster_path: OMIT, public: OMIT, revenue: OMIT, runtime: OMIT, sort_by: OMIT, total_pages: OMIT, total_results: OMIT, additional_properties: nil) ⇒ TmdbApiClient::ListDetailsResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ListDetailsResponse to a JSON object.
Constructor Details
#initialize(average_rating: OMIT, backdrop_path: OMIT, results: OMIT, comments: OMIT, created_by: OMIT, description: OMIT, id: OMIT, iso_3166_1: OMIT, iso_639_1: OMIT, item_count: OMIT, name: OMIT, object_ids: OMIT, page: OMIT, poster_path: OMIT, public: OMIT, revenue: OMIT, runtime: OMIT, sort_by: OMIT, total_pages: OMIT, total_results: OMIT, additional_properties: nil) ⇒ TmdbApiClient::ListDetailsResponse
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 82 def initialize(average_rating: OMIT, backdrop_path: OMIT, results: OMIT, comments: OMIT, created_by: OMIT, description: OMIT, id: OMIT, iso_3166_1: OMIT, iso_639_1: OMIT, item_count: OMIT, name: OMIT, object_ids: OMIT, page: OMIT, poster_path: OMIT, public: OMIT, revenue: OMIT, runtime: OMIT, sort_by: OMIT, total_pages: OMIT, total_results: OMIT, additional_properties: nil) = if != OMIT @backdrop_path = backdrop_path if backdrop_path != OMIT @results = results if results != OMIT @comments = comments if comments != OMIT @created_by = created_by if created_by != OMIT @description = description if description != OMIT @id = id if id != OMIT @iso_3166_1 = iso_3166_1 if iso_3166_1 != OMIT @iso_639_1 = iso_639_1 if iso_639_1 != OMIT @item_count = item_count if item_count != OMIT @name = name if name != OMIT @object_ids = object_ids if object_ids != OMIT @page = page if page != OMIT @poster_path = poster_path if poster_path != OMIT @public = public if public != OMIT @revenue = revenue if revenue != OMIT @runtime = runtime if runtime != OMIT @sort_by = sort_by if sort_by != OMIT @total_pages = total_pages if total_pages != OMIT @total_results = total_results if total_results != OMIT @additional_properties = additional_properties @_field_set = { "average_rating": , "backdrop_path": backdrop_path, "results": results, "comments": comments, "created_by": created_by, "description": description, "id": id, "iso_3166_1": iso_3166_1, "iso_639_1": iso_639_1, "item_count": item_count, "name": name, "object_ids": object_ids, "page": page, "poster_path": poster_path, "public": public, "revenue": revenue, "runtime": runtime, "sort_by": sort_by, "total_pages": total_pages, "total_results": total_results }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
53 54 55 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 53 def additional_properties @additional_properties end |
#average_rating ⇒ Float (readonly)
13 14 15 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 13 def end |
#backdrop_path ⇒ String (readonly)
15 16 17 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 15 def backdrop_path @backdrop_path end |
#comments ⇒ TmdbApiClient::ListDetailsResponseComments (readonly)
19 20 21 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 19 def comments @comments end |
#created_by ⇒ TmdbApiClient::ListDetailsResponseCreatedBy (readonly)
21 22 23 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 21 def created_by @created_by end |
#description ⇒ String (readonly)
23 24 25 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 23 def description @description end |
#id ⇒ Integer (readonly)
25 26 27 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 25 def id @id end |
#iso_3166_1 ⇒ String (readonly)
27 28 29 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 27 def iso_3166_1 @iso_3166_1 end |
#iso_639_1 ⇒ String (readonly)
29 30 31 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 29 def iso_639_1 @iso_639_1 end |
#item_count ⇒ Integer (readonly)
31 32 33 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 31 def item_count @item_count end |
#name ⇒ String (readonly)
33 34 35 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 33 def name @name end |
#object_ids ⇒ TmdbApiClient::ListDetailsResponseObjectIds (readonly)
35 36 37 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 35 def object_ids @object_ids end |
#page ⇒ Integer (readonly)
37 38 39 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 37 def page @page end |
#poster_path ⇒ String (readonly)
39 40 41 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 39 def poster_path @poster_path end |
#public ⇒ Boolean (readonly)
41 42 43 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 41 def public @public end |
#results ⇒ Array<TmdbApiClient::ListDetailsResponseResultsItem> (readonly)
17 18 19 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 17 def results @results end |
#revenue ⇒ Integer (readonly)
43 44 45 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 43 def revenue @revenue end |
#runtime ⇒ Integer (readonly)
45 46 47 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 45 def runtime @runtime end |
#sort_by ⇒ String (readonly)
47 48 49 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 47 def sort_by @sort_by end |
#total_pages ⇒ Integer (readonly)
49 50 51 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 49 def total_pages @total_pages end |
#total_results ⇒ Integer (readonly)
51 52 53 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 51 def total_results @total_results end |
Class Method Details
.from_json(json_object:) ⇒ TmdbApiClient::ListDetailsResponse
Deserialize a JSON object to an instance of ListDetailsResponse
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 135 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) = parsed_json["average_rating"] backdrop_path = parsed_json["backdrop_path"] results = parsed_json["results"]&.map do |item| item = item.to_json TmdbApiClient::ListDetailsResponseResultsItem.from_json(json_object: item) end if parsed_json["comments"].nil? comments = nil else comments = parsed_json["comments"].to_json comments = TmdbApiClient::ListDetailsResponseComments.from_json(json_object: comments) end if parsed_json["created_by"].nil? created_by = nil else created_by = parsed_json["created_by"].to_json created_by = TmdbApiClient::ListDetailsResponseCreatedBy.from_json(json_object: created_by) end description = parsed_json["description"] id = parsed_json["id"] iso_3166_1 = parsed_json["iso_3166_1"] iso_639_1 = parsed_json["iso_639_1"] item_count = parsed_json["item_count"] name = parsed_json["name"] if parsed_json["object_ids"].nil? object_ids = nil else object_ids = parsed_json["object_ids"].to_json object_ids = TmdbApiClient::ListDetailsResponseObjectIds.from_json(json_object: object_ids) end page = parsed_json["page"] poster_path = parsed_json["poster_path"] public = parsed_json["public"] revenue = parsed_json["revenue"] runtime = parsed_json["runtime"] sort_by = parsed_json["sort_by"] total_pages = parsed_json["total_pages"] total_results = parsed_json["total_results"] new( average_rating: , backdrop_path: backdrop_path, results: results, comments: comments, created_by: created_by, description: description, id: id, iso_3166_1: iso_3166_1, iso_639_1: iso_639_1, item_count: item_count, name: name, object_ids: object_ids, page: page, poster_path: poster_path, public: public, revenue: revenue, runtime: runtime, sort_by: sort_by, total_pages: total_pages, total_results: total_results, 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.
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 214 def self.validate_raw(obj:) obj.&.is_a?(Float) != false || raise("Passed value for field obj.average_rating is not the expected type, validation failed.") obj.backdrop_path&.is_a?(String) != false || raise("Passed value for field obj.backdrop_path 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.comments.nil? || TmdbApiClient::ListDetailsResponseComments.validate_raw(obj: obj.comments) obj.created_by.nil? || TmdbApiClient::ListDetailsResponseCreatedBy.validate_raw(obj: obj.created_by) obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.iso_3166_1&.is_a?(String) != false || raise("Passed value for field obj.iso_3166_1 is not the expected type, validation failed.") obj.iso_639_1&.is_a?(String) != false || raise("Passed value for field obj.iso_639_1 is not the expected type, validation failed.") obj.item_count&.is_a?(Integer) != false || raise("Passed value for field obj.item_count is not the expected type, validation failed.") obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.object_ids.nil? || TmdbApiClient::ListDetailsResponseObjectIds.validate_raw(obj: obj.object_ids) obj.page&.is_a?(Integer) != false || raise("Passed value for field obj.page is not the expected type, validation failed.") obj.poster_path&.is_a?(String) != false || raise("Passed value for field obj.poster_path is not the expected type, validation failed.") obj.public&.is_a?(Boolean) != false || raise("Passed value for field obj.public is not the expected type, validation failed.") obj.revenue&.is_a?(Integer) != false || raise("Passed value for field obj.revenue is not the expected type, validation failed.") obj.runtime&.is_a?(Integer) != false || raise("Passed value for field obj.runtime is not the expected type, validation failed.") obj.sort_by&.is_a?(String) != false || raise("Passed value for field obj.sort_by is not the expected type, validation failed.") obj.total_pages&.is_a?(Integer) != false || raise("Passed value for field obj.total_pages is not the expected type, validation failed.") obj.total_results&.is_a?(Integer) != false || raise("Passed value for field obj.total_results is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ListDetailsResponse to a JSON object
204 205 206 |
# File 'lib/tmdb_ryanstep/types/list_details_response.rb', line 204 def to_json(*_args) @_field_set&.to_json end |