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