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,379 @@
|
|
|
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.explicit_content_settings_object import (
|
|
9
|
+
ExplicitContentSettingsObject,
|
|
10
|
+
)
|
|
11
|
+
from spotifywebapi.models.external_url_object import (
|
|
12
|
+
ExternalUrlObject,
|
|
13
|
+
)
|
|
14
|
+
from spotifywebapi.models.followers_object import (
|
|
15
|
+
FollowersObject,
|
|
16
|
+
)
|
|
17
|
+
from spotifywebapi.models.image_object import (
|
|
18
|
+
ImageObject,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class PrivateUserObject(object):
|
|
23
|
+
"""Implementation of the 'PrivateUserObject' model.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
country (str): The country of the user, as set in the user's account profile.
|
|
27
|
+
An [ISO 3166-1 alpha-2 country
|
|
28
|
+
code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). _This field is
|
|
29
|
+
only available when the current user has granted access to the
|
|
30
|
+
[user-read-private](/documentation/web-api/concepts/scopes/#list-of-scopes
|
|
31
|
+
) scope._
|
|
32
|
+
display_name (str): The name displayed on the user's profile. `null` if not
|
|
33
|
+
available.
|
|
34
|
+
email (str): The user's email address, as entered by the user when creating
|
|
35
|
+
their account. _**Important!** This email address is unverified; there is
|
|
36
|
+
no proof that it actually belongs to the user._ _This field is only
|
|
37
|
+
available when the current user has granted access to the
|
|
38
|
+
[user-read-email](/documentation/web-api/concepts/scopes/#list-of-scopes)
|
|
39
|
+
scope._
|
|
40
|
+
explicit_content (ExplicitContentSettingsObject): The user's explicit content
|
|
41
|
+
settings. _This field is only available when the current user has granted
|
|
42
|
+
access to the
|
|
43
|
+
[user-read-private](/documentation/web-api/concepts/scopes/#list-of-scopes
|
|
44
|
+
) scope._
|
|
45
|
+
external_urls (ExternalUrlObject): Known external URLs for this user.
|
|
46
|
+
followers (FollowersObject): Information about the followers of the user.
|
|
47
|
+
href (str): A link to the Web API endpoint for this user.
|
|
48
|
+
id (str): The [Spotify user
|
|
49
|
+
ID](/documentation/web-api/concepts/spotify-uris-ids) for the user.
|
|
50
|
+
images (List[ImageObject]): The user's profile image.
|
|
51
|
+
product (str): The user's Spotify subscription level: "premium", "free", etc.
|
|
52
|
+
(The subscription level "open" can be considered the same as "free".)
|
|
53
|
+
_This field is only available when the current user has granted access to
|
|
54
|
+
the
|
|
55
|
+
[user-read-private](/documentation/web-api/concepts/scopes/#list-of-scopes
|
|
56
|
+
) scope._
|
|
57
|
+
mtype (str): The object type: "user"
|
|
58
|
+
uri (str): The [Spotify
|
|
59
|
+
URI](/documentation/web-api/concepts/spotify-uris-ids) for the user.
|
|
60
|
+
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
# Create a mapping from Model property names to API property names
|
|
64
|
+
_names = {
|
|
65
|
+
"country": "country",
|
|
66
|
+
"display_name": "display_name",
|
|
67
|
+
"email": "email",
|
|
68
|
+
"explicit_content": "explicit_content",
|
|
69
|
+
"external_urls": "external_urls",
|
|
70
|
+
"followers": "followers",
|
|
71
|
+
"href": "href",
|
|
72
|
+
"id": "id",
|
|
73
|
+
"images": "images",
|
|
74
|
+
"product": "product",
|
|
75
|
+
"mtype": "type",
|
|
76
|
+
"uri": "uri",
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
_optionals = [
|
|
80
|
+
"country",
|
|
81
|
+
"display_name",
|
|
82
|
+
"email",
|
|
83
|
+
"explicit_content",
|
|
84
|
+
"external_urls",
|
|
85
|
+
"followers",
|
|
86
|
+
"href",
|
|
87
|
+
"id",
|
|
88
|
+
"images",
|
|
89
|
+
"product",
|
|
90
|
+
"mtype",
|
|
91
|
+
"uri",
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
def __init__(
|
|
95
|
+
self,
|
|
96
|
+
country=APIHelper.SKIP,
|
|
97
|
+
display_name=APIHelper.SKIP,
|
|
98
|
+
email=APIHelper.SKIP,
|
|
99
|
+
explicit_content=APIHelper.SKIP,
|
|
100
|
+
external_urls=APIHelper.SKIP,
|
|
101
|
+
followers=APIHelper.SKIP,
|
|
102
|
+
href=APIHelper.SKIP,
|
|
103
|
+
id=APIHelper.SKIP,
|
|
104
|
+
images=APIHelper.SKIP,
|
|
105
|
+
product=APIHelper.SKIP,
|
|
106
|
+
mtype=APIHelper.SKIP,
|
|
107
|
+
uri=APIHelper.SKIP):
|
|
108
|
+
"""Initialize a PrivateUserObject instance."""
|
|
109
|
+
# Initialize members of the class
|
|
110
|
+
if country is not APIHelper.SKIP:
|
|
111
|
+
self.country = country
|
|
112
|
+
if display_name is not APIHelper.SKIP:
|
|
113
|
+
self.display_name = display_name
|
|
114
|
+
if email is not APIHelper.SKIP:
|
|
115
|
+
self.email = email
|
|
116
|
+
if explicit_content is not APIHelper.SKIP:
|
|
117
|
+
self.explicit_content = explicit_content
|
|
118
|
+
if external_urls is not APIHelper.SKIP:
|
|
119
|
+
self.external_urls = external_urls
|
|
120
|
+
if followers is not APIHelper.SKIP:
|
|
121
|
+
self.followers = followers
|
|
122
|
+
if href is not APIHelper.SKIP:
|
|
123
|
+
self.href = href
|
|
124
|
+
if id is not APIHelper.SKIP:
|
|
125
|
+
self.id = id
|
|
126
|
+
if images is not APIHelper.SKIP:
|
|
127
|
+
self.images = images
|
|
128
|
+
if product is not APIHelper.SKIP:
|
|
129
|
+
self.product = product
|
|
130
|
+
if mtype is not APIHelper.SKIP:
|
|
131
|
+
self.mtype = mtype
|
|
132
|
+
if uri is not APIHelper.SKIP:
|
|
133
|
+
self.uri = uri
|
|
134
|
+
|
|
135
|
+
@classmethod
|
|
136
|
+
def from_dictionary(cls,
|
|
137
|
+
dictionary):
|
|
138
|
+
"""Create an instance of this model from a dictionary
|
|
139
|
+
|
|
140
|
+
Args:
|
|
141
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
142
|
+
as obtained from the deserialization of the server's response. The
|
|
143
|
+
keys MUST match property names in the API description.
|
|
144
|
+
|
|
145
|
+
Returns:
|
|
146
|
+
object: An instance of this structure class.
|
|
147
|
+
|
|
148
|
+
"""
|
|
149
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
150
|
+
return None
|
|
151
|
+
|
|
152
|
+
# Extract variables from the dictionary
|
|
153
|
+
country =\
|
|
154
|
+
dictionary.get("country")\
|
|
155
|
+
if dictionary.get("country")\
|
|
156
|
+
else APIHelper.SKIP
|
|
157
|
+
display_name =\
|
|
158
|
+
dictionary.get("display_name")\
|
|
159
|
+
if dictionary.get("display_name")\
|
|
160
|
+
else APIHelper.SKIP
|
|
161
|
+
email =\
|
|
162
|
+
dictionary.get("email")\
|
|
163
|
+
if dictionary.get("email")\
|
|
164
|
+
else APIHelper.SKIP
|
|
165
|
+
explicit_content =\
|
|
166
|
+
ExplicitContentSettingsObject.from_dictionary(
|
|
167
|
+
dictionary.get("explicit_content"))\
|
|
168
|
+
if "explicit_content" in dictionary.keys()\
|
|
169
|
+
else APIHelper.SKIP
|
|
170
|
+
external_urls =\
|
|
171
|
+
ExternalUrlObject.from_dictionary(
|
|
172
|
+
dictionary.get("external_urls"))\
|
|
173
|
+
if "external_urls" in dictionary.keys()\
|
|
174
|
+
else APIHelper.SKIP
|
|
175
|
+
followers =\
|
|
176
|
+
FollowersObject.from_dictionary(
|
|
177
|
+
dictionary.get("followers"))\
|
|
178
|
+
if "followers" in dictionary.keys()\
|
|
179
|
+
else APIHelper.SKIP
|
|
180
|
+
href =\
|
|
181
|
+
dictionary.get("href")\
|
|
182
|
+
if dictionary.get("href")\
|
|
183
|
+
else APIHelper.SKIP
|
|
184
|
+
id =\
|
|
185
|
+
dictionary.get("id")\
|
|
186
|
+
if dictionary.get("id")\
|
|
187
|
+
else APIHelper.SKIP
|
|
188
|
+
images = None
|
|
189
|
+
if dictionary.get("images") is not None:
|
|
190
|
+
images = [
|
|
191
|
+
ImageObject.from_dictionary(x)
|
|
192
|
+
for x in dictionary.get("images")
|
|
193
|
+
]
|
|
194
|
+
else:
|
|
195
|
+
images = APIHelper.SKIP
|
|
196
|
+
product =\
|
|
197
|
+
dictionary.get("product")\
|
|
198
|
+
if dictionary.get("product")\
|
|
199
|
+
else APIHelper.SKIP
|
|
200
|
+
mtype =\
|
|
201
|
+
dictionary.get("type")\
|
|
202
|
+
if dictionary.get("type")\
|
|
203
|
+
else APIHelper.SKIP
|
|
204
|
+
uri =\
|
|
205
|
+
dictionary.get("uri")\
|
|
206
|
+
if dictionary.get("uri")\
|
|
207
|
+
else APIHelper.SKIP
|
|
208
|
+
|
|
209
|
+
# Return an object of this model
|
|
210
|
+
return cls(country,
|
|
211
|
+
display_name,
|
|
212
|
+
email,
|
|
213
|
+
explicit_content,
|
|
214
|
+
external_urls,
|
|
215
|
+
followers,
|
|
216
|
+
href,
|
|
217
|
+
id,
|
|
218
|
+
images,
|
|
219
|
+
product,
|
|
220
|
+
mtype,
|
|
221
|
+
uri)
|
|
222
|
+
|
|
223
|
+
def __repr__(self):
|
|
224
|
+
"""Return a unambiguous string representation."""
|
|
225
|
+
_country=(
|
|
226
|
+
self.country
|
|
227
|
+
if hasattr(self, "country")
|
|
228
|
+
else None
|
|
229
|
+
)
|
|
230
|
+
_display_name=(
|
|
231
|
+
self.display_name
|
|
232
|
+
if hasattr(self, "display_name")
|
|
233
|
+
else None
|
|
234
|
+
)
|
|
235
|
+
_email=(
|
|
236
|
+
self.email
|
|
237
|
+
if hasattr(self, "email")
|
|
238
|
+
else None
|
|
239
|
+
)
|
|
240
|
+
_explicit_content=(
|
|
241
|
+
self.explicit_content
|
|
242
|
+
if hasattr(self, "explicit_content")
|
|
243
|
+
else None
|
|
244
|
+
)
|
|
245
|
+
_external_urls=(
|
|
246
|
+
self.external_urls
|
|
247
|
+
if hasattr(self, "external_urls")
|
|
248
|
+
else None
|
|
249
|
+
)
|
|
250
|
+
_followers=(
|
|
251
|
+
self.followers
|
|
252
|
+
if hasattr(self, "followers")
|
|
253
|
+
else None
|
|
254
|
+
)
|
|
255
|
+
_href=(
|
|
256
|
+
self.href
|
|
257
|
+
if hasattr(self, "href")
|
|
258
|
+
else None
|
|
259
|
+
)
|
|
260
|
+
_id=(
|
|
261
|
+
self.id
|
|
262
|
+
if hasattr(self, "id")
|
|
263
|
+
else None
|
|
264
|
+
)
|
|
265
|
+
_images=(
|
|
266
|
+
self.images
|
|
267
|
+
if hasattr(self, "images")
|
|
268
|
+
else None
|
|
269
|
+
)
|
|
270
|
+
_product=(
|
|
271
|
+
self.product
|
|
272
|
+
if hasattr(self, "product")
|
|
273
|
+
else None
|
|
274
|
+
)
|
|
275
|
+
_mtype=(
|
|
276
|
+
self.mtype
|
|
277
|
+
if hasattr(self, "mtype")
|
|
278
|
+
else None
|
|
279
|
+
)
|
|
280
|
+
_uri=(
|
|
281
|
+
self.uri
|
|
282
|
+
if hasattr(self, "uri")
|
|
283
|
+
else None
|
|
284
|
+
)
|
|
285
|
+
return (
|
|
286
|
+
f"{self.__class__.__name__}("
|
|
287
|
+
f"country={_country!r}, "
|
|
288
|
+
f"display_name={_display_name!r}, "
|
|
289
|
+
f"email={_email!r}, "
|
|
290
|
+
f"explicit_content={_explicit_content!r}, "
|
|
291
|
+
f"external_urls={_external_urls!r}, "
|
|
292
|
+
f"followers={_followers!r}, "
|
|
293
|
+
f"href={_href!r}, "
|
|
294
|
+
f"id={_id!r}, "
|
|
295
|
+
f"images={_images!r}, "
|
|
296
|
+
f"product={_product!r}, "
|
|
297
|
+
f"mtype={_mtype!r}, "
|
|
298
|
+
f"uri={_uri!r}, "
|
|
299
|
+
f")"
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
def __str__(self):
|
|
303
|
+
"""Return a human-readable string representation."""
|
|
304
|
+
_country=(
|
|
305
|
+
self.country
|
|
306
|
+
if hasattr(self, "country")
|
|
307
|
+
else None
|
|
308
|
+
)
|
|
309
|
+
_display_name=(
|
|
310
|
+
self.display_name
|
|
311
|
+
if hasattr(self, "display_name")
|
|
312
|
+
else None
|
|
313
|
+
)
|
|
314
|
+
_email=(
|
|
315
|
+
self.email
|
|
316
|
+
if hasattr(self, "email")
|
|
317
|
+
else None
|
|
318
|
+
)
|
|
319
|
+
_explicit_content=(
|
|
320
|
+
self.explicit_content
|
|
321
|
+
if hasattr(self, "explicit_content")
|
|
322
|
+
else None
|
|
323
|
+
)
|
|
324
|
+
_external_urls=(
|
|
325
|
+
self.external_urls
|
|
326
|
+
if hasattr(self, "external_urls")
|
|
327
|
+
else None
|
|
328
|
+
)
|
|
329
|
+
_followers=(
|
|
330
|
+
self.followers
|
|
331
|
+
if hasattr(self, "followers")
|
|
332
|
+
else None
|
|
333
|
+
)
|
|
334
|
+
_href=(
|
|
335
|
+
self.href
|
|
336
|
+
if hasattr(self, "href")
|
|
337
|
+
else None
|
|
338
|
+
)
|
|
339
|
+
_id=(
|
|
340
|
+
self.id
|
|
341
|
+
if hasattr(self, "id")
|
|
342
|
+
else None
|
|
343
|
+
)
|
|
344
|
+
_images=(
|
|
345
|
+
self.images
|
|
346
|
+
if hasattr(self, "images")
|
|
347
|
+
else None
|
|
348
|
+
)
|
|
349
|
+
_product=(
|
|
350
|
+
self.product
|
|
351
|
+
if hasattr(self, "product")
|
|
352
|
+
else None
|
|
353
|
+
)
|
|
354
|
+
_mtype=(
|
|
355
|
+
self.mtype
|
|
356
|
+
if hasattr(self, "mtype")
|
|
357
|
+
else None
|
|
358
|
+
)
|
|
359
|
+
_uri=(
|
|
360
|
+
self.uri
|
|
361
|
+
if hasattr(self, "uri")
|
|
362
|
+
else None
|
|
363
|
+
)
|
|
364
|
+
return (
|
|
365
|
+
f"{self.__class__.__name__}("
|
|
366
|
+
f"country={_country!s}, "
|
|
367
|
+
f"display_name={_display_name!s}, "
|
|
368
|
+
f"email={_email!s}, "
|
|
369
|
+
f"explicit_content={_explicit_content!s}, "
|
|
370
|
+
f"external_urls={_external_urls!s}, "
|
|
371
|
+
f"followers={_followers!s}, "
|
|
372
|
+
f"href={_href!s}, "
|
|
373
|
+
f"id={_id!s}, "
|
|
374
|
+
f"images={_images!s}, "
|
|
375
|
+
f"product={_product!s}, "
|
|
376
|
+
f"mtype={_mtype!s}, "
|
|
377
|
+
f"uri={_uri!s}, "
|
|
378
|
+
f")"
|
|
379
|
+
)
|
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
from spotifywebapi.models.followers_object import (
|
|
12
|
+
FollowersObject,
|
|
13
|
+
)
|
|
14
|
+
from spotifywebapi.models.image_object import (
|
|
15
|
+
ImageObject,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class PublicUserObject(object):
|
|
20
|
+
"""Implementation of the 'PublicUserObject' model.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
display_name (str): The name displayed on the user's profile. `null` if not
|
|
24
|
+
available.
|
|
25
|
+
external_urls (ExternalUrlObject): Known public external URLs for this user.
|
|
26
|
+
followers (FollowersObject): Information about the followers of this user.
|
|
27
|
+
href (str): A link to the Web API endpoint for this user.
|
|
28
|
+
id (str): The [Spotify user
|
|
29
|
+
ID](/documentation/web-api/concepts/spotify-uris-ids) for this user.
|
|
30
|
+
images (List[ImageObject]): The user's profile image.
|
|
31
|
+
mtype (Type4Enum): The object type.
|
|
32
|
+
uri (str): The [Spotify
|
|
33
|
+
URI](/documentation/web-api/concepts/spotify-uris-ids) for this user.
|
|
34
|
+
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
# Create a mapping from Model property names to API property names
|
|
38
|
+
_names = {
|
|
39
|
+
"display_name": "display_name",
|
|
40
|
+
"external_urls": "external_urls",
|
|
41
|
+
"followers": "followers",
|
|
42
|
+
"href": "href",
|
|
43
|
+
"id": "id",
|
|
44
|
+
"images": "images",
|
|
45
|
+
"mtype": "type",
|
|
46
|
+
"uri": "uri",
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_optionals = [
|
|
50
|
+
"display_name",
|
|
51
|
+
"external_urls",
|
|
52
|
+
"followers",
|
|
53
|
+
"href",
|
|
54
|
+
"id",
|
|
55
|
+
"images",
|
|
56
|
+
"mtype",
|
|
57
|
+
"uri",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
_nullables = [
|
|
61
|
+
"display_name",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
def __init__(
|
|
65
|
+
self,
|
|
66
|
+
display_name=APIHelper.SKIP,
|
|
67
|
+
external_urls=APIHelper.SKIP,
|
|
68
|
+
followers=APIHelper.SKIP,
|
|
69
|
+
href=APIHelper.SKIP,
|
|
70
|
+
id=APIHelper.SKIP,
|
|
71
|
+
images=APIHelper.SKIP,
|
|
72
|
+
mtype=APIHelper.SKIP,
|
|
73
|
+
uri=APIHelper.SKIP):
|
|
74
|
+
"""Initialize a PublicUserObject instance."""
|
|
75
|
+
# Initialize members of the class
|
|
76
|
+
if display_name is not APIHelper.SKIP:
|
|
77
|
+
self.display_name = display_name
|
|
78
|
+
if external_urls is not APIHelper.SKIP:
|
|
79
|
+
self.external_urls = external_urls
|
|
80
|
+
if followers is not APIHelper.SKIP:
|
|
81
|
+
self.followers = followers
|
|
82
|
+
if href is not APIHelper.SKIP:
|
|
83
|
+
self.href = href
|
|
84
|
+
if id is not APIHelper.SKIP:
|
|
85
|
+
self.id = id
|
|
86
|
+
if images is not APIHelper.SKIP:
|
|
87
|
+
self.images = images
|
|
88
|
+
if mtype is not APIHelper.SKIP:
|
|
89
|
+
self.mtype = mtype
|
|
90
|
+
if uri is not APIHelper.SKIP:
|
|
91
|
+
self.uri = uri
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dictionary(cls,
|
|
95
|
+
dictionary):
|
|
96
|
+
"""Create an instance of this model from a dictionary
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
100
|
+
as obtained from the deserialization of the server's response. The
|
|
101
|
+
keys MUST match property names in the API description.
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
object: An instance of this structure class.
|
|
105
|
+
|
|
106
|
+
"""
|
|
107
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
# Extract variables from the dictionary
|
|
111
|
+
display_name =\
|
|
112
|
+
dictionary.get("display_name")\
|
|
113
|
+
if "display_name" in dictionary.keys()\
|
|
114
|
+
else APIHelper.SKIP
|
|
115
|
+
external_urls =\
|
|
116
|
+
ExternalUrlObject.from_dictionary(
|
|
117
|
+
dictionary.get("external_urls"))\
|
|
118
|
+
if "external_urls" in dictionary.keys()\
|
|
119
|
+
else APIHelper.SKIP
|
|
120
|
+
followers =\
|
|
121
|
+
FollowersObject.from_dictionary(
|
|
122
|
+
dictionary.get("followers"))\
|
|
123
|
+
if "followers" in dictionary.keys()\
|
|
124
|
+
else APIHelper.SKIP
|
|
125
|
+
href =\
|
|
126
|
+
dictionary.get("href")\
|
|
127
|
+
if dictionary.get("href")\
|
|
128
|
+
else APIHelper.SKIP
|
|
129
|
+
id =\
|
|
130
|
+
dictionary.get("id")\
|
|
131
|
+
if dictionary.get("id")\
|
|
132
|
+
else APIHelper.SKIP
|
|
133
|
+
images = None
|
|
134
|
+
if dictionary.get("images") is not None:
|
|
135
|
+
images = [
|
|
136
|
+
ImageObject.from_dictionary(x)
|
|
137
|
+
for x in dictionary.get("images")
|
|
138
|
+
]
|
|
139
|
+
else:
|
|
140
|
+
images = APIHelper.SKIP
|
|
141
|
+
mtype =\
|
|
142
|
+
dictionary.get("type")\
|
|
143
|
+
if dictionary.get("type")\
|
|
144
|
+
else APIHelper.SKIP
|
|
145
|
+
uri =\
|
|
146
|
+
dictionary.get("uri")\
|
|
147
|
+
if dictionary.get("uri")\
|
|
148
|
+
else APIHelper.SKIP
|
|
149
|
+
|
|
150
|
+
# Return an object of this model
|
|
151
|
+
return cls(display_name,
|
|
152
|
+
external_urls,
|
|
153
|
+
followers,
|
|
154
|
+
href,
|
|
155
|
+
id,
|
|
156
|
+
images,
|
|
157
|
+
mtype,
|
|
158
|
+
uri)
|
|
159
|
+
|
|
160
|
+
def __repr__(self):
|
|
161
|
+
"""Return a unambiguous string representation."""
|
|
162
|
+
_display_name=(
|
|
163
|
+
self.display_name
|
|
164
|
+
if hasattr(self, "display_name")
|
|
165
|
+
else None
|
|
166
|
+
)
|
|
167
|
+
_external_urls=(
|
|
168
|
+
self.external_urls
|
|
169
|
+
if hasattr(self, "external_urls")
|
|
170
|
+
else None
|
|
171
|
+
)
|
|
172
|
+
_followers=(
|
|
173
|
+
self.followers
|
|
174
|
+
if hasattr(self, "followers")
|
|
175
|
+
else None
|
|
176
|
+
)
|
|
177
|
+
_href=(
|
|
178
|
+
self.href
|
|
179
|
+
if hasattr(self, "href")
|
|
180
|
+
else None
|
|
181
|
+
)
|
|
182
|
+
_id=(
|
|
183
|
+
self.id
|
|
184
|
+
if hasattr(self, "id")
|
|
185
|
+
else None
|
|
186
|
+
)
|
|
187
|
+
_images=(
|
|
188
|
+
self.images
|
|
189
|
+
if hasattr(self, "images")
|
|
190
|
+
else None
|
|
191
|
+
)
|
|
192
|
+
_mtype=(
|
|
193
|
+
self.mtype
|
|
194
|
+
if hasattr(self, "mtype")
|
|
195
|
+
else None
|
|
196
|
+
)
|
|
197
|
+
_uri=(
|
|
198
|
+
self.uri
|
|
199
|
+
if hasattr(self, "uri")
|
|
200
|
+
else None
|
|
201
|
+
)
|
|
202
|
+
return (
|
|
203
|
+
f"{self.__class__.__name__}("
|
|
204
|
+
f"display_name={_display_name!r}, "
|
|
205
|
+
f"external_urls={_external_urls!r}, "
|
|
206
|
+
f"followers={_followers!r}, "
|
|
207
|
+
f"href={_href!r}, "
|
|
208
|
+
f"id={_id!r}, "
|
|
209
|
+
f"images={_images!r}, "
|
|
210
|
+
f"mtype={_mtype!r}, "
|
|
211
|
+
f"uri={_uri!r}, "
|
|
212
|
+
f")"
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
def __str__(self):
|
|
216
|
+
"""Return a human-readable string representation."""
|
|
217
|
+
_display_name=(
|
|
218
|
+
self.display_name
|
|
219
|
+
if hasattr(self, "display_name")
|
|
220
|
+
else None
|
|
221
|
+
)
|
|
222
|
+
_external_urls=(
|
|
223
|
+
self.external_urls
|
|
224
|
+
if hasattr(self, "external_urls")
|
|
225
|
+
else None
|
|
226
|
+
)
|
|
227
|
+
_followers=(
|
|
228
|
+
self.followers
|
|
229
|
+
if hasattr(self, "followers")
|
|
230
|
+
else None
|
|
231
|
+
)
|
|
232
|
+
_href=(
|
|
233
|
+
self.href
|
|
234
|
+
if hasattr(self, "href")
|
|
235
|
+
else None
|
|
236
|
+
)
|
|
237
|
+
_id=(
|
|
238
|
+
self.id
|
|
239
|
+
if hasattr(self, "id")
|
|
240
|
+
else None
|
|
241
|
+
)
|
|
242
|
+
_images=(
|
|
243
|
+
self.images
|
|
244
|
+
if hasattr(self, "images")
|
|
245
|
+
else None
|
|
246
|
+
)
|
|
247
|
+
_mtype=(
|
|
248
|
+
self.mtype
|
|
249
|
+
if hasattr(self, "mtype")
|
|
250
|
+
else None
|
|
251
|
+
)
|
|
252
|
+
_uri=(
|
|
253
|
+
self.uri
|
|
254
|
+
if hasattr(self, "uri")
|
|
255
|
+
else None
|
|
256
|
+
)
|
|
257
|
+
return (
|
|
258
|
+
f"{self.__class__.__name__}("
|
|
259
|
+
f"display_name={_display_name!s}, "
|
|
260
|
+
f"external_urls={_external_urls!s}, "
|
|
261
|
+
f"followers={_followers!s}, "
|
|
262
|
+
f"href={_href!s}, "
|
|
263
|
+
f"id={_id!s}, "
|
|
264
|
+
f"images={_images!s}, "
|
|
265
|
+
f"mtype={_mtype!s}, "
|
|
266
|
+
f"uri={_uri!s}, "
|
|
267
|
+
f")"
|
|
268
|
+
)
|