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,213 @@
|
|
|
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.artist_object import (
|
|
9
|
+
ArtistObject,
|
|
10
|
+
)
|
|
11
|
+
from spotifywebapi.models.cursor_object import (
|
|
12
|
+
CursorObject,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class CursorPagingSimplifiedArtistObject(object):
|
|
17
|
+
"""Implementation of the 'CursorPagingSimplifiedArtistObject' 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[ArtistObject]): The model property of type List[ArtistObject].
|
|
28
|
+
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
# Create a mapping from Model property names to API property names
|
|
32
|
+
_names = {
|
|
33
|
+
"href": "href",
|
|
34
|
+
"limit": "limit",
|
|
35
|
+
"next": "next",
|
|
36
|
+
"cursors": "cursors",
|
|
37
|
+
"total": "total",
|
|
38
|
+
"items": "items",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_optionals = [
|
|
42
|
+
"href",
|
|
43
|
+
"limit",
|
|
44
|
+
"next",
|
|
45
|
+
"cursors",
|
|
46
|
+
"total",
|
|
47
|
+
"items",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
def __init__(
|
|
51
|
+
self,
|
|
52
|
+
href=APIHelper.SKIP,
|
|
53
|
+
limit=APIHelper.SKIP,
|
|
54
|
+
next=APIHelper.SKIP,
|
|
55
|
+
cursors=APIHelper.SKIP,
|
|
56
|
+
total=APIHelper.SKIP,
|
|
57
|
+
items=APIHelper.SKIP):
|
|
58
|
+
"""Initialize a CursorPagingSimplifiedArtistObject instance."""
|
|
59
|
+
# Initialize members of the class
|
|
60
|
+
if href is not APIHelper.SKIP:
|
|
61
|
+
self.href = href
|
|
62
|
+
if limit is not APIHelper.SKIP:
|
|
63
|
+
self.limit = limit
|
|
64
|
+
if next is not APIHelper.SKIP:
|
|
65
|
+
self.next = next
|
|
66
|
+
if cursors is not APIHelper.SKIP:
|
|
67
|
+
self.cursors = cursors
|
|
68
|
+
if total is not APIHelper.SKIP:
|
|
69
|
+
self.total = total
|
|
70
|
+
if items is not APIHelper.SKIP:
|
|
71
|
+
self.items = items
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dictionary(cls,
|
|
75
|
+
dictionary):
|
|
76
|
+
"""Create an instance of this model from a dictionary
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
80
|
+
as obtained from the deserialization of the server's response. The
|
|
81
|
+
keys MUST match property names in the API description.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
object: An instance of this structure class.
|
|
85
|
+
|
|
86
|
+
"""
|
|
87
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
# Extract variables from the dictionary
|
|
91
|
+
href =\
|
|
92
|
+
dictionary.get("href")\
|
|
93
|
+
if dictionary.get("href")\
|
|
94
|
+
else APIHelper.SKIP
|
|
95
|
+
limit =\
|
|
96
|
+
dictionary.get("limit")\
|
|
97
|
+
if dictionary.get("limit")\
|
|
98
|
+
else APIHelper.SKIP
|
|
99
|
+
next =\
|
|
100
|
+
dictionary.get("next")\
|
|
101
|
+
if dictionary.get("next")\
|
|
102
|
+
else APIHelper.SKIP
|
|
103
|
+
cursors =\
|
|
104
|
+
CursorObject.from_dictionary(
|
|
105
|
+
dictionary.get("cursors"))\
|
|
106
|
+
if "cursors" in dictionary.keys()\
|
|
107
|
+
else APIHelper.SKIP
|
|
108
|
+
total =\
|
|
109
|
+
dictionary.get("total")\
|
|
110
|
+
if dictionary.get("total")\
|
|
111
|
+
else APIHelper.SKIP
|
|
112
|
+
items = None
|
|
113
|
+
if dictionary.get("items") is not None:
|
|
114
|
+
items = [
|
|
115
|
+
ArtistObject.from_dictionary(x)
|
|
116
|
+
for x in dictionary.get("items")
|
|
117
|
+
]
|
|
118
|
+
else:
|
|
119
|
+
items = APIHelper.SKIP
|
|
120
|
+
|
|
121
|
+
# Return an object of this model
|
|
122
|
+
return cls(href,
|
|
123
|
+
limit,
|
|
124
|
+
next,
|
|
125
|
+
cursors,
|
|
126
|
+
total,
|
|
127
|
+
items)
|
|
128
|
+
|
|
129
|
+
def __repr__(self):
|
|
130
|
+
"""Return a unambiguous string representation."""
|
|
131
|
+
_href=(
|
|
132
|
+
self.href
|
|
133
|
+
if hasattr(self, "href")
|
|
134
|
+
else None
|
|
135
|
+
)
|
|
136
|
+
_limit=(
|
|
137
|
+
self.limit
|
|
138
|
+
if hasattr(self, "limit")
|
|
139
|
+
else None
|
|
140
|
+
)
|
|
141
|
+
_next=(
|
|
142
|
+
self.next
|
|
143
|
+
if hasattr(self, "next")
|
|
144
|
+
else None
|
|
145
|
+
)
|
|
146
|
+
_cursors=(
|
|
147
|
+
self.cursors
|
|
148
|
+
if hasattr(self, "cursors")
|
|
149
|
+
else None
|
|
150
|
+
)
|
|
151
|
+
_total=(
|
|
152
|
+
self.total
|
|
153
|
+
if hasattr(self, "total")
|
|
154
|
+
else None
|
|
155
|
+
)
|
|
156
|
+
_items=(
|
|
157
|
+
self.items
|
|
158
|
+
if hasattr(self, "items")
|
|
159
|
+
else None
|
|
160
|
+
)
|
|
161
|
+
return (
|
|
162
|
+
f"{self.__class__.__name__}("
|
|
163
|
+
f"href={_href!r}, "
|
|
164
|
+
f"limit={_limit!r}, "
|
|
165
|
+
f"next={_next!r}, "
|
|
166
|
+
f"cursors={_cursors!r}, "
|
|
167
|
+
f"total={_total!r}, "
|
|
168
|
+
f"items={_items!r}, "
|
|
169
|
+
f")"
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
def __str__(self):
|
|
173
|
+
"""Return a human-readable string representation."""
|
|
174
|
+
_href=(
|
|
175
|
+
self.href
|
|
176
|
+
if hasattr(self, "href")
|
|
177
|
+
else None
|
|
178
|
+
)
|
|
179
|
+
_limit=(
|
|
180
|
+
self.limit
|
|
181
|
+
if hasattr(self, "limit")
|
|
182
|
+
else None
|
|
183
|
+
)
|
|
184
|
+
_next=(
|
|
185
|
+
self.next
|
|
186
|
+
if hasattr(self, "next")
|
|
187
|
+
else None
|
|
188
|
+
)
|
|
189
|
+
_cursors=(
|
|
190
|
+
self.cursors
|
|
191
|
+
if hasattr(self, "cursors")
|
|
192
|
+
else None
|
|
193
|
+
)
|
|
194
|
+
_total=(
|
|
195
|
+
self.total
|
|
196
|
+
if hasattr(self, "total")
|
|
197
|
+
else None
|
|
198
|
+
)
|
|
199
|
+
_items=(
|
|
200
|
+
self.items
|
|
201
|
+
if hasattr(self, "items")
|
|
202
|
+
else None
|
|
203
|
+
)
|
|
204
|
+
return (
|
|
205
|
+
f"{self.__class__.__name__}("
|
|
206
|
+
f"href={_href!s}, "
|
|
207
|
+
f"limit={_limit!s}, "
|
|
208
|
+
f"next={_next!s}, "
|
|
209
|
+
f"cursors={_cursors!s}, "
|
|
210
|
+
f"total={_total!s}, "
|
|
211
|
+
f"items={_items!s}, "
|
|
212
|
+
f")"
|
|
213
|
+
)
|
|
@@ -0,0 +1,278 @@
|
|
|
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 DeviceObject(object):
|
|
11
|
+
"""Implementation of the 'DeviceObject' model.
|
|
12
|
+
|
|
13
|
+
Attributes:
|
|
14
|
+
id (str): The device ID. This ID is unique and persistent to some extent.
|
|
15
|
+
However, this is not guaranteed and any cached `device_id` should
|
|
16
|
+
periodically be cleared out and refetched as necessary.
|
|
17
|
+
is_active (bool): If this device is the currently active device.
|
|
18
|
+
is_private_session (bool): If this device is currently in a private session.
|
|
19
|
+
is_restricted (bool): Whether controlling this device is restricted. At
|
|
20
|
+
present if this is "true" then no Web API commands will be accepted by
|
|
21
|
+
this device.
|
|
22
|
+
name (str): A human-readable name for the device. Some devices have a name
|
|
23
|
+
that the user can configure (e.g. \"Loudest speaker\") and some devices
|
|
24
|
+
have a generic name associated with the manufacturer or device model.
|
|
25
|
+
mtype (str): Device type, such as "computer", "smartphone" or "speaker".
|
|
26
|
+
volume_percent (int): The current volume in percent.
|
|
27
|
+
supports_volume (bool): If this device can be used to set the volume.
|
|
28
|
+
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
# Create a mapping from Model property names to API property names
|
|
32
|
+
_names = {
|
|
33
|
+
"id": "id",
|
|
34
|
+
"is_active": "is_active",
|
|
35
|
+
"is_private_session": "is_private_session",
|
|
36
|
+
"is_restricted": "is_restricted",
|
|
37
|
+
"name": "name",
|
|
38
|
+
"mtype": "type",
|
|
39
|
+
"volume_percent": "volume_percent",
|
|
40
|
+
"supports_volume": "supports_volume",
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
_optionals = [
|
|
44
|
+
"id",
|
|
45
|
+
"is_active",
|
|
46
|
+
"is_private_session",
|
|
47
|
+
"is_restricted",
|
|
48
|
+
"name",
|
|
49
|
+
"mtype",
|
|
50
|
+
"volume_percent",
|
|
51
|
+
"supports_volume",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
_nullables = [
|
|
55
|
+
"id",
|
|
56
|
+
"volume_percent",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
def __init__(
|
|
60
|
+
self,
|
|
61
|
+
id=APIHelper.SKIP,
|
|
62
|
+
is_active=APIHelper.SKIP,
|
|
63
|
+
is_private_session=APIHelper.SKIP,
|
|
64
|
+
is_restricted=APIHelper.SKIP,
|
|
65
|
+
name=APIHelper.SKIP,
|
|
66
|
+
mtype=APIHelper.SKIP,
|
|
67
|
+
volume_percent=APIHelper.SKIP,
|
|
68
|
+
supports_volume=APIHelper.SKIP):
|
|
69
|
+
"""Initialize a DeviceObject instance."""
|
|
70
|
+
# Initialize members of the class
|
|
71
|
+
if id is not APIHelper.SKIP:
|
|
72
|
+
self.id = id
|
|
73
|
+
if is_active is not APIHelper.SKIP:
|
|
74
|
+
self.is_active = is_active
|
|
75
|
+
if is_private_session is not APIHelper.SKIP:
|
|
76
|
+
self.is_private_session = is_private_session
|
|
77
|
+
if is_restricted is not APIHelper.SKIP:
|
|
78
|
+
self.is_restricted = is_restricted
|
|
79
|
+
if name is not APIHelper.SKIP:
|
|
80
|
+
self.name = name
|
|
81
|
+
if mtype is not APIHelper.SKIP:
|
|
82
|
+
self.mtype = mtype
|
|
83
|
+
if volume_percent is not APIHelper.SKIP:
|
|
84
|
+
self.volume_percent = volume_percent
|
|
85
|
+
if supports_volume is not APIHelper.SKIP:
|
|
86
|
+
self.supports_volume = supports_volume
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dictionary(cls,
|
|
90
|
+
dictionary):
|
|
91
|
+
"""Create an instance of this model from a dictionary
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
95
|
+
as obtained from the deserialization of the server's response. The
|
|
96
|
+
keys MUST match property names in the API description.
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
object: An instance of this structure class.
|
|
100
|
+
|
|
101
|
+
"""
|
|
102
|
+
if not isinstance(dictionary, dict) or dictionary is None:
|
|
103
|
+
return None
|
|
104
|
+
|
|
105
|
+
# Extract variables from the dictionary
|
|
106
|
+
id =\
|
|
107
|
+
dictionary.get("id")\
|
|
108
|
+
if "id" in dictionary.keys()\
|
|
109
|
+
else APIHelper.SKIP
|
|
110
|
+
is_active =\
|
|
111
|
+
dictionary.get("is_active")\
|
|
112
|
+
if "is_active" in dictionary.keys()\
|
|
113
|
+
else APIHelper.SKIP
|
|
114
|
+
is_private_session =\
|
|
115
|
+
dictionary.get("is_private_session")\
|
|
116
|
+
if "is_private_session" in dictionary.keys()\
|
|
117
|
+
else APIHelper.SKIP
|
|
118
|
+
is_restricted =\
|
|
119
|
+
dictionary.get("is_restricted")\
|
|
120
|
+
if "is_restricted" in dictionary.keys()\
|
|
121
|
+
else APIHelper.SKIP
|
|
122
|
+
name =\
|
|
123
|
+
dictionary.get("name")\
|
|
124
|
+
if dictionary.get("name")\
|
|
125
|
+
else APIHelper.SKIP
|
|
126
|
+
mtype =\
|
|
127
|
+
dictionary.get("type")\
|
|
128
|
+
if dictionary.get("type")\
|
|
129
|
+
else APIHelper.SKIP
|
|
130
|
+
volume_percent =\
|
|
131
|
+
dictionary.get("volume_percent")\
|
|
132
|
+
if "volume_percent" in dictionary.keys()\
|
|
133
|
+
else APIHelper.SKIP
|
|
134
|
+
supports_volume =\
|
|
135
|
+
dictionary.get("supports_volume")\
|
|
136
|
+
if "supports_volume" in dictionary.keys()\
|
|
137
|
+
else APIHelper.SKIP
|
|
138
|
+
|
|
139
|
+
# Return an object of this model
|
|
140
|
+
return cls(id,
|
|
141
|
+
is_active,
|
|
142
|
+
is_private_session,
|
|
143
|
+
is_restricted,
|
|
144
|
+
name,
|
|
145
|
+
mtype,
|
|
146
|
+
volume_percent,
|
|
147
|
+
supports_volume)
|
|
148
|
+
|
|
149
|
+
@classmethod
|
|
150
|
+
def validate(cls, dictionary):
|
|
151
|
+
"""Validate dictionary against class required properties
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
dictionary (dictionary): A dictionary representation of the object
|
|
155
|
+
as obtained from the deserialization of the server's response. The
|
|
156
|
+
keys MUST match property names in the API description.
|
|
157
|
+
|
|
158
|
+
Returns:
|
|
159
|
+
boolean : if dictionary is valid contains required properties.
|
|
160
|
+
|
|
161
|
+
"""
|
|
162
|
+
if isinstance(dictionary, cls):
|
|
163
|
+
return True
|
|
164
|
+
|
|
165
|
+
if not isinstance(dictionary, dict):
|
|
166
|
+
return False
|
|
167
|
+
|
|
168
|
+
return True
|
|
169
|
+
|
|
170
|
+
def __repr__(self):
|
|
171
|
+
"""Return a unambiguous string representation."""
|
|
172
|
+
_id=(
|
|
173
|
+
self.id
|
|
174
|
+
if hasattr(self, "id")
|
|
175
|
+
else None
|
|
176
|
+
)
|
|
177
|
+
_is_active=(
|
|
178
|
+
self.is_active
|
|
179
|
+
if hasattr(self, "is_active")
|
|
180
|
+
else None
|
|
181
|
+
)
|
|
182
|
+
_is_private_session=(
|
|
183
|
+
self.is_private_session
|
|
184
|
+
if hasattr(self, "is_private_session")
|
|
185
|
+
else None
|
|
186
|
+
)
|
|
187
|
+
_is_restricted=(
|
|
188
|
+
self.is_restricted
|
|
189
|
+
if hasattr(self, "is_restricted")
|
|
190
|
+
else None
|
|
191
|
+
)
|
|
192
|
+
_name=(
|
|
193
|
+
self.name
|
|
194
|
+
if hasattr(self, "name")
|
|
195
|
+
else None
|
|
196
|
+
)
|
|
197
|
+
_mtype=(
|
|
198
|
+
self.mtype
|
|
199
|
+
if hasattr(self, "mtype")
|
|
200
|
+
else None
|
|
201
|
+
)
|
|
202
|
+
_volume_percent=(
|
|
203
|
+
self.volume_percent
|
|
204
|
+
if hasattr(self, "volume_percent")
|
|
205
|
+
else None
|
|
206
|
+
)
|
|
207
|
+
_supports_volume=(
|
|
208
|
+
self.supports_volume
|
|
209
|
+
if hasattr(self, "supports_volume")
|
|
210
|
+
else None
|
|
211
|
+
)
|
|
212
|
+
return (
|
|
213
|
+
f"{self.__class__.__name__}("
|
|
214
|
+
f"id={_id!r}, "
|
|
215
|
+
f"is_active={_is_active!r}, "
|
|
216
|
+
f"is_private_session={_is_private_session!r}, "
|
|
217
|
+
f"is_restricted={_is_restricted!r}, "
|
|
218
|
+
f"name={_name!r}, "
|
|
219
|
+
f"mtype={_mtype!r}, "
|
|
220
|
+
f"volume_percent={_volume_percent!r}, "
|
|
221
|
+
f"supports_volume={_supports_volume!r}, "
|
|
222
|
+
f")"
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
def __str__(self):
|
|
226
|
+
"""Return a human-readable string representation."""
|
|
227
|
+
_id=(
|
|
228
|
+
self.id
|
|
229
|
+
if hasattr(self, "id")
|
|
230
|
+
else None
|
|
231
|
+
)
|
|
232
|
+
_is_active=(
|
|
233
|
+
self.is_active
|
|
234
|
+
if hasattr(self, "is_active")
|
|
235
|
+
else None
|
|
236
|
+
)
|
|
237
|
+
_is_private_session=(
|
|
238
|
+
self.is_private_session
|
|
239
|
+
if hasattr(self, "is_private_session")
|
|
240
|
+
else None
|
|
241
|
+
)
|
|
242
|
+
_is_restricted=(
|
|
243
|
+
self.is_restricted
|
|
244
|
+
if hasattr(self, "is_restricted")
|
|
245
|
+
else None
|
|
246
|
+
)
|
|
247
|
+
_name=(
|
|
248
|
+
self.name
|
|
249
|
+
if hasattr(self, "name")
|
|
250
|
+
else None
|
|
251
|
+
)
|
|
252
|
+
_mtype=(
|
|
253
|
+
self.mtype
|
|
254
|
+
if hasattr(self, "mtype")
|
|
255
|
+
else None
|
|
256
|
+
)
|
|
257
|
+
_volume_percent=(
|
|
258
|
+
self.volume_percent
|
|
259
|
+
if hasattr(self, "volume_percent")
|
|
260
|
+
else None
|
|
261
|
+
)
|
|
262
|
+
_supports_volume=(
|
|
263
|
+
self.supports_volume
|
|
264
|
+
if hasattr(self, "supports_volume")
|
|
265
|
+
else None
|
|
266
|
+
)
|
|
267
|
+
return (
|
|
268
|
+
f"{self.__class__.__name__}("
|
|
269
|
+
f"id={_id!s}, "
|
|
270
|
+
f"is_active={_is_active!s}, "
|
|
271
|
+
f"is_private_session={_is_private_session!s}, "
|
|
272
|
+
f"is_restricted={_is_restricted!s}, "
|
|
273
|
+
f"name={_name!s}, "
|
|
274
|
+
f"mtype={_mtype!s}, "
|
|
275
|
+
f"volume_percent={_volume_percent!s}, "
|
|
276
|
+
f"supports_volume={_supports_volume!s}, "
|
|
277
|
+
f")"
|
|
278
|
+
)
|