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,112 @@
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 TrackRestrictionObject(object):
11
+ """Implementation of the 'TrackRestrictionObject' model.
12
+
13
+ Attributes:
14
+ reason (str): The reason for the restriction. Supported values: - `market` -
15
+ The content item is not available in the given market. - `product` - The
16
+ content item is not available for the user's subscription type. -
17
+ `explicit` - The content item is explicit and the user's account is set
18
+ to not play explicit content. Additional reasons may be added in the
19
+ future. **Note**: If you use this field, make sure that your application
20
+ safely handles unknown values.
21
+
22
+ """
23
+
24
+ # Create a mapping from Model property names to API property names
25
+ _names = {
26
+ "reason": "reason",
27
+ }
28
+
29
+ _optionals = [
30
+ "reason",
31
+ ]
32
+
33
+ def __init__(
34
+ self,
35
+ reason=APIHelper.SKIP):
36
+ """Initialize a TrackRestrictionObject instance."""
37
+ # Initialize members of the class
38
+ if reason is not APIHelper.SKIP:
39
+ self.reason = reason
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
+ reason =\
60
+ dictionary.get("reason")\
61
+ if dictionary.get("reason")\
62
+ else APIHelper.SKIP
63
+
64
+ # Return an object of this model
65
+ return cls(reason)
66
+
67
+ @classmethod
68
+ def validate(cls, dictionary):
69
+ """Validate dictionary against class required properties
70
+
71
+ Args:
72
+ dictionary (dictionary): A dictionary representation of the object
73
+ as obtained from the deserialization of the server's response. The
74
+ keys MUST match property names in the API description.
75
+
76
+ Returns:
77
+ boolean : if dictionary is valid contains required properties.
78
+
79
+ """
80
+ if isinstance(dictionary, cls):
81
+ return True
82
+
83
+ if not isinstance(dictionary, dict):
84
+ return False
85
+
86
+ return True
87
+
88
+ def __repr__(self):
89
+ """Return a unambiguous string representation."""
90
+ _reason=(
91
+ self.reason
92
+ if hasattr(self, "reason")
93
+ else None
94
+ )
95
+ return (
96
+ f"{self.__class__.__name__}("
97
+ f"reason={_reason!r}, "
98
+ f")"
99
+ )
100
+
101
+ def __str__(self):
102
+ """Return a human-readable string representation."""
103
+ _reason=(
104
+ self.reason
105
+ if hasattr(self, "reason")
106
+ else None
107
+ )
108
+ return (
109
+ f"{self.__class__.__name__}("
110
+ f"reason={_reason!s}, "
111
+ f")"
112
+ )
@@ -0,0 +1,56 @@
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 Type2Enum(object):
9
+ """Implementation of the 'Type2' enum.
10
+
11
+ The object type.
12
+
13
+ Attributes:
14
+ ALBUM: The enum member of type str.
15
+
16
+ """
17
+
18
+ _all_values = ["album"]
19
+ ALBUM = "album"
20
+
21
+ @classmethod
22
+ def validate(cls, value):
23
+ """Validate value contains in enum
24
+
25
+ Args:
26
+ value: the value to be validated
27
+
28
+ Returns:
29
+ boolean : if value is valid enum values.
30
+
31
+ """
32
+ return value in cls._all_values
33
+
34
+ @classmethod
35
+ def from_value(cls, value, default=None):
36
+ """Return the matching enum value for the given input."""
37
+ if value is None:
38
+ return default
39
+
40
+ # If numeric and matches directly
41
+ if isinstance(value, int):
42
+ for name, val in cls.__dict__.items():
43
+ if not name.startswith("_") and val == value:
44
+ return val
45
+
46
+ # If string, perform case-insensitive match
47
+ if isinstance(value, str):
48
+ value_lower = value.lower()
49
+ for name, val in cls.__dict__.items():
50
+ if not name.startswith("_") and (
51
+ name.lower() == value_lower or str(val).lower() == value_lower
52
+ ):
53
+ return val
54
+
55
+ # Fallback to default
56
+ return default
@@ -0,0 +1,56 @@
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 Type3Enum(object):
9
+ """Implementation of the 'Type3' enum.
10
+
11
+ The object type: "track".
12
+
13
+ Attributes:
14
+ TRACK: The enum member of type str.
15
+
16
+ """
17
+
18
+ _all_values = ["track"]
19
+ TRACK = "track"
20
+
21
+ @classmethod
22
+ def validate(cls, value):
23
+ """Validate value contains in enum
24
+
25
+ Args:
26
+ value: the value to be validated
27
+
28
+ Returns:
29
+ boolean : if value is valid enum values.
30
+
31
+ """
32
+ return value in cls._all_values
33
+
34
+ @classmethod
35
+ def from_value(cls, value, default=None):
36
+ """Return the matching enum value for the given input."""
37
+ if value is None:
38
+ return default
39
+
40
+ # If numeric and matches directly
41
+ if isinstance(value, int):
42
+ for name, val in cls.__dict__.items():
43
+ if not name.startswith("_") and val == value:
44
+ return val
45
+
46
+ # If string, perform case-insensitive match
47
+ if isinstance(value, str):
48
+ value_lower = value.lower()
49
+ for name, val in cls.__dict__.items():
50
+ if not name.startswith("_") and (
51
+ name.lower() == value_lower or str(val).lower() == value_lower
52
+ ):
53
+ return val
54
+
55
+ # Fallback to default
56
+ return default
@@ -0,0 +1,56 @@
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 Type4Enum(object):
9
+ """Implementation of the 'Type4' enum.
10
+
11
+ The object type.
12
+
13
+ Attributes:
14
+ USER: The enum member of type str.
15
+
16
+ """
17
+
18
+ _all_values = ["user"]
19
+ USER = "user"
20
+
21
+ @classmethod
22
+ def validate(cls, value):
23
+ """Validate value contains in enum
24
+
25
+ Args:
26
+ value: the value to be validated
27
+
28
+ Returns:
29
+ boolean : if value is valid enum values.
30
+
31
+ """
32
+ return value in cls._all_values
33
+
34
+ @classmethod
35
+ def from_value(cls, value, default=None):
36
+ """Return the matching enum value for the given input."""
37
+ if value is None:
38
+ return default
39
+
40
+ # If numeric and matches directly
41
+ if isinstance(value, int):
42
+ for name, val in cls.__dict__.items():
43
+ if not name.startswith("_") and val == value:
44
+ return val
45
+
46
+ # If string, perform case-insensitive match
47
+ if isinstance(value, str):
48
+ value_lower = value.lower()
49
+ for name, val in cls.__dict__.items():
50
+ if not name.startswith("_") and (
51
+ name.lower() == value_lower or str(val).lower() == value_lower
52
+ ):
53
+ return val
54
+
55
+ # Fallback to default
56
+ return default
@@ -0,0 +1,56 @@
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 Type5Enum(object):
9
+ """Implementation of the 'Type5' enum.
10
+
11
+ The object type.
12
+
13
+ Attributes:
14
+ EPISODE: The enum member of type str.
15
+
16
+ """
17
+
18
+ _all_values = ["episode"]
19
+ EPISODE = "episode"
20
+
21
+ @classmethod
22
+ def validate(cls, value):
23
+ """Validate value contains in enum
24
+
25
+ Args:
26
+ value: the value to be validated
27
+
28
+ Returns:
29
+ boolean : if value is valid enum values.
30
+
31
+ """
32
+ return value in cls._all_values
33
+
34
+ @classmethod
35
+ def from_value(cls, value, default=None):
36
+ """Return the matching enum value for the given input."""
37
+ if value is None:
38
+ return default
39
+
40
+ # If numeric and matches directly
41
+ if isinstance(value, int):
42
+ for name, val in cls.__dict__.items():
43
+ if not name.startswith("_") and val == value:
44
+ return val
45
+
46
+ # If string, perform case-insensitive match
47
+ if isinstance(value, str):
48
+ value_lower = value.lower()
49
+ for name, val in cls.__dict__.items():
50
+ if not name.startswith("_") and (
51
+ name.lower() == value_lower or str(val).lower() == value_lower
52
+ ):
53
+ return val
54
+
55
+ # Fallback to default
56
+ return default
@@ -0,0 +1,56 @@
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 Type6Enum(object):
9
+ """Implementation of the 'Type6' enum.
10
+
11
+ The object type.
12
+
13
+ Attributes:
14
+ SHOW: The enum member of type str.
15
+
16
+ """
17
+
18
+ _all_values = ["show"]
19
+ SHOW = "show"
20
+
21
+ @classmethod
22
+ def validate(cls, value):
23
+ """Validate value contains in enum
24
+
25
+ Args:
26
+ value: the value to be validated
27
+
28
+ Returns:
29
+ boolean : if value is valid enum values.
30
+
31
+ """
32
+ return value in cls._all_values
33
+
34
+ @classmethod
35
+ def from_value(cls, value, default=None):
36
+ """Return the matching enum value for the given input."""
37
+ if value is None:
38
+ return default
39
+
40
+ # If numeric and matches directly
41
+ if isinstance(value, int):
42
+ for name, val in cls.__dict__.items():
43
+ if not name.startswith("_") and val == value:
44
+ return val
45
+
46
+ # If string, perform case-insensitive match
47
+ if isinstance(value, str):
48
+ value_lower = value.lower()
49
+ for name, val in cls.__dict__.items():
50
+ if not name.startswith("_") and (
51
+ name.lower() == value_lower or str(val).lower() == value_lower
52
+ ):
53
+ return val
54
+
55
+ # Fallback to default
56
+ return default
@@ -0,0 +1,42 @@
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 Type8Enum(object):
9
+ """Implementation of the 'Type8' enum.
10
+
11
+ The object type.
12
+
13
+ Attributes:
14
+ AUDIO_FEATURES: The enum member of type str.
15
+
16
+ """
17
+
18
+ AUDIO_FEATURES = "audio_features"
19
+
20
+ @classmethod
21
+ def from_value(cls, value, default=None):
22
+ """Return the matching enum value for the given input."""
23
+ if value is None:
24
+ return default
25
+
26
+ # If numeric and matches directly
27
+ if isinstance(value, int):
28
+ for name, val in cls.__dict__.items():
29
+ if not name.startswith("_") and val == value:
30
+ return val
31
+
32
+ # If string, perform case-insensitive match
33
+ if isinstance(value, str):
34
+ value_lower = value.lower()
35
+ for name, val in cls.__dict__.items():
36
+ if not name.startswith("_") and (
37
+ name.lower() == value_lower or str(val).lower() == value_lower
38
+ ):
39
+ return val
40
+
41
+ # Fallback to default
42
+ return default
@@ -0,0 +1,42 @@
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 Type9Enum(object):
9
+ """Implementation of the 'Type9' enum.
10
+
11
+ The object type.
12
+
13
+ Attributes:
14
+ AUDIOBOOK: The enum member of type str.
15
+
16
+ """
17
+
18
+ AUDIOBOOK = "audiobook"
19
+
20
+ @classmethod
21
+ def from_value(cls, value, default=None):
22
+ """Return the matching enum value for the given input."""
23
+ if value is None:
24
+ return default
25
+
26
+ # If numeric and matches directly
27
+ if isinstance(value, int):
28
+ for name, val in cls.__dict__.items():
29
+ if not name.startswith("_") and val == value:
30
+ return val
31
+
32
+ # If string, perform case-insensitive match
33
+ if isinstance(value, str):
34
+ value_lower = value.lower()
35
+ for name, val in cls.__dict__.items():
36
+ if not name.startswith("_") and (
37
+ name.lower() == value_lower or str(val).lower() == value_lower
38
+ ):
39
+ return val
40
+
41
+ # Fallback to default
42
+ return default
@@ -0,0 +1,56 @@
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 TypeEnum(object):
9
+ """Implementation of the 'Type' enum.
10
+
11
+ The object type.
12
+
13
+ Attributes:
14
+ ARTIST: The enum member of type str.
15
+
16
+ """
17
+
18
+ _all_values = ["artist"]
19
+ ARTIST = "artist"
20
+
21
+ @classmethod
22
+ def validate(cls, value):
23
+ """Validate value contains in enum
24
+
25
+ Args:
26
+ value: the value to be validated
27
+
28
+ Returns:
29
+ boolean : if value is valid enum values.
30
+
31
+ """
32
+ return value in cls._all_values
33
+
34
+ @classmethod
35
+ def from_value(cls, value, default=None):
36
+ """Return the matching enum value for the given input."""
37
+ if value is None:
38
+ return default
39
+
40
+ # If numeric and matches directly
41
+ if isinstance(value, int):
42
+ for name, val in cls.__dict__.items():
43
+ if not name.startswith("_") and val == value:
44
+ return val
45
+
46
+ # If string, perform case-insensitive match
47
+ if isinstance(value, str):
48
+ value_lower = value.lower()
49
+ for name, val in cls.__dict__.items():
50
+ if not name.startswith("_") and (
51
+ name.lower() == value_lower or str(val).lower() == value_lower
52
+ ):
53
+ return val
54
+
55
+ # Fallback to default
56
+ return default
@@ -0,0 +1,154 @@
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 UsersPlaylistsRequest(object):
11
+ """Implementation of the 'Users Playlists Request' model.
12
+
13
+ Attributes:
14
+ name (str): The name for the new playlist, for example `"Your Coolest
15
+ Playlist"`. This name does not need to be unique; a user may have several
16
+ playlists with the same name.
17
+ public (bool): Defaults to `true`. If `true` the playlist will be public, if
18
+ `false` it will be private. To be able to create private playlists, the
19
+ user must have granted the `playlist-modify-private`
20
+ [scope](/documentation/web-api/concepts/scopes/#list-of-scopes)
21
+ collaborative (bool): Defaults to `false`. If `true` the playlist will be
22
+ collaborative. _**Note**: to create a collaborative playlist you must
23
+ also set `public` to `false`. To create collaborative playlists you must
24
+ have granted `playlist-modify-private` and `playlist-modify-public`
25
+ [scopes](/documentation/web-api/concepts/scopes/#list-of-scopes)._
26
+ description (str): value for playlist description as displayed in Spotify
27
+ Clients and in the Web API.
28
+
29
+ """
30
+
31
+ # Create a mapping from Model property names to API property names
32
+ _names = {
33
+ "name": "name",
34
+ "public": "public",
35
+ "collaborative": "collaborative",
36
+ "description": "description",
37
+ }
38
+
39
+ _optionals = [
40
+ "public",
41
+ "collaborative",
42
+ "description",
43
+ ]
44
+
45
+ def __init__(
46
+ self,
47
+ name=None,
48
+ public=APIHelper.SKIP,
49
+ collaborative=APIHelper.SKIP,
50
+ description=APIHelper.SKIP):
51
+ """Initialize a UsersPlaylistsRequest instance."""
52
+ # Initialize members of the class
53
+ self.name = name
54
+ if public is not APIHelper.SKIP:
55
+ self.public = public
56
+ if collaborative is not APIHelper.SKIP:
57
+ self.collaborative = collaborative
58
+ if description is not APIHelper.SKIP:
59
+ self.description = description
60
+
61
+ @classmethod
62
+ def from_dictionary(cls,
63
+ dictionary):
64
+ """Create an instance of this model from a dictionary
65
+
66
+ Args:
67
+ dictionary (dictionary): A dictionary representation of the object
68
+ as obtained from the deserialization of the server's response. The
69
+ keys MUST match property names in the API description.
70
+
71
+ Returns:
72
+ object: An instance of this structure class.
73
+
74
+ """
75
+ if not isinstance(dictionary, dict) or dictionary is None:
76
+ return None
77
+
78
+ # Extract variables from the dictionary
79
+ name =\
80
+ dictionary.get("name")\
81
+ if dictionary.get("name")\
82
+ else None
83
+ public =\
84
+ dictionary.get("public")\
85
+ if "public" in dictionary.keys()\
86
+ else APIHelper.SKIP
87
+ collaborative =\
88
+ dictionary.get("collaborative")\
89
+ if "collaborative" in dictionary.keys()\
90
+ else APIHelper.SKIP
91
+ description =\
92
+ dictionary.get("description")\
93
+ if dictionary.get("description")\
94
+ else APIHelper.SKIP
95
+
96
+ # Return an object of this model
97
+ return cls(name,
98
+ public,
99
+ collaborative,
100
+ description)
101
+
102
+ def __repr__(self):
103
+ """Return a unambiguous string representation."""
104
+ _name=self.name
105
+ _public=(
106
+ self.public
107
+ if hasattr(self, "public")
108
+ else None
109
+ )
110
+ _collaborative=(
111
+ self.collaborative
112
+ if hasattr(self, "collaborative")
113
+ else None
114
+ )
115
+ _description=(
116
+ self.description
117
+ if hasattr(self, "description")
118
+ else None
119
+ )
120
+ return (
121
+ f"{self.__class__.__name__}("
122
+ f"name={_name!r}, "
123
+ f"public={_public!r}, "
124
+ f"collaborative={_collaborative!r}, "
125
+ f"description={_description!r}, "
126
+ f")"
127
+ )
128
+
129
+ def __str__(self):
130
+ """Return a human-readable string representation."""
131
+ _name=self.name
132
+ _public=(
133
+ self.public
134
+ if hasattr(self, "public")
135
+ else None
136
+ )
137
+ _collaborative=(
138
+ self.collaborative
139
+ if hasattr(self, "collaborative")
140
+ else None
141
+ )
142
+ _description=(
143
+ self.description
144
+ if hasattr(self, "description")
145
+ else None
146
+ )
147
+ return (
148
+ f"{self.__class__.__name__}("
149
+ f"name={_name!s}, "
150
+ f"public={_public!s}, "
151
+ f"collaborative={_collaborative!s}, "
152
+ f"description={_description!s}, "
153
+ f")"
154
+ )