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