tmdb_ryanstep 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/lib/environment.rb +7 -0
  3. data/lib/gemconfig.rb +14 -0
  4. data/lib/requests.rb +163 -0
  5. data/lib/tmdb_ryanstep/types/account_favorite_movies_request_sort_by.rb +8 -0
  6. data/lib/tmdb_ryanstep/types/account_favorite_movies_response.rb +90 -0
  7. data/lib/tmdb_ryanstep/types/account_favorite_movies_response_results_item.rb +169 -0
  8. data/lib/tmdb_ryanstep/types/account_favorite_tv_request_sort_by.rb +8 -0
  9. data/lib/tmdb_ryanstep/types/account_favorite_tv_response.rb +90 -0
  10. data/lib/tmdb_ryanstep/types/account_favorite_tv_response_results_item.rb +167 -0
  11. data/lib/tmdb_ryanstep/types/account_lists_response.rb +90 -0
  12. data/lib/tmdb_ryanstep/types/account_lists_response_results_item.rb +183 -0
  13. data/lib/tmdb_ryanstep/types/account_movie_recommendations_response.rb +90 -0
  14. data/lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb +177 -0
  15. data/lib/tmdb_ryanstep/types/account_movie_watchlist_request_sort_by.rb +8 -0
  16. data/lib/tmdb_ryanstep/types/account_movie_watchlist_response.rb +90 -0
  17. data/lib/tmdb_ryanstep/types/account_movie_watchlist_response_results_item.rb +177 -0
  18. data/lib/tmdb_ryanstep/types/account_rated_movies_request_sort_by.rb +8 -0
  19. data/lib/tmdb_ryanstep/types/account_rated_movies_response.rb +90 -0
  20. data/lib/tmdb_ryanstep/types/account_rated_movies_response_results_item.rb +182 -0
  21. data/lib/tmdb_ryanstep/types/account_rated_movies_response_results_item_account_rating.rb +69 -0
  22. data/lib/tmdb_ryanstep/types/account_rated_tv_request_sort_by.rb +8 -0
  23. data/lib/tmdb_ryanstep/types/account_rated_tv_response.rb +90 -0
  24. data/lib/tmdb_ryanstep/types/account_rated_tv_response_results_item.rb +181 -0
  25. data/lib/tmdb_ryanstep/types/account_rated_tv_response_results_item_account_rating.rb +69 -0
  26. data/lib/tmdb_ryanstep/types/account_tv_recommendations_response.rb +90 -0
  27. data/lib/tmdb_ryanstep/types/account_tv_recommendations_response_results_item.rb +177 -0
  28. data/lib/tmdb_ryanstep/types/account_tv_watchlist_request_sort_by.rb +8 -0
  29. data/lib/tmdb_ryanstep/types/account_tv_watchlist_response.rb +90 -0
  30. data/lib/tmdb_ryanstep/types/account_tv_watchlist_response_results_item.rb +176 -0
  31. data/lib/tmdb_ryanstep/types/auth_create_access_token_response.rb +95 -0
  32. data/lib/tmdb_ryanstep/types/auth_create_request_token_response.rb +87 -0
  33. data/lib/tmdb_ryanstep/types/auth_logout_response.rb +78 -0
  34. data/lib/tmdb_ryanstep/types/list_add_items_response.rb +90 -0
  35. data/lib/tmdb_ryanstep/types/list_add_items_response_results_item.rb +74 -0
  36. data/lib/tmdb_ryanstep/types/list_clear_response.rb +95 -0
  37. data/lib/tmdb_ryanstep/types/list_create_response.rb +86 -0
  38. data/lib/tmdb_ryanstep/types/list_delete_response.rb +78 -0
  39. data/lib/tmdb_ryanstep/types/list_details_response.rb +237 -0
  40. data/lib/tmdb_ryanstep/types/list_details_response_comments.rb +215 -0
  41. data/lib/tmdb_ryanstep/types/list_details_response_created_by.rb +95 -0
  42. data/lib/tmdb_ryanstep/types/list_details_response_object_ids.rb +47 -0
  43. data/lib/tmdb_ryanstep/types/list_details_response_results_item.rb +175 -0
  44. data/lib/tmdb_ryanstep/types/list_item_status_request_media_type.rb +9 -0
  45. data/lib/tmdb_ryanstep/types/list_item_status_response.rb +103 -0
  46. data/lib/tmdb_ryanstep/types/list_remove_items_response.rb +90 -0
  47. data/lib/tmdb_ryanstep/types/list_remove_items_response_results_item.rb +74 -0
  48. data/lib/tmdb_ryanstep/types/list_update_items_response.rb +90 -0
  49. data/lib/tmdb_ryanstep/types/list_update_items_response_results_item.rb +74 -0
  50. data/lib/tmdb_ryanstep/types/list_update_response.rb +78 -0
  51. data/lib/tmdb_ryanstep.rb +1557 -0
  52. data/lib/types_export.rb +48 -0
  53. metadata +175 -0
@@ -0,0 +1,167 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module TmdbApiClient
7
+ class AccountFavoriteTvResponseResultsItem
8
+ # @return [Boolean]
9
+ attr_reader :adult
10
+ # @return [String]
11
+ attr_reader :backdrop_path
12
+ # @return [Array<Integer>]
13
+ attr_reader :genre_ids
14
+ # @return [Integer]
15
+ attr_reader :id
16
+ # @return [Array<String>]
17
+ attr_reader :origin_country
18
+ # @return [String]
19
+ attr_reader :original_language
20
+ # @return [String]
21
+ attr_reader :original_name
22
+ # @return [String]
23
+ attr_reader :overview
24
+ # @return [Float]
25
+ attr_reader :popularity
26
+ # @return [String]
27
+ attr_reader :poster_path
28
+ # @return [String]
29
+ attr_reader :first_air_date
30
+ # @return [String]
31
+ attr_reader :name
32
+ # @return [Float]
33
+ attr_reader :vote_average
34
+ # @return [Integer]
35
+ attr_reader :vote_count
36
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
37
+ attr_reader :additional_properties
38
+ # @return [Object]
39
+ attr_reader :_field_set
40
+ protected :_field_set
41
+
42
+ OMIT = Object.new
43
+
44
+ # @param adult [Boolean]
45
+ # @param backdrop_path [String]
46
+ # @param genre_ids [Array<Integer>]
47
+ # @param id [Integer]
48
+ # @param origin_country [Array<String>]
49
+ # @param original_language [String]
50
+ # @param original_name [String]
51
+ # @param overview [String]
52
+ # @param popularity [Float]
53
+ # @param poster_path [String]
54
+ # @param first_air_date [String]
55
+ # @param name [String]
56
+ # @param vote_average [Float]
57
+ # @param vote_count [Integer]
58
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
59
+ # @return [TmdbApiClient::AccountFavoriteTvResponseResultsItem]
60
+ def initialize(adult: OMIT, backdrop_path: OMIT, genre_ids: OMIT, id: OMIT, origin_country: OMIT,
61
+ original_language: OMIT, original_name: OMIT, overview: OMIT, popularity: OMIT, poster_path: OMIT, first_air_date: OMIT, name: OMIT, vote_average: OMIT, vote_count: OMIT, additional_properties: nil)
62
+ @adult = adult if adult != OMIT
63
+ @backdrop_path = backdrop_path if backdrop_path != OMIT
64
+ @genre_ids = genre_ids if genre_ids != OMIT
65
+ @id = id if id != OMIT
66
+ @origin_country = origin_country if origin_country != OMIT
67
+ @original_language = original_language if original_language != OMIT
68
+ @original_name = original_name if original_name != OMIT
69
+ @overview = overview if overview != OMIT
70
+ @popularity = popularity if popularity != OMIT
71
+ @poster_path = poster_path if poster_path != OMIT
72
+ @first_air_date = first_air_date if first_air_date != OMIT
73
+ @name = name if name != OMIT
74
+ @vote_average = vote_average if vote_average != OMIT
75
+ @vote_count = vote_count if vote_count != OMIT
76
+ @additional_properties = additional_properties
77
+ @_field_set = {
78
+ "adult": adult,
79
+ "backdrop_path": backdrop_path,
80
+ "genre_ids": genre_ids,
81
+ "id": id,
82
+ "origin_country": origin_country,
83
+ "original_language": original_language,
84
+ "original_name": original_name,
85
+ "overview": overview,
86
+ "popularity": popularity,
87
+ "poster_path": poster_path,
88
+ "first_air_date": first_air_date,
89
+ "name": name,
90
+ "vote_average": vote_average,
91
+ "vote_count": vote_count
92
+ }.reject do |_k, v|
93
+ v == OMIT
94
+ end
95
+ end
96
+
97
+ # Deserialize a JSON object to an instance of AccountFavoriteTvResponseResultsItem
98
+ #
99
+ # @param json_object [String]
100
+ # @return [TmdbApiClient::AccountFavoriteTvResponseResultsItem]
101
+ def self.from_json(json_object:)
102
+ struct = JSON.parse(json_object, object_class: OpenStruct)
103
+ parsed_json = JSON.parse(json_object)
104
+ adult = parsed_json["adult"]
105
+ backdrop_path = parsed_json["backdrop_path"]
106
+ genre_ids = parsed_json["genre_ids"]
107
+ id = parsed_json["id"]
108
+ origin_country = parsed_json["origin_country"]
109
+ original_language = parsed_json["original_language"]
110
+ original_name = parsed_json["original_name"]
111
+ overview = parsed_json["overview"]
112
+ popularity = parsed_json["popularity"]
113
+ poster_path = parsed_json["poster_path"]
114
+ first_air_date = parsed_json["first_air_date"]
115
+ name = parsed_json["name"]
116
+ vote_average = parsed_json["vote_average"]
117
+ vote_count = parsed_json["vote_count"]
118
+ new(
119
+ adult: adult,
120
+ backdrop_path: backdrop_path,
121
+ genre_ids: genre_ids,
122
+ id: id,
123
+ origin_country: origin_country,
124
+ original_language: original_language,
125
+ original_name: original_name,
126
+ overview: overview,
127
+ popularity: popularity,
128
+ poster_path: poster_path,
129
+ first_air_date: first_air_date,
130
+ name: name,
131
+ vote_average: vote_average,
132
+ vote_count: vote_count,
133
+ additional_properties: struct
134
+ )
135
+ end
136
+
137
+ # Serialize an instance of AccountFavoriteTvResponseResultsItem to a JSON object
138
+ #
139
+ # @return [String]
140
+ def to_json(*_args)
141
+ @_field_set&.to_json
142
+ end
143
+
144
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
145
+ # hash and check each fields type against the current object's property
146
+ # definitions.
147
+ #
148
+ # @param obj [Object]
149
+ # @return [Void]
150
+ def self.validate_raw(obj:)
151
+ obj.adult&.is_a?(Boolean) != false || raise("Passed value for field obj.adult is not the expected type, validation failed.")
152
+ obj.backdrop_path&.is_a?(String) != false || raise("Passed value for field obj.backdrop_path is not the expected type, validation failed.")
153
+ obj.genre_ids&.is_a?(Array) != false || raise("Passed value for field obj.genre_ids is not the expected type, validation failed.")
154
+ obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
155
+ obj.origin_country&.is_a?(Array) != false || raise("Passed value for field obj.origin_country is not the expected type, validation failed.")
156
+ obj.original_language&.is_a?(String) != false || raise("Passed value for field obj.original_language is not the expected type, validation failed.")
157
+ obj.original_name&.is_a?(String) != false || raise("Passed value for field obj.original_name is not the expected type, validation failed.")
158
+ obj.overview&.is_a?(String) != false || raise("Passed value for field obj.overview is not the expected type, validation failed.")
159
+ obj.popularity&.is_a?(Float) != false || raise("Passed value for field obj.popularity is not the expected type, validation failed.")
160
+ obj.poster_path&.is_a?(String) != false || raise("Passed value for field obj.poster_path is not the expected type, validation failed.")
161
+ obj.first_air_date&.is_a?(String) != false || raise("Passed value for field obj.first_air_date is not the expected type, validation failed.")
162
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
163
+ obj.vote_average&.is_a?(Float) != false || raise("Passed value for field obj.vote_average is not the expected type, validation failed.")
164
+ obj.vote_count&.is_a?(Integer) != false || raise("Passed value for field obj.vote_count is not the expected type, validation failed.")
165
+ end
166
+ end
167
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "account_lists_response_results_item"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module TmdbApiClient
8
+ class AccountListsResponse
9
+ # @return [Integer]
10
+ attr_reader :page
11
+ # @return [Array<TmdbApiClient::AccountListsResponseResultsItem>]
12
+ attr_reader :results
13
+ # @return [Integer]
14
+ attr_reader :total_pages
15
+ # @return [Integer]
16
+ attr_reader :total_results
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param page [Integer]
26
+ # @param results [Array<TmdbApiClient::AccountListsResponseResultsItem>]
27
+ # @param total_pages [Integer]
28
+ # @param total_results [Integer]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [TmdbApiClient::AccountListsResponse]
31
+ def initialize(page: OMIT, results: OMIT, total_pages: OMIT, total_results: OMIT, additional_properties: nil)
32
+ @page = page if page != OMIT
33
+ @results = results if results != OMIT
34
+ @total_pages = total_pages if total_pages != OMIT
35
+ @total_results = total_results if total_results != OMIT
36
+ @additional_properties = additional_properties
37
+ @_field_set = {
38
+ "page": page,
39
+ "results": results,
40
+ "total_pages": total_pages,
41
+ "total_results": total_results
42
+ }.reject do |_k, v|
43
+ v == OMIT
44
+ end
45
+ end
46
+
47
+ # Deserialize a JSON object to an instance of AccountListsResponse
48
+ #
49
+ # @param json_object [String]
50
+ # @return [TmdbApiClient::AccountListsResponse]
51
+ def self.from_json(json_object:)
52
+ struct = JSON.parse(json_object, object_class: OpenStruct)
53
+ parsed_json = JSON.parse(json_object)
54
+ page = parsed_json["page"]
55
+ results = parsed_json["results"]&.map do |item|
56
+ item = item.to_json
57
+ TmdbApiClient::AccountListsResponseResultsItem.from_json(json_object: item)
58
+ end
59
+ total_pages = parsed_json["total_pages"]
60
+ total_results = parsed_json["total_results"]
61
+ new(
62
+ page: page,
63
+ results: results,
64
+ total_pages: total_pages,
65
+ total_results: total_results,
66
+ additional_properties: struct
67
+ )
68
+ end
69
+
70
+ # Serialize an instance of AccountListsResponse to a JSON object
71
+ #
72
+ # @return [String]
73
+ def to_json(*_args)
74
+ @_field_set&.to_json
75
+ end
76
+
77
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
78
+ # hash and check each fields type against the current object's property
79
+ # definitions.
80
+ #
81
+ # @param obj [Object]
82
+ # @return [Void]
83
+ def self.validate_raw(obj:)
84
+ obj.page&.is_a?(Integer) != false || raise("Passed value for field obj.page is not the expected type, validation failed.")
85
+ obj.results&.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
86
+ obj.total_pages&.is_a?(Integer) != false || raise("Passed value for field obj.total_pages is not the expected type, validation failed.")
87
+ obj.total_results&.is_a?(Integer) != false || raise("Passed value for field obj.total_results is not the expected type, validation failed.")
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,183 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module TmdbApiClient
7
+ class AccountListsResponseResultsItem
8
+ # @return [String]
9
+ attr_reader :account_object_id
10
+ # @return [Integer]
11
+ attr_reader :adult
12
+ # @return [Float]
13
+ attr_reader :average_rating
14
+ # @return [String]
15
+ attr_reader :created_at
16
+ # @return [String]
17
+ attr_reader :description
18
+ # @return [Integer]
19
+ attr_reader :featured
20
+ # @return [Integer]
21
+ attr_reader :id
22
+ # @return [String]
23
+ attr_reader :iso_3166_1
24
+ # @return [String]
25
+ attr_reader :iso_639_1
26
+ # @return [String]
27
+ attr_reader :name
28
+ # @return [Integer]
29
+ attr_reader :number_of_items
30
+ # @return [Integer]
31
+ attr_reader :public
32
+ # @return [String]
33
+ attr_reader :revenue
34
+ # @return [Integer]
35
+ attr_reader :runtime
36
+ # @return [Integer]
37
+ attr_reader :sort_by
38
+ # @return [String]
39
+ attr_reader :updated_at
40
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
41
+ attr_reader :additional_properties
42
+ # @return [Object]
43
+ attr_reader :_field_set
44
+ protected :_field_set
45
+
46
+ OMIT = Object.new
47
+
48
+ # @param account_object_id [String]
49
+ # @param adult [Integer]
50
+ # @param average_rating [Float]
51
+ # @param created_at [String]
52
+ # @param description [String]
53
+ # @param featured [Integer]
54
+ # @param id [Integer]
55
+ # @param iso_3166_1 [String]
56
+ # @param iso_639_1 [String]
57
+ # @param name [String]
58
+ # @param number_of_items [Integer]
59
+ # @param public [Integer]
60
+ # @param revenue [String]
61
+ # @param runtime [Integer]
62
+ # @param sort_by [Integer]
63
+ # @param updated_at [String]
64
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
65
+ # @return [TmdbApiClient::AccountListsResponseResultsItem]
66
+ def initialize(account_object_id: OMIT, adult: OMIT, average_rating: OMIT, created_at: OMIT, description: OMIT,
67
+ featured: OMIT, id: OMIT, iso_3166_1: OMIT, iso_639_1: OMIT, name: OMIT, number_of_items: OMIT, public: OMIT, revenue: OMIT, runtime: OMIT, sort_by: OMIT, updated_at: OMIT, additional_properties: nil)
68
+ @account_object_id = account_object_id if account_object_id != OMIT
69
+ @adult = adult if adult != OMIT
70
+ @average_rating = average_rating if average_rating != OMIT
71
+ @created_at = created_at if created_at != OMIT
72
+ @description = description if description != OMIT
73
+ @featured = featured if featured != OMIT
74
+ @id = id if id != OMIT
75
+ @iso_3166_1 = iso_3166_1 if iso_3166_1 != OMIT
76
+ @iso_639_1 = iso_639_1 if iso_639_1 != OMIT
77
+ @name = name if name != OMIT
78
+ @number_of_items = number_of_items if number_of_items != OMIT
79
+ @public = public if public != OMIT
80
+ @revenue = revenue if revenue != OMIT
81
+ @runtime = runtime if runtime != OMIT
82
+ @sort_by = sort_by if sort_by != OMIT
83
+ @updated_at = updated_at if updated_at != OMIT
84
+ @additional_properties = additional_properties
85
+ @_field_set = {
86
+ "account_object_id": account_object_id,
87
+ "adult": adult,
88
+ "average_rating": average_rating,
89
+ "created_at": created_at,
90
+ "description": description,
91
+ "featured": featured,
92
+ "id": id,
93
+ "iso_3166_1": iso_3166_1,
94
+ "iso_639_1": iso_639_1,
95
+ "name": name,
96
+ "number_of_items": number_of_items,
97
+ "public": public,
98
+ "revenue": revenue,
99
+ "runtime": runtime,
100
+ "sort_by": sort_by,
101
+ "updated_at": updated_at
102
+ }.reject do |_k, v|
103
+ v == OMIT
104
+ end
105
+ end
106
+
107
+ # Deserialize a JSON object to an instance of AccountListsResponseResultsItem
108
+ #
109
+ # @param json_object [String]
110
+ # @return [TmdbApiClient::AccountListsResponseResultsItem]
111
+ def self.from_json(json_object:)
112
+ struct = JSON.parse(json_object, object_class: OpenStruct)
113
+ parsed_json = JSON.parse(json_object)
114
+ account_object_id = parsed_json["account_object_id"]
115
+ adult = parsed_json["adult"]
116
+ average_rating = parsed_json["average_rating"]
117
+ created_at = parsed_json["created_at"]
118
+ description = parsed_json["description"]
119
+ featured = parsed_json["featured"]
120
+ id = parsed_json["id"]
121
+ iso_3166_1 = parsed_json["iso_3166_1"]
122
+ iso_639_1 = parsed_json["iso_639_1"]
123
+ name = parsed_json["name"]
124
+ number_of_items = parsed_json["number_of_items"]
125
+ public = parsed_json["public"]
126
+ revenue = parsed_json["revenue"]
127
+ runtime = parsed_json["runtime"]
128
+ sort_by = parsed_json["sort_by"]
129
+ updated_at = parsed_json["updated_at"]
130
+ new(
131
+ account_object_id: account_object_id,
132
+ adult: adult,
133
+ average_rating: average_rating,
134
+ created_at: created_at,
135
+ description: description,
136
+ featured: featured,
137
+ id: id,
138
+ iso_3166_1: iso_3166_1,
139
+ iso_639_1: iso_639_1,
140
+ name: name,
141
+ number_of_items: number_of_items,
142
+ public: public,
143
+ revenue: revenue,
144
+ runtime: runtime,
145
+ sort_by: sort_by,
146
+ updated_at: updated_at,
147
+ additional_properties: struct
148
+ )
149
+ end
150
+
151
+ # Serialize an instance of AccountListsResponseResultsItem to a JSON object
152
+ #
153
+ # @return [String]
154
+ def to_json(*_args)
155
+ @_field_set&.to_json
156
+ end
157
+
158
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
159
+ # hash and check each fields type against the current object's property
160
+ # definitions.
161
+ #
162
+ # @param obj [Object]
163
+ # @return [Void]
164
+ def self.validate_raw(obj:)
165
+ obj.account_object_id&.is_a?(String) != false || raise("Passed value for field obj.account_object_id is not the expected type, validation failed.")
166
+ obj.adult&.is_a?(Integer) != false || raise("Passed value for field obj.adult is not the expected type, validation failed.")
167
+ obj.average_rating&.is_a?(Float) != false || raise("Passed value for field obj.average_rating is not the expected type, validation failed.")
168
+ obj.created_at&.is_a?(String) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
169
+ obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
170
+ obj.featured&.is_a?(Integer) != false || raise("Passed value for field obj.featured is not the expected type, validation failed.")
171
+ obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
172
+ obj.iso_3166_1&.is_a?(String) != false || raise("Passed value for field obj.iso_3166_1 is not the expected type, validation failed.")
173
+ obj.iso_639_1&.is_a?(String) != false || raise("Passed value for field obj.iso_639_1 is not the expected type, validation failed.")
174
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
175
+ obj.number_of_items&.is_a?(Integer) != false || raise("Passed value for field obj.number_of_items is not the expected type, validation failed.")
176
+ obj.public&.is_a?(Integer) != false || raise("Passed value for field obj.public is not the expected type, validation failed.")
177
+ obj.revenue&.is_a?(String) != false || raise("Passed value for field obj.revenue is not the expected type, validation failed.")
178
+ obj.runtime&.is_a?(Integer) != false || raise("Passed value for field obj.runtime is not the expected type, validation failed.")
179
+ obj.sort_by&.is_a?(Integer) != false || raise("Passed value for field obj.sort_by is not the expected type, validation failed.")
180
+ obj.updated_at&.is_a?(String) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
181
+ end
182
+ end
183
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "account_movie_recommendations_response_results_item"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module TmdbApiClient
8
+ class AccountMovieRecommendationsResponse
9
+ # @return [Integer]
10
+ attr_reader :page
11
+ # @return [Array<TmdbApiClient::AccountMovieRecommendationsResponseResultsItem>]
12
+ attr_reader :results
13
+ # @return [Integer]
14
+ attr_reader :total_pages
15
+ # @return [Integer]
16
+ attr_reader :total_results
17
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
18
+ attr_reader :additional_properties
19
+ # @return [Object]
20
+ attr_reader :_field_set
21
+ protected :_field_set
22
+
23
+ OMIT = Object.new
24
+
25
+ # @param page [Integer]
26
+ # @param results [Array<TmdbApiClient::AccountMovieRecommendationsResponseResultsItem>]
27
+ # @param total_pages [Integer]
28
+ # @param total_results [Integer]
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [TmdbApiClient::AccountMovieRecommendationsResponse]
31
+ def initialize(page: OMIT, results: OMIT, total_pages: OMIT, total_results: OMIT, additional_properties: nil)
32
+ @page = page if page != OMIT
33
+ @results = results if results != OMIT
34
+ @total_pages = total_pages if total_pages != OMIT
35
+ @total_results = total_results if total_results != OMIT
36
+ @additional_properties = additional_properties
37
+ @_field_set = {
38
+ "page": page,
39
+ "results": results,
40
+ "total_pages": total_pages,
41
+ "total_results": total_results
42
+ }.reject do |_k, v|
43
+ v == OMIT
44
+ end
45
+ end
46
+
47
+ # Deserialize a JSON object to an instance of AccountMovieRecommendationsResponse
48
+ #
49
+ # @param json_object [String]
50
+ # @return [TmdbApiClient::AccountMovieRecommendationsResponse]
51
+ def self.from_json(json_object:)
52
+ struct = JSON.parse(json_object, object_class: OpenStruct)
53
+ parsed_json = JSON.parse(json_object)
54
+ page = parsed_json["page"]
55
+ results = parsed_json["results"]&.map do |item|
56
+ item = item.to_json
57
+ TmdbApiClient::AccountMovieRecommendationsResponseResultsItem.from_json(json_object: item)
58
+ end
59
+ total_pages = parsed_json["total_pages"]
60
+ total_results = parsed_json["total_results"]
61
+ new(
62
+ page: page,
63
+ results: results,
64
+ total_pages: total_pages,
65
+ total_results: total_results,
66
+ additional_properties: struct
67
+ )
68
+ end
69
+
70
+ # Serialize an instance of AccountMovieRecommendationsResponse to a JSON object
71
+ #
72
+ # @return [String]
73
+ def to_json(*_args)
74
+ @_field_set&.to_json
75
+ end
76
+
77
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
78
+ # hash and check each fields type against the current object's property
79
+ # definitions.
80
+ #
81
+ # @param obj [Object]
82
+ # @return [Void]
83
+ def self.validate_raw(obj:)
84
+ obj.page&.is_a?(Integer) != false || raise("Passed value for field obj.page is not the expected type, validation failed.")
85
+ obj.results&.is_a?(Array) != false || raise("Passed value for field obj.results is not the expected type, validation failed.")
86
+ obj.total_pages&.is_a?(Integer) != false || raise("Passed value for field obj.total_pages is not the expected type, validation failed.")
87
+ obj.total_results&.is_a?(Integer) != false || raise("Passed value for field obj.total_results is not the expected type, validation failed.")
88
+ end
89
+ end
90
+ end