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.
Files changed (186) hide show
  1. spotify_apimatic_sdk-1.0.0.dist-info/METADATA +150 -0
  2. spotify_apimatic_sdk-1.0.0.dist-info/RECORD +186 -0
  3. spotify_apimatic_sdk-1.0.0.dist-info/WHEEL +5 -0
  4. spotify_apimatic_sdk-1.0.0.dist-info/licenses/LICENSE +30 -0
  5. spotify_apimatic_sdk-1.0.0.dist-info/top_level.txt +1 -0
  6. spotifywebapi/__init__.py +12 -0
  7. spotifywebapi/api_helper.py +19 -0
  8. spotifywebapi/configuration.py +318 -0
  9. spotifywebapi/controllers/__init__.py +20 -0
  10. spotifywebapi/controllers/albums_controller.py +498 -0
  11. spotifywebapi/controllers/artists_controller.py +327 -0
  12. spotifywebapi/controllers/audiobooks_controller.py +441 -0
  13. spotifywebapi/controllers/base_controller.py +67 -0
  14. spotifywebapi/controllers/categories_controller.py +161 -0
  15. spotifywebapi/controllers/chapters_controller.py +157 -0
  16. spotifywebapi/controllers/episodes_controller.py +390 -0
  17. spotifywebapi/controllers/genres_controller.py +84 -0
  18. spotifywebapi/controllers/markets_controller.py +82 -0
  19. spotifywebapi/controllers/o_auth_authorization_controller.py +156 -0
  20. spotifywebapi/controllers/player_controller.py +807 -0
  21. spotifywebapi/controllers/playlists_controller.py +851 -0
  22. spotifywebapi/controllers/search_controller.py +123 -0
  23. spotifywebapi/controllers/shows_controller.py +439 -0
  24. spotifywebapi/controllers/tracks_controller.py +821 -0
  25. spotifywebapi/controllers/users_controller.py +649 -0
  26. spotifywebapi/exceptions/__init__.py +11 -0
  27. spotifywebapi/exceptions/api_exception.py +36 -0
  28. spotifywebapi/exceptions/bad_request_exception.py +56 -0
  29. spotifywebapi/exceptions/forbidden_exception.py +56 -0
  30. spotifywebapi/exceptions/not_found_exception.py +56 -0
  31. spotifywebapi/exceptions/o_auth_provider_exception.py +73 -0
  32. spotifywebapi/exceptions/too_many_requests_exception.py +56 -0
  33. spotifywebapi/exceptions/unauthorized_exception.py +56 -0
  34. spotifywebapi/http/__init__.py +11 -0
  35. spotifywebapi/http/api_response.py +67 -0
  36. spotifywebapi/http/auth/__init__.py +5 -0
  37. spotifywebapi/http/auth/o_auth_2.py +336 -0
  38. spotifywebapi/http/http_call_back.py +20 -0
  39. spotifywebapi/http/http_client_provider.py +23 -0
  40. spotifywebapi/http/http_method_enum.py +25 -0
  41. spotifywebapi/http/http_request.py +55 -0
  42. spotifywebapi/http/http_response.py +45 -0
  43. spotifywebapi/http/proxy_settings.py +50 -0
  44. spotifywebapi/models/__init__.py +142 -0
  45. spotifywebapi/models/album_base.py +264 -0
  46. spotifywebapi/models/album_group_enum.py +51 -0
  47. spotifywebapi/models/album_object.py +375 -0
  48. spotifywebapi/models/album_restriction_object.py +109 -0
  49. spotifywebapi/models/album_type_enum.py +62 -0
  50. spotifywebapi/models/artist_discography_album_object.py +298 -0
  51. spotifywebapi/models/artist_object.py +335 -0
  52. spotifywebapi/models/audio_analysis_object.py +266 -0
  53. spotifywebapi/models/audio_features_object.py +518 -0
  54. spotifywebapi/models/audiobook_base.py +353 -0
  55. spotifywebapi/models/audiobook_object.py +369 -0
  56. spotifywebapi/models/author_object.py +85 -0
  57. spotifywebapi/models/categories.py +162 -0
  58. spotifywebapi/models/category_object.py +117 -0
  59. spotifywebapi/models/chapter_base.py +392 -0
  60. spotifywebapi/models/chapter_object.py +408 -0
  61. spotifywebapi/models/chapter_restriction_object.py +113 -0
  62. spotifywebapi/models/context_object.py +181 -0
  63. spotifywebapi/models/copyright_object.py +130 -0
  64. spotifywebapi/models/currently_playing_context_object.py +314 -0
  65. spotifywebapi/models/currently_playing_object.py +241 -0
  66. spotifywebapi/models/cursor_object.py +108 -0
  67. spotifywebapi/models/cursor_paged_artists.py +75 -0
  68. spotifywebapi/models/cursor_paging_object.py +183 -0
  69. spotifywebapi/models/cursor_paging_play_history_object.py +214 -0
  70. spotifywebapi/models/cursor_paging_simplified_artist_object.py +213 -0
  71. spotifywebapi/models/device_object.py +278 -0
  72. spotifywebapi/models/disallows_object.py +314 -0
  73. spotifywebapi/models/episode_base.py +394 -0
  74. spotifywebapi/models/episode_object.py +665 -0
  75. spotifywebapi/models/episode_restriction_object.py +112 -0
  76. spotifywebapi/models/error_object.py +85 -0
  77. spotifywebapi/models/explicit_content_settings_object.py +110 -0
  78. spotifywebapi/models/external_id_object.py +156 -0
  79. spotifywebapi/models/external_url_object.py +107 -0
  80. spotifywebapi/models/followers_object.py +134 -0
  81. spotifywebapi/models/image_object.py +168 -0
  82. spotifywebapi/models/include_external_enum.py +45 -0
  83. spotifywebapi/models/item_type_1_enum.py +56 -0
  84. spotifywebapi/models/item_type_2_enum.py +45 -0
  85. spotifywebapi/models/item_type_3_enum.py +45 -0
  86. spotifywebapi/models/item_type_enum.py +58 -0
  87. spotifywebapi/models/linked_track_object.py +205 -0
  88. spotifywebapi/models/many_albums.py +76 -0
  89. spotifywebapi/models/many_artists.py +76 -0
  90. spotifywebapi/models/many_audio_features.py +77 -0
  91. spotifywebapi/models/many_audiobooks.py +77 -0
  92. spotifywebapi/models/many_chapters.py +77 -0
  93. spotifywebapi/models/many_devices.py +76 -0
  94. spotifywebapi/models/many_episodes.py +77 -0
  95. spotifywebapi/models/many_genres.py +69 -0
  96. spotifywebapi/models/many_simplified_shows.py +74 -0
  97. spotifywebapi/models/many_tracks.py +76 -0
  98. spotifywebapi/models/markets.py +85 -0
  99. spotifywebapi/models/me_albums_request.py +90 -0
  100. spotifywebapi/models/me_episodes_request.py +73 -0
  101. spotifywebapi/models/me_episodes_request_1.py +89 -0
  102. spotifywebapi/models/me_following_request.py +74 -0
  103. spotifywebapi/models/me_following_request_1.py +90 -0
  104. spotifywebapi/models/me_player_play_request.py +165 -0
  105. spotifywebapi/models/me_player_request.py +103 -0
  106. spotifywebapi/models/me_shows_request.py +89 -0
  107. spotifywebapi/models/me_tracks_request.py +74 -0
  108. spotifywebapi/models/me_tracks_request_1.py +90 -0
  109. spotifywebapi/models/meta.py +227 -0
  110. spotifywebapi/models/mode_enum.py +52 -0
  111. spotifywebapi/models/narrator_object.py +85 -0
  112. spotifywebapi/models/o_auth_provider_error_enum.py +67 -0
  113. spotifywebapi/models/o_auth_scope_enum.py +98 -0
  114. spotifywebapi/models/o_auth_token.py +113 -0
  115. spotifywebapi/models/paged_albums.py +75 -0
  116. spotifywebapi/models/paged_categories.py +74 -0
  117. spotifywebapi/models/paging_artist_discography_album_object.py +163 -0
  118. spotifywebapi/models/paging_artist_object.py +162 -0
  119. spotifywebapi/models/paging_featured_playlist_object.py +113 -0
  120. spotifywebapi/models/paging_object.py +142 -0
  121. spotifywebapi/models/paging_playlist_object.py +163 -0
  122. spotifywebapi/models/paging_playlist_track_object.py +163 -0
  123. spotifywebapi/models/paging_saved_album_object.py +163 -0
  124. spotifywebapi/models/paging_saved_audiobook_object.py +163 -0
  125. spotifywebapi/models/paging_saved_episode_object.py +163 -0
  126. spotifywebapi/models/paging_saved_show_object.py +163 -0
  127. spotifywebapi/models/paging_saved_track_object.py +163 -0
  128. spotifywebapi/models/paging_simplified_album_object.py +163 -0
  129. spotifywebapi/models/paging_simplified_audiobook_object.py +162 -0
  130. spotifywebapi/models/paging_simplified_chapter_object.py +162 -0
  131. spotifywebapi/models/paging_simplified_episode_object.py +162 -0
  132. spotifywebapi/models/paging_simplified_show_object.py +160 -0
  133. spotifywebapi/models/paging_simplified_track_object.py +163 -0
  134. spotifywebapi/models/paging_track_object.py +162 -0
  135. spotifywebapi/models/play_history_object.py +141 -0
  136. spotifywebapi/models/playlist_object.py +425 -0
  137. spotifywebapi/models/playlist_owner_object.py +238 -0
  138. spotifywebapi/models/playlist_snapshot_id.py +85 -0
  139. spotifywebapi/models/playlist_track_object.py +171 -0
  140. spotifywebapi/models/playlist_tracks_ref_object.py +109 -0
  141. spotifywebapi/models/playlist_user_object.py +231 -0
  142. spotifywebapi/models/playlists_followers_request.py +86 -0
  143. spotifywebapi/models/playlists_request.py +160 -0
  144. spotifywebapi/models/playlists_tracks_request.py +121 -0
  145. spotifywebapi/models/playlists_tracks_request_1.py +188 -0
  146. spotifywebapi/models/playlists_tracks_request_2.py +109 -0
  147. spotifywebapi/models/private_user_object.py +379 -0
  148. spotifywebapi/models/public_user_object.py +268 -0
  149. spotifywebapi/models/queue_object.py +118 -0
  150. spotifywebapi/models/reason_enum.py +65 -0
  151. spotifywebapi/models/recommendation_seed_object.py +208 -0
  152. spotifywebapi/models/recommendations_object.py +96 -0
  153. spotifywebapi/models/release_date_precision_enum.py +62 -0
  154. spotifywebapi/models/resume_point_object.py +131 -0
  155. spotifywebapi/models/saved_album_object.py +118 -0
  156. spotifywebapi/models/saved_audiobook_object.py +118 -0
  157. spotifywebapi/models/saved_episode_object.py +116 -0
  158. spotifywebapi/models/saved_show_object.py +116 -0
  159. spotifywebapi/models/saved_track_object.py +118 -0
  160. spotifywebapi/models/search_items.py +256 -0
  161. spotifywebapi/models/section_object.py +362 -0
  162. spotifywebapi/models/segment_object.py +307 -0
  163. spotifywebapi/models/show_base.py +550 -0
  164. spotifywebapi/models/show_object.py +319 -0
  165. spotifywebapi/models/simplified_album_object.py +468 -0
  166. spotifywebapi/models/simplified_artist_object.py +228 -0
  167. spotifywebapi/models/simplified_playlist_object.py +398 -0
  168. spotifywebapi/models/simplified_track_object.py +494 -0
  169. spotifywebapi/models/time_interval_object.py +132 -0
  170. spotifywebapi/models/track.py +697 -0
  171. spotifywebapi/models/track_1.py +85 -0
  172. spotifywebapi/models/track_object.py +605 -0
  173. spotifywebapi/models/track_restriction_object.py +112 -0
  174. spotifywebapi/models/type_2_enum.py +56 -0
  175. spotifywebapi/models/type_3_enum.py +56 -0
  176. spotifywebapi/models/type_4_enum.py +56 -0
  177. spotifywebapi/models/type_5_enum.py +56 -0
  178. spotifywebapi/models/type_6_enum.py +56 -0
  179. spotifywebapi/models/type_8_enum.py +42 -0
  180. spotifywebapi/models/type_9_enum.py +42 -0
  181. spotifywebapi/models/type_enum.py +56 -0
  182. spotifywebapi/models/users_playlists_request.py +154 -0
  183. spotifywebapi/spotifywebapi_client.py +198 -0
  184. spotifywebapi/utilities/__init__.py +6 -0
  185. spotifywebapi/utilities/file_wrapper.py +45 -0
  186. spotifywebapi/utilities/union_type_lookup.py +113 -0
@@ -0,0 +1,425 @@
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
+ from spotifywebapi.models.paging_playlist_track_object import (
18
+ PagingPlaylistTrackObject,
19
+ )
20
+ from spotifywebapi.models.playlist_owner_object import (
21
+ PlaylistOwnerObject,
22
+ )
23
+
24
+
25
+ class PlaylistObject(object):
26
+ """Implementation of the 'PlaylistObject' model.
27
+
28
+ Attributes:
29
+ collaborative (bool): `true` if the owner allows other users to modify the
30
+ playlist.
31
+ description (str): The playlist description. _Only returned for modified,
32
+ verified playlists, otherwise_ `null`.
33
+ external_urls (ExternalUrlObject): Known external URLs for this playlist.
34
+ followers (FollowersObject): Information about the followers of the playlist.
35
+ href (str): A link to the Web API endpoint providing full details of the
36
+ playlist.
37
+ id (str): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids)
38
+ for the playlist.
39
+ images (List[ImageObject]): Images for the playlist. The array may be empty
40
+ or contain up to three images. The images are returned by size in
41
+ descending order. See [Working with
42
+ Playlists](/documentation/web-api/concepts/playlists). _**Note**: If
43
+ returned, the source URL for the image (`url`) is temporary and will
44
+ expire in less than a day._
45
+ name (str): The name of the playlist.
46
+ owner (PlaylistOwnerObject): The user who owns the playlist
47
+ public (bool): The playlist's public/private status: `true` the playlist is
48
+ public, `false` the playlist is private, `null` the playlist status is
49
+ not relevant. For more about public/private status, see [Working with
50
+ Playlists](/documentation/web-api/concepts/playlists)
51
+ snapshot_id (str): The version identifier for the current playlist. Can be
52
+ supplied in other requests to target a specific playlist version
53
+ tracks (PagingPlaylistTrackObject): The tracks of the playlist.
54
+ mtype (str): The object type: "playlist"
55
+ uri (str): The [Spotify
56
+ URI](/documentation/web-api/concepts/spotify-uris-ids) for the playlist.
57
+
58
+ """
59
+
60
+ # Create a mapping from Model property names to API property names
61
+ _names = {
62
+ "collaborative": "collaborative",
63
+ "description": "description",
64
+ "external_urls": "external_urls",
65
+ "followers": "followers",
66
+ "href": "href",
67
+ "id": "id",
68
+ "images": "images",
69
+ "name": "name",
70
+ "owner": "owner",
71
+ "public": "public",
72
+ "snapshot_id": "snapshot_id",
73
+ "tracks": "tracks",
74
+ "mtype": "type",
75
+ "uri": "uri",
76
+ }
77
+
78
+ _optionals = [
79
+ "collaborative",
80
+ "description",
81
+ "external_urls",
82
+ "followers",
83
+ "href",
84
+ "id",
85
+ "images",
86
+ "name",
87
+ "owner",
88
+ "public",
89
+ "snapshot_id",
90
+ "tracks",
91
+ "mtype",
92
+ "uri",
93
+ ]
94
+
95
+ _nullables = [
96
+ "description",
97
+ ]
98
+
99
+ def __init__(
100
+ self,
101
+ collaborative=APIHelper.SKIP,
102
+ description=APIHelper.SKIP,
103
+ external_urls=APIHelper.SKIP,
104
+ followers=APIHelper.SKIP,
105
+ href=APIHelper.SKIP,
106
+ id=APIHelper.SKIP,
107
+ images=APIHelper.SKIP,
108
+ name=APIHelper.SKIP,
109
+ owner=APIHelper.SKIP,
110
+ public=APIHelper.SKIP,
111
+ snapshot_id=APIHelper.SKIP,
112
+ tracks=APIHelper.SKIP,
113
+ mtype=APIHelper.SKIP,
114
+ uri=APIHelper.SKIP):
115
+ """Initialize a PlaylistObject instance."""
116
+ # Initialize members of the class
117
+ if collaborative is not APIHelper.SKIP:
118
+ self.collaborative = collaborative
119
+ if description is not APIHelper.SKIP:
120
+ self.description = description
121
+ if external_urls is not APIHelper.SKIP:
122
+ self.external_urls = external_urls
123
+ if followers is not APIHelper.SKIP:
124
+ self.followers = followers
125
+ if href is not APIHelper.SKIP:
126
+ self.href = href
127
+ if id is not APIHelper.SKIP:
128
+ self.id = id
129
+ if images is not APIHelper.SKIP:
130
+ self.images = images
131
+ if name is not APIHelper.SKIP:
132
+ self.name = name
133
+ if owner is not APIHelper.SKIP:
134
+ self.owner = owner
135
+ if public is not APIHelper.SKIP:
136
+ self.public = public
137
+ if snapshot_id is not APIHelper.SKIP:
138
+ self.snapshot_id = snapshot_id
139
+ if tracks is not APIHelper.SKIP:
140
+ self.tracks = tracks
141
+ if mtype is not APIHelper.SKIP:
142
+ self.mtype = mtype
143
+ if uri is not APIHelper.SKIP:
144
+ self.uri = uri
145
+
146
+ @classmethod
147
+ def from_dictionary(cls,
148
+ dictionary):
149
+ """Create an instance of this model from a dictionary
150
+
151
+ Args:
152
+ dictionary (dictionary): A dictionary representation of the object
153
+ as obtained from the deserialization of the server's response. The
154
+ keys MUST match property names in the API description.
155
+
156
+ Returns:
157
+ object: An instance of this structure class.
158
+
159
+ """
160
+ if not isinstance(dictionary, dict) or dictionary is None:
161
+ return None
162
+
163
+ # Extract variables from the dictionary
164
+ collaborative =\
165
+ dictionary.get("collaborative")\
166
+ if "collaborative" in dictionary.keys()\
167
+ else APIHelper.SKIP
168
+ description =\
169
+ dictionary.get("description")\
170
+ if "description" in dictionary.keys()\
171
+ else APIHelper.SKIP
172
+ external_urls =\
173
+ ExternalUrlObject.from_dictionary(
174
+ dictionary.get("external_urls"))\
175
+ if "external_urls" in dictionary.keys()\
176
+ else APIHelper.SKIP
177
+ followers =\
178
+ FollowersObject.from_dictionary(
179
+ dictionary.get("followers"))\
180
+ if "followers" in dictionary.keys()\
181
+ else APIHelper.SKIP
182
+ href =\
183
+ dictionary.get("href")\
184
+ if dictionary.get("href")\
185
+ else APIHelper.SKIP
186
+ id =\
187
+ dictionary.get("id")\
188
+ if dictionary.get("id")\
189
+ else APIHelper.SKIP
190
+ images = None
191
+ if dictionary.get("images") is not None:
192
+ images = [
193
+ ImageObject.from_dictionary(x)
194
+ for x in dictionary.get("images")
195
+ ]
196
+ else:
197
+ images = APIHelper.SKIP
198
+ name =\
199
+ dictionary.get("name")\
200
+ if dictionary.get("name")\
201
+ else APIHelper.SKIP
202
+ owner =\
203
+ PlaylistOwnerObject.from_dictionary(
204
+ dictionary.get("owner"))\
205
+ if "owner" in dictionary.keys()\
206
+ else APIHelper.SKIP
207
+ public =\
208
+ dictionary.get("public")\
209
+ if "public" in dictionary.keys()\
210
+ else APIHelper.SKIP
211
+ snapshot_id =\
212
+ dictionary.get("snapshot_id")\
213
+ if dictionary.get("snapshot_id")\
214
+ else APIHelper.SKIP
215
+ tracks =\
216
+ PagingPlaylistTrackObject.from_dictionary(
217
+ dictionary.get("tracks"))\
218
+ if "tracks" in dictionary.keys()\
219
+ else APIHelper.SKIP
220
+ mtype =\
221
+ dictionary.get("type")\
222
+ if dictionary.get("type")\
223
+ else APIHelper.SKIP
224
+ uri =\
225
+ dictionary.get("uri")\
226
+ if dictionary.get("uri")\
227
+ else APIHelper.SKIP
228
+
229
+ # Return an object of this model
230
+ return cls(collaborative,
231
+ description,
232
+ external_urls,
233
+ followers,
234
+ href,
235
+ id,
236
+ images,
237
+ name,
238
+ owner,
239
+ public,
240
+ snapshot_id,
241
+ tracks,
242
+ mtype,
243
+ uri)
244
+
245
+ def __repr__(self):
246
+ """Return a unambiguous string representation."""
247
+ _collaborative=(
248
+ self.collaborative
249
+ if hasattr(self, "collaborative")
250
+ else None
251
+ )
252
+ _description=(
253
+ self.description
254
+ if hasattr(self, "description")
255
+ else None
256
+ )
257
+ _external_urls=(
258
+ self.external_urls
259
+ if hasattr(self, "external_urls")
260
+ else None
261
+ )
262
+ _followers=(
263
+ self.followers
264
+ if hasattr(self, "followers")
265
+ else None
266
+ )
267
+ _href=(
268
+ self.href
269
+ if hasattr(self, "href")
270
+ else None
271
+ )
272
+ _id=(
273
+ self.id
274
+ if hasattr(self, "id")
275
+ else None
276
+ )
277
+ _images=(
278
+ self.images
279
+ if hasattr(self, "images")
280
+ else None
281
+ )
282
+ _name=(
283
+ self.name
284
+ if hasattr(self, "name")
285
+ else None
286
+ )
287
+ _owner=(
288
+ self.owner
289
+ if hasattr(self, "owner")
290
+ else None
291
+ )
292
+ _public=(
293
+ self.public
294
+ if hasattr(self, "public")
295
+ else None
296
+ )
297
+ _snapshot_id=(
298
+ self.snapshot_id
299
+ if hasattr(self, "snapshot_id")
300
+ else None
301
+ )
302
+ _tracks=(
303
+ self.tracks
304
+ if hasattr(self, "tracks")
305
+ else None
306
+ )
307
+ _mtype=(
308
+ self.mtype
309
+ if hasattr(self, "mtype")
310
+ else None
311
+ )
312
+ _uri=(
313
+ self.uri
314
+ if hasattr(self, "uri")
315
+ else None
316
+ )
317
+ return (
318
+ f"{self.__class__.__name__}("
319
+ f"collaborative={_collaborative!r}, "
320
+ f"description={_description!r}, "
321
+ f"external_urls={_external_urls!r}, "
322
+ f"followers={_followers!r}, "
323
+ f"href={_href!r}, "
324
+ f"id={_id!r}, "
325
+ f"images={_images!r}, "
326
+ f"name={_name!r}, "
327
+ f"owner={_owner!r}, "
328
+ f"public={_public!r}, "
329
+ f"snapshot_id={_snapshot_id!r}, "
330
+ f"tracks={_tracks!r}, "
331
+ f"mtype={_mtype!r}, "
332
+ f"uri={_uri!r}, "
333
+ f")"
334
+ )
335
+
336
+ def __str__(self):
337
+ """Return a human-readable string representation."""
338
+ _collaborative=(
339
+ self.collaborative
340
+ if hasattr(self, "collaborative")
341
+ else None
342
+ )
343
+ _description=(
344
+ self.description
345
+ if hasattr(self, "description")
346
+ else None
347
+ )
348
+ _external_urls=(
349
+ self.external_urls
350
+ if hasattr(self, "external_urls")
351
+ else None
352
+ )
353
+ _followers=(
354
+ self.followers
355
+ if hasattr(self, "followers")
356
+ else None
357
+ )
358
+ _href=(
359
+ self.href
360
+ if hasattr(self, "href")
361
+ else None
362
+ )
363
+ _id=(
364
+ self.id
365
+ if hasattr(self, "id")
366
+ else None
367
+ )
368
+ _images=(
369
+ self.images
370
+ if hasattr(self, "images")
371
+ else None
372
+ )
373
+ _name=(
374
+ self.name
375
+ if hasattr(self, "name")
376
+ else None
377
+ )
378
+ _owner=(
379
+ self.owner
380
+ if hasattr(self, "owner")
381
+ else None
382
+ )
383
+ _public=(
384
+ self.public
385
+ if hasattr(self, "public")
386
+ else None
387
+ )
388
+ _snapshot_id=(
389
+ self.snapshot_id
390
+ if hasattr(self, "snapshot_id")
391
+ else None
392
+ )
393
+ _tracks=(
394
+ self.tracks
395
+ if hasattr(self, "tracks")
396
+ else None
397
+ )
398
+ _mtype=(
399
+ self.mtype
400
+ if hasattr(self, "mtype")
401
+ else None
402
+ )
403
+ _uri=(
404
+ self.uri
405
+ if hasattr(self, "uri")
406
+ else None
407
+ )
408
+ return (
409
+ f"{self.__class__.__name__}("
410
+ f"collaborative={_collaborative!s}, "
411
+ f"description={_description!s}, "
412
+ f"external_urls={_external_urls!s}, "
413
+ f"followers={_followers!s}, "
414
+ f"href={_href!s}, "
415
+ f"id={_id!s}, "
416
+ f"images={_images!s}, "
417
+ f"name={_name!s}, "
418
+ f"owner={_owner!s}, "
419
+ f"public={_public!s}, "
420
+ f"snapshot_id={_snapshot_id!s}, "
421
+ f"tracks={_tracks!s}, "
422
+ f"mtype={_mtype!s}, "
423
+ f"uri={_uri!s}, "
424
+ f")"
425
+ )
@@ -0,0 +1,238 @@
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
+
15
+
16
+ class PlaylistOwnerObject(object):
17
+ """Implementation of the 'PlaylistOwnerObject' model.
18
+
19
+ Attributes:
20
+ external_urls (ExternalUrlObject): Known public external URLs for this user.
21
+ followers (FollowersObject): Information about the followers of this user.
22
+ href (str): A link to the Web API endpoint for this user.
23
+ id (str): The [Spotify user
24
+ ID](/documentation/web-api/concepts/spotify-uris-ids) for this user.
25
+ mtype (Type4Enum): The object type.
26
+ uri (str): The [Spotify
27
+ URI](/documentation/web-api/concepts/spotify-uris-ids) for this user.
28
+ display_name (str): The name displayed on the user's profile. `null` if not
29
+ available.
30
+
31
+ """
32
+
33
+ # Create a mapping from Model property names to API property names
34
+ _names = {
35
+ "external_urls": "external_urls",
36
+ "followers": "followers",
37
+ "href": "href",
38
+ "id": "id",
39
+ "mtype": "type",
40
+ "uri": "uri",
41
+ "display_name": "display_name",
42
+ }
43
+
44
+ _optionals = [
45
+ "external_urls",
46
+ "followers",
47
+ "href",
48
+ "id",
49
+ "mtype",
50
+ "uri",
51
+ "display_name",
52
+ ]
53
+
54
+ _nullables = [
55
+ "display_name",
56
+ ]
57
+
58
+ def __init__(
59
+ self,
60
+ external_urls=APIHelper.SKIP,
61
+ followers=APIHelper.SKIP,
62
+ href=APIHelper.SKIP,
63
+ id=APIHelper.SKIP,
64
+ mtype=APIHelper.SKIP,
65
+ uri=APIHelper.SKIP,
66
+ display_name=APIHelper.SKIP):
67
+ """Initialize a PlaylistOwnerObject instance."""
68
+ # Initialize members of the class
69
+ if external_urls is not APIHelper.SKIP:
70
+ self.external_urls = external_urls
71
+ if followers is not APIHelper.SKIP:
72
+ self.followers = followers
73
+ if href is not APIHelper.SKIP:
74
+ self.href = href
75
+ if id is not APIHelper.SKIP:
76
+ self.id = id
77
+ if mtype is not APIHelper.SKIP:
78
+ self.mtype = mtype
79
+ if uri is not APIHelper.SKIP:
80
+ self.uri = uri
81
+ if display_name is not APIHelper.SKIP:
82
+ self.display_name = display_name
83
+
84
+ @classmethod
85
+ def from_dictionary(cls,
86
+ dictionary):
87
+ """Create an instance of this model from a dictionary
88
+
89
+ Args:
90
+ dictionary (dictionary): A dictionary representation of the object
91
+ as obtained from the deserialization of the server's response. The
92
+ keys MUST match property names in the API description.
93
+
94
+ Returns:
95
+ object: An instance of this structure class.
96
+
97
+ """
98
+ if not isinstance(dictionary, dict) or dictionary is None:
99
+ return None
100
+
101
+ # Extract variables from the dictionary
102
+ external_urls =\
103
+ ExternalUrlObject.from_dictionary(
104
+ dictionary.get("external_urls"))\
105
+ if "external_urls" in dictionary.keys()\
106
+ else APIHelper.SKIP
107
+ followers =\
108
+ FollowersObject.from_dictionary(
109
+ dictionary.get("followers"))\
110
+ if "followers" in dictionary.keys()\
111
+ else APIHelper.SKIP
112
+ href =\
113
+ dictionary.get("href")\
114
+ if dictionary.get("href")\
115
+ else APIHelper.SKIP
116
+ id =\
117
+ dictionary.get("id")\
118
+ if dictionary.get("id")\
119
+ else APIHelper.SKIP
120
+ mtype =\
121
+ dictionary.get("type")\
122
+ if dictionary.get("type")\
123
+ else APIHelper.SKIP
124
+ uri =\
125
+ dictionary.get("uri")\
126
+ if dictionary.get("uri")\
127
+ else APIHelper.SKIP
128
+ display_name =\
129
+ dictionary.get("display_name")\
130
+ if "display_name" in dictionary.keys()\
131
+ else APIHelper.SKIP
132
+
133
+ # Return an object of this model
134
+ return cls(external_urls,
135
+ followers,
136
+ href,
137
+ id,
138
+ mtype,
139
+ uri,
140
+ display_name)
141
+
142
+ def __repr__(self):
143
+ """Return a unambiguous string representation."""
144
+ _external_urls=(
145
+ self.external_urls
146
+ if hasattr(self, "external_urls")
147
+ else None
148
+ )
149
+ _followers=(
150
+ self.followers
151
+ if hasattr(self, "followers")
152
+ else None
153
+ )
154
+ _href=(
155
+ self.href
156
+ if hasattr(self, "href")
157
+ else None
158
+ )
159
+ _id=(
160
+ self.id
161
+ if hasattr(self, "id")
162
+ else None
163
+ )
164
+ _mtype=(
165
+ self.mtype
166
+ if hasattr(self, "mtype")
167
+ else None
168
+ )
169
+ _uri=(
170
+ self.uri
171
+ if hasattr(self, "uri")
172
+ else None
173
+ )
174
+ _display_name=(
175
+ self.display_name
176
+ if hasattr(self, "display_name")
177
+ else None
178
+ )
179
+ return (
180
+ f"{self.__class__.__name__}("
181
+ f"external_urls={_external_urls!r}, "
182
+ f"followers={_followers!r}, "
183
+ f"href={_href!r}, "
184
+ f"id={_id!r}, "
185
+ f"mtype={_mtype!r}, "
186
+ f"uri={_uri!r}, "
187
+ f"display_name={_display_name!r}, "
188
+ f")"
189
+ )
190
+
191
+ def __str__(self):
192
+ """Return a human-readable string representation."""
193
+ _external_urls=(
194
+ self.external_urls
195
+ if hasattr(self, "external_urls")
196
+ else None
197
+ )
198
+ _followers=(
199
+ self.followers
200
+ if hasattr(self, "followers")
201
+ else None
202
+ )
203
+ _href=(
204
+ self.href
205
+ if hasattr(self, "href")
206
+ else None
207
+ )
208
+ _id=(
209
+ self.id
210
+ if hasattr(self, "id")
211
+ else None
212
+ )
213
+ _mtype=(
214
+ self.mtype
215
+ if hasattr(self, "mtype")
216
+ else None
217
+ )
218
+ _uri=(
219
+ self.uri
220
+ if hasattr(self, "uri")
221
+ else None
222
+ )
223
+ _display_name=(
224
+ self.display_name
225
+ if hasattr(self, "display_name")
226
+ else None
227
+ )
228
+ return (
229
+ f"{self.__class__.__name__}("
230
+ f"external_urls={_external_urls!s}, "
231
+ f"followers={_followers!s}, "
232
+ f"href={_href!s}, "
233
+ f"id={_id!s}, "
234
+ f"mtype={_mtype!s}, "
235
+ f"uri={_uri!s}, "
236
+ f"display_name={_display_name!s}, "
237
+ f")"
238
+ )