spotifywebapiPython 1.0.242__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.
- spotifywebapipython/__init__.py +35 -0
- spotifywebapipython/const.py +114 -0
- spotifywebapipython/docs/__init__.html +2156 -0
- spotifywebapipython/docs/codecopy.js +70 -0
- spotifywebapipython/docs/index.html +514 -0
- spotifywebapipython/docs/search.js +46 -0
- spotifywebapipython/docs/spotifywebapipython/const.html +636 -0
- spotifywebapipython/docs/spotifywebapipython/saappmessages.html +540 -0
- spotifywebapipython/docs/spotifywebapipython/sautils.html +620 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +341 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +598 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +612 -0
- spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +16557 -0
- spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +518 -0
- spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +421 -0
- spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +400 -0
- spotifywebapipython/docs/spotifywebapipython/spotifywebplayertoken.html +635 -0
- spotifywebapipython/docs/spotifywebapipython.ico +0 -0
- spotifywebapipython/docs/spotifywebapipython_OLD.ico +0 -0
- spotifywebapipython/models/__init__.py +121 -0
- spotifywebapipython/models/album.py +170 -0
- spotifywebapipython/models/albumpagesaved.py +85 -0
- spotifywebapipython/models/albumpagesimplified.py +88 -0
- spotifywebapipython/models/albumsaved.py +102 -0
- spotifywebapipython/models/albumsimplified.py +308 -0
- spotifywebapipython/models/artist.py +146 -0
- spotifywebapipython/models/artistinfo.py +282 -0
- spotifywebapipython/models/artistinfotourevent.py +127 -0
- spotifywebapipython/models/artistpage.py +70 -0
- spotifywebapipython/models/artistsimplified.py +163 -0
- spotifywebapipython/models/audiobook.py +87 -0
- spotifywebapipython/models/audiobookpagesimplified.py +88 -0
- spotifywebapipython/models/audiobooksimplified.py +362 -0
- spotifywebapipython/models/audiofeatures.py +333 -0
- spotifywebapipython/models/author.py +67 -0
- spotifywebapipython/models/category.py +168 -0
- spotifywebapipython/models/categorypage.py +70 -0
- spotifywebapipython/models/chapter.py +84 -0
- spotifywebapipython/models/chapterpagesimplified.py +88 -0
- spotifywebapipython/models/chaptersimplified.py +387 -0
- spotifywebapipython/models/context.py +113 -0
- spotifywebapipython/models/copyright.py +79 -0
- spotifywebapipython/models/device.py +301 -0
- spotifywebapipython/models/episode.py +84 -0
- spotifywebapipython/models/episodepagesaved.py +85 -0
- spotifywebapipython/models/episodepagesimplified.py +88 -0
- spotifywebapipython/models/episodesaved.py +99 -0
- spotifywebapipython/models/episodesimplified.py +370 -0
- spotifywebapipython/models/explicitcontent.py +80 -0
- spotifywebapipython/models/externalids.py +91 -0
- spotifywebapipython/models/externalurls.py +104 -0
- spotifywebapipython/models/followers.py +81 -0
- spotifywebapipython/models/imageobject.py +193 -0
- spotifywebapipython/models/imagevibrantcolors.py +182 -0
- spotifywebapipython/models/linkedfrom.py +165 -0
- spotifywebapipython/models/narrator.py +67 -0
- spotifywebapipython/models/owner.py +162 -0
- spotifywebapipython/models/pageobject.py +343 -0
- spotifywebapipython/models/playeractions.py +196 -0
- spotifywebapipython/models/playerlastplayedinfo.py +334 -0
- spotifywebapipython/models/playerplaystate.py +467 -0
- spotifywebapipython/models/playerqueueinfo.py +207 -0
- spotifywebapipython/models/playhistory.py +136 -0
- spotifywebapipython/models/playhistorypage.py +85 -0
- spotifywebapipython/models/playlist.py +125 -0
- spotifywebapipython/models/playlistpage.py +85 -0
- spotifywebapipython/models/playlistpagesimplified.py +107 -0
- spotifywebapipython/models/playlistsimplified.py +334 -0
- spotifywebapipython/models/playlisttrack.py +143 -0
- spotifywebapipython/models/playlisttracksummary.py +80 -0
- spotifywebapipython/models/recommendationseed.py +135 -0
- spotifywebapipython/models/restrictions.py +86 -0
- spotifywebapipython/models/resumepoint.py +79 -0
- spotifywebapipython/models/searchresponse.py +391 -0
- spotifywebapipython/models/searchresultbase.py +299 -0
- spotifywebapipython/models/show.py +87 -0
- spotifywebapipython/models/showpagesaved.py +85 -0
- spotifywebapipython/models/showpagesimplified.py +88 -0
- spotifywebapipython/models/showsaved.py +99 -0
- spotifywebapipython/models/showsimplified.py +320 -0
- spotifywebapipython/models/spotifyconnectdevice.py +321 -0
- spotifywebapipython/models/spotifyconnectdevices.py +441 -0
- spotifywebapipython/models/track.py +142 -0
- spotifywebapipython/models/trackpage.py +110 -0
- spotifywebapipython/models/trackpagesaved.py +85 -0
- spotifywebapipython/models/trackpagesimplified.py +88 -0
- spotifywebapipython/models/trackrecommendations.py +88 -0
- spotifywebapipython/models/tracksaved.py +99 -0
- spotifywebapipython/models/tracksimplified.py +398 -0
- spotifywebapipython/models/userprofile.py +184 -0
- spotifywebapipython/models/userprofilesimplified.py +206 -0
- spotifywebapipython/models/zeroconfdiscoveryresult.py +592 -0
- spotifywebapipython/models/zeroconfproperty.py +93 -0
- spotifywebapipython/oauthcli/__init__.py +7 -0
- spotifywebapipython/oauthcli/authclient.py +1229 -0
- spotifywebapipython/saappmessages.py +86 -0
- spotifywebapipython/sautils.py +285 -0
- spotifywebapipython/spotifyapierror.py +66 -0
- spotifywebapipython/spotifyapimessage.py +269 -0
- spotifywebapipython/spotifyauthtoken.py +264 -0
- spotifywebapipython/spotifyclient.py +17885 -0
- spotifywebapipython/spotifyconnect/__init__.py +19 -0
- spotifywebapipython/spotifyconnect/spotifyconnectdeviceeventargs.py +67 -0
- spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py +2564 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastapptask.py +467 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastcontroller.py +701 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastlistener.py +359 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfcastmultizonelistener.py +212 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconfexceptions.py +20 -0
- spotifywebapipython/spotifyconnect/spotifyconnectzeroconflistener.py +335 -0
- spotifywebapipython/spotifydiscovery.py +473 -0
- spotifywebapipython/spotifymediatypes.py +53 -0
- spotifywebapipython/spotifywebapiauthenticationerror.py +122 -0
- spotifywebapipython/spotifywebapierror.py +106 -0
- spotifywebapipython/spotifywebplayertoken.py +743 -0
- spotifywebapipython/vibrant/__init__.py +17 -0
- spotifywebapipython/vibrant/generator.py +261 -0
- spotifywebapipython/vibrant/image.py +100 -0
- spotifywebapipython/vibrant/main.py +34 -0
- spotifywebapipython/vibrant/models.py +93 -0
- spotifywebapipython/vibrant/utils.py +56 -0
- spotifywebapipython/zeroconfapi/__init__.py +23 -0
- spotifywebapipython/zeroconfapi/authenticationtypes.py +38 -0
- spotifywebapipython/zeroconfapi/blobbuilder.py +370 -0
- spotifywebapipython/zeroconfapi/credentials.py +37 -0
- spotifywebapipython/zeroconfapi/cryptodiffiehellman.py +89 -0
- spotifywebapipython/zeroconfapi/helpers.py +64 -0
- spotifywebapipython/zeroconfapi/spotifyzeroconfapierror.py +108 -0
- spotifywebapipython/zeroconfapi/zeroconfconnect.py +1327 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfo.py +572 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfoalias.py +109 -0
- spotifywebapipython/zeroconfapi/zeroconfgetinfodrmmediaformat.py +90 -0
- spotifywebapipython/zeroconfapi/zeroconfresponse.py +195 -0
- spotifywebapipython-1.0.242.dist-info/LICENSE +22 -0
- spotifywebapipython-1.0.242.dist-info/METADATA +219 -0
- spotifywebapipython-1.0.242.dist-info/RECORD +138 -0
- spotifywebapipython-1.0.242.dist-info/WHEEL +5 -0
- spotifywebapipython-1.0.242.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
|
|
6
|
+
@export
|
|
7
|
+
class Restrictions:
|
|
8
|
+
"""
|
|
9
|
+
Spotify Web API Content Restrictions object.
|
|
10
|
+
|
|
11
|
+
Contains information about content restrictions.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, root:dict=None) -> None:
|
|
15
|
+
"""
|
|
16
|
+
Initializes a new instance of the class.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
root (dict):
|
|
20
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
21
|
+
attributes; otherwise, None to not load attributes.
|
|
22
|
+
"""
|
|
23
|
+
self._Market:str = None
|
|
24
|
+
self._Reason:str = None
|
|
25
|
+
|
|
26
|
+
if (root is None):
|
|
27
|
+
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
else:
|
|
31
|
+
|
|
32
|
+
self._Market = root.get('market', None)
|
|
33
|
+
self._Reason = root.get('reason', None)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def __repr__(self) -> str:
|
|
37
|
+
return self.ToString()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def __str__(self) -> str:
|
|
41
|
+
return self.ToString()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def Market(self) -> str:
|
|
46
|
+
"""
|
|
47
|
+
The market for the restriction.
|
|
48
|
+
"""
|
|
49
|
+
return self._Market
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def Reason(self) -> str:
|
|
54
|
+
"""
|
|
55
|
+
The reason for the restriction. Supported values:
|
|
56
|
+
- market: The content item is not available in the given market.
|
|
57
|
+
- product: The content item is not available for the user's subscription type.
|
|
58
|
+
- explicit: The content item is explicit and the user's account is set to not play explicit content.
|
|
59
|
+
|
|
60
|
+
Additional reasons may be added in the future.
|
|
61
|
+
|
|
62
|
+
Note: If you use this field, make sure that your application safely handles unknown values.
|
|
63
|
+
"""
|
|
64
|
+
return self._Reason
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def ToDictionary(self) -> dict:
|
|
68
|
+
"""
|
|
69
|
+
Returns a dictionary representation of the class.
|
|
70
|
+
"""
|
|
71
|
+
result:dict = \
|
|
72
|
+
{
|
|
73
|
+
'reason': self._Reason,
|
|
74
|
+
'market': self._Market,
|
|
75
|
+
}
|
|
76
|
+
return result
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def ToString(self) -> str:
|
|
80
|
+
"""
|
|
81
|
+
Returns a displayable string representation of the class.
|
|
82
|
+
"""
|
|
83
|
+
msg:str = 'Restrictions:'
|
|
84
|
+
if self._Reason is not None: msg = '%s\n Reason="%s"' % (msg, str(self._Reason))
|
|
85
|
+
if self._Market is not None: msg = '%s\n Market="%s"' % (msg, str(self._Market))
|
|
86
|
+
return msg
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
|
|
6
|
+
@export
|
|
7
|
+
class ResumePoint:
|
|
8
|
+
"""
|
|
9
|
+
Spotify Web API Content ResumePoint object.
|
|
10
|
+
|
|
11
|
+
Contains information about the user's most recent position in the episode.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, root:dict=None) -> None:
|
|
15
|
+
"""
|
|
16
|
+
Initializes a new instance of the class.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
root (dict):
|
|
20
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
21
|
+
attributes; otherwise, None to not load attributes.
|
|
22
|
+
"""
|
|
23
|
+
self._FullyPlayed:bool = None
|
|
24
|
+
self._ResumePositionMS:int = None
|
|
25
|
+
|
|
26
|
+
if (root is None):
|
|
27
|
+
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
else:
|
|
31
|
+
|
|
32
|
+
self._FullyPlayed = root.get('fully_played', None)
|
|
33
|
+
self._ResumePositionMS = root.get('resume_position_ms', None)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def __repr__(self) -> str:
|
|
37
|
+
return self.ToString()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def __str__(self) -> str:
|
|
41
|
+
return self.ToString()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def FullyPlayed(self) -> bool:
|
|
46
|
+
"""
|
|
47
|
+
Whether or not the episode has been fully played by the user.
|
|
48
|
+
"""
|
|
49
|
+
return self._FullyPlayed
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def ResumePositionMS(self) -> int:
|
|
54
|
+
"""
|
|
55
|
+
The user's most recent position in the episode in milliseconds.
|
|
56
|
+
"""
|
|
57
|
+
return self._ResumePositionMS
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def ToDictionary(self) -> dict:
|
|
61
|
+
"""
|
|
62
|
+
Returns a dictionary representation of the class.
|
|
63
|
+
"""
|
|
64
|
+
result:dict = \
|
|
65
|
+
{
|
|
66
|
+
'fully_played': self._FullyPlayed,
|
|
67
|
+
'resume_position_ms': self._ResumePositionMS,
|
|
68
|
+
}
|
|
69
|
+
return result
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def ToString(self) -> str:
|
|
73
|
+
"""
|
|
74
|
+
Returns a displayable string representation of the class.
|
|
75
|
+
"""
|
|
76
|
+
msg:str = 'ResumePoint:'
|
|
77
|
+
if self._FullyPlayed is not None: msg = '%s\n FullyPlayed="%s"' % (msg, str(self._FullyPlayed))
|
|
78
|
+
if self._ResumePositionMS is not None: msg = '%s\n ResumePositionMS="%s"' % (msg, str(self._ResumePositionMS))
|
|
79
|
+
return msg
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
# external package imports.
|
|
2
|
+
|
|
3
|
+
# our package imports.
|
|
4
|
+
from ..sautils import export
|
|
5
|
+
from .albumpagesimplified import AlbumPageSimplified
|
|
6
|
+
from .artistpage import ArtistPage
|
|
7
|
+
from .audiobookpagesimplified import AudiobookPageSimplified
|
|
8
|
+
from .episodepagesimplified import EpisodePageSimplified
|
|
9
|
+
from .playlistpagesimplified import PlaylistPageSimplified
|
|
10
|
+
from .playlistsimplified import PlaylistSimplified
|
|
11
|
+
from .showpagesimplified import ShowPageSimplified
|
|
12
|
+
from .trackpage import TrackPage
|
|
13
|
+
|
|
14
|
+
@export
|
|
15
|
+
class SearchResponse:
|
|
16
|
+
"""
|
|
17
|
+
Spotify Web API SearchResponse object.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self,
|
|
21
|
+
searchCriteria:str,
|
|
22
|
+
searchCriteriaType:str,
|
|
23
|
+
root:dict=None
|
|
24
|
+
) -> None:
|
|
25
|
+
"""
|
|
26
|
+
Initializes a new instance of the class.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
searchCriteria (str):
|
|
30
|
+
Search query specified for the search.
|
|
31
|
+
searchCriteriaType (str):
|
|
32
|
+
A comma-separated list of item types that were searched.
|
|
33
|
+
root (dict):
|
|
34
|
+
Spotify Web API JSON response in dictionary format, used to load object
|
|
35
|
+
attributes; otherwise, None to not load attributes.
|
|
36
|
+
"""
|
|
37
|
+
self._Albums:AlbumPageSimplified = AlbumPageSimplified()
|
|
38
|
+
self._Artists:ArtistPage = ArtistPage()
|
|
39
|
+
self._Audiobooks:AudiobookPageSimplified = AudiobookPageSimplified()
|
|
40
|
+
self._Episodes:EpisodePageSimplified = EpisodePageSimplified()
|
|
41
|
+
self._Playlists:PlaylistPageSimplified = PlaylistPageSimplified()
|
|
42
|
+
self._SearchCriteria:str = searchCriteria
|
|
43
|
+
self._SearchCriteriaType:str = searchCriteriaType
|
|
44
|
+
self._Shows:ShowPageSimplified = ShowPageSimplified()
|
|
45
|
+
self._Tracks:TrackPage = TrackPage()
|
|
46
|
+
|
|
47
|
+
if (root is None):
|
|
48
|
+
|
|
49
|
+
pass
|
|
50
|
+
|
|
51
|
+
else:
|
|
52
|
+
|
|
53
|
+
# process all collections and objects.
|
|
54
|
+
item:dict = root.get('albums',None)
|
|
55
|
+
if item is not None:
|
|
56
|
+
self._Albums = AlbumPageSimplified(root=item)
|
|
57
|
+
|
|
58
|
+
item:dict = root.get('artists',None)
|
|
59
|
+
if item is not None:
|
|
60
|
+
self._Artists = ArtistPage(root=item)
|
|
61
|
+
|
|
62
|
+
item:dict = root.get('audiobooks',None)
|
|
63
|
+
if item is not None:
|
|
64
|
+
self._Audiobooks = AudiobookPageSimplified(root=item)
|
|
65
|
+
|
|
66
|
+
item:dict = root.get('episodes',None)
|
|
67
|
+
if item is not None:
|
|
68
|
+
self._Episodes = EpisodePageSimplified(root=item)
|
|
69
|
+
|
|
70
|
+
item:dict = root.get('playlists',None)
|
|
71
|
+
if item is not None:
|
|
72
|
+
self._Playlists = PlaylistPageSimplified(root=item)
|
|
73
|
+
|
|
74
|
+
item:dict = root.get('shows',None)
|
|
75
|
+
if item is not None:
|
|
76
|
+
self._Shows = ShowPageSimplified(root=item)
|
|
77
|
+
|
|
78
|
+
item:dict = root.get('tracks',None)
|
|
79
|
+
if item is not None:
|
|
80
|
+
self._Tracks = TrackPage(root=item)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def __repr__(self) -> str:
|
|
84
|
+
return self.ToString()
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def __str__(self) -> str:
|
|
88
|
+
return self.ToString()
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def AlbumsCount(self) -> int:
|
|
93
|
+
"""
|
|
94
|
+
The total number of album items returned in the `Tracks.Items` collection
|
|
95
|
+
"""
|
|
96
|
+
if self._Albums is not None:
|
|
97
|
+
return self._Albums.ItemsCount
|
|
98
|
+
return 0
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def Albums(self) -> AlbumPageSimplified:
|
|
103
|
+
"""
|
|
104
|
+
An `AlbumPageSimplified` object that allows for multiple pages of albums to be navigated.
|
|
105
|
+
"""
|
|
106
|
+
return self._Albums
|
|
107
|
+
|
|
108
|
+
@Albums.setter
|
|
109
|
+
def Albums(self, value:AlbumPageSimplified):
|
|
110
|
+
"""
|
|
111
|
+
Sets the Albums property value.
|
|
112
|
+
"""
|
|
113
|
+
if value is not None:
|
|
114
|
+
if isinstance(value, AlbumPageSimplified):
|
|
115
|
+
self._Albums = value
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
@property
|
|
119
|
+
def ArtistsCount(self) -> int:
|
|
120
|
+
"""
|
|
121
|
+
The total number of artist items returned in the `Tracks.Items` collection
|
|
122
|
+
"""
|
|
123
|
+
if self._Artists is not None:
|
|
124
|
+
return self._Artists.ItemsCount
|
|
125
|
+
return 0
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
def Artists(self) -> ArtistPage:
|
|
130
|
+
"""
|
|
131
|
+
An `ArtistPage` object that allows for multiple pages of artists to be navigated.
|
|
132
|
+
"""
|
|
133
|
+
return self._Artists
|
|
134
|
+
|
|
135
|
+
@Artists.setter
|
|
136
|
+
def Artists(self, value:str):
|
|
137
|
+
"""
|
|
138
|
+
Sets the Artists property value.
|
|
139
|
+
"""
|
|
140
|
+
if value is not None:
|
|
141
|
+
if isinstance(value, ArtistPage):
|
|
142
|
+
self._Artists = value
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
@property
|
|
146
|
+
def AudiobooksCount(self) -> int:
|
|
147
|
+
"""
|
|
148
|
+
The total number of audiobook items returned in the `Tracks.Items` collection
|
|
149
|
+
"""
|
|
150
|
+
if self._Audiobooks is not None:
|
|
151
|
+
return self._Audiobooks.ItemsCount
|
|
152
|
+
return 0
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
@property
|
|
156
|
+
def Audiobooks(self) -> AudiobookPageSimplified:
|
|
157
|
+
"""
|
|
158
|
+
An `AudiobookPageSimplified` object that allows for multiple pages of audiobooks to be navigated.
|
|
159
|
+
"""
|
|
160
|
+
return self._Audiobooks
|
|
161
|
+
|
|
162
|
+
@Audiobooks.setter
|
|
163
|
+
def Audiobooks(self, value:str):
|
|
164
|
+
"""
|
|
165
|
+
Sets the Audiobooks property value.
|
|
166
|
+
"""
|
|
167
|
+
if value is not None:
|
|
168
|
+
if isinstance(value, AudiobookPageSimplified):
|
|
169
|
+
self._Audiobooks = value
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
@property
|
|
173
|
+
def EpisodesCount(self) -> int:
|
|
174
|
+
"""
|
|
175
|
+
The total number of episode items returned in the `Tracks.Items` collection
|
|
176
|
+
"""
|
|
177
|
+
if self._Episodes is not None:
|
|
178
|
+
return self._Episodes.ItemsCount
|
|
179
|
+
return 0
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
@property
|
|
183
|
+
def Episodes(self) -> EpisodePageSimplified:
|
|
184
|
+
"""
|
|
185
|
+
An `EpisodePageSimplified` object that allows for multiple pages of episodes to be navigated.
|
|
186
|
+
"""
|
|
187
|
+
return self._Episodes
|
|
188
|
+
|
|
189
|
+
@Episodes.setter
|
|
190
|
+
def Episodes(self, value:str):
|
|
191
|
+
"""
|
|
192
|
+
Sets the Episodes property value.
|
|
193
|
+
"""
|
|
194
|
+
if value is not None:
|
|
195
|
+
if isinstance(value, EpisodePageSimplified):
|
|
196
|
+
self._Episodes = value
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
@property
|
|
200
|
+
def PlaylistsCount(self) -> int:
|
|
201
|
+
"""
|
|
202
|
+
The total number of playlist items returned in the `Tracks.Items` collection
|
|
203
|
+
"""
|
|
204
|
+
if self._Playlists is not None:
|
|
205
|
+
return self._Playlists.ItemsCount
|
|
206
|
+
return 0
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
@property
|
|
210
|
+
def Playlists(self) -> PlaylistPageSimplified:
|
|
211
|
+
"""
|
|
212
|
+
An `PlaylistPageSimplified` object that allows for multiple pages of playlists to be navigated.
|
|
213
|
+
"""
|
|
214
|
+
return self._Playlists
|
|
215
|
+
|
|
216
|
+
@Playlists.setter
|
|
217
|
+
def Playlists(self, value:str):
|
|
218
|
+
"""
|
|
219
|
+
Sets the Playlists property value.
|
|
220
|
+
"""
|
|
221
|
+
if value is not None:
|
|
222
|
+
if isinstance(value, PlaylistPageSimplified):
|
|
223
|
+
self._Playlists = value
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
@property
|
|
227
|
+
def SearchCriteria(self) -> str:
|
|
228
|
+
"""
|
|
229
|
+
The search query used to generate the response.
|
|
230
|
+
"""
|
|
231
|
+
return self._SearchCriteria
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
@property
|
|
235
|
+
def SearchCriteriaType(self) -> str:
|
|
236
|
+
"""
|
|
237
|
+
The comma-separated list of item types that were searched for.
|
|
238
|
+
|
|
239
|
+
Search results include hits from all of the specified item types.
|
|
240
|
+
"""
|
|
241
|
+
return self._SearchCriteriaType
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
@property
|
|
245
|
+
def ShowsCount(self) -> int:
|
|
246
|
+
"""
|
|
247
|
+
The total number of show items returned in the `Tracks.Items` collection
|
|
248
|
+
"""
|
|
249
|
+
if self._Shows is not None:
|
|
250
|
+
return self._Shows.ItemsCount
|
|
251
|
+
return 0
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
@property
|
|
255
|
+
def Shows(self) -> ShowPageSimplified:
|
|
256
|
+
"""
|
|
257
|
+
An `ShowPageSimplified` object that allows for multiple pages of shows to be navigated.
|
|
258
|
+
"""
|
|
259
|
+
return self._Shows
|
|
260
|
+
|
|
261
|
+
@Shows.setter
|
|
262
|
+
def Shows(self, value:str):
|
|
263
|
+
"""
|
|
264
|
+
Sets the Shows property value.
|
|
265
|
+
"""
|
|
266
|
+
if value is not None:
|
|
267
|
+
if isinstance(value, ShowPageSimplified):
|
|
268
|
+
self._Shows = value
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
@property
|
|
272
|
+
def TracksCount(self) -> int:
|
|
273
|
+
"""
|
|
274
|
+
The total number of track items returned in the `Tracks.Items` collection
|
|
275
|
+
"""
|
|
276
|
+
if self._Tracks is not None:
|
|
277
|
+
return self._Tracks.ItemsCount
|
|
278
|
+
return 0
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
@property
|
|
282
|
+
def Tracks(self) -> TrackPage:
|
|
283
|
+
"""
|
|
284
|
+
A `TrackPage` object that allows for multiple pages of tracks to be navigated.
|
|
285
|
+
"""
|
|
286
|
+
return self._Tracks
|
|
287
|
+
|
|
288
|
+
@Tracks.setter
|
|
289
|
+
def Tracks(self, value:str):
|
|
290
|
+
"""
|
|
291
|
+
Sets the Tracks property value.
|
|
292
|
+
"""
|
|
293
|
+
if value is not None:
|
|
294
|
+
if isinstance(value, TrackPage):
|
|
295
|
+
self._Tracks = value
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def GetSpotifyOwnedPlaylists(self) -> list[PlaylistSimplified]:
|
|
299
|
+
"""
|
|
300
|
+
Gets a list of all playlists contained in the underlying `Playlists` list
|
|
301
|
+
that are owned by `spotify:user:spotify`.
|
|
302
|
+
"""
|
|
303
|
+
result:list[PlaylistSimplified] = []
|
|
304
|
+
item:PlaylistSimplified
|
|
305
|
+
for item in self._Playlists.Items:
|
|
306
|
+
if item.Owner is not None:
|
|
307
|
+
if item.Owner.Uri == "spotify:user:spotify":
|
|
308
|
+
result.append(item)
|
|
309
|
+
|
|
310
|
+
# sort items on Name property, ascending order.
|
|
311
|
+
if len(result) > 0:
|
|
312
|
+
result.sort(key=lambda x: (x.Name or "").lower(), reverse=False)
|
|
313
|
+
|
|
314
|
+
# return to caller.
|
|
315
|
+
return result
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
def ToDictionary(self) -> dict:
|
|
319
|
+
"""
|
|
320
|
+
Returns a dictionary representation of the class.
|
|
321
|
+
"""
|
|
322
|
+
albums:dict = {}
|
|
323
|
+
if self._Albums is not None:
|
|
324
|
+
albums = self._Albums.ToDictionary()
|
|
325
|
+
|
|
326
|
+
artists:dict = {}
|
|
327
|
+
if self._Artists is not None:
|
|
328
|
+
artists = self._Artists.ToDictionary()
|
|
329
|
+
|
|
330
|
+
audiobooks:dict = {}
|
|
331
|
+
if self._Audiobooks is not None:
|
|
332
|
+
audiobooks = self._Audiobooks.ToDictionary()
|
|
333
|
+
|
|
334
|
+
episodes:dict = {}
|
|
335
|
+
if self._Episodes is not None:
|
|
336
|
+
episodes = self._Episodes.ToDictionary()
|
|
337
|
+
|
|
338
|
+
playlists:dict = {}
|
|
339
|
+
if self._Playlists is not None:
|
|
340
|
+
playlists = self._Playlists.ToDictionary()
|
|
341
|
+
|
|
342
|
+
shows:dict = {}
|
|
343
|
+
if self._Shows is not None:
|
|
344
|
+
shows = self._Shows.ToDictionary()
|
|
345
|
+
|
|
346
|
+
tracks:dict = {}
|
|
347
|
+
if self._Tracks is not None:
|
|
348
|
+
tracks = self._Tracks.ToDictionary()
|
|
349
|
+
|
|
350
|
+
result:dict = \
|
|
351
|
+
{
|
|
352
|
+
'search_criteria': self._SearchCriteria,
|
|
353
|
+
'search_criteria_type': self._SearchCriteriaType,
|
|
354
|
+
'albums_count': self.AlbumsCount,
|
|
355
|
+
'albums': albums,
|
|
356
|
+
'artists_count': self.ArtistsCount,
|
|
357
|
+
'artists': artists,
|
|
358
|
+
'audiobooks_count': self.AudiobooksCount,
|
|
359
|
+
'audiobooks': audiobooks,
|
|
360
|
+
'episodes_count': self.EpisodesCount,
|
|
361
|
+
'episodes': episodes,
|
|
362
|
+
'playlists_count': self.PlaylistsCount,
|
|
363
|
+
'playlists': playlists,
|
|
364
|
+
'shows_count': self.ShowsCount,
|
|
365
|
+
'shows': shows,
|
|
366
|
+
'tracks_count': self.TracksCount,
|
|
367
|
+
'tracks': tracks,
|
|
368
|
+
}
|
|
369
|
+
return result
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
def ToString(self) -> str:
|
|
373
|
+
"""
|
|
374
|
+
Returns a displayable string representation of the class.
|
|
375
|
+
|
|
376
|
+
Args:
|
|
377
|
+
includeItems (bool):
|
|
378
|
+
True to include the Items collection of objects; otherwise, False
|
|
379
|
+
to only return base properties.
|
|
380
|
+
"""
|
|
381
|
+
msg:str = 'SearchResponse:'
|
|
382
|
+
msg = '%s\n Search Criteria="%s"' % (msg, str(self._SearchCriteria))
|
|
383
|
+
msg = '%s\n Search Type="%s"' % (msg, str(self._SearchCriteriaType))
|
|
384
|
+
msg = '%s\n Albums Count=%s' % (msg, str(self.AlbumsCount))
|
|
385
|
+
msg = '%s\n Artists Count=%s' % (msg, str(self.ArtistsCount))
|
|
386
|
+
msg = '%s\n Audiobooks Count=%s' % (msg, str(self.AudiobooksCount))
|
|
387
|
+
msg = '%s\n Episodes Count=%s' % (msg, str(self.EpisodesCount))
|
|
388
|
+
msg = '%s\n Playlists Count=%s' % (msg, str(self.PlaylistsCount))
|
|
389
|
+
msg = '%s\n Shows Count=%s' % (msg, str(self.ShowsCount))
|
|
390
|
+
msg = '%s\n Tracks Count=%s' % (msg, str(self.TracksCount))
|
|
391
|
+
return msg
|