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,168 @@
|
|
|
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
|
+
|
|
9
|
+
|
|
10
|
+
class ImageObject(object):
|
|
11
|
+
"""Implementation of the 'ImageObject' model.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
url (str): The source URL of the image.
|
|
15
|
+
height (int): The image height in pixels.
|
|
16
|
+
width (int): The image width in pixels.
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
# Create a mapping from Model property names to API property names
|
|
21
|
+
_names = {
|
|
22
|
+
"url": "url",
|
|
23
|
+
"height": "height",
|
|
24
|
+
"width": "width",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_nullables = [
|
|
28
|
+
"height",
|
|
29
|
+
"width",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
def __init__(
|
|
33
|
+
self,
|
|
34
|
+
url=None,
|
|
35
|
+
height=None,
|
|
36
|
+
width=None):
|
|
37
|
+
"""Initialize a ImageObject instance."""
|
|
38
|
+
# Initialize members of the class
|
|
39
|
+
self.url = url
|
|
40
|
+
self.height = height
|
|
41
|
+
self.width = width
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_dictionary(cls,
|
|
45
|
+
dictionary):
|
|
46
|
+
"""Create an instance of this model from a dictionary
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
50
|
+
as obtained from the deserialization of the server's response. The
|
|
51
|
+
keys MUST match property names in the API description.
|
|
52
|
+
|
|
53
|
+
Returns:
|
|
54
|
+
object: An instance of this structure class.
|
|
55
|
+
|
|
56
|
+
"""
|
|
57
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
58
|
+
return None
|
|
59
|
+
|
|
60
|
+
# Extract variables from the dictionary
|
|
61
|
+
url =\
|
|
62
|
+
dictionary.get("url")\
|
|
63
|
+
if dictionary.get("url")\
|
|
64
|
+
else None
|
|
65
|
+
height =\
|
|
66
|
+
dictionary.get("height")\
|
|
67
|
+
if dictionary.get("height")\
|
|
68
|
+
else None
|
|
69
|
+
width =\
|
|
70
|
+
dictionary.get("width")\
|
|
71
|
+
if dictionary.get("width")\
|
|
72
|
+
else None
|
|
73
|
+
|
|
74
|
+
# Return an object of this model
|
|
75
|
+
return cls(url,
|
|
76
|
+
height,
|
|
77
|
+
width)
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def validate(cls, dictionary):
|
|
81
|
+
"""Validate dictionary against class required properties
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
85
|
+
as obtained from the deserialization of the server's response. The
|
|
86
|
+
keys MUST match property names in the API description.
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
boolean : if dictionary is valid contains required properties.
|
|
90
|
+
|
|
91
|
+
"""
|
|
92
|
+
if isinstance(dictionary, cls):
|
|
93
|
+
return APIHelper.is_valid_type(
|
|
94
|
+
value=dictionary.url,
|
|
95
|
+
type_callable=lambda value:
|
|
96
|
+
isinstance(
|
|
97
|
+
value,
|
|
98
|
+
str,
|
|
99
|
+
)) \
|
|
100
|
+
and APIHelper.is_valid_type(
|
|
101
|
+
value=dictionary.height,
|
|
102
|
+
type_callable=lambda value:
|
|
103
|
+
isinstance(
|
|
104
|
+
value,
|
|
105
|
+
int,
|
|
106
|
+
),
|
|
107
|
+
is_value_nullable=True) \
|
|
108
|
+
and APIHelper.is_valid_type(
|
|
109
|
+
value=dictionary.width,
|
|
110
|
+
type_callable=lambda value:
|
|
111
|
+
isinstance(
|
|
112
|
+
value,
|
|
113
|
+
int,
|
|
114
|
+
),
|
|
115
|
+
is_value_nullable=True)
|
|
116
|
+
|
|
117
|
+
if not isinstance(dictionary, dict):
|
|
118
|
+
return False
|
|
119
|
+
|
|
120
|
+
return APIHelper.is_valid_type(
|
|
121
|
+
value=dictionary.get("url"),
|
|
122
|
+
type_callable=lambda value:
|
|
123
|
+
isinstance(
|
|
124
|
+
value,
|
|
125
|
+
str,
|
|
126
|
+
)) \
|
|
127
|
+
and APIHelper.is_valid_type(
|
|
128
|
+
value=dictionary.get("height"),
|
|
129
|
+
type_callable=lambda value:
|
|
130
|
+
isinstance(
|
|
131
|
+
value,
|
|
132
|
+
int,
|
|
133
|
+
),
|
|
134
|
+
is_value_nullable=True) \
|
|
135
|
+
and APIHelper.is_valid_type(
|
|
136
|
+
value=dictionary.get("width"),
|
|
137
|
+
type_callable=lambda value:
|
|
138
|
+
isinstance(
|
|
139
|
+
value,
|
|
140
|
+
int,
|
|
141
|
+
),
|
|
142
|
+
is_value_nullable=True)
|
|
143
|
+
|
|
144
|
+
def __repr__(self):
|
|
145
|
+
"""Return a unambiguous string representation."""
|
|
146
|
+
_url=self.url
|
|
147
|
+
_height=self.height
|
|
148
|
+
_width=self.width
|
|
149
|
+
return (
|
|
150
|
+
f"{self.__class__.__name__}("
|
|
151
|
+
f"url={_url!r}, "
|
|
152
|
+
f"height={_height!r}, "
|
|
153
|
+
f"width={_width!r}, "
|
|
154
|
+
f")"
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
def __str__(self):
|
|
158
|
+
"""Return a human-readable string representation."""
|
|
159
|
+
_url=self.url
|
|
160
|
+
_height=self.height
|
|
161
|
+
_width=self.width
|
|
162
|
+
return (
|
|
163
|
+
f"{self.__class__.__name__}("
|
|
164
|
+
f"url={_url!s}, "
|
|
165
|
+
f"height={_height!s}, "
|
|
166
|
+
f"width={_width!s}, "
|
|
167
|
+
f")"
|
|
168
|
+
)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""spotifywebapi.
|
|
2
|
+
|
|
3
|
+
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
|
|
8
|
+
class IncludeExternalEnum(object):
|
|
9
|
+
"""Implementation of the 'Include External' enum.
|
|
10
|
+
|
|
11
|
+
If `include_external=audio` is specified it signals that the client can play
|
|
12
|
+
externally hosted audio content, and marks
|
|
13
|
+
the content as playable in the response. By default externally hosted audio
|
|
14
|
+
content is marked as unplayable in the response.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
AUDIO: The enum member of type str.
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
AUDIO = "audio"
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def from_value(cls, value, default=None):
|
|
25
|
+
"""Return the matching enum value for the given input."""
|
|
26
|
+
if value is None:
|
|
27
|
+
return default
|
|
28
|
+
|
|
29
|
+
# If numeric and matches directly
|
|
30
|
+
if isinstance(value, int):
|
|
31
|
+
for name, val in cls.__dict__.items():
|
|
32
|
+
if not name.startswith("_") and val == value:
|
|
33
|
+
return val
|
|
34
|
+
|
|
35
|
+
# If string, perform case-insensitive match
|
|
36
|
+
if isinstance(value, str):
|
|
37
|
+
value_lower = value.lower()
|
|
38
|
+
for name, val in cls.__dict__.items():
|
|
39
|
+
if not name.startswith("_") and (
|
|
40
|
+
name.lower() == value_lower or str(val).lower() == value_lower
|
|
41
|
+
):
|
|
42
|
+
return val
|
|
43
|
+
|
|
44
|
+
# Fallback to default
|
|
45
|
+
return default
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""spotifywebapi.
|
|
2
|
+
|
|
3
|
+
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
|
|
8
|
+
class ItemType1Enum(object):
|
|
9
|
+
"""Implementation of the 'Item Type1' enum.
|
|
10
|
+
|
|
11
|
+
The ID type: currently only `artist` is supported.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
ARTIST: The enum member of type str.
|
|
15
|
+
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
_all_values = ["artist"]
|
|
19
|
+
ARTIST = "artist"
|
|
20
|
+
|
|
21
|
+
@classmethod
|
|
22
|
+
def validate(cls, value):
|
|
23
|
+
"""Validate value contains in enum
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
value: the value to be validated
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
boolean : if value is valid enum values.
|
|
30
|
+
|
|
31
|
+
"""
|
|
32
|
+
return value in cls._all_values
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_value(cls, value, default=None):
|
|
36
|
+
"""Return the matching enum value for the given input."""
|
|
37
|
+
if value is None:
|
|
38
|
+
return default
|
|
39
|
+
|
|
40
|
+
# If numeric and matches directly
|
|
41
|
+
if isinstance(value, int):
|
|
42
|
+
for name, val in cls.__dict__.items():
|
|
43
|
+
if not name.startswith("_") and val == value:
|
|
44
|
+
return val
|
|
45
|
+
|
|
46
|
+
# If string, perform case-insensitive match
|
|
47
|
+
if isinstance(value, str):
|
|
48
|
+
value_lower = value.lower()
|
|
49
|
+
for name, val in cls.__dict__.items():
|
|
50
|
+
if not name.startswith("_") and (
|
|
51
|
+
name.lower() == value_lower or str(val).lower() == value_lower
|
|
52
|
+
):
|
|
53
|
+
return val
|
|
54
|
+
|
|
55
|
+
# Fallback to default
|
|
56
|
+
return default
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""spotifywebapi.
|
|
2
|
+
|
|
3
|
+
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
|
|
8
|
+
class ItemType2Enum(object):
|
|
9
|
+
"""Implementation of the 'Item Type2' enum.
|
|
10
|
+
|
|
11
|
+
The ID type.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
ARTIST: The enum member of type str.
|
|
15
|
+
USER: The enum member of type str.
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
ARTIST = "artist"
|
|
20
|
+
|
|
21
|
+
USER = "user"
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def from_value(cls, value, default=None):
|
|
25
|
+
"""Return the matching enum value for the given input."""
|
|
26
|
+
if value is None:
|
|
27
|
+
return default
|
|
28
|
+
|
|
29
|
+
# If numeric and matches directly
|
|
30
|
+
if isinstance(value, int):
|
|
31
|
+
for name, val in cls.__dict__.items():
|
|
32
|
+
if not name.startswith("_") and val == value:
|
|
33
|
+
return val
|
|
34
|
+
|
|
35
|
+
# If string, perform case-insensitive match
|
|
36
|
+
if isinstance(value, str):
|
|
37
|
+
value_lower = value.lower()
|
|
38
|
+
for name, val in cls.__dict__.items():
|
|
39
|
+
if not name.startswith("_") and (
|
|
40
|
+
name.lower() == value_lower or str(val).lower() == value_lower
|
|
41
|
+
):
|
|
42
|
+
return val
|
|
43
|
+
|
|
44
|
+
# Fallback to default
|
|
45
|
+
return default
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""spotifywebapi.
|
|
2
|
+
|
|
3
|
+
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
|
|
8
|
+
class ItemType3Enum(object):
|
|
9
|
+
"""Implementation of the 'Item Type3' enum.
|
|
10
|
+
|
|
11
|
+
The ID type: either `artist` or `user`.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
ARTIST: The enum member of type str.
|
|
15
|
+
USER: The enum member of type str.
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
ARTIST = "artist"
|
|
20
|
+
|
|
21
|
+
USER = "user"
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def from_value(cls, value, default=None):
|
|
25
|
+
"""Return the matching enum value for the given input."""
|
|
26
|
+
if value is None:
|
|
27
|
+
return default
|
|
28
|
+
|
|
29
|
+
# If numeric and matches directly
|
|
30
|
+
if isinstance(value, int):
|
|
31
|
+
for name, val in cls.__dict__.items():
|
|
32
|
+
if not name.startswith("_") and val == value:
|
|
33
|
+
return val
|
|
34
|
+
|
|
35
|
+
# If string, perform case-insensitive match
|
|
36
|
+
if isinstance(value, str):
|
|
37
|
+
value_lower = value.lower()
|
|
38
|
+
for name, val in cls.__dict__.items():
|
|
39
|
+
if not name.startswith("_") and (
|
|
40
|
+
name.lower() == value_lower or str(val).lower() == value_lower
|
|
41
|
+
):
|
|
42
|
+
return val
|
|
43
|
+
|
|
44
|
+
# Fallback to default
|
|
45
|
+
return default
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""spotifywebapi.
|
|
2
|
+
|
|
3
|
+
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
|
|
8
|
+
class ItemTypeEnum(object):
|
|
9
|
+
"""Implementation of the 'Item type' enum.
|
|
10
|
+
|
|
11
|
+
Attributes:
|
|
12
|
+
ALBUM: The enum member of type str.
|
|
13
|
+
ARTIST: The enum member of type str.
|
|
14
|
+
PLAYLIST: The enum member of type str.
|
|
15
|
+
TRACK: The enum member of type str.
|
|
16
|
+
SHOW: The enum member of type str.
|
|
17
|
+
EPISODE: The enum member of type str.
|
|
18
|
+
AUDIOBOOK: The enum member of type str.
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
ALBUM = "album"
|
|
23
|
+
|
|
24
|
+
ARTIST = "artist"
|
|
25
|
+
|
|
26
|
+
PLAYLIST = "playlist"
|
|
27
|
+
|
|
28
|
+
TRACK = "track"
|
|
29
|
+
|
|
30
|
+
SHOW = "show"
|
|
31
|
+
|
|
32
|
+
EPISODE = "episode"
|
|
33
|
+
|
|
34
|
+
AUDIOBOOK = "audiobook"
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def from_value(cls, value, default=None):
|
|
38
|
+
"""Return the matching enum value for the given input."""
|
|
39
|
+
if value is None:
|
|
40
|
+
return default
|
|
41
|
+
|
|
42
|
+
# If numeric and matches directly
|
|
43
|
+
if isinstance(value, int):
|
|
44
|
+
for name, val in cls.__dict__.items():
|
|
45
|
+
if not name.startswith("_") and val == value:
|
|
46
|
+
return val
|
|
47
|
+
|
|
48
|
+
# If string, perform case-insensitive match
|
|
49
|
+
if isinstance(value, str):
|
|
50
|
+
value_lower = value.lower()
|
|
51
|
+
for name, val in cls.__dict__.items():
|
|
52
|
+
if not name.startswith("_") and (
|
|
53
|
+
name.lower() == value_lower or str(val).lower() == value_lower
|
|
54
|
+
):
|
|
55
|
+
return val
|
|
56
|
+
|
|
57
|
+
# Fallback to default
|
|
58
|
+
return default
|
|
@@ -0,0 +1,205 @@
|
|
|
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 LinkedTrackObject(object):
|
|
14
|
+
"""Implementation of the 'LinkedTrackObject' model.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
external_urls (ExternalUrlObject): Known external URLs for this track.
|
|
18
|
+
href (str): A link to the Web API endpoint providing full details of the
|
|
19
|
+
track.
|
|
20
|
+
id (str): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids)
|
|
21
|
+
for the track.
|
|
22
|
+
mtype (str): The object type: "track".
|
|
23
|
+
uri (str): The [Spotify
|
|
24
|
+
URI](/documentation/web-api/concepts/spotify-uris-ids) for the track.
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
# Create a mapping from Model property names to API property names
|
|
29
|
+
_names = {
|
|
30
|
+
"external_urls": "external_urls",
|
|
31
|
+
"href": "href",
|
|
32
|
+
"id": "id",
|
|
33
|
+
"mtype": "type",
|
|
34
|
+
"uri": "uri",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_optionals = [
|
|
38
|
+
"external_urls",
|
|
39
|
+
"href",
|
|
40
|
+
"id",
|
|
41
|
+
"mtype",
|
|
42
|
+
"uri",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
def __init__(
|
|
46
|
+
self,
|
|
47
|
+
external_urls=APIHelper.SKIP,
|
|
48
|
+
href=APIHelper.SKIP,
|
|
49
|
+
id=APIHelper.SKIP,
|
|
50
|
+
mtype=APIHelper.SKIP,
|
|
51
|
+
uri=APIHelper.SKIP):
|
|
52
|
+
"""Initialize a LinkedTrackObject instance."""
|
|
53
|
+
# Initialize members of the class
|
|
54
|
+
if external_urls is not APIHelper.SKIP:
|
|
55
|
+
self.external_urls = external_urls
|
|
56
|
+
if href is not APIHelper.SKIP:
|
|
57
|
+
self.href = href
|
|
58
|
+
if id is not APIHelper.SKIP:
|
|
59
|
+
self.id = id
|
|
60
|
+
if mtype is not APIHelper.SKIP:
|
|
61
|
+
self.mtype = mtype
|
|
62
|
+
if uri is not APIHelper.SKIP:
|
|
63
|
+
self.uri = uri
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_dictionary(cls,
|
|
67
|
+
dictionary):
|
|
68
|
+
"""Create an instance of this model from a dictionary
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
72
|
+
as obtained from the deserialization of the server's response. The
|
|
73
|
+
keys MUST match property names in the API description.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
object: An instance of this structure class.
|
|
77
|
+
|
|
78
|
+
"""
|
|
79
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
# Extract variables from the dictionary
|
|
83
|
+
external_urls =\
|
|
84
|
+
ExternalUrlObject.from_dictionary(
|
|
85
|
+
dictionary.get("external_urls"))\
|
|
86
|
+
if "external_urls" in dictionary.keys()\
|
|
87
|
+
else APIHelper.SKIP
|
|
88
|
+
href =\
|
|
89
|
+
dictionary.get("href")\
|
|
90
|
+
if dictionary.get("href")\
|
|
91
|
+
else APIHelper.SKIP
|
|
92
|
+
id =\
|
|
93
|
+
dictionary.get("id")\
|
|
94
|
+
if dictionary.get("id")\
|
|
95
|
+
else APIHelper.SKIP
|
|
96
|
+
mtype =\
|
|
97
|
+
dictionary.get("type")\
|
|
98
|
+
if dictionary.get("type")\
|
|
99
|
+
else APIHelper.SKIP
|
|
100
|
+
uri =\
|
|
101
|
+
dictionary.get("uri")\
|
|
102
|
+
if dictionary.get("uri")\
|
|
103
|
+
else APIHelper.SKIP
|
|
104
|
+
|
|
105
|
+
# Return an object of this model
|
|
106
|
+
return cls(external_urls,
|
|
107
|
+
href,
|
|
108
|
+
id,
|
|
109
|
+
mtype,
|
|
110
|
+
uri)
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def validate(cls, dictionary):
|
|
114
|
+
"""Validate dictionary against class required properties
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
118
|
+
as obtained from the deserialization of the server's response. The
|
|
119
|
+
keys MUST match property names in the API description.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
boolean : if dictionary is valid contains required properties.
|
|
123
|
+
|
|
124
|
+
"""
|
|
125
|
+
if isinstance(dictionary, cls):
|
|
126
|
+
return True
|
|
127
|
+
|
|
128
|
+
if not isinstance(dictionary, dict):
|
|
129
|
+
return False
|
|
130
|
+
|
|
131
|
+
return True
|
|
132
|
+
|
|
133
|
+
def __repr__(self):
|
|
134
|
+
"""Return a unambiguous string representation."""
|
|
135
|
+
_external_urls=(
|
|
136
|
+
self.external_urls
|
|
137
|
+
if hasattr(self, "external_urls")
|
|
138
|
+
else None
|
|
139
|
+
)
|
|
140
|
+
_href=(
|
|
141
|
+
self.href
|
|
142
|
+
if hasattr(self, "href")
|
|
143
|
+
else None
|
|
144
|
+
)
|
|
145
|
+
_id=(
|
|
146
|
+
self.id
|
|
147
|
+
if hasattr(self, "id")
|
|
148
|
+
else None
|
|
149
|
+
)
|
|
150
|
+
_mtype=(
|
|
151
|
+
self.mtype
|
|
152
|
+
if hasattr(self, "mtype")
|
|
153
|
+
else None
|
|
154
|
+
)
|
|
155
|
+
_uri=(
|
|
156
|
+
self.uri
|
|
157
|
+
if hasattr(self, "uri")
|
|
158
|
+
else None
|
|
159
|
+
)
|
|
160
|
+
return (
|
|
161
|
+
f"{self.__class__.__name__}("
|
|
162
|
+
f"external_urls={_external_urls!r}, "
|
|
163
|
+
f"href={_href!r}, "
|
|
164
|
+
f"id={_id!r}, "
|
|
165
|
+
f"mtype={_mtype!r}, "
|
|
166
|
+
f"uri={_uri!r}, "
|
|
167
|
+
f")"
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
def __str__(self):
|
|
171
|
+
"""Return a human-readable string representation."""
|
|
172
|
+
_external_urls=(
|
|
173
|
+
self.external_urls
|
|
174
|
+
if hasattr(self, "external_urls")
|
|
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
|
+
_mtype=(
|
|
188
|
+
self.mtype
|
|
189
|
+
if hasattr(self, "mtype")
|
|
190
|
+
else None
|
|
191
|
+
)
|
|
192
|
+
_uri=(
|
|
193
|
+
self.uri
|
|
194
|
+
if hasattr(self, "uri")
|
|
195
|
+
else None
|
|
196
|
+
)
|
|
197
|
+
return (
|
|
198
|
+
f"{self.__class__.__name__}("
|
|
199
|
+
f"external_urls={_external_urls!s}, "
|
|
200
|
+
f"href={_href!s}, "
|
|
201
|
+
f"id={_id!s}, "
|
|
202
|
+
f"mtype={_mtype!s}, "
|
|
203
|
+
f"uri={_uri!s}, "
|
|
204
|
+
f")"
|
|
205
|
+
)
|
|
@@ -0,0 +1,76 @@
|
|
|
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.models.album_object import (
|
|
8
|
+
AlbumObject,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ManyAlbums(object):
|
|
13
|
+
"""Implementation of the 'ManyAlbums' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
albums (List[AlbumObject]): The model property of type List[AlbumObject].
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
# Create a mapping from Model property names to API property names
|
|
21
|
+
_names = {
|
|
22
|
+
"albums": "albums",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def __init__(
|
|
26
|
+
self,
|
|
27
|
+
albums=None):
|
|
28
|
+
"""Initialize a ManyAlbums instance."""
|
|
29
|
+
# Initialize members of the class
|
|
30
|
+
self.albums = albums
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def from_dictionary(cls,
|
|
34
|
+
dictionary):
|
|
35
|
+
"""Create an instance of this model from a dictionary
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
39
|
+
as obtained from the deserialization of the server's response. The
|
|
40
|
+
keys MUST match property names in the API description.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
object: An instance of this structure class.
|
|
44
|
+
|
|
45
|
+
"""
|
|
46
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
# Extract variables from the dictionary
|
|
50
|
+
albums = None
|
|
51
|
+
if dictionary.get("albums") is not None:
|
|
52
|
+
albums = [
|
|
53
|
+
AlbumObject.from_dictionary(x)
|
|
54
|
+
for x in dictionary.get("albums")
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
# Return an object of this model
|
|
58
|
+
return cls(albums)
|
|
59
|
+
|
|
60
|
+
def __repr__(self):
|
|
61
|
+
"""Return a unambiguous string representation."""
|
|
62
|
+
_albums=self.albums
|
|
63
|
+
return (
|
|
64
|
+
f"{self.__class__.__name__}("
|
|
65
|
+
f"albums={_albums!r}, "
|
|
66
|
+
f")"
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
def __str__(self):
|
|
70
|
+
"""Return a human-readable string representation."""
|
|
71
|
+
_albums=self.albums
|
|
72
|
+
return (
|
|
73
|
+
f"{self.__class__.__name__}("
|
|
74
|
+
f"albums={_albums!s}, "
|
|
75
|
+
f")"
|
|
76
|
+
)
|