spotify-apimatic-sdk 1.0.0__py3-none-any.whl
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.
- spotify_apimatic_sdk-1.0.0.dist-info/METADATA +150 -0
- spotify_apimatic_sdk-1.0.0.dist-info/RECORD +186 -0
- spotify_apimatic_sdk-1.0.0.dist-info/WHEEL +5 -0
- spotify_apimatic_sdk-1.0.0.dist-info/licenses/LICENSE +30 -0
- spotify_apimatic_sdk-1.0.0.dist-info/top_level.txt +1 -0
- spotifywebapi/__init__.py +12 -0
- spotifywebapi/api_helper.py +19 -0
- spotifywebapi/configuration.py +318 -0
- spotifywebapi/controllers/__init__.py +20 -0
- spotifywebapi/controllers/albums_controller.py +498 -0
- spotifywebapi/controllers/artists_controller.py +327 -0
- spotifywebapi/controllers/audiobooks_controller.py +441 -0
- spotifywebapi/controllers/base_controller.py +67 -0
- spotifywebapi/controllers/categories_controller.py +161 -0
- spotifywebapi/controllers/chapters_controller.py +157 -0
- spotifywebapi/controllers/episodes_controller.py +390 -0
- spotifywebapi/controllers/genres_controller.py +84 -0
- spotifywebapi/controllers/markets_controller.py +82 -0
- spotifywebapi/controllers/o_auth_authorization_controller.py +156 -0
- spotifywebapi/controllers/player_controller.py +807 -0
- spotifywebapi/controllers/playlists_controller.py +851 -0
- spotifywebapi/controllers/search_controller.py +123 -0
- spotifywebapi/controllers/shows_controller.py +439 -0
- spotifywebapi/controllers/tracks_controller.py +821 -0
- spotifywebapi/controllers/users_controller.py +649 -0
- spotifywebapi/exceptions/__init__.py +11 -0
- spotifywebapi/exceptions/api_exception.py +36 -0
- spotifywebapi/exceptions/bad_request_exception.py +56 -0
- spotifywebapi/exceptions/forbidden_exception.py +56 -0
- spotifywebapi/exceptions/not_found_exception.py +56 -0
- spotifywebapi/exceptions/o_auth_provider_exception.py +73 -0
- spotifywebapi/exceptions/too_many_requests_exception.py +56 -0
- spotifywebapi/exceptions/unauthorized_exception.py +56 -0
- spotifywebapi/http/__init__.py +11 -0
- spotifywebapi/http/api_response.py +67 -0
- spotifywebapi/http/auth/__init__.py +5 -0
- spotifywebapi/http/auth/o_auth_2.py +336 -0
- spotifywebapi/http/http_call_back.py +20 -0
- spotifywebapi/http/http_client_provider.py +23 -0
- spotifywebapi/http/http_method_enum.py +25 -0
- spotifywebapi/http/http_request.py +55 -0
- spotifywebapi/http/http_response.py +45 -0
- spotifywebapi/http/proxy_settings.py +50 -0
- spotifywebapi/models/__init__.py +142 -0
- spotifywebapi/models/album_base.py +264 -0
- spotifywebapi/models/album_group_enum.py +51 -0
- spotifywebapi/models/album_object.py +375 -0
- spotifywebapi/models/album_restriction_object.py +109 -0
- spotifywebapi/models/album_type_enum.py +62 -0
- spotifywebapi/models/artist_discography_album_object.py +298 -0
- spotifywebapi/models/artist_object.py +335 -0
- spotifywebapi/models/audio_analysis_object.py +266 -0
- spotifywebapi/models/audio_features_object.py +518 -0
- spotifywebapi/models/audiobook_base.py +353 -0
- spotifywebapi/models/audiobook_object.py +369 -0
- spotifywebapi/models/author_object.py +85 -0
- spotifywebapi/models/categories.py +162 -0
- spotifywebapi/models/category_object.py +117 -0
- spotifywebapi/models/chapter_base.py +392 -0
- spotifywebapi/models/chapter_object.py +408 -0
- spotifywebapi/models/chapter_restriction_object.py +113 -0
- spotifywebapi/models/context_object.py +181 -0
- spotifywebapi/models/copyright_object.py +130 -0
- spotifywebapi/models/currently_playing_context_object.py +314 -0
- spotifywebapi/models/currently_playing_object.py +241 -0
- spotifywebapi/models/cursor_object.py +108 -0
- spotifywebapi/models/cursor_paged_artists.py +75 -0
- spotifywebapi/models/cursor_paging_object.py +183 -0
- spotifywebapi/models/cursor_paging_play_history_object.py +214 -0
- spotifywebapi/models/cursor_paging_simplified_artist_object.py +213 -0
- spotifywebapi/models/device_object.py +278 -0
- spotifywebapi/models/disallows_object.py +314 -0
- spotifywebapi/models/episode_base.py +394 -0
- spotifywebapi/models/episode_object.py +665 -0
- spotifywebapi/models/episode_restriction_object.py +112 -0
- spotifywebapi/models/error_object.py +85 -0
- spotifywebapi/models/explicit_content_settings_object.py +110 -0
- spotifywebapi/models/external_id_object.py +156 -0
- spotifywebapi/models/external_url_object.py +107 -0
- spotifywebapi/models/followers_object.py +134 -0
- spotifywebapi/models/image_object.py +168 -0
- spotifywebapi/models/include_external_enum.py +45 -0
- spotifywebapi/models/item_type_1_enum.py +56 -0
- spotifywebapi/models/item_type_2_enum.py +45 -0
- spotifywebapi/models/item_type_3_enum.py +45 -0
- spotifywebapi/models/item_type_enum.py +58 -0
- spotifywebapi/models/linked_track_object.py +205 -0
- spotifywebapi/models/many_albums.py +76 -0
- spotifywebapi/models/many_artists.py +76 -0
- spotifywebapi/models/many_audio_features.py +77 -0
- spotifywebapi/models/many_audiobooks.py +77 -0
- spotifywebapi/models/many_chapters.py +77 -0
- spotifywebapi/models/many_devices.py +76 -0
- spotifywebapi/models/many_episodes.py +77 -0
- spotifywebapi/models/many_genres.py +69 -0
- spotifywebapi/models/many_simplified_shows.py +74 -0
- spotifywebapi/models/many_tracks.py +76 -0
- spotifywebapi/models/markets.py +85 -0
- spotifywebapi/models/me_albums_request.py +90 -0
- spotifywebapi/models/me_episodes_request.py +73 -0
- spotifywebapi/models/me_episodes_request_1.py +89 -0
- spotifywebapi/models/me_following_request.py +74 -0
- spotifywebapi/models/me_following_request_1.py +90 -0
- spotifywebapi/models/me_player_play_request.py +165 -0
- spotifywebapi/models/me_player_request.py +103 -0
- spotifywebapi/models/me_shows_request.py +89 -0
- spotifywebapi/models/me_tracks_request.py +74 -0
- spotifywebapi/models/me_tracks_request_1.py +90 -0
- spotifywebapi/models/meta.py +227 -0
- spotifywebapi/models/mode_enum.py +52 -0
- spotifywebapi/models/narrator_object.py +85 -0
- spotifywebapi/models/o_auth_provider_error_enum.py +67 -0
- spotifywebapi/models/o_auth_scope_enum.py +98 -0
- spotifywebapi/models/o_auth_token.py +113 -0
- spotifywebapi/models/paged_albums.py +75 -0
- spotifywebapi/models/paged_categories.py +74 -0
- spotifywebapi/models/paging_artist_discography_album_object.py +163 -0
- spotifywebapi/models/paging_artist_object.py +162 -0
- spotifywebapi/models/paging_featured_playlist_object.py +113 -0
- spotifywebapi/models/paging_object.py +142 -0
- spotifywebapi/models/paging_playlist_object.py +163 -0
- spotifywebapi/models/paging_playlist_track_object.py +163 -0
- spotifywebapi/models/paging_saved_album_object.py +163 -0
- spotifywebapi/models/paging_saved_audiobook_object.py +163 -0
- spotifywebapi/models/paging_saved_episode_object.py +163 -0
- spotifywebapi/models/paging_saved_show_object.py +163 -0
- spotifywebapi/models/paging_saved_track_object.py +163 -0
- spotifywebapi/models/paging_simplified_album_object.py +163 -0
- spotifywebapi/models/paging_simplified_audiobook_object.py +162 -0
- spotifywebapi/models/paging_simplified_chapter_object.py +162 -0
- spotifywebapi/models/paging_simplified_episode_object.py +162 -0
- spotifywebapi/models/paging_simplified_show_object.py +160 -0
- spotifywebapi/models/paging_simplified_track_object.py +163 -0
- spotifywebapi/models/paging_track_object.py +162 -0
- spotifywebapi/models/play_history_object.py +141 -0
- spotifywebapi/models/playlist_object.py +425 -0
- spotifywebapi/models/playlist_owner_object.py +238 -0
- spotifywebapi/models/playlist_snapshot_id.py +85 -0
- spotifywebapi/models/playlist_track_object.py +171 -0
- spotifywebapi/models/playlist_tracks_ref_object.py +109 -0
- spotifywebapi/models/playlist_user_object.py +231 -0
- spotifywebapi/models/playlists_followers_request.py +86 -0
- spotifywebapi/models/playlists_request.py +160 -0
- spotifywebapi/models/playlists_tracks_request.py +121 -0
- spotifywebapi/models/playlists_tracks_request_1.py +188 -0
- spotifywebapi/models/playlists_tracks_request_2.py +109 -0
- spotifywebapi/models/private_user_object.py +379 -0
- spotifywebapi/models/public_user_object.py +268 -0
- spotifywebapi/models/queue_object.py +118 -0
- spotifywebapi/models/reason_enum.py +65 -0
- spotifywebapi/models/recommendation_seed_object.py +208 -0
- spotifywebapi/models/recommendations_object.py +96 -0
- spotifywebapi/models/release_date_precision_enum.py +62 -0
- spotifywebapi/models/resume_point_object.py +131 -0
- spotifywebapi/models/saved_album_object.py +118 -0
- spotifywebapi/models/saved_audiobook_object.py +118 -0
- spotifywebapi/models/saved_episode_object.py +116 -0
- spotifywebapi/models/saved_show_object.py +116 -0
- spotifywebapi/models/saved_track_object.py +118 -0
- spotifywebapi/models/search_items.py +256 -0
- spotifywebapi/models/section_object.py +362 -0
- spotifywebapi/models/segment_object.py +307 -0
- spotifywebapi/models/show_base.py +550 -0
- spotifywebapi/models/show_object.py +319 -0
- spotifywebapi/models/simplified_album_object.py +468 -0
- spotifywebapi/models/simplified_artist_object.py +228 -0
- spotifywebapi/models/simplified_playlist_object.py +398 -0
- spotifywebapi/models/simplified_track_object.py +494 -0
- spotifywebapi/models/time_interval_object.py +132 -0
- spotifywebapi/models/track.py +697 -0
- spotifywebapi/models/track_1.py +85 -0
- spotifywebapi/models/track_object.py +605 -0
- spotifywebapi/models/track_restriction_object.py +112 -0
- spotifywebapi/models/type_2_enum.py +56 -0
- spotifywebapi/models/type_3_enum.py +56 -0
- spotifywebapi/models/type_4_enum.py +56 -0
- spotifywebapi/models/type_5_enum.py +56 -0
- spotifywebapi/models/type_6_enum.py +56 -0
- spotifywebapi/models/type_8_enum.py +42 -0
- spotifywebapi/models/type_9_enum.py +42 -0
- spotifywebapi/models/type_enum.py +56 -0
- spotifywebapi/models/users_playlists_request.py +154 -0
- spotifywebapi/spotifywebapi_client.py +198 -0
- spotifywebapi/utilities/__init__.py +6 -0
- spotifywebapi/utilities/file_wrapper.py +45 -0
- spotifywebapi/utilities/union_type_lookup.py +113 -0
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
"""spotifywebapi.
|
|
2
|
+
|
|
3
|
+
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
from spotifywebapi.api_helper import APIHelper
|
|
8
|
+
from spotifywebapi.models.copyright_object import (
|
|
9
|
+
CopyrightObject,
|
|
10
|
+
)
|
|
11
|
+
from spotifywebapi.models.external_url_object import (
|
|
12
|
+
ExternalUrlObject,
|
|
13
|
+
)
|
|
14
|
+
from spotifywebapi.models.image_object import (
|
|
15
|
+
ImageObject,
|
|
16
|
+
)
|
|
17
|
+
from spotifywebapi.models.type_6_enum import (
|
|
18
|
+
Type6Enum,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ShowBase(object):
|
|
23
|
+
"""Implementation of the 'ShowBase' model.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
available_markets (List[str]): A list of the countries in which the show can
|
|
27
|
+
be played, identified by their [ISO 3166-1
|
|
28
|
+
alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.
|
|
29
|
+
copyrights (List[CopyrightObject]): The copyright statements of the show.
|
|
30
|
+
description (str): A description of the show. HTML tags are stripped away
|
|
31
|
+
from this field, use `html_description` field in case HTML tags are
|
|
32
|
+
needed.
|
|
33
|
+
html_description (str): A description of the show. This field may contain
|
|
34
|
+
HTML tags.
|
|
35
|
+
explicit (bool): Whether or not the show has explicit content (true = yes it
|
|
36
|
+
does; false = no it does not OR unknown).
|
|
37
|
+
external_urls (ExternalUrlObject): External URLs for this show.
|
|
38
|
+
href (str): A link to the Web API endpoint providing full details of the show.
|
|
39
|
+
id (str): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids)
|
|
40
|
+
for the show.
|
|
41
|
+
images (List[ImageObject]): The cover art for the show in various sizes,
|
|
42
|
+
widest first.
|
|
43
|
+
is_externally_hosted (bool): True if all of the shows episodes are hosted
|
|
44
|
+
outside of Spotify's CDN. This field might be `null` in some cases.
|
|
45
|
+
languages (List[str]): A list of the languages used in the show, identified
|
|
46
|
+
by their [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
|
|
47
|
+
media_type (str): The media type of the show.
|
|
48
|
+
name (str): The name of the episode.
|
|
49
|
+
publisher (str): The publisher of the show.
|
|
50
|
+
mtype (Type6Enum): The object type.
|
|
51
|
+
uri (str): The [Spotify
|
|
52
|
+
URI](/documentation/web-api/concepts/spotify-uris-ids) for the show.
|
|
53
|
+
total_episodes (int): The total number of episodes in the show.
|
|
54
|
+
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
# Create a mapping from Model property names to API property names
|
|
58
|
+
_names = {
|
|
59
|
+
"available_markets": "available_markets",
|
|
60
|
+
"copyrights": "copyrights",
|
|
61
|
+
"description": "description",
|
|
62
|
+
"html_description": "html_description",
|
|
63
|
+
"explicit": "explicit",
|
|
64
|
+
"external_urls": "external_urls",
|
|
65
|
+
"href": "href",
|
|
66
|
+
"id": "id",
|
|
67
|
+
"images": "images",
|
|
68
|
+
"is_externally_hosted": "is_externally_hosted",
|
|
69
|
+
"languages": "languages",
|
|
70
|
+
"media_type": "media_type",
|
|
71
|
+
"name": "name",
|
|
72
|
+
"publisher": "publisher",
|
|
73
|
+
"mtype": "type",
|
|
74
|
+
"uri": "uri",
|
|
75
|
+
"total_episodes": "total_episodes",
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
def __init__(
|
|
79
|
+
self,
|
|
80
|
+
available_markets=None,
|
|
81
|
+
copyrights=None,
|
|
82
|
+
description=None,
|
|
83
|
+
html_description=None,
|
|
84
|
+
explicit=None,
|
|
85
|
+
external_urls=None,
|
|
86
|
+
href=None,
|
|
87
|
+
id=None,
|
|
88
|
+
images=None,
|
|
89
|
+
is_externally_hosted=None,
|
|
90
|
+
languages=None,
|
|
91
|
+
media_type=None,
|
|
92
|
+
name=None,
|
|
93
|
+
publisher=None,
|
|
94
|
+
mtype=None,
|
|
95
|
+
uri=None,
|
|
96
|
+
total_episodes=None):
|
|
97
|
+
"""Initialize a ShowBase instance."""
|
|
98
|
+
# Initialize members of the class
|
|
99
|
+
self.available_markets = available_markets
|
|
100
|
+
self.copyrights = copyrights
|
|
101
|
+
self.description = description
|
|
102
|
+
self.html_description = html_description
|
|
103
|
+
self.explicit = explicit
|
|
104
|
+
self.external_urls = external_urls
|
|
105
|
+
self.href = href
|
|
106
|
+
self.id = id
|
|
107
|
+
self.images = images
|
|
108
|
+
self.is_externally_hosted = is_externally_hosted
|
|
109
|
+
self.languages = languages
|
|
110
|
+
self.media_type = media_type
|
|
111
|
+
self.name = name
|
|
112
|
+
self.publisher = publisher
|
|
113
|
+
self.mtype = mtype
|
|
114
|
+
self.uri = uri
|
|
115
|
+
self.total_episodes = total_episodes
|
|
116
|
+
|
|
117
|
+
@classmethod
|
|
118
|
+
def from_dictionary(cls,
|
|
119
|
+
dictionary):
|
|
120
|
+
"""Create an instance of this model from a dictionary
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
124
|
+
as obtained from the deserialization of the server's response. The
|
|
125
|
+
keys MUST match property names in the API description.
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
object: An instance of this structure class.
|
|
129
|
+
|
|
130
|
+
"""
|
|
131
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
132
|
+
return None
|
|
133
|
+
|
|
134
|
+
# Extract variables from the dictionary
|
|
135
|
+
available_markets =\
|
|
136
|
+
dictionary.get("available_markets")\
|
|
137
|
+
if dictionary.get("available_markets")\
|
|
138
|
+
else None
|
|
139
|
+
copyrights = None
|
|
140
|
+
if dictionary.get("copyrights") is not None:
|
|
141
|
+
copyrights = [
|
|
142
|
+
CopyrightObject.from_dictionary(x)
|
|
143
|
+
for x in dictionary.get("copyrights")
|
|
144
|
+
]
|
|
145
|
+
description =\
|
|
146
|
+
dictionary.get("description")\
|
|
147
|
+
if dictionary.get("description")\
|
|
148
|
+
else None
|
|
149
|
+
html_description =\
|
|
150
|
+
dictionary.get("html_description")\
|
|
151
|
+
if dictionary.get("html_description")\
|
|
152
|
+
else None
|
|
153
|
+
explicit =\
|
|
154
|
+
dictionary.get("explicit")\
|
|
155
|
+
if "explicit" in dictionary.keys()\
|
|
156
|
+
else None
|
|
157
|
+
external_urls =\
|
|
158
|
+
ExternalUrlObject.from_dictionary(
|
|
159
|
+
dictionary.get("external_urls"))\
|
|
160
|
+
if dictionary.get("external_urls") else None
|
|
161
|
+
href =\
|
|
162
|
+
dictionary.get("href")\
|
|
163
|
+
if dictionary.get("href")\
|
|
164
|
+
else None
|
|
165
|
+
id =\
|
|
166
|
+
dictionary.get("id")\
|
|
167
|
+
if dictionary.get("id")\
|
|
168
|
+
else None
|
|
169
|
+
images = None
|
|
170
|
+
if dictionary.get("images") is not None:
|
|
171
|
+
images = [
|
|
172
|
+
ImageObject.from_dictionary(x)
|
|
173
|
+
for x in dictionary.get("images")
|
|
174
|
+
]
|
|
175
|
+
is_externally_hosted =\
|
|
176
|
+
dictionary.get("is_externally_hosted")\
|
|
177
|
+
if "is_externally_hosted" in dictionary.keys()\
|
|
178
|
+
else None
|
|
179
|
+
languages =\
|
|
180
|
+
dictionary.get("languages")\
|
|
181
|
+
if dictionary.get("languages")\
|
|
182
|
+
else None
|
|
183
|
+
media_type =\
|
|
184
|
+
dictionary.get("media_type")\
|
|
185
|
+
if dictionary.get("media_type")\
|
|
186
|
+
else None
|
|
187
|
+
name =\
|
|
188
|
+
dictionary.get("name")\
|
|
189
|
+
if dictionary.get("name")\
|
|
190
|
+
else None
|
|
191
|
+
publisher =\
|
|
192
|
+
dictionary.get("publisher")\
|
|
193
|
+
if dictionary.get("publisher")\
|
|
194
|
+
else None
|
|
195
|
+
mtype =\
|
|
196
|
+
dictionary.get("type")\
|
|
197
|
+
if dictionary.get("type")\
|
|
198
|
+
else None
|
|
199
|
+
uri =\
|
|
200
|
+
dictionary.get("uri")\
|
|
201
|
+
if dictionary.get("uri")\
|
|
202
|
+
else None
|
|
203
|
+
total_episodes =\
|
|
204
|
+
dictionary.get("total_episodes")\
|
|
205
|
+
if dictionary.get("total_episodes")\
|
|
206
|
+
else None
|
|
207
|
+
|
|
208
|
+
# Return an object of this model
|
|
209
|
+
return cls(available_markets,
|
|
210
|
+
copyrights,
|
|
211
|
+
description,
|
|
212
|
+
html_description,
|
|
213
|
+
explicit,
|
|
214
|
+
external_urls,
|
|
215
|
+
href,
|
|
216
|
+
id,
|
|
217
|
+
images,
|
|
218
|
+
is_externally_hosted,
|
|
219
|
+
languages,
|
|
220
|
+
media_type,
|
|
221
|
+
name,
|
|
222
|
+
publisher,
|
|
223
|
+
mtype,
|
|
224
|
+
uri,
|
|
225
|
+
total_episodes)
|
|
226
|
+
|
|
227
|
+
@classmethod
|
|
228
|
+
def validate(cls, dictionary):
|
|
229
|
+
"""Validate dictionary against class required properties
|
|
230
|
+
|
|
231
|
+
Args:
|
|
232
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
233
|
+
as obtained from the deserialization of the server's response. The
|
|
234
|
+
keys MUST match property names in the API description.
|
|
235
|
+
|
|
236
|
+
Returns:
|
|
237
|
+
boolean : if dictionary is valid contains required properties.
|
|
238
|
+
|
|
239
|
+
"""
|
|
240
|
+
if isinstance(dictionary, cls):
|
|
241
|
+
return APIHelper.is_valid_type(
|
|
242
|
+
value=dictionary.available_markets,
|
|
243
|
+
type_callable=lambda value:
|
|
244
|
+
isinstance(
|
|
245
|
+
value,
|
|
246
|
+
str,
|
|
247
|
+
)) \
|
|
248
|
+
and APIHelper.is_valid_type(
|
|
249
|
+
value=dictionary.copyrights,
|
|
250
|
+
type_callable=lambda value:
|
|
251
|
+
CopyrightObject.validate(value),
|
|
252
|
+
is_model_dict=True,
|
|
253
|
+
is_inner_model_dict=True) \
|
|
254
|
+
and APIHelper.is_valid_type(
|
|
255
|
+
value=dictionary.description,
|
|
256
|
+
type_callable=lambda value:
|
|
257
|
+
isinstance(
|
|
258
|
+
value,
|
|
259
|
+
str,
|
|
260
|
+
)) \
|
|
261
|
+
and APIHelper.is_valid_type(
|
|
262
|
+
value=dictionary.html_description,
|
|
263
|
+
type_callable=lambda value:
|
|
264
|
+
isinstance(
|
|
265
|
+
value,
|
|
266
|
+
str,
|
|
267
|
+
)) \
|
|
268
|
+
and APIHelper.is_valid_type(
|
|
269
|
+
value=dictionary.explicit,
|
|
270
|
+
type_callable=lambda value:
|
|
271
|
+
isinstance(
|
|
272
|
+
value,
|
|
273
|
+
bool,
|
|
274
|
+
)) \
|
|
275
|
+
and APIHelper.is_valid_type(
|
|
276
|
+
value=dictionary.external_urls,
|
|
277
|
+
type_callable=lambda value:
|
|
278
|
+
ExternalUrlObject.validate(value),
|
|
279
|
+
is_model_dict=True) \
|
|
280
|
+
and APIHelper.is_valid_type(
|
|
281
|
+
value=dictionary.href,
|
|
282
|
+
type_callable=lambda value:
|
|
283
|
+
isinstance(
|
|
284
|
+
value,
|
|
285
|
+
str,
|
|
286
|
+
)) \
|
|
287
|
+
and APIHelper.is_valid_type(
|
|
288
|
+
value=dictionary.id,
|
|
289
|
+
type_callable=lambda value:
|
|
290
|
+
isinstance(
|
|
291
|
+
value,
|
|
292
|
+
str,
|
|
293
|
+
)) \
|
|
294
|
+
and APIHelper.is_valid_type(
|
|
295
|
+
value=dictionary.images,
|
|
296
|
+
type_callable=lambda value:
|
|
297
|
+
ImageObject.validate(value),
|
|
298
|
+
is_model_dict=True,
|
|
299
|
+
is_inner_model_dict=True) \
|
|
300
|
+
and APIHelper.is_valid_type(
|
|
301
|
+
value=dictionary.is_externally_hosted,
|
|
302
|
+
type_callable=lambda value:
|
|
303
|
+
isinstance(
|
|
304
|
+
value,
|
|
305
|
+
bool,
|
|
306
|
+
)) \
|
|
307
|
+
and APIHelper.is_valid_type(
|
|
308
|
+
value=dictionary.languages,
|
|
309
|
+
type_callable=lambda value:
|
|
310
|
+
isinstance(
|
|
311
|
+
value,
|
|
312
|
+
str,
|
|
313
|
+
)) \
|
|
314
|
+
and APIHelper.is_valid_type(
|
|
315
|
+
value=dictionary.media_type,
|
|
316
|
+
type_callable=lambda value:
|
|
317
|
+
isinstance(
|
|
318
|
+
value,
|
|
319
|
+
str,
|
|
320
|
+
)) \
|
|
321
|
+
and APIHelper.is_valid_type(
|
|
322
|
+
value=dictionary.name,
|
|
323
|
+
type_callable=lambda value:
|
|
324
|
+
isinstance(
|
|
325
|
+
value,
|
|
326
|
+
str,
|
|
327
|
+
)) \
|
|
328
|
+
and APIHelper.is_valid_type(
|
|
329
|
+
value=dictionary.publisher,
|
|
330
|
+
type_callable=lambda value:
|
|
331
|
+
isinstance(
|
|
332
|
+
value,
|
|
333
|
+
str,
|
|
334
|
+
)) \
|
|
335
|
+
and APIHelper.is_valid_type(
|
|
336
|
+
value=dictionary.mtype,
|
|
337
|
+
type_callable=lambda value:
|
|
338
|
+
Type6Enum.validate(value)) \
|
|
339
|
+
and APIHelper.is_valid_type(
|
|
340
|
+
value=dictionary.uri,
|
|
341
|
+
type_callable=lambda value:
|
|
342
|
+
isinstance(
|
|
343
|
+
value,
|
|
344
|
+
str,
|
|
345
|
+
)) \
|
|
346
|
+
and APIHelper.is_valid_type(
|
|
347
|
+
value=dictionary.total_episodes,
|
|
348
|
+
type_callable=lambda value:
|
|
349
|
+
isinstance(
|
|
350
|
+
value,
|
|
351
|
+
int,
|
|
352
|
+
))
|
|
353
|
+
|
|
354
|
+
if not isinstance(dictionary, dict):
|
|
355
|
+
return False
|
|
356
|
+
|
|
357
|
+
return APIHelper.is_valid_type(
|
|
358
|
+
value=dictionary.get("available_markets"),
|
|
359
|
+
type_callable=lambda value:
|
|
360
|
+
isinstance(
|
|
361
|
+
value,
|
|
362
|
+
str,
|
|
363
|
+
)) \
|
|
364
|
+
and APIHelper.is_valid_type(
|
|
365
|
+
value=dictionary.get("copyrights"),
|
|
366
|
+
type_callable=lambda value:
|
|
367
|
+
CopyrightObject.validate(value),
|
|
368
|
+
is_model_dict=True,
|
|
369
|
+
is_inner_model_dict=True) \
|
|
370
|
+
and APIHelper.is_valid_type(
|
|
371
|
+
value=dictionary.get("description"),
|
|
372
|
+
type_callable=lambda value:
|
|
373
|
+
isinstance(
|
|
374
|
+
value,
|
|
375
|
+
str,
|
|
376
|
+
)) \
|
|
377
|
+
and APIHelper.is_valid_type(
|
|
378
|
+
value=dictionary.get("html_description"),
|
|
379
|
+
type_callable=lambda value:
|
|
380
|
+
isinstance(
|
|
381
|
+
value,
|
|
382
|
+
str,
|
|
383
|
+
)) \
|
|
384
|
+
and APIHelper.is_valid_type(
|
|
385
|
+
value=dictionary.get("explicit"),
|
|
386
|
+
type_callable=lambda value:
|
|
387
|
+
isinstance(
|
|
388
|
+
value,
|
|
389
|
+
bool,
|
|
390
|
+
)) \
|
|
391
|
+
and APIHelper.is_valid_type(
|
|
392
|
+
value=dictionary.get("external_urls"),
|
|
393
|
+
type_callable=lambda value:
|
|
394
|
+
ExternalUrlObject.validate(value),
|
|
395
|
+
is_model_dict=True) \
|
|
396
|
+
and APIHelper.is_valid_type(
|
|
397
|
+
value=dictionary.get("href"),
|
|
398
|
+
type_callable=lambda value:
|
|
399
|
+
isinstance(
|
|
400
|
+
value,
|
|
401
|
+
str,
|
|
402
|
+
)) \
|
|
403
|
+
and APIHelper.is_valid_type(
|
|
404
|
+
value=dictionary.get("id"),
|
|
405
|
+
type_callable=lambda value:
|
|
406
|
+
isinstance(
|
|
407
|
+
value,
|
|
408
|
+
str,
|
|
409
|
+
)) \
|
|
410
|
+
and APIHelper.is_valid_type(
|
|
411
|
+
value=dictionary.get("images"),
|
|
412
|
+
type_callable=lambda value:
|
|
413
|
+
ImageObject.validate(value),
|
|
414
|
+
is_model_dict=True,
|
|
415
|
+
is_inner_model_dict=True) \
|
|
416
|
+
and APIHelper.is_valid_type(
|
|
417
|
+
value=dictionary.get("is_externally_hosted"),
|
|
418
|
+
type_callable=lambda value:
|
|
419
|
+
isinstance(
|
|
420
|
+
value,
|
|
421
|
+
bool,
|
|
422
|
+
)) \
|
|
423
|
+
and APIHelper.is_valid_type(
|
|
424
|
+
value=dictionary.get("languages"),
|
|
425
|
+
type_callable=lambda value:
|
|
426
|
+
isinstance(
|
|
427
|
+
value,
|
|
428
|
+
str,
|
|
429
|
+
)) \
|
|
430
|
+
and APIHelper.is_valid_type(
|
|
431
|
+
value=dictionary.get("media_type"),
|
|
432
|
+
type_callable=lambda value:
|
|
433
|
+
isinstance(
|
|
434
|
+
value,
|
|
435
|
+
str,
|
|
436
|
+
)) \
|
|
437
|
+
and APIHelper.is_valid_type(
|
|
438
|
+
value=dictionary.get("name"),
|
|
439
|
+
type_callable=lambda value:
|
|
440
|
+
isinstance(
|
|
441
|
+
value,
|
|
442
|
+
str,
|
|
443
|
+
)) \
|
|
444
|
+
and APIHelper.is_valid_type(
|
|
445
|
+
value=dictionary.get("publisher"),
|
|
446
|
+
type_callable=lambda value:
|
|
447
|
+
isinstance(
|
|
448
|
+
value,
|
|
449
|
+
str,
|
|
450
|
+
)) \
|
|
451
|
+
and APIHelper.is_valid_type(
|
|
452
|
+
value=dictionary.get("type"),
|
|
453
|
+
type_callable=lambda value:
|
|
454
|
+
Type6Enum.validate(value)) \
|
|
455
|
+
and APIHelper.is_valid_type(
|
|
456
|
+
value=dictionary.get("uri"),
|
|
457
|
+
type_callable=lambda value:
|
|
458
|
+
isinstance(
|
|
459
|
+
value,
|
|
460
|
+
str,
|
|
461
|
+
)) \
|
|
462
|
+
and APIHelper.is_valid_type(
|
|
463
|
+
value=dictionary.get("total_episodes"),
|
|
464
|
+
type_callable=lambda value:
|
|
465
|
+
isinstance(
|
|
466
|
+
value,
|
|
467
|
+
int,
|
|
468
|
+
))
|
|
469
|
+
|
|
470
|
+
def __repr__(self):
|
|
471
|
+
"""Return a unambiguous string representation."""
|
|
472
|
+
_available_markets=self.available_markets
|
|
473
|
+
_copyrights=self.copyrights
|
|
474
|
+
_description=self.description
|
|
475
|
+
_html_description=self.html_description
|
|
476
|
+
_explicit=self.explicit
|
|
477
|
+
_external_urls=self.external_urls
|
|
478
|
+
_href=self.href
|
|
479
|
+
_id=self.id
|
|
480
|
+
_images=self.images
|
|
481
|
+
_is_externally_hosted=self.is_externally_hosted
|
|
482
|
+
_languages=self.languages
|
|
483
|
+
_media_type=self.media_type
|
|
484
|
+
_name=self.name
|
|
485
|
+
_publisher=self.publisher
|
|
486
|
+
_mtype=self.mtype
|
|
487
|
+
_uri=self.uri
|
|
488
|
+
_total_episodes=self.total_episodes
|
|
489
|
+
return (
|
|
490
|
+
f"{self.__class__.__name__}("
|
|
491
|
+
f"available_markets={_available_markets!r}, "
|
|
492
|
+
f"copyrights={_copyrights!r}, "
|
|
493
|
+
f"description={_description!r}, "
|
|
494
|
+
f"html_description={_html_description!r}, "
|
|
495
|
+
f"explicit={_explicit!r}, "
|
|
496
|
+
f"external_urls={_external_urls!r}, "
|
|
497
|
+
f"href={_href!r}, "
|
|
498
|
+
f"id={_id!r}, "
|
|
499
|
+
f"images={_images!r}, "
|
|
500
|
+
f"is_externally_hosted={_is_externally_hosted!r}, "
|
|
501
|
+
f"languages={_languages!r}, "
|
|
502
|
+
f"media_type={_media_type!r}, "
|
|
503
|
+
f"name={_name!r}, "
|
|
504
|
+
f"publisher={_publisher!r}, "
|
|
505
|
+
f"mtype={_mtype!r}, "
|
|
506
|
+
f"uri={_uri!r}, "
|
|
507
|
+
f"total_episodes={_total_episodes!r}, "
|
|
508
|
+
f")"
|
|
509
|
+
)
|
|
510
|
+
|
|
511
|
+
def __str__(self):
|
|
512
|
+
"""Return a human-readable string representation."""
|
|
513
|
+
_available_markets=self.available_markets
|
|
514
|
+
_copyrights=self.copyrights
|
|
515
|
+
_description=self.description
|
|
516
|
+
_html_description=self.html_description
|
|
517
|
+
_explicit=self.explicit
|
|
518
|
+
_external_urls=self.external_urls
|
|
519
|
+
_href=self.href
|
|
520
|
+
_id=self.id
|
|
521
|
+
_images=self.images
|
|
522
|
+
_is_externally_hosted=self.is_externally_hosted
|
|
523
|
+
_languages=self.languages
|
|
524
|
+
_media_type=self.media_type
|
|
525
|
+
_name=self.name
|
|
526
|
+
_publisher=self.publisher
|
|
527
|
+
_mtype=self.mtype
|
|
528
|
+
_uri=self.uri
|
|
529
|
+
_total_episodes=self.total_episodes
|
|
530
|
+
return (
|
|
531
|
+
f"{self.__class__.__name__}("
|
|
532
|
+
f"available_markets={_available_markets!s}, "
|
|
533
|
+
f"copyrights={_copyrights!s}, "
|
|
534
|
+
f"description={_description!s}, "
|
|
535
|
+
f"html_description={_html_description!s}, "
|
|
536
|
+
f"explicit={_explicit!s}, "
|
|
537
|
+
f"external_urls={_external_urls!s}, "
|
|
538
|
+
f"href={_href!s}, "
|
|
539
|
+
f"id={_id!s}, "
|
|
540
|
+
f"images={_images!s}, "
|
|
541
|
+
f"is_externally_hosted={_is_externally_hosted!s}, "
|
|
542
|
+
f"languages={_languages!s}, "
|
|
543
|
+
f"media_type={_media_type!s}, "
|
|
544
|
+
f"name={_name!s}, "
|
|
545
|
+
f"publisher={_publisher!s}, "
|
|
546
|
+
f"mtype={_mtype!s}, "
|
|
547
|
+
f"uri={_uri!s}, "
|
|
548
|
+
f"total_episodes={_total_episodes!s}, "
|
|
549
|
+
f")"
|
|
550
|
+
)
|