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,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "account_tv_recommendations_response_results_item"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module TmdbApiClient
|
8
|
+
class AccountTvRecommendationsResponse
|
9
|
+
# @return [Integer]
|
10
|
+
attr_reader :page
|
11
|
+
# @return [Array<TmdbApiClient::AccountTvRecommendationsResponseResultsItem>]
|
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::AccountTvRecommendationsResponseResultsItem>]
|
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::AccountTvRecommendationsResponse]
|
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 AccountTvRecommendationsResponse
|
48
|
+
#
|
49
|
+
# @param json_object [String]
|
50
|
+
# @return [TmdbApiClient::AccountTvRecommendationsResponse]
|
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::AccountTvRecommendationsResponseResultsItem.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 AccountTvRecommendationsResponse 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 AccountTvRecommendationsResponseResultsItem
|
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 :name
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :original_language
|
18
|
+
# @return [String]
|
19
|
+
attr_reader :original_name
|
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 :first_air_date
|
32
|
+
# @return [Float]
|
33
|
+
attr_reader :vote_average
|
34
|
+
# @return [Integer]
|
35
|
+
attr_reader :vote_count
|
36
|
+
# @return [Array<String>]
|
37
|
+
attr_reader :origin_country
|
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 name [String]
|
50
|
+
# @param original_language [String]
|
51
|
+
# @param original_name [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 first_air_date [String]
|
58
|
+
# @param vote_average [Float]
|
59
|
+
# @param vote_count [Integer]
|
60
|
+
# @param origin_country [Array<String>]
|
61
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
62
|
+
# @return [TmdbApiClient::AccountTvRecommendationsResponseResultsItem]
|
63
|
+
def initialize(adult: OMIT, backdrop_path: OMIT, id: OMIT, name: OMIT, original_language: OMIT,
|
64
|
+
original_name: OMIT, overview: OMIT, poster_path: OMIT, media_type: OMIT, genre_ids: OMIT, popularity: OMIT, first_air_date: OMIT, vote_average: OMIT, vote_count: OMIT, origin_country: 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
|
+
@name = name if name != OMIT
|
69
|
+
@original_language = original_language if original_language != OMIT
|
70
|
+
@original_name = original_name if original_name != 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
|
+
@first_air_date = first_air_date if first_air_date != OMIT
|
77
|
+
@vote_average = vote_average if vote_average != OMIT
|
78
|
+
@vote_count = vote_count if vote_count != OMIT
|
79
|
+
@origin_country = origin_country if origin_country != OMIT
|
80
|
+
@additional_properties = additional_properties
|
81
|
+
@_field_set = {
|
82
|
+
"adult": adult,
|
83
|
+
"backdrop_path": backdrop_path,
|
84
|
+
"id": id,
|
85
|
+
"name": name,
|
86
|
+
"original_language": original_language,
|
87
|
+
"original_name": original_name,
|
88
|
+
"overview": overview,
|
89
|
+
"poster_path": poster_path,
|
90
|
+
"media_type": media_type,
|
91
|
+
"genre_ids": genre_ids,
|
92
|
+
"popularity": popularity,
|
93
|
+
"first_air_date": first_air_date,
|
94
|
+
"vote_average": vote_average,
|
95
|
+
"vote_count": vote_count,
|
96
|
+
"origin_country": origin_country
|
97
|
+
}.reject do |_k, v|
|
98
|
+
v == OMIT
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Deserialize a JSON object to an instance of
|
103
|
+
# AccountTvRecommendationsResponseResultsItem
|
104
|
+
#
|
105
|
+
# @param json_object [String]
|
106
|
+
# @return [TmdbApiClient::AccountTvRecommendationsResponseResultsItem]
|
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
|
+
name = parsed_json["name"]
|
114
|
+
original_language = parsed_json["original_language"]
|
115
|
+
original_name = parsed_json["original_name"]
|
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
|
+
first_air_date = parsed_json["first_air_date"]
|
122
|
+
vote_average = parsed_json["vote_average"]
|
123
|
+
vote_count = parsed_json["vote_count"]
|
124
|
+
origin_country = parsed_json["origin_country"]
|
125
|
+
new(
|
126
|
+
adult: adult,
|
127
|
+
backdrop_path: backdrop_path,
|
128
|
+
id: id,
|
129
|
+
name: name,
|
130
|
+
original_language: original_language,
|
131
|
+
original_name: original_name,
|
132
|
+
overview: overview,
|
133
|
+
poster_path: poster_path,
|
134
|
+
media_type: media_type,
|
135
|
+
genre_ids: genre_ids,
|
136
|
+
popularity: popularity,
|
137
|
+
first_air_date: first_air_date,
|
138
|
+
vote_average: vote_average,
|
139
|
+
vote_count: vote_count,
|
140
|
+
origin_country: origin_country,
|
141
|
+
additional_properties: struct
|
142
|
+
)
|
143
|
+
end
|
144
|
+
|
145
|
+
# Serialize an instance of AccountTvRecommendationsResponseResultsItem 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.name&.is_a?(String) != false || raise("Passed value for field obj.name 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_name&.is_a?(String) != false || raise("Passed value for field obj.original_name 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.first_air_date&.is_a?(String) != false || raise("Passed value for field obj.first_air_date is not the expected type, validation failed.")
|
172
|
+
obj.vote_average&.is_a?(Float) != false || raise("Passed value for field obj.vote_average is not the expected type, validation failed.")
|
173
|
+
obj.vote_count&.is_a?(Integer) != false || raise("Passed value for field obj.vote_count is not the expected type, validation failed.")
|
174
|
+
obj.origin_country&.is_a?(Array) != false || raise("Passed value for field obj.origin_country 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_tv_watchlist_response_results_item"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module TmdbApiClient
|
8
|
+
class AccountTvWatchlistResponse
|
9
|
+
# @return [Integer]
|
10
|
+
attr_reader :page
|
11
|
+
# @return [Array<TmdbApiClient::AccountTvWatchlistResponseResultsItem>]
|
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::AccountTvWatchlistResponseResultsItem>]
|
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::AccountTvWatchlistResponse]
|
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 AccountTvWatchlistResponse
|
48
|
+
#
|
49
|
+
# @param json_object [String]
|
50
|
+
# @return [TmdbApiClient::AccountTvWatchlistResponse]
|
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::AccountTvWatchlistResponseResultsItem.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 AccountTvWatchlistResponse 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,176 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module TmdbApiClient
|
7
|
+
class AccountTvWatchlistResponseResultsItem
|
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 :name
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :original_language
|
18
|
+
# @return [String]
|
19
|
+
attr_reader :original_name
|
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 :first_air_date
|
32
|
+
# @return [Float]
|
33
|
+
attr_reader :vote_average
|
34
|
+
# @return [Integer]
|
35
|
+
attr_reader :vote_count
|
36
|
+
# @return [Array<String>]
|
37
|
+
attr_reader :origin_country
|
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 name [String]
|
50
|
+
# @param original_language [String]
|
51
|
+
# @param original_name [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 first_air_date [String]
|
58
|
+
# @param vote_average [Float]
|
59
|
+
# @param vote_count [Integer]
|
60
|
+
# @param origin_country [Array<String>]
|
61
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
62
|
+
# @return [TmdbApiClient::AccountTvWatchlistResponseResultsItem]
|
63
|
+
def initialize(adult: OMIT, backdrop_path: OMIT, id: OMIT, name: OMIT, original_language: OMIT,
|
64
|
+
original_name: OMIT, overview: OMIT, poster_path: OMIT, media_type: OMIT, genre_ids: OMIT, popularity: OMIT, first_air_date: OMIT, vote_average: OMIT, vote_count: OMIT, origin_country: 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
|
+
@name = name if name != OMIT
|
69
|
+
@original_language = original_language if original_language != OMIT
|
70
|
+
@original_name = original_name if original_name != 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
|
+
@first_air_date = first_air_date if first_air_date != OMIT
|
77
|
+
@vote_average = vote_average if vote_average != OMIT
|
78
|
+
@vote_count = vote_count if vote_count != OMIT
|
79
|
+
@origin_country = origin_country if origin_country != OMIT
|
80
|
+
@additional_properties = additional_properties
|
81
|
+
@_field_set = {
|
82
|
+
"adult": adult,
|
83
|
+
"backdrop_path": backdrop_path,
|
84
|
+
"id": id,
|
85
|
+
"name": name,
|
86
|
+
"original_language": original_language,
|
87
|
+
"original_name": original_name,
|
88
|
+
"overview": overview,
|
89
|
+
"poster_path": poster_path,
|
90
|
+
"media_type": media_type,
|
91
|
+
"genre_ids": genre_ids,
|
92
|
+
"popularity": popularity,
|
93
|
+
"first_air_date": first_air_date,
|
94
|
+
"vote_average": vote_average,
|
95
|
+
"vote_count": vote_count,
|
96
|
+
"origin_country": origin_country
|
97
|
+
}.reject do |_k, v|
|
98
|
+
v == OMIT
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
# Deserialize a JSON object to an instance of
|
103
|
+
# AccountTvWatchlistResponseResultsItem
|
104
|
+
#
|
105
|
+
# @param json_object [String]
|
106
|
+
# @return [TmdbApiClient::AccountTvWatchlistResponseResultsItem]
|
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
|
+
name = parsed_json["name"]
|
114
|
+
original_language = parsed_json["original_language"]
|
115
|
+
original_name = parsed_json["original_name"]
|
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
|
+
first_air_date = parsed_json["first_air_date"]
|
122
|
+
vote_average = parsed_json["vote_average"]
|
123
|
+
vote_count = parsed_json["vote_count"]
|
124
|
+
origin_country = parsed_json["origin_country"]
|
125
|
+
new(
|
126
|
+
adult: adult,
|
127
|
+
backdrop_path: backdrop_path,
|
128
|
+
id: id,
|
129
|
+
name: name,
|
130
|
+
original_language: original_language,
|
131
|
+
original_name: original_name,
|
132
|
+
overview: overview,
|
133
|
+
poster_path: poster_path,
|
134
|
+
media_type: media_type,
|
135
|
+
genre_ids: genre_ids,
|
136
|
+
popularity: popularity,
|
137
|
+
first_air_date: first_air_date,
|
138
|
+
vote_average: vote_average,
|
139
|
+
vote_count: vote_count,
|
140
|
+
origin_country: origin_country,
|
141
|
+
additional_properties: struct
|
142
|
+
)
|
143
|
+
end
|
144
|
+
|
145
|
+
# Serialize an instance of AccountTvWatchlistResponseResultsItem to a JSON object
|
146
|
+
#
|
147
|
+
# @return [String]
|
148
|
+
def to_json(*_args)
|
149
|
+
@_field_set&.to_json
|
150
|
+
end
|
151
|
+
|
152
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
153
|
+
# hash and check each fields type against the current object's property
|
154
|
+
# definitions.
|
155
|
+
#
|
156
|
+
# @param obj [Object]
|
157
|
+
# @return [Void]
|
158
|
+
def self.validate_raw(obj:)
|
159
|
+
obj.adult&.is_a?(Boolean) != false || raise("Passed value for field obj.adult is not the expected type, validation failed.")
|
160
|
+
obj.backdrop_path&.is_a?(String) != false || raise("Passed value for field obj.backdrop_path is not the expected type, validation failed.")
|
161
|
+
obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id 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.original_language&.is_a?(String) != false || raise("Passed value for field obj.original_language is not the expected type, validation failed.")
|
164
|
+
obj.original_name&.is_a?(String) != false || raise("Passed value for field obj.original_name is not the expected type, validation failed.")
|
165
|
+
obj.overview&.is_a?(String) != false || raise("Passed value for field obj.overview is not the expected type, validation failed.")
|
166
|
+
obj.poster_path&.is_a?(String) != false || raise("Passed value for field obj.poster_path is not the expected type, validation failed.")
|
167
|
+
obj.media_type&.is_a?(String) != false || raise("Passed value for field obj.media_type is not the expected type, validation failed.")
|
168
|
+
obj.genre_ids&.is_a?(Array) != false || raise("Passed value for field obj.genre_ids is not the expected type, validation failed.")
|
169
|
+
obj.popularity&.is_a?(Float) != false || raise("Passed value for field obj.popularity is not the expected type, validation failed.")
|
170
|
+
obj.first_air_date&.is_a?(String) != false || raise("Passed value for field obj.first_air_date is not the expected type, validation failed.")
|
171
|
+
obj.vote_average&.is_a?(Float) != false || raise("Passed value for field obj.vote_average is not the expected type, validation failed.")
|
172
|
+
obj.vote_count&.is_a?(Integer) != false || raise("Passed value for field obj.vote_count is not the expected type, validation failed.")
|
173
|
+
obj.origin_country&.is_a?(Array) != false || raise("Passed value for field obj.origin_country is not the expected type, validation failed.")
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module TmdbApiClient
|
7
|
+
class AuthCreateAccessTokenResponse
|
8
|
+
# @return [String]
|
9
|
+
attr_reader :account_id
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :access_token
|
12
|
+
# @return [Boolean]
|
13
|
+
attr_reader :success
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :status_message
|
16
|
+
# @return [Integer]
|
17
|
+
attr_reader :status_code
|
18
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
attr_reader :additional_properties
|
20
|
+
# @return [Object]
|
21
|
+
attr_reader :_field_set
|
22
|
+
protected :_field_set
|
23
|
+
|
24
|
+
OMIT = Object.new
|
25
|
+
|
26
|
+
# @param account_id [String]
|
27
|
+
# @param access_token [String]
|
28
|
+
# @param success [Boolean]
|
29
|
+
# @param status_message [String]
|
30
|
+
# @param status_code [Integer]
|
31
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
32
|
+
# @return [TmdbApiClient::AuthCreateAccessTokenResponse]
|
33
|
+
def initialize(account_id: OMIT, access_token: OMIT, success: OMIT, status_message: OMIT, status_code: OMIT,
|
34
|
+
additional_properties: nil)
|
35
|
+
@account_id = account_id if account_id != OMIT
|
36
|
+
@access_token = access_token if access_token != OMIT
|
37
|
+
@success = success if success != OMIT
|
38
|
+
@status_message = status_message if status_message != OMIT
|
39
|
+
@status_code = status_code if status_code != OMIT
|
40
|
+
@additional_properties = additional_properties
|
41
|
+
@_field_set = {
|
42
|
+
"account_id": account_id,
|
43
|
+
"access_token": access_token,
|
44
|
+
"success": success,
|
45
|
+
"status_message": status_message,
|
46
|
+
"status_code": status_code
|
47
|
+
}.reject do |_k, v|
|
48
|
+
v == OMIT
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Deserialize a JSON object to an instance of AuthCreateAccessTokenResponse
|
53
|
+
#
|
54
|
+
# @param json_object [String]
|
55
|
+
# @return [TmdbApiClient::AuthCreateAccessTokenResponse]
|
56
|
+
def self.from_json(json_object:)
|
57
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
58
|
+
parsed_json = JSON.parse(json_object)
|
59
|
+
account_id = parsed_json["account_id"]
|
60
|
+
access_token = parsed_json["access_token"]
|
61
|
+
success = parsed_json["success"]
|
62
|
+
status_message = parsed_json["status_message"]
|
63
|
+
status_code = parsed_json["status_code"]
|
64
|
+
new(
|
65
|
+
account_id: account_id,
|
66
|
+
access_token: access_token,
|
67
|
+
success: success,
|
68
|
+
status_message: status_message,
|
69
|
+
status_code: status_code,
|
70
|
+
additional_properties: struct
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Serialize an instance of AuthCreateAccessTokenResponse to a JSON object
|
75
|
+
#
|
76
|
+
# @return [String]
|
77
|
+
def to_json(*_args)
|
78
|
+
@_field_set&.to_json
|
79
|
+
end
|
80
|
+
|
81
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
82
|
+
# hash and check each fields type against the current object's property
|
83
|
+
# definitions.
|
84
|
+
#
|
85
|
+
# @param obj [Object]
|
86
|
+
# @return [Void]
|
87
|
+
def self.validate_raw(obj:)
|
88
|
+
obj.account_id&.is_a?(String) != false || raise("Passed value for field obj.account_id is not the expected type, validation failed.")
|
89
|
+
obj.access_token&.is_a?(String) != false || raise("Passed value for field obj.access_token is not the expected type, validation failed.")
|
90
|
+
obj.success&.is_a?(Boolean) != false || raise("Passed value for field obj.success is not the expected type, validation failed.")
|
91
|
+
obj.status_message&.is_a?(String) != false || raise("Passed value for field obj.status_message is not the expected type, validation failed.")
|
92
|
+
obj.status_code&.is_a?(Integer) != false || raise("Passed value for field obj.status_code is not the expected type, validation failed.")
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|