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,108 @@
|
|
|
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 CursorObject(object):
|
|
11
|
+
"""Implementation of the 'CursorObject' model.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
after (str): The cursor to use as key to find the next page of items.
|
|
15
|
+
before (str): The cursor to use as key to find the previous page of items.
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
# Create a mapping from Model property names to API property names
|
|
20
|
+
_names = {
|
|
21
|
+
"after": "after",
|
|
22
|
+
"before": "before",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_optionals = [
|
|
26
|
+
"after",
|
|
27
|
+
"before",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
def __init__(
|
|
31
|
+
self,
|
|
32
|
+
after=APIHelper.SKIP,
|
|
33
|
+
before=APIHelper.SKIP):
|
|
34
|
+
"""Initialize a CursorObject instance."""
|
|
35
|
+
# Initialize members of the class
|
|
36
|
+
if after is not APIHelper.SKIP:
|
|
37
|
+
self.after = after
|
|
38
|
+
if before is not APIHelper.SKIP:
|
|
39
|
+
self.before = before
|
|
40
|
+
|
|
41
|
+
@classmethod
|
|
42
|
+
def from_dictionary(cls,
|
|
43
|
+
dictionary):
|
|
44
|
+
"""Create an instance of this model from a dictionary
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
48
|
+
as obtained from the deserialization of the server's response. The
|
|
49
|
+
keys MUST match property names in the API description.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
object: An instance of this structure class.
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
56
|
+
return None
|
|
57
|
+
|
|
58
|
+
# Extract variables from the dictionary
|
|
59
|
+
after =\
|
|
60
|
+
dictionary.get("after")\
|
|
61
|
+
if dictionary.get("after")\
|
|
62
|
+
else APIHelper.SKIP
|
|
63
|
+
before =\
|
|
64
|
+
dictionary.get("before")\
|
|
65
|
+
if dictionary.get("before")\
|
|
66
|
+
else APIHelper.SKIP
|
|
67
|
+
|
|
68
|
+
# Return an object of this model
|
|
69
|
+
return cls(after,
|
|
70
|
+
before)
|
|
71
|
+
|
|
72
|
+
def __repr__(self):
|
|
73
|
+
"""Return a unambiguous string representation."""
|
|
74
|
+
_after=(
|
|
75
|
+
self.after
|
|
76
|
+
if hasattr(self, "after")
|
|
77
|
+
else None
|
|
78
|
+
)
|
|
79
|
+
_before=(
|
|
80
|
+
self.before
|
|
81
|
+
if hasattr(self, "before")
|
|
82
|
+
else None
|
|
83
|
+
)
|
|
84
|
+
return (
|
|
85
|
+
f"{self.__class__.__name__}("
|
|
86
|
+
f"after={_after!r}, "
|
|
87
|
+
f"before={_before!r}, "
|
|
88
|
+
f")"
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
def __str__(self):
|
|
92
|
+
"""Return a human-readable string representation."""
|
|
93
|
+
_after=(
|
|
94
|
+
self.after
|
|
95
|
+
if hasattr(self, "after")
|
|
96
|
+
else None
|
|
97
|
+
)
|
|
98
|
+
_before=(
|
|
99
|
+
self.before
|
|
100
|
+
if hasattr(self, "before")
|
|
101
|
+
else None
|
|
102
|
+
)
|
|
103
|
+
return (
|
|
104
|
+
f"{self.__class__.__name__}("
|
|
105
|
+
f"after={_after!s}, "
|
|
106
|
+
f"before={_before!s}, "
|
|
107
|
+
f")"
|
|
108
|
+
)
|
|
@@ -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.cursor_paging_simplified_artist_object import (
|
|
8
|
+
CursorPagingSimplifiedArtistObject,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CursorPagedArtists(object):
|
|
13
|
+
"""Implementation of the 'CursorPagedArtists' model.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
artists (CursorPagingSimplifiedArtistObject): The model property of type
|
|
17
|
+
CursorPagingSimplifiedArtistObject.
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
# Create a mapping from Model property names to API property names
|
|
22
|
+
_names = {
|
|
23
|
+
"artists": "artists",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
def __init__(
|
|
27
|
+
self,
|
|
28
|
+
artists=None):
|
|
29
|
+
"""Initialize a CursorPagedArtists instance."""
|
|
30
|
+
# Initialize members of the class
|
|
31
|
+
self.artists = artists
|
|
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
|
+
artists =\
|
|
52
|
+
CursorPagingSimplifiedArtistObject.from_dictionary(
|
|
53
|
+
dictionary.get("artists"))\
|
|
54
|
+
if dictionary.get("artists") else None
|
|
55
|
+
|
|
56
|
+
# Return an object of this model
|
|
57
|
+
return cls(artists)
|
|
58
|
+
|
|
59
|
+
def __repr__(self):
|
|
60
|
+
"""Return a unambiguous string representation."""
|
|
61
|
+
_artists=self.artists
|
|
62
|
+
return (
|
|
63
|
+
f"{self.__class__.__name__}("
|
|
64
|
+
f"artists={_artists!r}, "
|
|
65
|
+
f")"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
def __str__(self):
|
|
69
|
+
"""Return a human-readable string representation."""
|
|
70
|
+
_artists=self.artists
|
|
71
|
+
return (
|
|
72
|
+
f"{self.__class__.__name__}("
|
|
73
|
+
f"artists={_artists!s}, "
|
|
74
|
+
f")"
|
|
75
|
+
)
|
|
@@ -0,0 +1,183 @@
|
|
|
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.cursor_object import (
|
|
9
|
+
CursorObject,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CursorPagingObject(object):
|
|
14
|
+
"""Implementation of the 'CursorPagingObject' model.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
href (str): A link to the Web API endpoint returning the full result of the
|
|
18
|
+
request.
|
|
19
|
+
limit (int): The maximum number of items in the response (as set in the query
|
|
20
|
+
or by default).
|
|
21
|
+
next (str): URL to the next page of items. ( `null` if none)
|
|
22
|
+
cursors (CursorObject): The cursors used to find the next set of items.
|
|
23
|
+
total (int): The total number of items available to return.
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
# Create a mapping from Model property names to API property names
|
|
28
|
+
_names = {
|
|
29
|
+
"href": "href",
|
|
30
|
+
"limit": "limit",
|
|
31
|
+
"next": "next",
|
|
32
|
+
"cursors": "cursors",
|
|
33
|
+
"total": "total",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_optionals = [
|
|
37
|
+
"href",
|
|
38
|
+
"limit",
|
|
39
|
+
"next",
|
|
40
|
+
"cursors",
|
|
41
|
+
"total",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
def __init__(
|
|
45
|
+
self,
|
|
46
|
+
href=APIHelper.SKIP,
|
|
47
|
+
limit=APIHelper.SKIP,
|
|
48
|
+
next=APIHelper.SKIP,
|
|
49
|
+
cursors=APIHelper.SKIP,
|
|
50
|
+
total=APIHelper.SKIP):
|
|
51
|
+
"""Initialize a CursorPagingObject instance."""
|
|
52
|
+
# Initialize members of the class
|
|
53
|
+
if href is not APIHelper.SKIP:
|
|
54
|
+
self.href = href
|
|
55
|
+
if limit is not APIHelper.SKIP:
|
|
56
|
+
self.limit = limit
|
|
57
|
+
if next is not APIHelper.SKIP:
|
|
58
|
+
self.next = next
|
|
59
|
+
if cursors is not APIHelper.SKIP:
|
|
60
|
+
self.cursors = cursors
|
|
61
|
+
if total is not APIHelper.SKIP:
|
|
62
|
+
self.total = total
|
|
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
|
+
href =\
|
|
83
|
+
dictionary.get("href")\
|
|
84
|
+
if dictionary.get("href")\
|
|
85
|
+
else APIHelper.SKIP
|
|
86
|
+
limit =\
|
|
87
|
+
dictionary.get("limit")\
|
|
88
|
+
if dictionary.get("limit")\
|
|
89
|
+
else APIHelper.SKIP
|
|
90
|
+
next =\
|
|
91
|
+
dictionary.get("next")\
|
|
92
|
+
if dictionary.get("next")\
|
|
93
|
+
else APIHelper.SKIP
|
|
94
|
+
cursors =\
|
|
95
|
+
CursorObject.from_dictionary(
|
|
96
|
+
dictionary.get("cursors"))\
|
|
97
|
+
if "cursors" in dictionary.keys()\
|
|
98
|
+
else APIHelper.SKIP
|
|
99
|
+
total =\
|
|
100
|
+
dictionary.get("total")\
|
|
101
|
+
if dictionary.get("total")\
|
|
102
|
+
else APIHelper.SKIP
|
|
103
|
+
|
|
104
|
+
# Return an object of this model
|
|
105
|
+
return cls(href,
|
|
106
|
+
limit,
|
|
107
|
+
next,
|
|
108
|
+
cursors,
|
|
109
|
+
total)
|
|
110
|
+
|
|
111
|
+
def __repr__(self):
|
|
112
|
+
"""Return a unambiguous string representation."""
|
|
113
|
+
_href=(
|
|
114
|
+
self.href
|
|
115
|
+
if hasattr(self, "href")
|
|
116
|
+
else None
|
|
117
|
+
)
|
|
118
|
+
_limit=(
|
|
119
|
+
self.limit
|
|
120
|
+
if hasattr(self, "limit")
|
|
121
|
+
else None
|
|
122
|
+
)
|
|
123
|
+
_next=(
|
|
124
|
+
self.next
|
|
125
|
+
if hasattr(self, "next")
|
|
126
|
+
else None
|
|
127
|
+
)
|
|
128
|
+
_cursors=(
|
|
129
|
+
self.cursors
|
|
130
|
+
if hasattr(self, "cursors")
|
|
131
|
+
else None
|
|
132
|
+
)
|
|
133
|
+
_total=(
|
|
134
|
+
self.total
|
|
135
|
+
if hasattr(self, "total")
|
|
136
|
+
else None
|
|
137
|
+
)
|
|
138
|
+
return (
|
|
139
|
+
f"{self.__class__.__name__}("
|
|
140
|
+
f"href={_href!r}, "
|
|
141
|
+
f"limit={_limit!r}, "
|
|
142
|
+
f"next={_next!r}, "
|
|
143
|
+
f"cursors={_cursors!r}, "
|
|
144
|
+
f"total={_total!r}, "
|
|
145
|
+
f")"
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
def __str__(self):
|
|
149
|
+
"""Return a human-readable string representation."""
|
|
150
|
+
_href=(
|
|
151
|
+
self.href
|
|
152
|
+
if hasattr(self, "href")
|
|
153
|
+
else None
|
|
154
|
+
)
|
|
155
|
+
_limit=(
|
|
156
|
+
self.limit
|
|
157
|
+
if hasattr(self, "limit")
|
|
158
|
+
else None
|
|
159
|
+
)
|
|
160
|
+
_next=(
|
|
161
|
+
self.next
|
|
162
|
+
if hasattr(self, "next")
|
|
163
|
+
else None
|
|
164
|
+
)
|
|
165
|
+
_cursors=(
|
|
166
|
+
self.cursors
|
|
167
|
+
if hasattr(self, "cursors")
|
|
168
|
+
else None
|
|
169
|
+
)
|
|
170
|
+
_total=(
|
|
171
|
+
self.total
|
|
172
|
+
if hasattr(self, "total")
|
|
173
|
+
else None
|
|
174
|
+
)
|
|
175
|
+
return (
|
|
176
|
+
f"{self.__class__.__name__}("
|
|
177
|
+
f"href={_href!s}, "
|
|
178
|
+
f"limit={_limit!s}, "
|
|
179
|
+
f"next={_next!s}, "
|
|
180
|
+
f"cursors={_cursors!s}, "
|
|
181
|
+
f"total={_total!s}, "
|
|
182
|
+
f")"
|
|
183
|
+
)
|
|
@@ -0,0 +1,214 @@
|
|
|
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.cursor_object import (
|
|
9
|
+
CursorObject,
|
|
10
|
+
)
|
|
11
|
+
from spotifywebapi.models.play_history_object import (
|
|
12
|
+
PlayHistoryObject,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class CursorPagingPlayHistoryObject(object):
|
|
17
|
+
"""Implementation of the 'CursorPagingPlayHistoryObject' model.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
href (str): A link to the Web API endpoint returning the full result of the
|
|
21
|
+
request.
|
|
22
|
+
limit (int): The maximum number of items in the response (as set in the query
|
|
23
|
+
or by default).
|
|
24
|
+
next (str): URL to the next page of items. ( `null` if none)
|
|
25
|
+
cursors (CursorObject): The cursors used to find the next set of items.
|
|
26
|
+
total (int): The total number of items available to return.
|
|
27
|
+
items (List[PlayHistoryObject]): The model property of type
|
|
28
|
+
List[PlayHistoryObject].
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
# Create a mapping from Model property names to API property names
|
|
33
|
+
_names = {
|
|
34
|
+
"href": "href",
|
|
35
|
+
"limit": "limit",
|
|
36
|
+
"next": "next",
|
|
37
|
+
"cursors": "cursors",
|
|
38
|
+
"total": "total",
|
|
39
|
+
"items": "items",
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
_optionals = [
|
|
43
|
+
"href",
|
|
44
|
+
"limit",
|
|
45
|
+
"next",
|
|
46
|
+
"cursors",
|
|
47
|
+
"total",
|
|
48
|
+
"items",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
def __init__(
|
|
52
|
+
self,
|
|
53
|
+
href=APIHelper.SKIP,
|
|
54
|
+
limit=APIHelper.SKIP,
|
|
55
|
+
next=APIHelper.SKIP,
|
|
56
|
+
cursors=APIHelper.SKIP,
|
|
57
|
+
total=APIHelper.SKIP,
|
|
58
|
+
items=APIHelper.SKIP):
|
|
59
|
+
"""Initialize a CursorPagingPlayHistoryObject instance."""
|
|
60
|
+
# Initialize members of the class
|
|
61
|
+
if href is not APIHelper.SKIP:
|
|
62
|
+
self.href = href
|
|
63
|
+
if limit is not APIHelper.SKIP:
|
|
64
|
+
self.limit = limit
|
|
65
|
+
if next is not APIHelper.SKIP:
|
|
66
|
+
self.next = next
|
|
67
|
+
if cursors is not APIHelper.SKIP:
|
|
68
|
+
self.cursors = cursors
|
|
69
|
+
if total is not APIHelper.SKIP:
|
|
70
|
+
self.total = total
|
|
71
|
+
if items is not APIHelper.SKIP:
|
|
72
|
+
self.items = items
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dictionary(cls,
|
|
76
|
+
dictionary):
|
|
77
|
+
"""Create an instance of this model from a dictionary
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
81
|
+
as obtained from the deserialization of the server's response. The
|
|
82
|
+
keys MUST match property names in the API description.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
object: An instance of this structure class.
|
|
86
|
+
|
|
87
|
+
"""
|
|
88
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
# Extract variables from the dictionary
|
|
92
|
+
href =\
|
|
93
|
+
dictionary.get("href")\
|
|
94
|
+
if dictionary.get("href")\
|
|
95
|
+
else APIHelper.SKIP
|
|
96
|
+
limit =\
|
|
97
|
+
dictionary.get("limit")\
|
|
98
|
+
if dictionary.get("limit")\
|
|
99
|
+
else APIHelper.SKIP
|
|
100
|
+
next =\
|
|
101
|
+
dictionary.get("next")\
|
|
102
|
+
if dictionary.get("next")\
|
|
103
|
+
else APIHelper.SKIP
|
|
104
|
+
cursors =\
|
|
105
|
+
CursorObject.from_dictionary(
|
|
106
|
+
dictionary.get("cursors"))\
|
|
107
|
+
if "cursors" in dictionary.keys()\
|
|
108
|
+
else APIHelper.SKIP
|
|
109
|
+
total =\
|
|
110
|
+
dictionary.get("total")\
|
|
111
|
+
if dictionary.get("total")\
|
|
112
|
+
else APIHelper.SKIP
|
|
113
|
+
items = None
|
|
114
|
+
if dictionary.get("items") is not None:
|
|
115
|
+
items = [
|
|
116
|
+
PlayHistoryObject.from_dictionary(x)
|
|
117
|
+
for x in dictionary.get("items")
|
|
118
|
+
]
|
|
119
|
+
else:
|
|
120
|
+
items = APIHelper.SKIP
|
|
121
|
+
|
|
122
|
+
# Return an object of this model
|
|
123
|
+
return cls(href,
|
|
124
|
+
limit,
|
|
125
|
+
next,
|
|
126
|
+
cursors,
|
|
127
|
+
total,
|
|
128
|
+
items)
|
|
129
|
+
|
|
130
|
+
def __repr__(self):
|
|
131
|
+
"""Return a unambiguous string representation."""
|
|
132
|
+
_href=(
|
|
133
|
+
self.href
|
|
134
|
+
if hasattr(self, "href")
|
|
135
|
+
else None
|
|
136
|
+
)
|
|
137
|
+
_limit=(
|
|
138
|
+
self.limit
|
|
139
|
+
if hasattr(self, "limit")
|
|
140
|
+
else None
|
|
141
|
+
)
|
|
142
|
+
_next=(
|
|
143
|
+
self.next
|
|
144
|
+
if hasattr(self, "next")
|
|
145
|
+
else None
|
|
146
|
+
)
|
|
147
|
+
_cursors=(
|
|
148
|
+
self.cursors
|
|
149
|
+
if hasattr(self, "cursors")
|
|
150
|
+
else None
|
|
151
|
+
)
|
|
152
|
+
_total=(
|
|
153
|
+
self.total
|
|
154
|
+
if hasattr(self, "total")
|
|
155
|
+
else None
|
|
156
|
+
)
|
|
157
|
+
_items=(
|
|
158
|
+
self.items
|
|
159
|
+
if hasattr(self, "items")
|
|
160
|
+
else None
|
|
161
|
+
)
|
|
162
|
+
return (
|
|
163
|
+
f"{self.__class__.__name__}("
|
|
164
|
+
f"href={_href!r}, "
|
|
165
|
+
f"limit={_limit!r}, "
|
|
166
|
+
f"next={_next!r}, "
|
|
167
|
+
f"cursors={_cursors!r}, "
|
|
168
|
+
f"total={_total!r}, "
|
|
169
|
+
f"items={_items!r}, "
|
|
170
|
+
f")"
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
def __str__(self):
|
|
174
|
+
"""Return a human-readable string representation."""
|
|
175
|
+
_href=(
|
|
176
|
+
self.href
|
|
177
|
+
if hasattr(self, "href")
|
|
178
|
+
else None
|
|
179
|
+
)
|
|
180
|
+
_limit=(
|
|
181
|
+
self.limit
|
|
182
|
+
if hasattr(self, "limit")
|
|
183
|
+
else None
|
|
184
|
+
)
|
|
185
|
+
_next=(
|
|
186
|
+
self.next
|
|
187
|
+
if hasattr(self, "next")
|
|
188
|
+
else None
|
|
189
|
+
)
|
|
190
|
+
_cursors=(
|
|
191
|
+
self.cursors
|
|
192
|
+
if hasattr(self, "cursors")
|
|
193
|
+
else None
|
|
194
|
+
)
|
|
195
|
+
_total=(
|
|
196
|
+
self.total
|
|
197
|
+
if hasattr(self, "total")
|
|
198
|
+
else None
|
|
199
|
+
)
|
|
200
|
+
_items=(
|
|
201
|
+
self.items
|
|
202
|
+
if hasattr(self, "items")
|
|
203
|
+
else None
|
|
204
|
+
)
|
|
205
|
+
return (
|
|
206
|
+
f"{self.__class__.__name__}("
|
|
207
|
+
f"href={_href!s}, "
|
|
208
|
+
f"limit={_limit!s}, "
|
|
209
|
+
f"next={_next!s}, "
|
|
210
|
+
f"cursors={_cursors!s}, "
|
|
211
|
+
f"total={_total!s}, "
|
|
212
|
+
f"items={_items!s}, "
|
|
213
|
+
f")"
|
|
214
|
+
)
|