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,118 @@
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 QueueObject(object):
11
+ """Implementation of the 'QueueObject' model.
12
+
13
+ Attributes:
14
+ currently_playing (TrackObject | EpisodeObject | None): The currently playing
15
+ track or episode. Can be `null`.
16
+ queue (List[TrackObject | EpisodeObject] | None): The tracks or episodes in
17
+ the queue. Can be empty.
18
+
19
+ """
20
+
21
+ # Create a mapping from Model property names to API property names
22
+ _names = {
23
+ "currently_playing": "currently_playing",
24
+ "queue": "queue",
25
+ }
26
+
27
+ _optionals = [
28
+ "currently_playing",
29
+ "queue",
30
+ ]
31
+
32
+ def __init__(
33
+ self,
34
+ currently_playing=APIHelper.SKIP,
35
+ queue=APIHelper.SKIP):
36
+ """Initialize a QueueObject instance."""
37
+ # Initialize members of the class
38
+ if currently_playing is not APIHelper.SKIP:
39
+ self.currently_playing = currently_playing
40
+ if queue is not APIHelper.SKIP:
41
+ self.queue = queue
42
+
43
+ @classmethod
44
+ def from_dictionary(cls,
45
+ dictionary):
46
+ """Create an instance of this model from a dictionary
47
+
48
+ Args:
49
+ dictionary (dictionary): A dictionary representation of the object
50
+ as obtained from the deserialization of the server's response. The
51
+ keys MUST match property names in the API description.
52
+
53
+ Returns:
54
+ object: An instance of this structure class.
55
+
56
+ """
57
+ from spotifywebapi.utilities.union_type_lookup import (
58
+ UnionTypeLookUp,
59
+ )
60
+
61
+ if not isinstance(dictionary, dict) or dictionary is None:
62
+ return None
63
+
64
+ # Extract variables from the dictionary
65
+ currently_playing = APIHelper.deserialize_union_type(
66
+ UnionTypeLookUp.get("QueueObjectCurrentlyPlaying"),
67
+ dictionary.get("currently_playing"),
68
+ False)\
69
+ if dictionary.get("currently_playing") is not None\
70
+ else APIHelper.SKIP
71
+ queue = APIHelper.deserialize_union_type(
72
+ UnionTypeLookUp.get("QueueObjectQueue"),
73
+ dictionary.get("queue"),
74
+ False)\
75
+ if dictionary.get("queue") is not None\
76
+ else APIHelper.SKIP
77
+
78
+ # Return an object of this model
79
+ return cls(currently_playing,
80
+ queue)
81
+
82
+ def __repr__(self):
83
+ """Return a unambiguous string representation."""
84
+ _currently_playing=(
85
+ self.currently_playing
86
+ if hasattr(self, "currently_playing")
87
+ else None
88
+ )
89
+ _queue=(
90
+ self.queue
91
+ if hasattr(self, "queue")
92
+ else None
93
+ )
94
+ return (
95
+ f"{self.__class__.__name__}("
96
+ f"currently_playing={_currently_playing!r}, "
97
+ f"queue={_queue!r}, "
98
+ f")"
99
+ )
100
+
101
+ def __str__(self):
102
+ """Return a human-readable string representation."""
103
+ _currently_playing=(
104
+ self.currently_playing
105
+ if hasattr(self, "currently_playing")
106
+ else None
107
+ )
108
+ _queue=(
109
+ self.queue
110
+ if hasattr(self, "queue")
111
+ else None
112
+ )
113
+ return (
114
+ f"{self.__class__.__name__}("
115
+ f"currently_playing={_currently_playing!s}, "
116
+ f"queue={_queue!s}, "
117
+ f")"
118
+ )
@@ -0,0 +1,65 @@
1
+ """spotifywebapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+
8
+ class ReasonEnum(object):
9
+ """Implementation of the 'Reason' enum.
10
+
11
+ The reason for the restriction. Albums may be restricted if the content is not
12
+ available in a given market, to the user's subscription type, or when the user's
13
+ account is set to not play explicit content.
14
+ Additional reasons may be added in the future.
15
+
16
+ Attributes:
17
+ MARKET: The enum member of type str.
18
+ PRODUCT: The enum member of type str.
19
+ EXPLICIT: The enum member of type str.
20
+
21
+ """
22
+
23
+ _all_values = ["market", "product", "explicit"]
24
+ MARKET = "market"
25
+
26
+ PRODUCT = "product"
27
+
28
+ EXPLICIT = "explicit"
29
+
30
+ @classmethod
31
+ def validate(cls, value):
32
+ """Validate value contains in enum
33
+
34
+ Args:
35
+ value: the value to be validated
36
+
37
+ Returns:
38
+ boolean : if value is valid enum values.
39
+
40
+ """
41
+ return value in cls._all_values
42
+
43
+ @classmethod
44
+ def from_value(cls, value, default=None):
45
+ """Return the matching enum value for the given input."""
46
+ if value is None:
47
+ return default
48
+
49
+ # If numeric and matches directly
50
+ if isinstance(value, int):
51
+ for name, val in cls.__dict__.items():
52
+ if not name.startswith("_") and val == value:
53
+ return val
54
+
55
+ # If string, perform case-insensitive match
56
+ if isinstance(value, str):
57
+ value_lower = value.lower()
58
+ for name, val in cls.__dict__.items():
59
+ if not name.startswith("_") and (
60
+ name.lower() == value_lower or str(val).lower() == value_lower
61
+ ):
62
+ return val
63
+
64
+ # Fallback to default
65
+ return default
@@ -0,0 +1,208 @@
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 RecommendationSeedObject(object):
11
+ """Implementation of the 'RecommendationSeedObject' model.
12
+
13
+ Attributes:
14
+ after_filtering_size (int): The number of tracks available after min\_\* and
15
+ max\_\* filters have been applied.
16
+ after_relinking_size (int): The number of tracks available after relinking
17
+ for regional availability.
18
+ href (str): A link to the full track or artist data for this seed. For tracks
19
+ this will be a link to a Track Object. For artists a link to an Artist
20
+ Object. For genre seeds, this value will be `null`.
21
+ id (str): The id used to select this seed. This will be the same as the
22
+ string used in the `seed_artists`, `seed_tracks` or `seed_genres`
23
+ parameter.
24
+ initial_pool_size (int): The number of recommended tracks available for this
25
+ seed.
26
+ mtype (str): The entity type of this seed. One of `artist`, `track` or
27
+ `genre`.
28
+
29
+ """
30
+
31
+ # Create a mapping from Model property names to API property names
32
+ _names = {
33
+ "after_filtering_size": "afterFilteringSize",
34
+ "after_relinking_size": "afterRelinkingSize",
35
+ "href": "href",
36
+ "id": "id",
37
+ "initial_pool_size": "initialPoolSize",
38
+ "mtype": "type",
39
+ }
40
+
41
+ _optionals = [
42
+ "after_filtering_size",
43
+ "after_relinking_size",
44
+ "href",
45
+ "id",
46
+ "initial_pool_size",
47
+ "mtype",
48
+ ]
49
+
50
+ def __init__(
51
+ self,
52
+ after_filtering_size=APIHelper.SKIP,
53
+ after_relinking_size=APIHelper.SKIP,
54
+ href=APIHelper.SKIP,
55
+ id=APIHelper.SKIP,
56
+ initial_pool_size=APIHelper.SKIP,
57
+ mtype=APIHelper.SKIP):
58
+ """Initialize a RecommendationSeedObject instance."""
59
+ # Initialize members of the class
60
+ if after_filtering_size is not APIHelper.SKIP:
61
+ self.after_filtering_size = after_filtering_size
62
+ if after_relinking_size is not APIHelper.SKIP:
63
+ self.after_relinking_size = after_relinking_size
64
+ if href is not APIHelper.SKIP:
65
+ self.href = href
66
+ if id is not APIHelper.SKIP:
67
+ self.id = id
68
+ if initial_pool_size is not APIHelper.SKIP:
69
+ self.initial_pool_size = initial_pool_size
70
+ if mtype is not APIHelper.SKIP:
71
+ self.mtype = mtype
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
+ after_filtering_size =\
92
+ dictionary.get("afterFilteringSize")\
93
+ if dictionary.get("afterFilteringSize")\
94
+ else APIHelper.SKIP
95
+ after_relinking_size =\
96
+ dictionary.get("afterRelinkingSize")\
97
+ if dictionary.get("afterRelinkingSize")\
98
+ else APIHelper.SKIP
99
+ href =\
100
+ dictionary.get("href")\
101
+ if dictionary.get("href")\
102
+ else APIHelper.SKIP
103
+ id =\
104
+ dictionary.get("id")\
105
+ if dictionary.get("id")\
106
+ else APIHelper.SKIP
107
+ initial_pool_size =\
108
+ dictionary.get("initialPoolSize")\
109
+ if dictionary.get("initialPoolSize")\
110
+ else APIHelper.SKIP
111
+ mtype =\
112
+ dictionary.get("type")\
113
+ if dictionary.get("type")\
114
+ else APIHelper.SKIP
115
+
116
+ # Return an object of this model
117
+ return cls(after_filtering_size,
118
+ after_relinking_size,
119
+ href,
120
+ id,
121
+ initial_pool_size,
122
+ mtype)
123
+
124
+ def __repr__(self):
125
+ """Return a unambiguous string representation."""
126
+ _after_filtering_size=(
127
+ self.after_filtering_size
128
+ if hasattr(self, "after_filtering_size")
129
+ else None
130
+ )
131
+ _after_relinking_size=(
132
+ self.after_relinking_size
133
+ if hasattr(self, "after_relinking_size")
134
+ else None
135
+ )
136
+ _href=(
137
+ self.href
138
+ if hasattr(self, "href")
139
+ else None
140
+ )
141
+ _id=(
142
+ self.id
143
+ if hasattr(self, "id")
144
+ else None
145
+ )
146
+ _initial_pool_size=(
147
+ self.initial_pool_size
148
+ if hasattr(self, "initial_pool_size")
149
+ else None
150
+ )
151
+ _mtype=(
152
+ self.mtype
153
+ if hasattr(self, "mtype")
154
+ else None
155
+ )
156
+ return (
157
+ f"{self.__class__.__name__}("
158
+ f"after_filtering_size={_after_filtering_size!r}, "
159
+ f"after_relinking_size={_after_relinking_size!r}, "
160
+ f"href={_href!r}, "
161
+ f"id={_id!r}, "
162
+ f"initial_pool_size={_initial_pool_size!r}, "
163
+ f"mtype={_mtype!r}, "
164
+ f")"
165
+ )
166
+
167
+ def __str__(self):
168
+ """Return a human-readable string representation."""
169
+ _after_filtering_size=(
170
+ self.after_filtering_size
171
+ if hasattr(self, "after_filtering_size")
172
+ else None
173
+ )
174
+ _after_relinking_size=(
175
+ self.after_relinking_size
176
+ if hasattr(self, "after_relinking_size")
177
+ else None
178
+ )
179
+ _href=(
180
+ self.href
181
+ if hasattr(self, "href")
182
+ else None
183
+ )
184
+ _id=(
185
+ self.id
186
+ if hasattr(self, "id")
187
+ else None
188
+ )
189
+ _initial_pool_size=(
190
+ self.initial_pool_size
191
+ if hasattr(self, "initial_pool_size")
192
+ else None
193
+ )
194
+ _mtype=(
195
+ self.mtype
196
+ if hasattr(self, "mtype")
197
+ else None
198
+ )
199
+ return (
200
+ f"{self.__class__.__name__}("
201
+ f"after_filtering_size={_after_filtering_size!s}, "
202
+ f"after_relinking_size={_after_relinking_size!s}, "
203
+ f"href={_href!s}, "
204
+ f"id={_id!s}, "
205
+ f"initial_pool_size={_initial_pool_size!s}, "
206
+ f"mtype={_mtype!s}, "
207
+ f")"
208
+ )
@@ -0,0 +1,96 @@
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.recommendation_seed_object import (
8
+ RecommendationSeedObject,
9
+ )
10
+ from spotifywebapi.models.track_object import (
11
+ TrackObject,
12
+ )
13
+
14
+
15
+ class RecommendationsObject(object):
16
+ """Implementation of the 'RecommendationsObject' model.
17
+
18
+ Attributes:
19
+ seeds (List[RecommendationSeedObject]): An array of recommendation seed
20
+ objects.
21
+ tracks (List[TrackObject]): An array of track objects ordered according to
22
+ the parameters supplied.
23
+
24
+ """
25
+
26
+ # Create a mapping from Model property names to API property names
27
+ _names = {
28
+ "seeds": "seeds",
29
+ "tracks": "tracks",
30
+ }
31
+
32
+ def __init__(
33
+ self,
34
+ seeds=None,
35
+ tracks=None):
36
+ """Initialize a RecommendationsObject instance."""
37
+ # Initialize members of the class
38
+ self.seeds = seeds
39
+ self.tracks = tracks
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
+ seeds = None
60
+ if dictionary.get("seeds") is not None:
61
+ seeds = [
62
+ RecommendationSeedObject.from_dictionary(x)
63
+ for x in dictionary.get("seeds")
64
+ ]
65
+ tracks = None
66
+ if dictionary.get("tracks") is not None:
67
+ tracks = [
68
+ TrackObject.from_dictionary(x)
69
+ for x in dictionary.get("tracks")
70
+ ]
71
+
72
+ # Return an object of this model
73
+ return cls(seeds,
74
+ tracks)
75
+
76
+ def __repr__(self):
77
+ """Return a unambiguous string representation."""
78
+ _seeds=self.seeds
79
+ _tracks=self.tracks
80
+ return (
81
+ f"{self.__class__.__name__}("
82
+ f"seeds={_seeds!r}, "
83
+ f"tracks={_tracks!r}, "
84
+ f")"
85
+ )
86
+
87
+ def __str__(self):
88
+ """Return a human-readable string representation."""
89
+ _seeds=self.seeds
90
+ _tracks=self.tracks
91
+ return (
92
+ f"{self.__class__.__name__}("
93
+ f"seeds={_seeds!s}, "
94
+ f"tracks={_tracks!s}, "
95
+ f")"
96
+ )
@@ -0,0 +1,62 @@
1
+ """spotifywebapi.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+
8
+ class ReleaseDatePrecisionEnum(object):
9
+ """Implementation of the 'ReleaseDatePrecision' enum.
10
+
11
+ The precision with which `release_date` value is known.
12
+
13
+ Attributes:
14
+ YEAR: The enum member of type str.
15
+ MONTH: The enum member of type str.
16
+ DAY: The enum member of type str.
17
+
18
+ """
19
+
20
+ _all_values = ["year", "month", "day"]
21
+ YEAR = "year"
22
+
23
+ MONTH = "month"
24
+
25
+ DAY = "day"
26
+
27
+ @classmethod
28
+ def validate(cls, value):
29
+ """Validate value contains in enum
30
+
31
+ Args:
32
+ value: the value to be validated
33
+
34
+ Returns:
35
+ boolean : if value is valid enum values.
36
+
37
+ """
38
+ return value in cls._all_values
39
+
40
+ @classmethod
41
+ def from_value(cls, value, default=None):
42
+ """Return the matching enum value for the given input."""
43
+ if value is None:
44
+ return default
45
+
46
+ # If numeric and matches directly
47
+ if isinstance(value, int):
48
+ for name, val in cls.__dict__.items():
49
+ if not name.startswith("_") and val == value:
50
+ return val
51
+
52
+ # If string, perform case-insensitive match
53
+ if isinstance(value, str):
54
+ value_lower = value.lower()
55
+ for name, val in cls.__dict__.items():
56
+ if not name.startswith("_") and (
57
+ name.lower() == value_lower or str(val).lower() == value_lower
58
+ ):
59
+ return val
60
+
61
+ # Fallback to default
62
+ return default
@@ -0,0 +1,131 @@
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 ResumePointObject(object):
11
+ """Implementation of the 'ResumePointObject' model.
12
+
13
+ Attributes:
14
+ fully_played (bool): Whether or not the episode has been fully played by the
15
+ user.
16
+ resume_position_ms (int): The user's most recent position in the episode in
17
+ milliseconds.
18
+
19
+ """
20
+
21
+ # Create a mapping from Model property names to API property names
22
+ _names = {
23
+ "fully_played": "fully_played",
24
+ "resume_position_ms": "resume_position_ms",
25
+ }
26
+
27
+ _optionals = [
28
+ "fully_played",
29
+ "resume_position_ms",
30
+ ]
31
+
32
+ def __init__(
33
+ self,
34
+ fully_played=APIHelper.SKIP,
35
+ resume_position_ms=APIHelper.SKIP):
36
+ """Initialize a ResumePointObject instance."""
37
+ # Initialize members of the class
38
+ if fully_played is not APIHelper.SKIP:
39
+ self.fully_played = fully_played
40
+ if resume_position_ms is not APIHelper.SKIP:
41
+ self.resume_position_ms = resume_position_ms
42
+
43
+ @classmethod
44
+ def from_dictionary(cls,
45
+ dictionary):
46
+ """Create an instance of this model from a dictionary
47
+
48
+ Args:
49
+ dictionary (dictionary): A dictionary representation of the object
50
+ as obtained from the deserialization of the server's response. The
51
+ keys MUST match property names in the API description.
52
+
53
+ Returns:
54
+ object: An instance of this structure class.
55
+
56
+ """
57
+ if not isinstance(dictionary, dict) or dictionary is None:
58
+ return None
59
+
60
+ # Extract variables from the dictionary
61
+ fully_played =\
62
+ dictionary.get("fully_played")\
63
+ if "fully_played" in dictionary.keys()\
64
+ else APIHelper.SKIP
65
+ resume_position_ms =\
66
+ dictionary.get("resume_position_ms")\
67
+ if dictionary.get("resume_position_ms")\
68
+ else APIHelper.SKIP
69
+
70
+ # Return an object of this model
71
+ return cls(fully_played,
72
+ resume_position_ms)
73
+
74
+ @classmethod
75
+ def validate(cls, dictionary):
76
+ """Validate dictionary against class required properties
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
+ boolean : if dictionary is valid contains required properties.
85
+
86
+ """
87
+ if isinstance(dictionary, cls):
88
+ return True
89
+
90
+ if not isinstance(dictionary, dict):
91
+ return False
92
+
93
+ return True
94
+
95
+ def __repr__(self):
96
+ """Return a unambiguous string representation."""
97
+ _fully_played=(
98
+ self.fully_played
99
+ if hasattr(self, "fully_played")
100
+ else None
101
+ )
102
+ _resume_position_ms=(
103
+ self.resume_position_ms
104
+ if hasattr(self, "resume_position_ms")
105
+ else None
106
+ )
107
+ return (
108
+ f"{self.__class__.__name__}("
109
+ f"fully_played={_fully_played!r}, "
110
+ f"resume_position_ms={_resume_position_ms!r}, "
111
+ f")"
112
+ )
113
+
114
+ def __str__(self):
115
+ """Return a human-readable string representation."""
116
+ _fully_played=(
117
+ self.fully_played
118
+ if hasattr(self, "fully_played")
119
+ else None
120
+ )
121
+ _resume_position_ms=(
122
+ self.resume_position_ms
123
+ if hasattr(self, "resume_position_ms")
124
+ else None
125
+ )
126
+ return (
127
+ f"{self.__class__.__name__}("
128
+ f"fully_played={_fully_played!s}, "
129
+ f"resume_position_ms={_resume_position_ms!s}, "
130
+ f")"
131
+ )