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.
Files changed (186) hide show
  1. spotify_apimatic_sdk-1.0.0.dist-info/METADATA +150 -0
  2. spotify_apimatic_sdk-1.0.0.dist-info/RECORD +186 -0
  3. spotify_apimatic_sdk-1.0.0.dist-info/WHEEL +5 -0
  4. spotify_apimatic_sdk-1.0.0.dist-info/licenses/LICENSE +30 -0
  5. spotify_apimatic_sdk-1.0.0.dist-info/top_level.txt +1 -0
  6. spotifywebapi/__init__.py +12 -0
  7. spotifywebapi/api_helper.py +19 -0
  8. spotifywebapi/configuration.py +318 -0
  9. spotifywebapi/controllers/__init__.py +20 -0
  10. spotifywebapi/controllers/albums_controller.py +498 -0
  11. spotifywebapi/controllers/artists_controller.py +327 -0
  12. spotifywebapi/controllers/audiobooks_controller.py +441 -0
  13. spotifywebapi/controllers/base_controller.py +67 -0
  14. spotifywebapi/controllers/categories_controller.py +161 -0
  15. spotifywebapi/controllers/chapters_controller.py +157 -0
  16. spotifywebapi/controllers/episodes_controller.py +390 -0
  17. spotifywebapi/controllers/genres_controller.py +84 -0
  18. spotifywebapi/controllers/markets_controller.py +82 -0
  19. spotifywebapi/controllers/o_auth_authorization_controller.py +156 -0
  20. spotifywebapi/controllers/player_controller.py +807 -0
  21. spotifywebapi/controllers/playlists_controller.py +851 -0
  22. spotifywebapi/controllers/search_controller.py +123 -0
  23. spotifywebapi/controllers/shows_controller.py +439 -0
  24. spotifywebapi/controllers/tracks_controller.py +821 -0
  25. spotifywebapi/controllers/users_controller.py +649 -0
  26. spotifywebapi/exceptions/__init__.py +11 -0
  27. spotifywebapi/exceptions/api_exception.py +36 -0
  28. spotifywebapi/exceptions/bad_request_exception.py +56 -0
  29. spotifywebapi/exceptions/forbidden_exception.py +56 -0
  30. spotifywebapi/exceptions/not_found_exception.py +56 -0
  31. spotifywebapi/exceptions/o_auth_provider_exception.py +73 -0
  32. spotifywebapi/exceptions/too_many_requests_exception.py +56 -0
  33. spotifywebapi/exceptions/unauthorized_exception.py +56 -0
  34. spotifywebapi/http/__init__.py +11 -0
  35. spotifywebapi/http/api_response.py +67 -0
  36. spotifywebapi/http/auth/__init__.py +5 -0
  37. spotifywebapi/http/auth/o_auth_2.py +336 -0
  38. spotifywebapi/http/http_call_back.py +20 -0
  39. spotifywebapi/http/http_client_provider.py +23 -0
  40. spotifywebapi/http/http_method_enum.py +25 -0
  41. spotifywebapi/http/http_request.py +55 -0
  42. spotifywebapi/http/http_response.py +45 -0
  43. spotifywebapi/http/proxy_settings.py +50 -0
  44. spotifywebapi/models/__init__.py +142 -0
  45. spotifywebapi/models/album_base.py +264 -0
  46. spotifywebapi/models/album_group_enum.py +51 -0
  47. spotifywebapi/models/album_object.py +375 -0
  48. spotifywebapi/models/album_restriction_object.py +109 -0
  49. spotifywebapi/models/album_type_enum.py +62 -0
  50. spotifywebapi/models/artist_discography_album_object.py +298 -0
  51. spotifywebapi/models/artist_object.py +335 -0
  52. spotifywebapi/models/audio_analysis_object.py +266 -0
  53. spotifywebapi/models/audio_features_object.py +518 -0
  54. spotifywebapi/models/audiobook_base.py +353 -0
  55. spotifywebapi/models/audiobook_object.py +369 -0
  56. spotifywebapi/models/author_object.py +85 -0
  57. spotifywebapi/models/categories.py +162 -0
  58. spotifywebapi/models/category_object.py +117 -0
  59. spotifywebapi/models/chapter_base.py +392 -0
  60. spotifywebapi/models/chapter_object.py +408 -0
  61. spotifywebapi/models/chapter_restriction_object.py +113 -0
  62. spotifywebapi/models/context_object.py +181 -0
  63. spotifywebapi/models/copyright_object.py +130 -0
  64. spotifywebapi/models/currently_playing_context_object.py +314 -0
  65. spotifywebapi/models/currently_playing_object.py +241 -0
  66. spotifywebapi/models/cursor_object.py +108 -0
  67. spotifywebapi/models/cursor_paged_artists.py +75 -0
  68. spotifywebapi/models/cursor_paging_object.py +183 -0
  69. spotifywebapi/models/cursor_paging_play_history_object.py +214 -0
  70. spotifywebapi/models/cursor_paging_simplified_artist_object.py +213 -0
  71. spotifywebapi/models/device_object.py +278 -0
  72. spotifywebapi/models/disallows_object.py +314 -0
  73. spotifywebapi/models/episode_base.py +394 -0
  74. spotifywebapi/models/episode_object.py +665 -0
  75. spotifywebapi/models/episode_restriction_object.py +112 -0
  76. spotifywebapi/models/error_object.py +85 -0
  77. spotifywebapi/models/explicit_content_settings_object.py +110 -0
  78. spotifywebapi/models/external_id_object.py +156 -0
  79. spotifywebapi/models/external_url_object.py +107 -0
  80. spotifywebapi/models/followers_object.py +134 -0
  81. spotifywebapi/models/image_object.py +168 -0
  82. spotifywebapi/models/include_external_enum.py +45 -0
  83. spotifywebapi/models/item_type_1_enum.py +56 -0
  84. spotifywebapi/models/item_type_2_enum.py +45 -0
  85. spotifywebapi/models/item_type_3_enum.py +45 -0
  86. spotifywebapi/models/item_type_enum.py +58 -0
  87. spotifywebapi/models/linked_track_object.py +205 -0
  88. spotifywebapi/models/many_albums.py +76 -0
  89. spotifywebapi/models/many_artists.py +76 -0
  90. spotifywebapi/models/many_audio_features.py +77 -0
  91. spotifywebapi/models/many_audiobooks.py +77 -0
  92. spotifywebapi/models/many_chapters.py +77 -0
  93. spotifywebapi/models/many_devices.py +76 -0
  94. spotifywebapi/models/many_episodes.py +77 -0
  95. spotifywebapi/models/many_genres.py +69 -0
  96. spotifywebapi/models/many_simplified_shows.py +74 -0
  97. spotifywebapi/models/many_tracks.py +76 -0
  98. spotifywebapi/models/markets.py +85 -0
  99. spotifywebapi/models/me_albums_request.py +90 -0
  100. spotifywebapi/models/me_episodes_request.py +73 -0
  101. spotifywebapi/models/me_episodes_request_1.py +89 -0
  102. spotifywebapi/models/me_following_request.py +74 -0
  103. spotifywebapi/models/me_following_request_1.py +90 -0
  104. spotifywebapi/models/me_player_play_request.py +165 -0
  105. spotifywebapi/models/me_player_request.py +103 -0
  106. spotifywebapi/models/me_shows_request.py +89 -0
  107. spotifywebapi/models/me_tracks_request.py +74 -0
  108. spotifywebapi/models/me_tracks_request_1.py +90 -0
  109. spotifywebapi/models/meta.py +227 -0
  110. spotifywebapi/models/mode_enum.py +52 -0
  111. spotifywebapi/models/narrator_object.py +85 -0
  112. spotifywebapi/models/o_auth_provider_error_enum.py +67 -0
  113. spotifywebapi/models/o_auth_scope_enum.py +98 -0
  114. spotifywebapi/models/o_auth_token.py +113 -0
  115. spotifywebapi/models/paged_albums.py +75 -0
  116. spotifywebapi/models/paged_categories.py +74 -0
  117. spotifywebapi/models/paging_artist_discography_album_object.py +163 -0
  118. spotifywebapi/models/paging_artist_object.py +162 -0
  119. spotifywebapi/models/paging_featured_playlist_object.py +113 -0
  120. spotifywebapi/models/paging_object.py +142 -0
  121. spotifywebapi/models/paging_playlist_object.py +163 -0
  122. spotifywebapi/models/paging_playlist_track_object.py +163 -0
  123. spotifywebapi/models/paging_saved_album_object.py +163 -0
  124. spotifywebapi/models/paging_saved_audiobook_object.py +163 -0
  125. spotifywebapi/models/paging_saved_episode_object.py +163 -0
  126. spotifywebapi/models/paging_saved_show_object.py +163 -0
  127. spotifywebapi/models/paging_saved_track_object.py +163 -0
  128. spotifywebapi/models/paging_simplified_album_object.py +163 -0
  129. spotifywebapi/models/paging_simplified_audiobook_object.py +162 -0
  130. spotifywebapi/models/paging_simplified_chapter_object.py +162 -0
  131. spotifywebapi/models/paging_simplified_episode_object.py +162 -0
  132. spotifywebapi/models/paging_simplified_show_object.py +160 -0
  133. spotifywebapi/models/paging_simplified_track_object.py +163 -0
  134. spotifywebapi/models/paging_track_object.py +162 -0
  135. spotifywebapi/models/play_history_object.py +141 -0
  136. spotifywebapi/models/playlist_object.py +425 -0
  137. spotifywebapi/models/playlist_owner_object.py +238 -0
  138. spotifywebapi/models/playlist_snapshot_id.py +85 -0
  139. spotifywebapi/models/playlist_track_object.py +171 -0
  140. spotifywebapi/models/playlist_tracks_ref_object.py +109 -0
  141. spotifywebapi/models/playlist_user_object.py +231 -0
  142. spotifywebapi/models/playlists_followers_request.py +86 -0
  143. spotifywebapi/models/playlists_request.py +160 -0
  144. spotifywebapi/models/playlists_tracks_request.py +121 -0
  145. spotifywebapi/models/playlists_tracks_request_1.py +188 -0
  146. spotifywebapi/models/playlists_tracks_request_2.py +109 -0
  147. spotifywebapi/models/private_user_object.py +379 -0
  148. spotifywebapi/models/public_user_object.py +268 -0
  149. spotifywebapi/models/queue_object.py +118 -0
  150. spotifywebapi/models/reason_enum.py +65 -0
  151. spotifywebapi/models/recommendation_seed_object.py +208 -0
  152. spotifywebapi/models/recommendations_object.py +96 -0
  153. spotifywebapi/models/release_date_precision_enum.py +62 -0
  154. spotifywebapi/models/resume_point_object.py +131 -0
  155. spotifywebapi/models/saved_album_object.py +118 -0
  156. spotifywebapi/models/saved_audiobook_object.py +118 -0
  157. spotifywebapi/models/saved_episode_object.py +116 -0
  158. spotifywebapi/models/saved_show_object.py +116 -0
  159. spotifywebapi/models/saved_track_object.py +118 -0
  160. spotifywebapi/models/search_items.py +256 -0
  161. spotifywebapi/models/section_object.py +362 -0
  162. spotifywebapi/models/segment_object.py +307 -0
  163. spotifywebapi/models/show_base.py +550 -0
  164. spotifywebapi/models/show_object.py +319 -0
  165. spotifywebapi/models/simplified_album_object.py +468 -0
  166. spotifywebapi/models/simplified_artist_object.py +228 -0
  167. spotifywebapi/models/simplified_playlist_object.py +398 -0
  168. spotifywebapi/models/simplified_track_object.py +494 -0
  169. spotifywebapi/models/time_interval_object.py +132 -0
  170. spotifywebapi/models/track.py +697 -0
  171. spotifywebapi/models/track_1.py +85 -0
  172. spotifywebapi/models/track_object.py +605 -0
  173. spotifywebapi/models/track_restriction_object.py +112 -0
  174. spotifywebapi/models/type_2_enum.py +56 -0
  175. spotifywebapi/models/type_3_enum.py +56 -0
  176. spotifywebapi/models/type_4_enum.py +56 -0
  177. spotifywebapi/models/type_5_enum.py +56 -0
  178. spotifywebapi/models/type_6_enum.py +56 -0
  179. spotifywebapi/models/type_8_enum.py +42 -0
  180. spotifywebapi/models/type_9_enum.py +42 -0
  181. spotifywebapi/models/type_enum.py +56 -0
  182. spotifywebapi/models/users_playlists_request.py +154 -0
  183. spotifywebapi/spotifywebapi_client.py +198 -0
  184. spotifywebapi/utilities/__init__.py +6 -0
  185. spotifywebapi/utilities/file_wrapper.py +45 -0
  186. spotifywebapi/utilities/union_type_lookup.py +113 -0
@@ -0,0 +1,160 @@
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 PlaylistsRequest(object):
11
+ """Implementation of the 'Playlists Request' model.
12
+
13
+ Attributes:
14
+ name (str): The new name for the playlist, for example `"My New Playlist
15
+ Title"`
16
+ public (bool): If `true` the playlist will be public, if `false` it will be
17
+ private.
18
+ collaborative (bool): If `true`, the playlist will become collaborative and
19
+ other users will be able to modify the playlist in their Spotify client.
20
+ <br/> _**Note**: You can only set `collaborative` to `true` on non-public
21
+ playlists._
22
+ description (str): Value for playlist description as displayed in Spotify
23
+ Clients and in the Web API.
24
+
25
+ """
26
+
27
+ # Create a mapping from Model property names to API property names
28
+ _names = {
29
+ "name": "name",
30
+ "public": "public",
31
+ "collaborative": "collaborative",
32
+ "description": "description",
33
+ }
34
+
35
+ _optionals = [
36
+ "name",
37
+ "public",
38
+ "collaborative",
39
+ "description",
40
+ ]
41
+
42
+ def __init__(
43
+ self,
44
+ name=APIHelper.SKIP,
45
+ public=APIHelper.SKIP,
46
+ collaborative=APIHelper.SKIP,
47
+ description=APIHelper.SKIP):
48
+ """Initialize a PlaylistsRequest instance."""
49
+ # Initialize members of the class
50
+ if name is not APIHelper.SKIP:
51
+ self.name = name
52
+ if public is not APIHelper.SKIP:
53
+ self.public = public
54
+ if collaborative is not APIHelper.SKIP:
55
+ self.collaborative = collaborative
56
+ if description is not APIHelper.SKIP:
57
+ self.description = description
58
+
59
+ @classmethod
60
+ def from_dictionary(cls,
61
+ dictionary):
62
+ """Create an instance of this model from a dictionary
63
+
64
+ Args:
65
+ dictionary (dictionary): A dictionary representation of the object
66
+ as obtained from the deserialization of the server's response. The
67
+ keys MUST match property names in the API description.
68
+
69
+ Returns:
70
+ object: An instance of this structure class.
71
+
72
+ """
73
+ if not isinstance(dictionary, dict) or dictionary is None:
74
+ return None
75
+
76
+ # Extract variables from the dictionary
77
+ name =\
78
+ dictionary.get("name")\
79
+ if dictionary.get("name")\
80
+ else APIHelper.SKIP
81
+ public =\
82
+ dictionary.get("public")\
83
+ if "public" in dictionary.keys()\
84
+ else APIHelper.SKIP
85
+ collaborative =\
86
+ dictionary.get("collaborative")\
87
+ if "collaborative" in dictionary.keys()\
88
+ else APIHelper.SKIP
89
+ description =\
90
+ dictionary.get("description")\
91
+ if dictionary.get("description")\
92
+ else APIHelper.SKIP
93
+
94
+ # Return an object of this model
95
+ return cls(name,
96
+ public,
97
+ collaborative,
98
+ description)
99
+
100
+ def __repr__(self):
101
+ """Return a unambiguous string representation."""
102
+ _name=(
103
+ self.name
104
+ if hasattr(self, "name")
105
+ else None
106
+ )
107
+ _public=(
108
+ self.public
109
+ if hasattr(self, "public")
110
+ else None
111
+ )
112
+ _collaborative=(
113
+ self.collaborative
114
+ if hasattr(self, "collaborative")
115
+ else None
116
+ )
117
+ _description=(
118
+ self.description
119
+ if hasattr(self, "description")
120
+ else None
121
+ )
122
+ return (
123
+ f"{self.__class__.__name__}("
124
+ f"name={_name!r}, "
125
+ f"public={_public!r}, "
126
+ f"collaborative={_collaborative!r}, "
127
+ f"description={_description!r}, "
128
+ f")"
129
+ )
130
+
131
+ def __str__(self):
132
+ """Return a human-readable string representation."""
133
+ _name=(
134
+ self.name
135
+ if hasattr(self, "name")
136
+ else None
137
+ )
138
+ _public=(
139
+ self.public
140
+ if hasattr(self, "public")
141
+ else None
142
+ )
143
+ _collaborative=(
144
+ self.collaborative
145
+ if hasattr(self, "collaborative")
146
+ else None
147
+ )
148
+ _description=(
149
+ self.description
150
+ if hasattr(self, "description")
151
+ else None
152
+ )
153
+ return (
154
+ f"{self.__class__.__name__}("
155
+ f"name={_name!s}, "
156
+ f"public={_public!s}, "
157
+ f"collaborative={_collaborative!s}, "
158
+ f"description={_description!s}, "
159
+ f")"
160
+ )
@@ -0,0 +1,121 @@
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 PlaylistsTracksRequest(object):
11
+ """Implementation of the 'Playlists Tracks Request' model.
12
+
13
+ Attributes:
14
+ uris (List[str]): A JSON array of the [Spotify
15
+ URIs](/documentation/web-api/concepts/spotify-uris-ids) to add. For
16
+ example: `{"uris":
17
+ ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh","spotify:track:1301WleyT98MSxVHPZC
18
+ A6M", "spotify:episode:512ojhOuo1ktJprKbVcKyQ"]}`<br/>A maximum of 100
19
+ items can be added in one request. _**Note**: if the `uris` parameter is
20
+ present in the query string, any URIs listed here in the body will be
21
+ ignored._
22
+ position (int): The position to insert the items, a zero-based index. For
23
+ example, to insert the items in the first position: `position=0` ; to
24
+ insert the items in the third position: `position=2`. If omitted, the
25
+ items will be appended to the playlist. Items are added in the order they
26
+ appear in the uris array. For example: `{"uris":
27
+ ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh","spotify:track:1301WleyT98MSxVHPZC
28
+ A6M"], "position": 3}`
29
+
30
+ """
31
+
32
+ # Create a mapping from Model property names to API property names
33
+ _names = {
34
+ "uris": "uris",
35
+ "position": "position",
36
+ }
37
+
38
+ _optionals = [
39
+ "uris",
40
+ "position",
41
+ ]
42
+
43
+ def __init__(
44
+ self,
45
+ uris=APIHelper.SKIP,
46
+ position=APIHelper.SKIP):
47
+ """Initialize a PlaylistsTracksRequest instance."""
48
+ # Initialize members of the class
49
+ if uris is not APIHelper.SKIP:
50
+ self.uris = uris
51
+ if position is not APIHelper.SKIP:
52
+ self.position = position
53
+
54
+ @classmethod
55
+ def from_dictionary(cls,
56
+ dictionary):
57
+ """Create an instance of this model from a dictionary
58
+
59
+ Args:
60
+ dictionary (dictionary): A dictionary representation of the object
61
+ as obtained from the deserialization of the server's response. The
62
+ keys MUST match property names in the API description.
63
+
64
+ Returns:
65
+ object: An instance of this structure class.
66
+
67
+ """
68
+ if not isinstance(dictionary, dict) or dictionary is None:
69
+ return None
70
+
71
+ # Extract variables from the dictionary
72
+ uris =\
73
+ dictionary.get("uris")\
74
+ if dictionary.get("uris")\
75
+ else APIHelper.SKIP
76
+ position =\
77
+ dictionary.get("position")\
78
+ if dictionary.get("position")\
79
+ else APIHelper.SKIP
80
+
81
+ # Return an object of this model
82
+ return cls(uris,
83
+ position)
84
+
85
+ def __repr__(self):
86
+ """Return a unambiguous string representation."""
87
+ _uris=(
88
+ self.uris
89
+ if hasattr(self, "uris")
90
+ else None
91
+ )
92
+ _position=(
93
+ self.position
94
+ if hasattr(self, "position")
95
+ else None
96
+ )
97
+ return (
98
+ f"{self.__class__.__name__}("
99
+ f"uris={_uris!r}, "
100
+ f"position={_position!r}, "
101
+ f")"
102
+ )
103
+
104
+ def __str__(self):
105
+ """Return a human-readable string representation."""
106
+ _uris=(
107
+ self.uris
108
+ if hasattr(self, "uris")
109
+ else None
110
+ )
111
+ _position=(
112
+ self.position
113
+ if hasattr(self, "position")
114
+ else None
115
+ )
116
+ return (
117
+ f"{self.__class__.__name__}("
118
+ f"uris={_uris!s}, "
119
+ f"position={_position!s}, "
120
+ f")"
121
+ )
@@ -0,0 +1,188 @@
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 PlaylistsTracksRequest1(object):
11
+ """Implementation of the 'Playlists Tracks Request1' model.
12
+
13
+ Attributes:
14
+ uris (List[str]): The model property of type List[str].
15
+ range_start (int): The position of the first item to be reordered.
16
+ insert_before (int): The position where the items should be inserted.<br/>To
17
+ reorder the items to the end of the playlist, simply set _insert_before_
18
+ to the position after the last item.<br/>Examples:<br/>To reorder the
19
+ first item to the last position in a playlist with 10 items, set
20
+ _range_start_ to 0, and _insert_before_ to 10.<br/>To reorder the last
21
+ item in a playlist with 10 items to the start of the playlist, set
22
+ _range_start_ to 9, and _insert_before_ to 0.
23
+ range_length (int): The amount of items to be reordered. Defaults to 1 if not
24
+ set.<br/>The range of items to be reordered begins from the _range_start_
25
+ position, and includes the _range_length_ subsequent
26
+ items.<br/>Example:<br/>To move the items at index 9-10 to the start of
27
+ the playlist, _range_start_ is set to 9, and _range_length_ is set to 2.
28
+ snapshot_id (str): The playlist's snapshot ID against which you want to make
29
+ the changes.
30
+
31
+ """
32
+
33
+ # Create a mapping from Model property names to API property names
34
+ _names = {
35
+ "uris": "uris",
36
+ "range_start": "range_start",
37
+ "insert_before": "insert_before",
38
+ "range_length": "range_length",
39
+ "snapshot_id": "snapshot_id",
40
+ }
41
+
42
+ _optionals = [
43
+ "uris",
44
+ "range_start",
45
+ "insert_before",
46
+ "range_length",
47
+ "snapshot_id",
48
+ ]
49
+
50
+ def __init__(
51
+ self,
52
+ uris=APIHelper.SKIP,
53
+ range_start=APIHelper.SKIP,
54
+ insert_before=APIHelper.SKIP,
55
+ range_length=APIHelper.SKIP,
56
+ snapshot_id=APIHelper.SKIP):
57
+ """Initialize a PlaylistsTracksRequest1 instance."""
58
+ # Initialize members of the class
59
+ if uris is not APIHelper.SKIP:
60
+ self.uris = uris
61
+ if range_start is not APIHelper.SKIP:
62
+ self.range_start = range_start
63
+ if insert_before is not APIHelper.SKIP:
64
+ self.insert_before = insert_before
65
+ if range_length is not APIHelper.SKIP:
66
+ self.range_length = range_length
67
+ if snapshot_id is not APIHelper.SKIP:
68
+ self.snapshot_id = snapshot_id
69
+
70
+ @classmethod
71
+ def from_dictionary(cls,
72
+ dictionary):
73
+ """Create an instance of this model from a dictionary
74
+
75
+ Args:
76
+ dictionary (dictionary): A dictionary representation of the object
77
+ as obtained from the deserialization of the server's response. The
78
+ keys MUST match property names in the API description.
79
+
80
+ Returns:
81
+ object: An instance of this structure class.
82
+
83
+ """
84
+ if not isinstance(dictionary, dict) or dictionary is None:
85
+ return None
86
+
87
+ # Extract variables from the dictionary
88
+ uris =\
89
+ dictionary.get("uris")\
90
+ if dictionary.get("uris")\
91
+ else APIHelper.SKIP
92
+ range_start =\
93
+ dictionary.get("range_start")\
94
+ if dictionary.get("range_start")\
95
+ else APIHelper.SKIP
96
+ insert_before =\
97
+ dictionary.get("insert_before")\
98
+ if dictionary.get("insert_before")\
99
+ else APIHelper.SKIP
100
+ range_length =\
101
+ dictionary.get("range_length")\
102
+ if dictionary.get("range_length")\
103
+ else APIHelper.SKIP
104
+ snapshot_id =\
105
+ dictionary.get("snapshot_id")\
106
+ if dictionary.get("snapshot_id")\
107
+ else APIHelper.SKIP
108
+
109
+ # Return an object of this model
110
+ return cls(uris,
111
+ range_start,
112
+ insert_before,
113
+ range_length,
114
+ snapshot_id)
115
+
116
+ def __repr__(self):
117
+ """Return a unambiguous string representation."""
118
+ _uris=(
119
+ self.uris
120
+ if hasattr(self, "uris")
121
+ else None
122
+ )
123
+ _range_start=(
124
+ self.range_start
125
+ if hasattr(self, "range_start")
126
+ else None
127
+ )
128
+ _insert_before=(
129
+ self.insert_before
130
+ if hasattr(self, "insert_before")
131
+ else None
132
+ )
133
+ _range_length=(
134
+ self.range_length
135
+ if hasattr(self, "range_length")
136
+ else None
137
+ )
138
+ _snapshot_id=(
139
+ self.snapshot_id
140
+ if hasattr(self, "snapshot_id")
141
+ else None
142
+ )
143
+ return (
144
+ f"{self.__class__.__name__}("
145
+ f"uris={_uris!r}, "
146
+ f"range_start={_range_start!r}, "
147
+ f"insert_before={_insert_before!r}, "
148
+ f"range_length={_range_length!r}, "
149
+ f"snapshot_id={_snapshot_id!r}, "
150
+ f")"
151
+ )
152
+
153
+ def __str__(self):
154
+ """Return a human-readable string representation."""
155
+ _uris=(
156
+ self.uris
157
+ if hasattr(self, "uris")
158
+ else None
159
+ )
160
+ _range_start=(
161
+ self.range_start
162
+ if hasattr(self, "range_start")
163
+ else None
164
+ )
165
+ _insert_before=(
166
+ self.insert_before
167
+ if hasattr(self, "insert_before")
168
+ else None
169
+ )
170
+ _range_length=(
171
+ self.range_length
172
+ if hasattr(self, "range_length")
173
+ else None
174
+ )
175
+ _snapshot_id=(
176
+ self.snapshot_id
177
+ if hasattr(self, "snapshot_id")
178
+ else None
179
+ )
180
+ return (
181
+ f"{self.__class__.__name__}("
182
+ f"uris={_uris!s}, "
183
+ f"range_start={_range_start!s}, "
184
+ f"insert_before={_insert_before!s}, "
185
+ f"range_length={_range_length!s}, "
186
+ f"snapshot_id={_snapshot_id!s}, "
187
+ f")"
188
+ )
@@ -0,0 +1,109 @@
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.track_1 import Track1
9
+
10
+
11
+ class PlaylistsTracksRequest2(object):
12
+ """Implementation of the 'Playlists Tracks Request2' model.
13
+
14
+ Attributes:
15
+ tracks (List[Track1]): An array of objects containing [Spotify
16
+ URIs](/documentation/web-api/concepts/spotify-uris-ids) of the tracks or
17
+ episodes to remove. For example: `{ "tracks": [{ "uri":
18
+ "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },{ "uri":
19
+ "spotify:track:1301WleyT98MSxVHPZCA6M" }] }`. A maximum of 100 objects
20
+ can be sent at once.
21
+ snapshot_id (str): The playlist's snapshot ID against which you want to make
22
+ the changes. The API will validate that the specified items exist and in
23
+ the specified positions and make the changes, even if more recent changes
24
+ have been made to the playlist.
25
+
26
+ """
27
+
28
+ # Create a mapping from Model property names to API property names
29
+ _names = {
30
+ "tracks": "tracks",
31
+ "snapshot_id": "snapshot_id",
32
+ }
33
+
34
+ _optionals = [
35
+ "snapshot_id",
36
+ ]
37
+
38
+ def __init__(
39
+ self,
40
+ tracks=None,
41
+ snapshot_id=APIHelper.SKIP):
42
+ """Initialize a PlaylistsTracksRequest2 instance."""
43
+ # Initialize members of the class
44
+ self.tracks = tracks
45
+ if snapshot_id is not APIHelper.SKIP:
46
+ self.snapshot_id = snapshot_id
47
+
48
+ @classmethod
49
+ def from_dictionary(cls,
50
+ dictionary):
51
+ """Create an instance of this model from a dictionary
52
+
53
+ Args:
54
+ dictionary (dictionary): A dictionary representation of the object
55
+ as obtained from the deserialization of the server's response. The
56
+ keys MUST match property names in the API description.
57
+
58
+ Returns:
59
+ object: An instance of this structure class.
60
+
61
+ """
62
+ if not isinstance(dictionary, dict) or dictionary is None:
63
+ return None
64
+
65
+ # Extract variables from the dictionary
66
+ tracks = None
67
+ if dictionary.get("tracks") is not None:
68
+ tracks = [
69
+ Track1.from_dictionary(x)
70
+ for x in dictionary.get("tracks")
71
+ ]
72
+ snapshot_id =\
73
+ dictionary.get("snapshot_id")\
74
+ if dictionary.get("snapshot_id")\
75
+ else APIHelper.SKIP
76
+
77
+ # Return an object of this model
78
+ return cls(tracks,
79
+ snapshot_id)
80
+
81
+ def __repr__(self):
82
+ """Return a unambiguous string representation."""
83
+ _tracks=self.tracks
84
+ _snapshot_id=(
85
+ self.snapshot_id
86
+ if hasattr(self, "snapshot_id")
87
+ else None
88
+ )
89
+ return (
90
+ f"{self.__class__.__name__}("
91
+ f"tracks={_tracks!r}, "
92
+ f"snapshot_id={_snapshot_id!r}, "
93
+ f")"
94
+ )
95
+
96
+ def __str__(self):
97
+ """Return a human-readable string representation."""
98
+ _tracks=self.tracks
99
+ _snapshot_id=(
100
+ self.snapshot_id
101
+ if hasattr(self, "snapshot_id")
102
+ else None
103
+ )
104
+ return (
105
+ f"{self.__class__.__name__}("
106
+ f"tracks={_tracks!s}, "
107
+ f"snapshot_id={_snapshot_id!s}, "
108
+ f")"
109
+ )