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,468 @@
|
|
|
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.album_restriction_object import (
|
|
9
|
+
AlbumRestrictionObject,
|
|
10
|
+
)
|
|
11
|
+
from spotifywebapi.models.album_type_enum import (
|
|
12
|
+
AlbumTypeEnum,
|
|
13
|
+
)
|
|
14
|
+
from spotifywebapi.models.external_url_object import (
|
|
15
|
+
ExternalUrlObject,
|
|
16
|
+
)
|
|
17
|
+
from spotifywebapi.models.image_object import (
|
|
18
|
+
ImageObject,
|
|
19
|
+
)
|
|
20
|
+
from spotifywebapi.models.release_date_precision_enum import (
|
|
21
|
+
ReleaseDatePrecisionEnum,
|
|
22
|
+
)
|
|
23
|
+
from spotifywebapi.models.simplified_artist_object import (
|
|
24
|
+
SimplifiedArtistObject,
|
|
25
|
+
)
|
|
26
|
+
from spotifywebapi.models.type_2_enum import (
|
|
27
|
+
Type2Enum,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class SimplifiedAlbumObject(object):
|
|
32
|
+
"""Implementation of the 'SimplifiedAlbumObject' model.
|
|
33
|
+
|
|
34
|
+
Attributes:
|
|
35
|
+
album_type (AlbumTypeEnum): The type of the album.
|
|
36
|
+
total_tracks (int): The number of tracks in the album.
|
|
37
|
+
available_markets (List[str]): The markets in which the album is available:
|
|
38
|
+
[ISO 3166-1 alpha-2 country
|
|
39
|
+
codes](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). _**NOTE**: an
|
|
40
|
+
album is considered available in a market when at least 1 of its tracks
|
|
41
|
+
is available in that market._
|
|
42
|
+
external_urls (ExternalUrlObject): Known external URLs for this album.
|
|
43
|
+
href (str): A link to the Web API endpoint providing full details of the
|
|
44
|
+
album.
|
|
45
|
+
id (str): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids)
|
|
46
|
+
for the album.
|
|
47
|
+
images (List[ImageObject]): The cover art for the album in various sizes,
|
|
48
|
+
widest first.
|
|
49
|
+
name (str): The name of the album. In case of an album takedown, the value
|
|
50
|
+
may be an empty string.
|
|
51
|
+
release_date (str): The date the album was first released.
|
|
52
|
+
release_date_precision (ReleaseDatePrecisionEnum): The precision with which
|
|
53
|
+
`release_date` value is known.
|
|
54
|
+
restrictions (AlbumRestrictionObject): Included in the response when a
|
|
55
|
+
content restriction is applied.
|
|
56
|
+
mtype (Type2Enum): The object type.
|
|
57
|
+
uri (str): The [Spotify
|
|
58
|
+
URI](/documentation/web-api/concepts/spotify-uris-ids) for the album.
|
|
59
|
+
artists (List[SimplifiedArtistObject]): The artists of the album. Each artist
|
|
60
|
+
object includes a link in `href` to more detailed information about the
|
|
61
|
+
artist.
|
|
62
|
+
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
# Create a mapping from Model property names to API property names
|
|
66
|
+
_names = {
|
|
67
|
+
"album_type": "album_type",
|
|
68
|
+
"total_tracks": "total_tracks",
|
|
69
|
+
"available_markets": "available_markets",
|
|
70
|
+
"external_urls": "external_urls",
|
|
71
|
+
"href": "href",
|
|
72
|
+
"id": "id",
|
|
73
|
+
"images": "images",
|
|
74
|
+
"name": "name",
|
|
75
|
+
"release_date": "release_date",
|
|
76
|
+
"release_date_precision": "release_date_precision",
|
|
77
|
+
"mtype": "type",
|
|
78
|
+
"uri": "uri",
|
|
79
|
+
"artists": "artists",
|
|
80
|
+
"restrictions": "restrictions",
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
_optionals = [
|
|
84
|
+
"restrictions",
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
def __init__(
|
|
88
|
+
self,
|
|
89
|
+
album_type=None,
|
|
90
|
+
total_tracks=None,
|
|
91
|
+
available_markets=None,
|
|
92
|
+
external_urls=None,
|
|
93
|
+
href=None,
|
|
94
|
+
id=None,
|
|
95
|
+
images=None,
|
|
96
|
+
name=None,
|
|
97
|
+
release_date=None,
|
|
98
|
+
release_date_precision=None,
|
|
99
|
+
mtype=None,
|
|
100
|
+
uri=None,
|
|
101
|
+
artists=None,
|
|
102
|
+
restrictions=APIHelper.SKIP):
|
|
103
|
+
"""Initialize a SimplifiedAlbumObject instance."""
|
|
104
|
+
# Initialize members of the class
|
|
105
|
+
self.album_type = album_type
|
|
106
|
+
self.total_tracks = total_tracks
|
|
107
|
+
self.available_markets = available_markets
|
|
108
|
+
self.external_urls = external_urls
|
|
109
|
+
self.href = href
|
|
110
|
+
self.id = id
|
|
111
|
+
self.images = images
|
|
112
|
+
self.name = name
|
|
113
|
+
self.release_date = release_date
|
|
114
|
+
self.release_date_precision = release_date_precision
|
|
115
|
+
if restrictions is not APIHelper.SKIP:
|
|
116
|
+
self.restrictions = restrictions
|
|
117
|
+
self.mtype = mtype
|
|
118
|
+
self.uri = uri
|
|
119
|
+
self.artists = artists
|
|
120
|
+
|
|
121
|
+
@classmethod
|
|
122
|
+
def from_dictionary(cls,
|
|
123
|
+
dictionary):
|
|
124
|
+
"""Create an instance of this model from a dictionary
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
128
|
+
as obtained from the deserialization of the server's response. The
|
|
129
|
+
keys MUST match property names in the API description.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
object: An instance of this structure class.
|
|
133
|
+
|
|
134
|
+
"""
|
|
135
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
136
|
+
return None
|
|
137
|
+
|
|
138
|
+
# Extract variables from the dictionary
|
|
139
|
+
album_type =\
|
|
140
|
+
dictionary.get("album_type")\
|
|
141
|
+
if dictionary.get("album_type")\
|
|
142
|
+
else None
|
|
143
|
+
total_tracks =\
|
|
144
|
+
dictionary.get("total_tracks")\
|
|
145
|
+
if dictionary.get("total_tracks")\
|
|
146
|
+
else None
|
|
147
|
+
available_markets =\
|
|
148
|
+
dictionary.get("available_markets")\
|
|
149
|
+
if dictionary.get("available_markets")\
|
|
150
|
+
else None
|
|
151
|
+
external_urls =\
|
|
152
|
+
ExternalUrlObject.from_dictionary(
|
|
153
|
+
dictionary.get("external_urls"))\
|
|
154
|
+
if dictionary.get("external_urls") else None
|
|
155
|
+
href =\
|
|
156
|
+
dictionary.get("href")\
|
|
157
|
+
if dictionary.get("href")\
|
|
158
|
+
else None
|
|
159
|
+
id =\
|
|
160
|
+
dictionary.get("id")\
|
|
161
|
+
if dictionary.get("id")\
|
|
162
|
+
else None
|
|
163
|
+
images = None
|
|
164
|
+
if dictionary.get("images") is not None:
|
|
165
|
+
images = [
|
|
166
|
+
ImageObject.from_dictionary(x)
|
|
167
|
+
for x in dictionary.get("images")
|
|
168
|
+
]
|
|
169
|
+
name =\
|
|
170
|
+
dictionary.get("name")\
|
|
171
|
+
if dictionary.get("name")\
|
|
172
|
+
else None
|
|
173
|
+
release_date =\
|
|
174
|
+
dictionary.get("release_date")\
|
|
175
|
+
if dictionary.get("release_date")\
|
|
176
|
+
else None
|
|
177
|
+
release_date_precision =\
|
|
178
|
+
dictionary.get("release_date_precision")\
|
|
179
|
+
if dictionary.get("release_date_precision")\
|
|
180
|
+
else None
|
|
181
|
+
mtype =\
|
|
182
|
+
dictionary.get("type")\
|
|
183
|
+
if dictionary.get("type")\
|
|
184
|
+
else None
|
|
185
|
+
uri =\
|
|
186
|
+
dictionary.get("uri")\
|
|
187
|
+
if dictionary.get("uri")\
|
|
188
|
+
else None
|
|
189
|
+
artists = None
|
|
190
|
+
if dictionary.get("artists") is not None:
|
|
191
|
+
artists = [
|
|
192
|
+
SimplifiedArtistObject.from_dictionary(x)
|
|
193
|
+
for x in dictionary.get("artists")
|
|
194
|
+
]
|
|
195
|
+
restrictions =\
|
|
196
|
+
AlbumRestrictionObject.from_dictionary(
|
|
197
|
+
dictionary.get("restrictions"))\
|
|
198
|
+
if "restrictions" in dictionary.keys()\
|
|
199
|
+
else APIHelper.SKIP
|
|
200
|
+
|
|
201
|
+
# Return an object of this model
|
|
202
|
+
return cls(album_type,
|
|
203
|
+
total_tracks,
|
|
204
|
+
available_markets,
|
|
205
|
+
external_urls,
|
|
206
|
+
href,
|
|
207
|
+
id,
|
|
208
|
+
images,
|
|
209
|
+
name,
|
|
210
|
+
release_date,
|
|
211
|
+
release_date_precision,
|
|
212
|
+
mtype,
|
|
213
|
+
uri,
|
|
214
|
+
artists,
|
|
215
|
+
restrictions)
|
|
216
|
+
|
|
217
|
+
@classmethod
|
|
218
|
+
def validate(cls, dictionary):
|
|
219
|
+
"""Validate dictionary against class required properties
|
|
220
|
+
|
|
221
|
+
Args:
|
|
222
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
223
|
+
as obtained from the deserialization of the server's response. The
|
|
224
|
+
keys MUST match property names in the API description.
|
|
225
|
+
|
|
226
|
+
Returns:
|
|
227
|
+
boolean : if dictionary is valid contains required properties.
|
|
228
|
+
|
|
229
|
+
"""
|
|
230
|
+
if isinstance(dictionary, cls):
|
|
231
|
+
return APIHelper.is_valid_type(
|
|
232
|
+
value=dictionary.album_type,
|
|
233
|
+
type_callable=lambda value:
|
|
234
|
+
AlbumTypeEnum.validate(value)) \
|
|
235
|
+
and APIHelper.is_valid_type(
|
|
236
|
+
value=dictionary.total_tracks,
|
|
237
|
+
type_callable=lambda value:
|
|
238
|
+
isinstance(
|
|
239
|
+
value,
|
|
240
|
+
int,
|
|
241
|
+
)) \
|
|
242
|
+
and APIHelper.is_valid_type(
|
|
243
|
+
value=dictionary.available_markets,
|
|
244
|
+
type_callable=lambda value:
|
|
245
|
+
isinstance(
|
|
246
|
+
value,
|
|
247
|
+
str,
|
|
248
|
+
)) \
|
|
249
|
+
and APIHelper.is_valid_type(
|
|
250
|
+
value=dictionary.external_urls,
|
|
251
|
+
type_callable=lambda value:
|
|
252
|
+
ExternalUrlObject.validate(value),
|
|
253
|
+
is_model_dict=True) \
|
|
254
|
+
and APIHelper.is_valid_type(
|
|
255
|
+
value=dictionary.href,
|
|
256
|
+
type_callable=lambda value:
|
|
257
|
+
isinstance(
|
|
258
|
+
value,
|
|
259
|
+
str,
|
|
260
|
+
)) \
|
|
261
|
+
and APIHelper.is_valid_type(
|
|
262
|
+
value=dictionary.id,
|
|
263
|
+
type_callable=lambda value:
|
|
264
|
+
isinstance(
|
|
265
|
+
value,
|
|
266
|
+
str,
|
|
267
|
+
)) \
|
|
268
|
+
and APIHelper.is_valid_type(
|
|
269
|
+
value=dictionary.images,
|
|
270
|
+
type_callable=lambda value:
|
|
271
|
+
ImageObject.validate(value),
|
|
272
|
+
is_model_dict=True,
|
|
273
|
+
is_inner_model_dict=True) \
|
|
274
|
+
and APIHelper.is_valid_type(
|
|
275
|
+
value=dictionary.name,
|
|
276
|
+
type_callable=lambda value:
|
|
277
|
+
isinstance(
|
|
278
|
+
value,
|
|
279
|
+
str,
|
|
280
|
+
)) \
|
|
281
|
+
and APIHelper.is_valid_type(
|
|
282
|
+
value=dictionary.release_date,
|
|
283
|
+
type_callable=lambda value:
|
|
284
|
+
isinstance(
|
|
285
|
+
value,
|
|
286
|
+
str,
|
|
287
|
+
)) \
|
|
288
|
+
and APIHelper.is_valid_type(
|
|
289
|
+
value=dictionary.release_date_precision,
|
|
290
|
+
type_callable=lambda value:
|
|
291
|
+
ReleaseDatePrecisionEnum.validate(value)) \
|
|
292
|
+
and APIHelper.is_valid_type(
|
|
293
|
+
value=dictionary.mtype,
|
|
294
|
+
type_callable=lambda value:
|
|
295
|
+
Type2Enum.validate(value)) \
|
|
296
|
+
and APIHelper.is_valid_type(
|
|
297
|
+
value=dictionary.uri,
|
|
298
|
+
type_callable=lambda value:
|
|
299
|
+
isinstance(
|
|
300
|
+
value,
|
|
301
|
+
str,
|
|
302
|
+
)) \
|
|
303
|
+
and APIHelper.is_valid_type(
|
|
304
|
+
value=dictionary.artists,
|
|
305
|
+
type_callable=lambda value:
|
|
306
|
+
SimplifiedArtistObject.validate(value),
|
|
307
|
+
is_model_dict=True,
|
|
308
|
+
is_inner_model_dict=True)
|
|
309
|
+
|
|
310
|
+
if not isinstance(dictionary, dict):
|
|
311
|
+
return False
|
|
312
|
+
|
|
313
|
+
return APIHelper.is_valid_type(
|
|
314
|
+
value=dictionary.get("album_type"),
|
|
315
|
+
type_callable=lambda value:
|
|
316
|
+
AlbumTypeEnum.validate(value)) \
|
|
317
|
+
and APIHelper.is_valid_type(
|
|
318
|
+
value=dictionary.get("total_tracks"),
|
|
319
|
+
type_callable=lambda value:
|
|
320
|
+
isinstance(
|
|
321
|
+
value,
|
|
322
|
+
int,
|
|
323
|
+
)) \
|
|
324
|
+
and APIHelper.is_valid_type(
|
|
325
|
+
value=dictionary.get("available_markets"),
|
|
326
|
+
type_callable=lambda value:
|
|
327
|
+
isinstance(
|
|
328
|
+
value,
|
|
329
|
+
str,
|
|
330
|
+
)) \
|
|
331
|
+
and APIHelper.is_valid_type(
|
|
332
|
+
value=dictionary.get("external_urls"),
|
|
333
|
+
type_callable=lambda value:
|
|
334
|
+
ExternalUrlObject.validate(value),
|
|
335
|
+
is_model_dict=True) \
|
|
336
|
+
and APIHelper.is_valid_type(
|
|
337
|
+
value=dictionary.get("href"),
|
|
338
|
+
type_callable=lambda value:
|
|
339
|
+
isinstance(
|
|
340
|
+
value,
|
|
341
|
+
str,
|
|
342
|
+
)) \
|
|
343
|
+
and APIHelper.is_valid_type(
|
|
344
|
+
value=dictionary.get("id"),
|
|
345
|
+
type_callable=lambda value:
|
|
346
|
+
isinstance(
|
|
347
|
+
value,
|
|
348
|
+
str,
|
|
349
|
+
)) \
|
|
350
|
+
and APIHelper.is_valid_type(
|
|
351
|
+
value=dictionary.get("images"),
|
|
352
|
+
type_callable=lambda value:
|
|
353
|
+
ImageObject.validate(value),
|
|
354
|
+
is_model_dict=True,
|
|
355
|
+
is_inner_model_dict=True) \
|
|
356
|
+
and APIHelper.is_valid_type(
|
|
357
|
+
value=dictionary.get("name"),
|
|
358
|
+
type_callable=lambda value:
|
|
359
|
+
isinstance(
|
|
360
|
+
value,
|
|
361
|
+
str,
|
|
362
|
+
)) \
|
|
363
|
+
and APIHelper.is_valid_type(
|
|
364
|
+
value=dictionary.get("release_date"),
|
|
365
|
+
type_callable=lambda value:
|
|
366
|
+
isinstance(
|
|
367
|
+
value,
|
|
368
|
+
str,
|
|
369
|
+
)) \
|
|
370
|
+
and APIHelper.is_valid_type(
|
|
371
|
+
value=dictionary.get("release_date_precision"),
|
|
372
|
+
type_callable=lambda value:
|
|
373
|
+
ReleaseDatePrecisionEnum.validate(value)) \
|
|
374
|
+
and APIHelper.is_valid_type(
|
|
375
|
+
value=dictionary.get("type"),
|
|
376
|
+
type_callable=lambda value:
|
|
377
|
+
Type2Enum.validate(value)) \
|
|
378
|
+
and APIHelper.is_valid_type(
|
|
379
|
+
value=dictionary.get("uri"),
|
|
380
|
+
type_callable=lambda value:
|
|
381
|
+
isinstance(
|
|
382
|
+
value,
|
|
383
|
+
str,
|
|
384
|
+
)) \
|
|
385
|
+
and APIHelper.is_valid_type(
|
|
386
|
+
value=dictionary.get("artists"),
|
|
387
|
+
type_callable=lambda value:
|
|
388
|
+
SimplifiedArtistObject.validate(value),
|
|
389
|
+
is_model_dict=True,
|
|
390
|
+
is_inner_model_dict=True)
|
|
391
|
+
|
|
392
|
+
def __repr__(self):
|
|
393
|
+
"""Return a unambiguous string representation."""
|
|
394
|
+
_album_type=self.album_type
|
|
395
|
+
_total_tracks=self.total_tracks
|
|
396
|
+
_available_markets=self.available_markets
|
|
397
|
+
_external_urls=self.external_urls
|
|
398
|
+
_href=self.href
|
|
399
|
+
_id=self.id
|
|
400
|
+
_images=self.images
|
|
401
|
+
_name=self.name
|
|
402
|
+
_release_date=self.release_date
|
|
403
|
+
_release_date_precision=self.release_date_precision
|
|
404
|
+
_restrictions=(
|
|
405
|
+
self.restrictions
|
|
406
|
+
if hasattr(self, "restrictions")
|
|
407
|
+
else None
|
|
408
|
+
)
|
|
409
|
+
_mtype=self.mtype
|
|
410
|
+
_uri=self.uri
|
|
411
|
+
_artists=self.artists
|
|
412
|
+
return (
|
|
413
|
+
f"{self.__class__.__name__}("
|
|
414
|
+
f"album_type={_album_type!r}, "
|
|
415
|
+
f"total_tracks={_total_tracks!r}, "
|
|
416
|
+
f"available_markets={_available_markets!r}, "
|
|
417
|
+
f"external_urls={_external_urls!r}, "
|
|
418
|
+
f"href={_href!r}, "
|
|
419
|
+
f"id={_id!r}, "
|
|
420
|
+
f"images={_images!r}, "
|
|
421
|
+
f"name={_name!r}, "
|
|
422
|
+
f"release_date={_release_date!r}, "
|
|
423
|
+
f"release_date_precision={_release_date_precision!r}, "
|
|
424
|
+
f"restrictions={_restrictions!r}, "
|
|
425
|
+
f"mtype={_mtype!r}, "
|
|
426
|
+
f"uri={_uri!r}, "
|
|
427
|
+
f"artists={_artists!r}, "
|
|
428
|
+
f")"
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
def __str__(self):
|
|
432
|
+
"""Return a human-readable string representation."""
|
|
433
|
+
_album_type=self.album_type
|
|
434
|
+
_total_tracks=self.total_tracks
|
|
435
|
+
_available_markets=self.available_markets
|
|
436
|
+
_external_urls=self.external_urls
|
|
437
|
+
_href=self.href
|
|
438
|
+
_id=self.id
|
|
439
|
+
_images=self.images
|
|
440
|
+
_name=self.name
|
|
441
|
+
_release_date=self.release_date
|
|
442
|
+
_release_date_precision=self.release_date_precision
|
|
443
|
+
_restrictions=(
|
|
444
|
+
self.restrictions
|
|
445
|
+
if hasattr(self, "restrictions")
|
|
446
|
+
else None
|
|
447
|
+
)
|
|
448
|
+
_mtype=self.mtype
|
|
449
|
+
_uri=self.uri
|
|
450
|
+
_artists=self.artists
|
|
451
|
+
return (
|
|
452
|
+
f"{self.__class__.__name__}("
|
|
453
|
+
f"album_type={_album_type!s}, "
|
|
454
|
+
f"total_tracks={_total_tracks!s}, "
|
|
455
|
+
f"available_markets={_available_markets!s}, "
|
|
456
|
+
f"external_urls={_external_urls!s}, "
|
|
457
|
+
f"href={_href!s}, "
|
|
458
|
+
f"id={_id!s}, "
|
|
459
|
+
f"images={_images!s}, "
|
|
460
|
+
f"name={_name!s}, "
|
|
461
|
+
f"release_date={_release_date!s}, "
|
|
462
|
+
f"release_date_precision={_release_date_precision!s}, "
|
|
463
|
+
f"restrictions={_restrictions!s}, "
|
|
464
|
+
f"mtype={_mtype!s}, "
|
|
465
|
+
f"uri={_uri!s}, "
|
|
466
|
+
f"artists={_artists!s}, "
|
|
467
|
+
f")"
|
|
468
|
+
)
|
|
@@ -0,0 +1,228 @@
|
|
|
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.external_url_object import (
|
|
9
|
+
ExternalUrlObject,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class SimplifiedArtistObject(object):
|
|
14
|
+
"""Implementation of the 'SimplifiedArtistObject' model.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
external_urls (ExternalUrlObject): Known external URLs for this artist.
|
|
18
|
+
href (str): A link to the Web API endpoint providing full details of the
|
|
19
|
+
artist.
|
|
20
|
+
id (str): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids)
|
|
21
|
+
for the artist.
|
|
22
|
+
name (str): The name of the artist.
|
|
23
|
+
mtype (TypeEnum): The object type.
|
|
24
|
+
uri (str): The [Spotify
|
|
25
|
+
URI](/documentation/web-api/concepts/spotify-uris-ids) for the artist.
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
# Create a mapping from Model property names to API property names
|
|
30
|
+
_names = {
|
|
31
|
+
"external_urls": "external_urls",
|
|
32
|
+
"href": "href",
|
|
33
|
+
"id": "id",
|
|
34
|
+
"name": "name",
|
|
35
|
+
"mtype": "type",
|
|
36
|
+
"uri": "uri",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
_optionals = [
|
|
40
|
+
"external_urls",
|
|
41
|
+
"href",
|
|
42
|
+
"id",
|
|
43
|
+
"name",
|
|
44
|
+
"mtype",
|
|
45
|
+
"uri",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
def __init__(
|
|
49
|
+
self,
|
|
50
|
+
external_urls=APIHelper.SKIP,
|
|
51
|
+
href=APIHelper.SKIP,
|
|
52
|
+
id=APIHelper.SKIP,
|
|
53
|
+
name=APIHelper.SKIP,
|
|
54
|
+
mtype=APIHelper.SKIP,
|
|
55
|
+
uri=APIHelper.SKIP):
|
|
56
|
+
"""Initialize a SimplifiedArtistObject instance."""
|
|
57
|
+
# Initialize members of the class
|
|
58
|
+
if external_urls is not APIHelper.SKIP:
|
|
59
|
+
self.external_urls = external_urls
|
|
60
|
+
if href is not APIHelper.SKIP:
|
|
61
|
+
self.href = href
|
|
62
|
+
if id is not APIHelper.SKIP:
|
|
63
|
+
self.id = id
|
|
64
|
+
if name is not APIHelper.SKIP:
|
|
65
|
+
self.name = name
|
|
66
|
+
if mtype is not APIHelper.SKIP:
|
|
67
|
+
self.mtype = mtype
|
|
68
|
+
if uri is not APIHelper.SKIP:
|
|
69
|
+
self.uri = uri
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_dictionary(cls,
|
|
73
|
+
dictionary):
|
|
74
|
+
"""Create an instance of this model from a dictionary
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
78
|
+
as obtained from the deserialization of the server's response. The
|
|
79
|
+
keys MUST match property names in the API description.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
object: An instance of this structure class.
|
|
83
|
+
|
|
84
|
+
"""
|
|
85
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
# Extract variables from the dictionary
|
|
89
|
+
external_urls =\
|
|
90
|
+
ExternalUrlObject.from_dictionary(
|
|
91
|
+
dictionary.get("external_urls"))\
|
|
92
|
+
if "external_urls" in dictionary.keys()\
|
|
93
|
+
else APIHelper.SKIP
|
|
94
|
+
href =\
|
|
95
|
+
dictionary.get("href")\
|
|
96
|
+
if dictionary.get("href")\
|
|
97
|
+
else APIHelper.SKIP
|
|
98
|
+
id =\
|
|
99
|
+
dictionary.get("id")\
|
|
100
|
+
if dictionary.get("id")\
|
|
101
|
+
else APIHelper.SKIP
|
|
102
|
+
name =\
|
|
103
|
+
dictionary.get("name")\
|
|
104
|
+
if dictionary.get("name")\
|
|
105
|
+
else APIHelper.SKIP
|
|
106
|
+
mtype =\
|
|
107
|
+
dictionary.get("type")\
|
|
108
|
+
if dictionary.get("type")\
|
|
109
|
+
else APIHelper.SKIP
|
|
110
|
+
uri =\
|
|
111
|
+
dictionary.get("uri")\
|
|
112
|
+
if dictionary.get("uri")\
|
|
113
|
+
else APIHelper.SKIP
|
|
114
|
+
|
|
115
|
+
# Return an object of this model
|
|
116
|
+
return cls(external_urls,
|
|
117
|
+
href,
|
|
118
|
+
id,
|
|
119
|
+
name,
|
|
120
|
+
mtype,
|
|
121
|
+
uri)
|
|
122
|
+
|
|
123
|
+
@classmethod
|
|
124
|
+
def validate(cls, dictionary):
|
|
125
|
+
"""Validate dictionary against class required properties
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
129
|
+
as obtained from the deserialization of the server's response. The
|
|
130
|
+
keys MUST match property names in the API description.
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
boolean : if dictionary is valid contains required properties.
|
|
134
|
+
|
|
135
|
+
"""
|
|
136
|
+
if isinstance(dictionary, cls):
|
|
137
|
+
return True
|
|
138
|
+
|
|
139
|
+
if not isinstance(dictionary, dict):
|
|
140
|
+
return False
|
|
141
|
+
|
|
142
|
+
return True
|
|
143
|
+
|
|
144
|
+
def __repr__(self):
|
|
145
|
+
"""Return a unambiguous string representation."""
|
|
146
|
+
_external_urls=(
|
|
147
|
+
self.external_urls
|
|
148
|
+
if hasattr(self, "external_urls")
|
|
149
|
+
else None
|
|
150
|
+
)
|
|
151
|
+
_href=(
|
|
152
|
+
self.href
|
|
153
|
+
if hasattr(self, "href")
|
|
154
|
+
else None
|
|
155
|
+
)
|
|
156
|
+
_id=(
|
|
157
|
+
self.id
|
|
158
|
+
if hasattr(self, "id")
|
|
159
|
+
else None
|
|
160
|
+
)
|
|
161
|
+
_name=(
|
|
162
|
+
self.name
|
|
163
|
+
if hasattr(self, "name")
|
|
164
|
+
else None
|
|
165
|
+
)
|
|
166
|
+
_mtype=(
|
|
167
|
+
self.mtype
|
|
168
|
+
if hasattr(self, "mtype")
|
|
169
|
+
else None
|
|
170
|
+
)
|
|
171
|
+
_uri=(
|
|
172
|
+
self.uri
|
|
173
|
+
if hasattr(self, "uri")
|
|
174
|
+
else None
|
|
175
|
+
)
|
|
176
|
+
return (
|
|
177
|
+
f"{self.__class__.__name__}("
|
|
178
|
+
f"external_urls={_external_urls!r}, "
|
|
179
|
+
f"href={_href!r}, "
|
|
180
|
+
f"id={_id!r}, "
|
|
181
|
+
f"name={_name!r}, "
|
|
182
|
+
f"mtype={_mtype!r}, "
|
|
183
|
+
f"uri={_uri!r}, "
|
|
184
|
+
f")"
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
def __str__(self):
|
|
188
|
+
"""Return a human-readable string representation."""
|
|
189
|
+
_external_urls=(
|
|
190
|
+
self.external_urls
|
|
191
|
+
if hasattr(self, "external_urls")
|
|
192
|
+
else None
|
|
193
|
+
)
|
|
194
|
+
_href=(
|
|
195
|
+
self.href
|
|
196
|
+
if hasattr(self, "href")
|
|
197
|
+
else None
|
|
198
|
+
)
|
|
199
|
+
_id=(
|
|
200
|
+
self.id
|
|
201
|
+
if hasattr(self, "id")
|
|
202
|
+
else None
|
|
203
|
+
)
|
|
204
|
+
_name=(
|
|
205
|
+
self.name
|
|
206
|
+
if hasattr(self, "name")
|
|
207
|
+
else None
|
|
208
|
+
)
|
|
209
|
+
_mtype=(
|
|
210
|
+
self.mtype
|
|
211
|
+
if hasattr(self, "mtype")
|
|
212
|
+
else None
|
|
213
|
+
)
|
|
214
|
+
_uri=(
|
|
215
|
+
self.uri
|
|
216
|
+
if hasattr(self, "uri")
|
|
217
|
+
else None
|
|
218
|
+
)
|
|
219
|
+
return (
|
|
220
|
+
f"{self.__class__.__name__}("
|
|
221
|
+
f"external_urls={_external_urls!s}, "
|
|
222
|
+
f"href={_href!s}, "
|
|
223
|
+
f"id={_id!s}, "
|
|
224
|
+
f"name={_name!s}, "
|
|
225
|
+
f"mtype={_mtype!s}, "
|
|
226
|
+
f"uri={_uri!s}, "
|
|
227
|
+
f")"
|
|
228
|
+
)
|