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,85 @@
|
|
|
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 NarratorObject(object):
|
|
11
|
+
"""Implementation of the 'NarratorObject' model.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
name (str): The name of the Narrator.
|
|
15
|
+
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
# Create a mapping from Model property names to API property names
|
|
19
|
+
_names = {
|
|
20
|
+
"name": "name",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
_optionals = [
|
|
24
|
+
"name",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
def __init__(
|
|
28
|
+
self,
|
|
29
|
+
name=APIHelper.SKIP):
|
|
30
|
+
"""Initialize a NarratorObject instance."""
|
|
31
|
+
# Initialize members of the class
|
|
32
|
+
if name is not APIHelper.SKIP:
|
|
33
|
+
self.name = name
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_dictionary(cls,
|
|
37
|
+
dictionary):
|
|
38
|
+
"""Create an instance of this model from a dictionary
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
42
|
+
as obtained from the deserialization of the server's response. The
|
|
43
|
+
keys MUST match property names in the API description.
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
object: An instance of this structure class.
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
# Extract variables from the dictionary
|
|
53
|
+
name =\
|
|
54
|
+
dictionary.get("name")\
|
|
55
|
+
if dictionary.get("name")\
|
|
56
|
+
else APIHelper.SKIP
|
|
57
|
+
|
|
58
|
+
# Return an object of this model
|
|
59
|
+
return cls(name)
|
|
60
|
+
|
|
61
|
+
def __repr__(self):
|
|
62
|
+
"""Return a unambiguous string representation."""
|
|
63
|
+
_name=(
|
|
64
|
+
self.name
|
|
65
|
+
if hasattr(self, "name")
|
|
66
|
+
else None
|
|
67
|
+
)
|
|
68
|
+
return (
|
|
69
|
+
f"{self.__class__.__name__}("
|
|
70
|
+
f"name={_name!r}, "
|
|
71
|
+
f")"
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
def __str__(self):
|
|
75
|
+
"""Return a human-readable string representation."""
|
|
76
|
+
_name=(
|
|
77
|
+
self.name
|
|
78
|
+
if hasattr(self, "name")
|
|
79
|
+
else None
|
|
80
|
+
)
|
|
81
|
+
return (
|
|
82
|
+
f"{self.__class__.__name__}("
|
|
83
|
+
f"name={_name!s}, "
|
|
84
|
+
f")"
|
|
85
|
+
)
|
|
@@ -0,0 +1,67 @@
|
|
|
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 OAuthProviderErrorEnum(object):
|
|
9
|
+
"""Implementation of the 'OAuthProviderError' enum.
|
|
10
|
+
|
|
11
|
+
OAuth 2 Authorization error codes
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
INVALID_REQUEST: The request is missing a required parameter, includes an
|
|
15
|
+
unsupported parameter value (other than grant type), repeats a parameter,
|
|
16
|
+
includes multiple credentials, utilizes more than one mechanism for
|
|
17
|
+
authenticating the client, or is otherwise malformed.
|
|
18
|
+
INVALID_CLIENT: Client authentication failed (e.g., unknown client, no client
|
|
19
|
+
authentication included, or unsupported authentication method).
|
|
20
|
+
INVALID_GRANT: The provided authorization grant (e.g., authorization code,
|
|
21
|
+
resource owner credentials) or refresh token is invalid, expired,
|
|
22
|
+
revoked, does not match the redirection URI used in the authorization
|
|
23
|
+
request, or was issued to another client.
|
|
24
|
+
UNAUTHORIZED_CLIENT: The authenticated client is not authorized to use this
|
|
25
|
+
authorization grant type.
|
|
26
|
+
UNSUPPORTED_GRANT_TYPE: The authorization grant type is not supported by the
|
|
27
|
+
authorization server.
|
|
28
|
+
INVALID_SCOPE: The requested scope is invalid, unknown, malformed, or exceeds
|
|
29
|
+
the scope granted by the resource owner.
|
|
30
|
+
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
INVALID_REQUEST = "invalid_request"
|
|
34
|
+
|
|
35
|
+
INVALID_CLIENT = "invalid_client"
|
|
36
|
+
|
|
37
|
+
INVALID_GRANT = "invalid_grant"
|
|
38
|
+
|
|
39
|
+
UNAUTHORIZED_CLIENT = "unauthorized_client"
|
|
40
|
+
|
|
41
|
+
UNSUPPORTED_GRANT_TYPE = "unsupported_grant_type"
|
|
42
|
+
|
|
43
|
+
INVALID_SCOPE = "invalid_scope"
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_value(cls, value, default=None):
|
|
47
|
+
"""Return the matching enum value for the given input."""
|
|
48
|
+
if value is None:
|
|
49
|
+
return default
|
|
50
|
+
|
|
51
|
+
# If numeric and matches directly
|
|
52
|
+
if isinstance(value, int):
|
|
53
|
+
for name, val in cls.__dict__.items():
|
|
54
|
+
if not name.startswith("_") and val == value:
|
|
55
|
+
return val
|
|
56
|
+
|
|
57
|
+
# If string, perform case-insensitive match
|
|
58
|
+
if isinstance(value, str):
|
|
59
|
+
value_lower = value.lower()
|
|
60
|
+
for name, val in cls.__dict__.items():
|
|
61
|
+
if not name.startswith("_") and (
|
|
62
|
+
name.lower() == value_lower or str(val).lower() == value_lower
|
|
63
|
+
):
|
|
64
|
+
return val
|
|
65
|
+
|
|
66
|
+
# Fallback to default
|
|
67
|
+
return default
|
|
@@ -0,0 +1,98 @@
|
|
|
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 OAuthScopeEnum(object):
|
|
9
|
+
"""Implementation of the 'OAuth Scope' enum.
|
|
10
|
+
|
|
11
|
+
OAuth 2 scopes supported by the API
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
APP-REMOTE-CONTROL: Communicate with the Spotify app on your device.
|
|
15
|
+
PLAYLIST-READ-PRIVATE: Access your private playlists.
|
|
16
|
+
PLAYLIST-READ-COLLABORATIVE: Access your collaborative playlists.
|
|
17
|
+
PLAYLIST-MODIFY-PUBLIC: Manage your public playlists.
|
|
18
|
+
PLAYLIST-MODIFY-PRIVATE: Manage your private playlists.
|
|
19
|
+
USER-LIBRARY-READ: Access your saved content.
|
|
20
|
+
USER-LIBRARY-MODIFY: Manage your saved content.
|
|
21
|
+
USER-READ-PRIVATE: Access your subscription details.
|
|
22
|
+
USER-READ-EMAIL: Get your real email address.
|
|
23
|
+
USER-FOLLOW-READ: Access your followers and who you are following.
|
|
24
|
+
USER-FOLLOW-MODIFY: Manage your saved content.
|
|
25
|
+
USER-TOP-READ: Read your top artists and content.
|
|
26
|
+
USER-READ-PLAYBACK-POSITION: Read your position in content you have played.
|
|
27
|
+
USER-READ-PLAYBACK-STATE: Read your currently playing content and Spotify
|
|
28
|
+
Connect devices information.
|
|
29
|
+
USER-READ-RECENTLY-PLAYED: Access your recently played items.
|
|
30
|
+
USER-READ-CURRENTLY-PLAYING: Read your currently playing content.
|
|
31
|
+
USER-MODIFY-PLAYBACK-STATE: Control playback on your Spotify clients and
|
|
32
|
+
Spotify Connect devices.
|
|
33
|
+
UGC-IMAGE-UPLOAD: Upload images to Spotify on your behalf.
|
|
34
|
+
STREAMING: Play content and control playback on your other devices.
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
APP_REMOTE_CONTROL = "app-remote-control"
|
|
39
|
+
|
|
40
|
+
PLAYLIST_READ_PRIVATE = "playlist-read-private"
|
|
41
|
+
|
|
42
|
+
PLAYLIST_READ_COLLABORATIVE = "playlist-read-collaborative"
|
|
43
|
+
|
|
44
|
+
PLAYLIST_MODIFY_PUBLIC = "playlist-modify-public"
|
|
45
|
+
|
|
46
|
+
PLAYLIST_MODIFY_PRIVATE = "playlist-modify-private"
|
|
47
|
+
|
|
48
|
+
USER_LIBRARY_READ = "user-library-read"
|
|
49
|
+
|
|
50
|
+
USER_LIBRARY_MODIFY = "user-library-modify"
|
|
51
|
+
|
|
52
|
+
USER_READ_PRIVATE = "user-read-private"
|
|
53
|
+
|
|
54
|
+
USER_READ_EMAIL = "user-read-email"
|
|
55
|
+
|
|
56
|
+
USER_FOLLOW_READ = "user-follow-read"
|
|
57
|
+
|
|
58
|
+
USER_FOLLOW_MODIFY = "user-follow-modify"
|
|
59
|
+
|
|
60
|
+
USER_TOP_READ = "user-top-read"
|
|
61
|
+
|
|
62
|
+
USER_READ_PLAYBACK_POSITION = "user-read-playback-position"
|
|
63
|
+
|
|
64
|
+
USER_READ_PLAYBACK_STATE = "user-read-playback-state"
|
|
65
|
+
|
|
66
|
+
USER_READ_RECENTLY_PLAYED = "user-read-recently-played"
|
|
67
|
+
|
|
68
|
+
USER_READ_CURRENTLY_PLAYING = "user-read-currently-playing"
|
|
69
|
+
|
|
70
|
+
USER_MODIFY_PLAYBACK_STATE = "user-modify-playback-state"
|
|
71
|
+
|
|
72
|
+
UGC_IMAGE_UPLOAD = "ugc-image-upload"
|
|
73
|
+
|
|
74
|
+
STREAMING = "streaming"
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_value(cls, value, default=None):
|
|
78
|
+
"""Return the matching enum value for the given input."""
|
|
79
|
+
if value is None:
|
|
80
|
+
return default
|
|
81
|
+
|
|
82
|
+
# If numeric and matches directly
|
|
83
|
+
if isinstance(value, int):
|
|
84
|
+
for name, val in cls.__dict__.items():
|
|
85
|
+
if not name.startswith("_") and val == value:
|
|
86
|
+
return val
|
|
87
|
+
|
|
88
|
+
# If string, perform case-insensitive match
|
|
89
|
+
if isinstance(value, str):
|
|
90
|
+
value_lower = value.lower()
|
|
91
|
+
for name, val in cls.__dict__.items():
|
|
92
|
+
if not name.startswith("_") and (
|
|
93
|
+
name.lower() == value_lower or str(val).lower() == value_lower
|
|
94
|
+
):
|
|
95
|
+
return val
|
|
96
|
+
|
|
97
|
+
# Fallback to default
|
|
98
|
+
return default
|
|
@@ -0,0 +1,113 @@
|
|
|
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 OAuthToken(object):
|
|
11
|
+
"""Implementation of the 'OAuthToken' model.
|
|
12
|
+
|
|
13
|
+
OAuth 2 Authorization endpoint response
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
access_token (str): Access token
|
|
17
|
+
token_type (str): Type of access token
|
|
18
|
+
expires_in (int): Time in seconds before the access token expires
|
|
19
|
+
scope (str): List of scopes granted This is a space-delimited list of strings.
|
|
20
|
+
expiry (int): Time of token expiry as unix timestamp (UTC)
|
|
21
|
+
refresh_token (str): Refresh token Used to get a new access token when it
|
|
22
|
+
expires.
|
|
23
|
+
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
# Create a mapping from Model property names to API property names
|
|
27
|
+
_names = {
|
|
28
|
+
"access_token": "access_token",
|
|
29
|
+
"token_type": "token_type",
|
|
30
|
+
"expires_in": "expires_in",
|
|
31
|
+
"scope": "scope",
|
|
32
|
+
"expiry": "expiry",
|
|
33
|
+
"refresh_token": "refresh_token",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_optionals = [
|
|
37
|
+
"expires_in",
|
|
38
|
+
"scope",
|
|
39
|
+
"expiry",
|
|
40
|
+
"refresh_token",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
def __init__(
|
|
44
|
+
self,
|
|
45
|
+
access_token=None,
|
|
46
|
+
token_type=None,
|
|
47
|
+
expires_in=APIHelper.SKIP,
|
|
48
|
+
scope=APIHelper.SKIP,
|
|
49
|
+
expiry=APIHelper.SKIP,
|
|
50
|
+
refresh_token=APIHelper.SKIP):
|
|
51
|
+
"""Initialize a OAuthToken instance."""
|
|
52
|
+
# Initialize members of the class
|
|
53
|
+
self.access_token = access_token
|
|
54
|
+
self.token_type = token_type
|
|
55
|
+
if expires_in is not APIHelper.SKIP:
|
|
56
|
+
self.expires_in = expires_in
|
|
57
|
+
if scope is not APIHelper.SKIP:
|
|
58
|
+
self.scope = scope
|
|
59
|
+
if expiry is not APIHelper.SKIP:
|
|
60
|
+
self.expiry = expiry
|
|
61
|
+
if refresh_token is not APIHelper.SKIP:
|
|
62
|
+
self.refresh_token = refresh_token
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_dictionary(cls,
|
|
66
|
+
dictionary):
|
|
67
|
+
"""Create an instance of this model from a dictionary
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
71
|
+
as obtained from the deserialization of the server's response. The
|
|
72
|
+
keys MUST match property names in the API description.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
object: An instance of this structure class.
|
|
76
|
+
|
|
77
|
+
"""
|
|
78
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
# Extract variables from the dictionary
|
|
82
|
+
access_token =\
|
|
83
|
+
dictionary.get("access_token")\
|
|
84
|
+
if dictionary.get("access_token")\
|
|
85
|
+
else None
|
|
86
|
+
token_type =\
|
|
87
|
+
dictionary.get("token_type")\
|
|
88
|
+
if dictionary.get("token_type")\
|
|
89
|
+
else None
|
|
90
|
+
expires_in =\
|
|
91
|
+
dictionary.get("expires_in")\
|
|
92
|
+
if dictionary.get("expires_in")\
|
|
93
|
+
else APIHelper.SKIP
|
|
94
|
+
scope =\
|
|
95
|
+
dictionary.get("scope")\
|
|
96
|
+
if dictionary.get("scope")\
|
|
97
|
+
else APIHelper.SKIP
|
|
98
|
+
expiry =\
|
|
99
|
+
dictionary.get("expiry")\
|
|
100
|
+
if dictionary.get("expiry")\
|
|
101
|
+
else APIHelper.SKIP
|
|
102
|
+
refresh_token =\
|
|
103
|
+
dictionary.get("refresh_token")\
|
|
104
|
+
if dictionary.get("refresh_token")\
|
|
105
|
+
else APIHelper.SKIP
|
|
106
|
+
|
|
107
|
+
# Return an object of this model
|
|
108
|
+
return cls(access_token,
|
|
109
|
+
token_type,
|
|
110
|
+
expires_in,
|
|
111
|
+
scope,
|
|
112
|
+
expiry,
|
|
113
|
+
refresh_token)
|
|
@@ -0,0 +1,75 @@
|
|
|
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.paging_simplified_album_object import (
|
|
8
|
+
PagingSimplifiedAlbumObject,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PagedAlbums(object):
|
|
13
|
+
"""Implementation of the 'PagedAlbums' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
albums (PagingSimplifiedAlbumObject): The model property of type
|
|
17
|
+
PagingSimplifiedAlbumObject.
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
# Create a mapping from Model property names to API property names
|
|
22
|
+
_names = {
|
|
23
|
+
"albums": "albums",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
def __init__(
|
|
27
|
+
self,
|
|
28
|
+
albums=None):
|
|
29
|
+
"""Initialize a PagedAlbums instance."""
|
|
30
|
+
# Initialize members of the class
|
|
31
|
+
self.albums = albums
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_dictionary(cls,
|
|
35
|
+
dictionary):
|
|
36
|
+
"""Create an instance of this model from a dictionary
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
40
|
+
as obtained from the deserialization of the server's response. The
|
|
41
|
+
keys MUST match property names in the API description.
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
object: An instance of this structure class.
|
|
45
|
+
|
|
46
|
+
"""
|
|
47
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
# Extract variables from the dictionary
|
|
51
|
+
albums =\
|
|
52
|
+
PagingSimplifiedAlbumObject.from_dictionary(
|
|
53
|
+
dictionary.get("albums"))\
|
|
54
|
+
if dictionary.get("albums") else None
|
|
55
|
+
|
|
56
|
+
# Return an object of this model
|
|
57
|
+
return cls(albums)
|
|
58
|
+
|
|
59
|
+
def __repr__(self):
|
|
60
|
+
"""Return a unambiguous string representation."""
|
|
61
|
+
_albums=self.albums
|
|
62
|
+
return (
|
|
63
|
+
f"{self.__class__.__name__}("
|
|
64
|
+
f"albums={_albums!r}, "
|
|
65
|
+
f")"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
def __str__(self):
|
|
69
|
+
"""Return a human-readable string representation."""
|
|
70
|
+
_albums=self.albums
|
|
71
|
+
return (
|
|
72
|
+
f"{self.__class__.__name__}("
|
|
73
|
+
f"albums={_albums!s}, "
|
|
74
|
+
f")"
|
|
75
|
+
)
|
|
@@ -0,0 +1,74 @@
|
|
|
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.categories import (
|
|
8
|
+
Categories,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PagedCategories(object):
|
|
13
|
+
"""Implementation of the 'PagedCategories' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
categories (Categories): The model property of type Categories.
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
# Create a mapping from Model property names to API property names
|
|
21
|
+
_names = {
|
|
22
|
+
"categories": "categories",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def __init__(
|
|
26
|
+
self,
|
|
27
|
+
categories=None):
|
|
28
|
+
"""Initialize a PagedCategories instance."""
|
|
29
|
+
# Initialize members of the class
|
|
30
|
+
self.categories = categories
|
|
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
|
+
categories =\
|
|
51
|
+
Categories.from_dictionary(
|
|
52
|
+
dictionary.get("categories"))\
|
|
53
|
+
if dictionary.get("categories") else None
|
|
54
|
+
|
|
55
|
+
# Return an object of this model
|
|
56
|
+
return cls(categories)
|
|
57
|
+
|
|
58
|
+
def __repr__(self):
|
|
59
|
+
"""Return a unambiguous string representation."""
|
|
60
|
+
_categories=self.categories
|
|
61
|
+
return (
|
|
62
|
+
f"{self.__class__.__name__}("
|
|
63
|
+
f"categories={_categories!r}, "
|
|
64
|
+
f")"
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
def __str__(self):
|
|
68
|
+
"""Return a human-readable string representation."""
|
|
69
|
+
_categories=self.categories
|
|
70
|
+
return (
|
|
71
|
+
f"{self.__class__.__name__}("
|
|
72
|
+
f"categories={_categories!s}, "
|
|
73
|
+
f")"
|
|
74
|
+
)
|
|
@@ -0,0 +1,163 @@
|
|
|
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.artist_discography_album_object import (
|
|
8
|
+
ArtistDiscographyAlbumObject,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PagingArtistDiscographyAlbumObject(object):
|
|
13
|
+
"""Implementation of the 'PagingArtistDiscographyAlbumObject' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
href (str): A link to the Web API endpoint returning the full result of the
|
|
17
|
+
request
|
|
18
|
+
limit (int): The maximum number of items in the response (as set in the query
|
|
19
|
+
or by default).
|
|
20
|
+
next (str): URL to the next page of items. ( `null` if none)
|
|
21
|
+
offset (int): The offset of the items returned (as set in the query or by
|
|
22
|
+
default)
|
|
23
|
+
previous (str): URL to the previous page of items. ( `null` if none)
|
|
24
|
+
total (int): The total number of items available to return.
|
|
25
|
+
items (List[ArtistDiscographyAlbumObject]): The model property of type
|
|
26
|
+
List[ArtistDiscographyAlbumObject].
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
# Create a mapping from Model property names to API property names
|
|
31
|
+
_names = {
|
|
32
|
+
"href": "href",
|
|
33
|
+
"limit": "limit",
|
|
34
|
+
"next": "next",
|
|
35
|
+
"offset": "offset",
|
|
36
|
+
"previous": "previous",
|
|
37
|
+
"total": "total",
|
|
38
|
+
"items": "items",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_nullables = [
|
|
42
|
+
"next",
|
|
43
|
+
"previous",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
href=None,
|
|
49
|
+
limit=None,
|
|
50
|
+
next=None,
|
|
51
|
+
offset=None,
|
|
52
|
+
previous=None,
|
|
53
|
+
total=None,
|
|
54
|
+
items=None):
|
|
55
|
+
"""Initialize a PagingArtistDiscographyAlbumObject instance."""
|
|
56
|
+
# Initialize members of the class
|
|
57
|
+
self.href = href
|
|
58
|
+
self.limit = limit
|
|
59
|
+
self.next = next
|
|
60
|
+
self.offset = offset
|
|
61
|
+
self.previous = previous
|
|
62
|
+
self.total = total
|
|
63
|
+
self.items = items
|
|
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
|
+
href =\
|
|
84
|
+
dictionary.get("href")\
|
|
85
|
+
if dictionary.get("href")\
|
|
86
|
+
else None
|
|
87
|
+
limit =\
|
|
88
|
+
dictionary.get("limit")\
|
|
89
|
+
if dictionary.get("limit")\
|
|
90
|
+
else None
|
|
91
|
+
next =\
|
|
92
|
+
dictionary.get("next")\
|
|
93
|
+
if dictionary.get("next")\
|
|
94
|
+
else None
|
|
95
|
+
offset =\
|
|
96
|
+
dictionary.get("offset")\
|
|
97
|
+
if dictionary.get("offset")\
|
|
98
|
+
else None
|
|
99
|
+
previous =\
|
|
100
|
+
dictionary.get("previous")\
|
|
101
|
+
if dictionary.get("previous")\
|
|
102
|
+
else None
|
|
103
|
+
total =\
|
|
104
|
+
dictionary.get("total")\
|
|
105
|
+
if dictionary.get("total")\
|
|
106
|
+
else None
|
|
107
|
+
items = None
|
|
108
|
+
if dictionary.get("items") is not None:
|
|
109
|
+
items = [
|
|
110
|
+
ArtistDiscographyAlbumObject.from_dictionary(x)
|
|
111
|
+
for x in dictionary.get("items")
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
# Return an object of this model
|
|
115
|
+
return cls(href,
|
|
116
|
+
limit,
|
|
117
|
+
next,
|
|
118
|
+
offset,
|
|
119
|
+
previous,
|
|
120
|
+
total,
|
|
121
|
+
items)
|
|
122
|
+
|
|
123
|
+
def __repr__(self):
|
|
124
|
+
"""Return a unambiguous string representation."""
|
|
125
|
+
_href=self.href
|
|
126
|
+
_limit=self.limit
|
|
127
|
+
_next=self.next
|
|
128
|
+
_offset=self.offset
|
|
129
|
+
_previous=self.previous
|
|
130
|
+
_total=self.total
|
|
131
|
+
_items=self.items
|
|
132
|
+
return (
|
|
133
|
+
f"{self.__class__.__name__}("
|
|
134
|
+
f"href={_href!r}, "
|
|
135
|
+
f"limit={_limit!r}, "
|
|
136
|
+
f"next={_next!r}, "
|
|
137
|
+
f"offset={_offset!r}, "
|
|
138
|
+
f"previous={_previous!r}, "
|
|
139
|
+
f"total={_total!r}, "
|
|
140
|
+
f"items={_items!r}, "
|
|
141
|
+
f")"
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
def __str__(self):
|
|
145
|
+
"""Return a human-readable string representation."""
|
|
146
|
+
_href=self.href
|
|
147
|
+
_limit=self.limit
|
|
148
|
+
_next=self.next
|
|
149
|
+
_offset=self.offset
|
|
150
|
+
_previous=self.previous
|
|
151
|
+
_total=self.total
|
|
152
|
+
_items=self.items
|
|
153
|
+
return (
|
|
154
|
+
f"{self.__class__.__name__}("
|
|
155
|
+
f"href={_href!s}, "
|
|
156
|
+
f"limit={_limit!s}, "
|
|
157
|
+
f"next={_next!s}, "
|
|
158
|
+
f"offset={_offset!s}, "
|
|
159
|
+
f"previous={_previous!s}, "
|
|
160
|
+
f"total={_total!s}, "
|
|
161
|
+
f"items={_items!s}, "
|
|
162
|
+
f")"
|
|
163
|
+
)
|