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