spotify-api-sdk 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +30 -0
- data/README.md +107 -0
- data/lib/spotify_web_api/api_helper.rb +10 -0
- data/lib/spotify_web_api/client.rb +154 -0
- data/lib/spotify_web_api/configuration.rb +180 -0
- data/lib/spotify_web_api/controllers/albums_controller.rb +295 -0
- data/lib/spotify_web_api/controllers/artists_controller.rb +187 -0
- data/lib/spotify_web_api/controllers/audiobooks_controller.rb +258 -0
- data/lib/spotify_web_api/controllers/base_controller.rb +66 -0
- data/lib/spotify_web_api/controllers/categories_controller.rb +83 -0
- data/lib/spotify_web_api/controllers/chapters_controller.rb +82 -0
- data/lib/spotify_web_api/controllers/episodes_controller.rb +239 -0
- data/lib/spotify_web_api/controllers/genres_controller.rb +39 -0
- data/lib/spotify_web_api/controllers/markets_controller.rb +38 -0
- data/lib/spotify_web_api/controllers/o_auth_authorization_controller.rb +82 -0
- data/lib/spotify_web_api/controllers/player_controller.rb +509 -0
- data/lib/spotify_web_api/controllers/playlists_controller.rb +521 -0
- data/lib/spotify_web_api/controllers/search_controller.rb +60 -0
- data/lib/spotify_web_api/controllers/shows_controller.rb +261 -0
- data/lib/spotify_web_api/controllers/tracks_controller.rb +491 -0
- data/lib/spotify_web_api/controllers/users_controller.rb +396 -0
- data/lib/spotify_web_api/exceptions/api_exception.rb +10 -0
- data/lib/spotify_web_api/exceptions/bad_request_exception.rb +32 -0
- data/lib/spotify_web_api/exceptions/forbidden_exception.rb +32 -0
- data/lib/spotify_web_api/exceptions/not_found_exception.rb +32 -0
- data/lib/spotify_web_api/exceptions/o_auth_provider_exception.rb +48 -0
- data/lib/spotify_web_api/exceptions/too_many_requests_exception.rb +32 -0
- data/lib/spotify_web_api/exceptions/unauthorized_exception.rb +32 -0
- data/lib/spotify_web_api/http/api_response.rb +21 -0
- data/lib/spotify_web_api/http/auth/o_auth2.rb +146 -0
- data/lib/spotify_web_api/http/http_call_back.rb +10 -0
- data/lib/spotify_web_api/http/http_method_enum.rb +10 -0
- data/lib/spotify_web_api/http/http_request.rb +10 -0
- data/lib/spotify_web_api/http/http_response.rb +10 -0
- data/lib/spotify_web_api/models/album_base.rb +168 -0
- data/lib/spotify_web_api/models/album_group_enum.rb +29 -0
- data/lib/spotify_web_api/models/album_object.rb +247 -0
- data/lib/spotify_web_api/models/album_restriction_object.rb +53 -0
- data/lib/spotify_web_api/models/album_type_enum.rb +26 -0
- data/lib/spotify_web_api/models/artist_discography_album_object.rb +194 -0
- data/lib/spotify_web_api/models/artist_object.rb +147 -0
- data/lib/spotify_web_api/models/audio_analysis_object.rb +156 -0
- data/lib/spotify_web_api/models/audio_features_object.rb +249 -0
- data/lib/spotify_web_api/models/audiobook_base.rb +245 -0
- data/lib/spotify_web_api/models/audiobook_object.rb +253 -0
- data/lib/spotify_web_api/models/author_object.rb +50 -0
- data/lib/spotify_web_api/models/base_model.rb +62 -0
- data/lib/spotify_web_api/models/categories.rb +110 -0
- data/lib/spotify_web_api/models/category_object.rb +82 -0
- data/lib/spotify_web_api/models/chapter_base.rb +237 -0
- data/lib/spotify_web_api/models/chapter_object.rb +245 -0
- data/lib/spotify_web_api/models/chapter_restriction_object.rb +59 -0
- data/lib/spotify_web_api/models/context_object.rb +78 -0
- data/lib/spotify_web_api/models/copyright_object.rb +60 -0
- data/lib/spotify_web_api/models/currently_playing_context_object.rb +137 -0
- data/lib/spotify_web_api/models/currently_playing_object.rb +109 -0
- data/lib/spotify_web_api/models/cursor_object.rb +59 -0
- data/lib/spotify_web_api/models/cursor_paged_artists.rb +48 -0
- data/lib/spotify_web_api/models/cursor_paging_object.rb +88 -0
- data/lib/spotify_web_api/models/cursor_paging_play_history_object.rb +106 -0
- data/lib/spotify_web_api/models/cursor_paging_simplified_artist_object.rb +106 -0
- data/lib/spotify_web_api/models/device_object.rb +126 -0
- data/lib/spotify_web_api/models/disallows_object.rb +140 -0
- data/lib/spotify_web_api/models/episode_base.rb +237 -0
- data/lib/spotify_web_api/models/episode_object.rb +246 -0
- data/lib/spotify_web_api/models/episode_restriction_object.rb +58 -0
- data/lib/spotify_web_api/models/error_object.rb +59 -0
- data/lib/spotify_web_api/models/explicit_content_settings_object.rb +61 -0
- data/lib/spotify_web_api/models/external_id_object.rb +72 -0
- data/lib/spotify_web_api/models/external_url_object.rb +51 -0
- data/lib/spotify_web_api/models/followers_object.rb +62 -0
- data/lib/spotify_web_api/models/image_object.rb +67 -0
- data/lib/spotify_web_api/models/include_external_enum.rb +23 -0
- data/lib/spotify_web_api/models/item_type1_enum.rb +20 -0
- data/lib/spotify_web_api/models/item_type2_enum.rb +23 -0
- data/lib/spotify_web_api/models/item_type3_enum.rb +23 -0
- data/lib/spotify_web_api/models/item_type_enum.rb +38 -0
- data/lib/spotify_web_api/models/linked_track_object.rb +89 -0
- data/lib/spotify_web_api/models/many_albums.rb +57 -0
- data/lib/spotify_web_api/models/many_artists.rb +57 -0
- data/lib/spotify_web_api/models/many_audio_features.rb +57 -0
- data/lib/spotify_web_api/models/many_audiobooks.rb +57 -0
- data/lib/spotify_web_api/models/many_chapters.rb +57 -0
- data/lib/spotify_web_api/models/many_devices.rb +57 -0
- data/lib/spotify_web_api/models/many_episodes.rb +57 -0
- data/lib/spotify_web_api/models/many_genres.rb +48 -0
- data/lib/spotify_web_api/models/many_simplified_shows.rb +57 -0
- data/lib/spotify_web_api/models/many_tracks.rb +57 -0
- data/lib/spotify_web_api/models/markets.rb +50 -0
- data/lib/spotify_web_api/models/me_albums_request.rb +55 -0
- data/lib/spotify_web_api/models/me_episodes_request.rb +52 -0
- data/lib/spotify_web_api/models/me_episodes_request1.rb +54 -0
- data/lib/spotify_web_api/models/me_following_request.rb +53 -0
- data/lib/spotify_web_api/models/me_following_request1.rb +55 -0
- data/lib/spotify_web_api/models/me_player_play_request.rb +89 -0
- data/lib/spotify_web_api/models/me_player_request.rb +63 -0
- data/lib/spotify_web_api/models/me_shows_request.rb +55 -0
- data/lib/spotify_web_api/models/me_tracks_request.rb +53 -0
- data/lib/spotify_web_api/models/me_tracks_request1.rb +55 -0
- data/lib/spotify_web_api/models/meta.rb +110 -0
- data/lib/spotify_web_api/models/mode_enum.rb +30 -0
- data/lib/spotify_web_api/models/narrator_object.rb +50 -0
- data/lib/spotify_web_api/models/o_auth_provider_error_enum.rb +45 -0
- data/lib/spotify_web_api/models/o_auth_scope_enum.rb +94 -0
- data/lib/spotify_web_api/models/o_auth_token.rb +96 -0
- data/lib/spotify_web_api/models/paged_albums.rb +48 -0
- data/lib/spotify_web_api/models/paged_categories.rb +48 -0
- data/lib/spotify_web_api/models/paging_artist_discography_album_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_artist_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_featured_playlist_object.rb +59 -0
- data/lib/spotify_web_api/models/paging_object.rb +93 -0
- data/lib/spotify_web_api/models/paging_playlist_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_playlist_track_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_saved_album_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_saved_audiobook_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_saved_episode_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_saved_show_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_saved_track_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_simplified_album_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_simplified_audiobook_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_simplified_chapter_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_simplified_episode_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_simplified_show_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_simplified_track_object.rb +110 -0
- data/lib/spotify_web_api/models/paging_track_object.rb +110 -0
- data/lib/spotify_web_api/models/play_history_object.rb +77 -0
- data/lib/spotify_web_api/models/playlist_object.rb +193 -0
- data/lib/spotify_web_api/models/playlist_owner_object.rb +109 -0
- data/lib/spotify_web_api/models/playlist_snapshot_id.rb +50 -0
- data/lib/spotify_web_api/models/playlist_track_object.rb +90 -0
- data/lib/spotify_web_api/models/playlist_tracks_ref_object.rb +60 -0
- data/lib/spotify_web_api/models/playlist_user_object.rb +98 -0
- data/lib/spotify_web_api/models/playlists_followers_request.rb +51 -0
- data/lib/spotify_web_api/models/playlists_request.rb +82 -0
- data/lib/spotify_web_api/models/playlists_tracks_request.rb +72 -0
- data/lib/spotify_web_api/models/playlists_tracks_request1.rb +97 -0
- data/lib/spotify_web_api/models/playlists_tracks_request2.rb +75 -0
- data/lib/spotify_web_api/models/private_user_object.rb +181 -0
- data/lib/spotify_web_api/models/public_user_object.rb +128 -0
- data/lib/spotify_web_api/models/queue_object.rb +60 -0
- data/lib/spotify_web_api/models/reason_enum.rb +29 -0
- data/lib/spotify_web_api/models/recommendation_seed_object.rb +104 -0
- data/lib/spotify_web_api/models/recommendations_object.rb +74 -0
- data/lib/spotify_web_api/models/release_date_precision_enum.rb +26 -0
- data/lib/spotify_web_api/models/resume_point_object.rb +60 -0
- data/lib/spotify_web_api/models/saved_album_object.rb +73 -0
- data/lib/spotify_web_api/models/saved_audiobook_object.rb +73 -0
- data/lib/spotify_web_api/models/saved_episode_object.rb +70 -0
- data/lib/spotify_web_api/models/saved_show_object.rb +73 -0
- data/lib/spotify_web_api/models/saved_track_object.rb +73 -0
- data/lib/spotify_web_api/models/search_items.rb +107 -0
- data/lib/spotify_web_api/models/section_object.rb +180 -0
- data/lib/spotify_web_api/models/segment_object.rb +166 -0
- data/lib/spotify_web_api/models/show_base.rb +211 -0
- data/lib/spotify_web_api/models/show_object.rb +219 -0
- data/lib/spotify_web_api/models/simplified_album_object.rb +186 -0
- data/lib/spotify_web_api/models/simplified_artist_object.rb +98 -0
- data/lib/spotify_web_api/models/simplified_playlist_object.rb +184 -0
- data/lib/spotify_web_api/models/simplified_track_object.rb +227 -0
- data/lib/spotify_web_api/models/time_interval_object.rb +68 -0
- data/lib/spotify_web_api/models/track.rb +331 -0
- data/lib/spotify_web_api/models/track1.rb +50 -0
- data/lib/spotify_web_api/models/track_object.rb +265 -0
- data/lib/spotify_web_api/models/track_restriction_object.rb +58 -0
- data/lib/spotify_web_api/models/type2_enum.rb +20 -0
- data/lib/spotify_web_api/models/type3_enum.rb +20 -0
- data/lib/spotify_web_api/models/type4_enum.rb +20 -0
- data/lib/spotify_web_api/models/type6_enum.rb +20 -0
- data/lib/spotify_web_api/models/type7_enum.rb +20 -0
- data/lib/spotify_web_api/models/type8_enum.rb +20 -0
- data/lib/spotify_web_api/models/type9_enum.rb +20 -0
- data/lib/spotify_web_api/models/type_enum.rb +20 -0
- data/lib/spotify_web_api/models/users_playlists_request.rb +87 -0
- data/lib/spotify_web_api/utilities/date_time_helper.rb +11 -0
- data/lib/spotify_web_api/utilities/file_wrapper.rb +16 -0
- data/lib/spotify_web_api.rb +198 -0
- metadata +264 -0
@@ -0,0 +1,246 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# EpisodeObject Model.
|
8
|
+
class EpisodeObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# A URL to a 30 second preview (MP3 format) of the episode. `null` if not
|
13
|
+
# available.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :audio_preview_url
|
16
|
+
|
17
|
+
# A description of the episode. HTML tags are stripped away from this field,
|
18
|
+
# use `html_description` field in case HTML tags are needed.
|
19
|
+
# @return [String]
|
20
|
+
attr_accessor :description
|
21
|
+
|
22
|
+
# A description of the episode. This field may contain HTML tags.
|
23
|
+
# @return [String]
|
24
|
+
attr_accessor :html_description
|
25
|
+
|
26
|
+
# The episode length in milliseconds.
|
27
|
+
# @return [Integer]
|
28
|
+
attr_accessor :duration_ms
|
29
|
+
|
30
|
+
# Whether or not the episode has explicit content (true = yes it does; false
|
31
|
+
# = no it does not OR unknown).
|
32
|
+
# @return [TrueClass | FalseClass]
|
33
|
+
attr_accessor :explicit
|
34
|
+
|
35
|
+
# External URLs for this episode.
|
36
|
+
# @return [ExternalUrlObject]
|
37
|
+
attr_accessor :external_urls
|
38
|
+
|
39
|
+
# A link to the Web API endpoint providing full details of the episode.
|
40
|
+
# @return [String]
|
41
|
+
attr_accessor :href
|
42
|
+
|
43
|
+
# The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
|
44
|
+
# episode.
|
45
|
+
# @return [String]
|
46
|
+
attr_accessor :id
|
47
|
+
|
48
|
+
# The cover art for the episode in various sizes, widest first.
|
49
|
+
# @return [Array[ImageObject]]
|
50
|
+
attr_accessor :images
|
51
|
+
|
52
|
+
# True if the episode is hosted outside of Spotify's CDN.
|
53
|
+
# @return [TrueClass | FalseClass]
|
54
|
+
attr_accessor :is_externally_hosted
|
55
|
+
|
56
|
+
# True if the episode is playable in the given market. Otherwise false.
|
57
|
+
# @return [TrueClass | FalseClass]
|
58
|
+
attr_accessor :is_playable
|
59
|
+
|
60
|
+
# The language used in the episode, identified by a [ISO
|
61
|
+
# 639](https://en.wikipedia.org/wiki/ISO_639) code. This field is deprecated
|
62
|
+
# and might be removed in the future. Please use the `languages` field
|
63
|
+
# instead.
|
64
|
+
# @return [String]
|
65
|
+
attr_accessor :language
|
66
|
+
|
67
|
+
# A list of the languages used in the episode, identified by their [ISO
|
68
|
+
# 639-1](https://en.wikipedia.org/wiki/ISO_639) code.
|
69
|
+
# @return [Array[String]]
|
70
|
+
attr_accessor :languages
|
71
|
+
|
72
|
+
# The name of the episode.
|
73
|
+
# @return [String]
|
74
|
+
attr_accessor :name
|
75
|
+
|
76
|
+
# The date the episode was first released, for example `"1981-12-15"`.
|
77
|
+
# Depending on the precision, it might be shown as `"1981"` or `"1981-12"`.
|
78
|
+
# @return [String]
|
79
|
+
attr_accessor :release_date
|
80
|
+
|
81
|
+
# The precision with which `release_date` value is known.
|
82
|
+
# @return [ReleaseDatePrecisionEnum]
|
83
|
+
attr_accessor :release_date_precision
|
84
|
+
|
85
|
+
# The user's most recent position in the episode. Set if the supplied access
|
86
|
+
# token is a user token and has the scope 'user-read-playback-position'.
|
87
|
+
# @return [ResumePointObject]
|
88
|
+
attr_accessor :resume_point
|
89
|
+
|
90
|
+
# The object type.
|
91
|
+
# @return [Type8Enum]
|
92
|
+
attr_accessor :type
|
93
|
+
|
94
|
+
# The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for
|
95
|
+
# the episode.
|
96
|
+
# @return [String]
|
97
|
+
attr_accessor :uri
|
98
|
+
|
99
|
+
# Included in the response when a content restriction is applied.
|
100
|
+
# @return [EpisodeRestrictionObject]
|
101
|
+
attr_accessor :restrictions
|
102
|
+
|
103
|
+
# The show on which the episode belongs.
|
104
|
+
# @return [ShowBase]
|
105
|
+
attr_accessor :show
|
106
|
+
|
107
|
+
# A mapping from model property names to API property names.
|
108
|
+
def self.names
|
109
|
+
@_hash = {} if @_hash.nil?
|
110
|
+
@_hash['audio_preview_url'] = 'audio_preview_url'
|
111
|
+
@_hash['description'] = 'description'
|
112
|
+
@_hash['html_description'] = 'html_description'
|
113
|
+
@_hash['duration_ms'] = 'duration_ms'
|
114
|
+
@_hash['explicit'] = 'explicit'
|
115
|
+
@_hash['external_urls'] = 'external_urls'
|
116
|
+
@_hash['href'] = 'href'
|
117
|
+
@_hash['id'] = 'id'
|
118
|
+
@_hash['images'] = 'images'
|
119
|
+
@_hash['is_externally_hosted'] = 'is_externally_hosted'
|
120
|
+
@_hash['is_playable'] = 'is_playable'
|
121
|
+
@_hash['language'] = 'language'
|
122
|
+
@_hash['languages'] = 'languages'
|
123
|
+
@_hash['name'] = 'name'
|
124
|
+
@_hash['release_date'] = 'release_date'
|
125
|
+
@_hash['release_date_precision'] = 'release_date_precision'
|
126
|
+
@_hash['resume_point'] = 'resume_point'
|
127
|
+
@_hash['type'] = 'type'
|
128
|
+
@_hash['uri'] = 'uri'
|
129
|
+
@_hash['restrictions'] = 'restrictions'
|
130
|
+
@_hash['show'] = 'show'
|
131
|
+
@_hash
|
132
|
+
end
|
133
|
+
|
134
|
+
# An array for optional fields
|
135
|
+
def self.optionals
|
136
|
+
%w[
|
137
|
+
language
|
138
|
+
resume_point
|
139
|
+
restrictions
|
140
|
+
]
|
141
|
+
end
|
142
|
+
|
143
|
+
# An array for nullable fields
|
144
|
+
def self.nullables
|
145
|
+
%w[
|
146
|
+
audio_preview_url
|
147
|
+
]
|
148
|
+
end
|
149
|
+
|
150
|
+
def initialize(audio_preview_url = nil, description = nil,
|
151
|
+
html_description = nil, duration_ms = nil, explicit = nil,
|
152
|
+
external_urls = nil, href = nil, id = nil, images = nil,
|
153
|
+
is_externally_hosted = nil, is_playable = nil,
|
154
|
+
languages = nil, name = nil, release_date = nil,
|
155
|
+
release_date_precision = nil, type = nil, uri = nil,
|
156
|
+
show = nil, language = SKIP, resume_point = SKIP,
|
157
|
+
restrictions = SKIP)
|
158
|
+
@audio_preview_url = audio_preview_url
|
159
|
+
@description = description
|
160
|
+
@html_description = html_description
|
161
|
+
@duration_ms = duration_ms
|
162
|
+
@explicit = explicit
|
163
|
+
@external_urls = external_urls
|
164
|
+
@href = href
|
165
|
+
@id = id
|
166
|
+
@images = images
|
167
|
+
@is_externally_hosted = is_externally_hosted
|
168
|
+
@is_playable = is_playable
|
169
|
+
@language = language unless language == SKIP
|
170
|
+
@languages = languages
|
171
|
+
@name = name
|
172
|
+
@release_date = release_date
|
173
|
+
@release_date_precision = release_date_precision
|
174
|
+
@resume_point = resume_point unless resume_point == SKIP
|
175
|
+
@type = type
|
176
|
+
@uri = uri
|
177
|
+
@restrictions = restrictions unless restrictions == SKIP
|
178
|
+
@show = show
|
179
|
+
end
|
180
|
+
|
181
|
+
# Creates an instance of the object from a hash.
|
182
|
+
def self.from_hash(hash)
|
183
|
+
return nil unless hash
|
184
|
+
|
185
|
+
# Extract variables from the hash.
|
186
|
+
audio_preview_url =
|
187
|
+
hash.key?('audio_preview_url') ? hash['audio_preview_url'] : nil
|
188
|
+
description = hash.key?('description') ? hash['description'] : nil
|
189
|
+
html_description =
|
190
|
+
hash.key?('html_description') ? hash['html_description'] : nil
|
191
|
+
duration_ms = hash.key?('duration_ms') ? hash['duration_ms'] : nil
|
192
|
+
explicit = hash.key?('explicit') ? hash['explicit'] : nil
|
193
|
+
external_urls = ExternalUrlObject.from_hash(hash['external_urls']) if hash['external_urls']
|
194
|
+
href = hash.key?('href') ? hash['href'] : nil
|
195
|
+
id = hash.key?('id') ? hash['id'] : nil
|
196
|
+
# Parameter is an array, so we need to iterate through it
|
197
|
+
images = nil
|
198
|
+
unless hash['images'].nil?
|
199
|
+
images = []
|
200
|
+
hash['images'].each do |structure|
|
201
|
+
images << (ImageObject.from_hash(structure) if structure)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
images = nil unless hash.key?('images')
|
206
|
+
is_externally_hosted =
|
207
|
+
hash.key?('is_externally_hosted') ? hash['is_externally_hosted'] : nil
|
208
|
+
is_playable = hash.key?('is_playable') ? hash['is_playable'] : nil
|
209
|
+
languages = hash.key?('languages') ? hash['languages'] : nil
|
210
|
+
name = hash.key?('name') ? hash['name'] : nil
|
211
|
+
release_date = hash.key?('release_date') ? hash['release_date'] : nil
|
212
|
+
release_date_precision =
|
213
|
+
hash.key?('release_date_precision') ? hash['release_date_precision'] : nil
|
214
|
+
type = hash.key?('type') ? hash['type'] : nil
|
215
|
+
uri = hash.key?('uri') ? hash['uri'] : nil
|
216
|
+
show = ShowBase.from_hash(hash['show']) if hash['show']
|
217
|
+
language = hash.key?('language') ? hash['language'] : SKIP
|
218
|
+
resume_point = ResumePointObject.from_hash(hash['resume_point']) if hash['resume_point']
|
219
|
+
restrictions = EpisodeRestrictionObject.from_hash(hash['restrictions']) if
|
220
|
+
hash['restrictions']
|
221
|
+
|
222
|
+
# Create object from extracted values.
|
223
|
+
EpisodeObject.new(audio_preview_url,
|
224
|
+
description,
|
225
|
+
html_description,
|
226
|
+
duration_ms,
|
227
|
+
explicit,
|
228
|
+
external_urls,
|
229
|
+
href,
|
230
|
+
id,
|
231
|
+
images,
|
232
|
+
is_externally_hosted,
|
233
|
+
is_playable,
|
234
|
+
languages,
|
235
|
+
name,
|
236
|
+
release_date,
|
237
|
+
release_date_precision,
|
238
|
+
type,
|
239
|
+
uri,
|
240
|
+
show,
|
241
|
+
language,
|
242
|
+
resume_point,
|
243
|
+
restrictions)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# EpisodeRestrictionObject Model.
|
8
|
+
class EpisodeRestrictionObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The reason for the restriction. Supported values:
|
13
|
+
# - `market` - The content item is not available in the given market.
|
14
|
+
# - `product` - The content item is not available for the user's
|
15
|
+
# subscription type.
|
16
|
+
# - `explicit` - The content item is explicit and the user's account is set
|
17
|
+
# to not play explicit content.
|
18
|
+
# Additional reasons may be added in the future.
|
19
|
+
# **Note**: If you use this field, make sure that your application safely
|
20
|
+
# handles unknown values.
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :reason
|
23
|
+
|
24
|
+
# A mapping from model property names to API property names.
|
25
|
+
def self.names
|
26
|
+
@_hash = {} if @_hash.nil?
|
27
|
+
@_hash['reason'] = 'reason'
|
28
|
+
@_hash
|
29
|
+
end
|
30
|
+
|
31
|
+
# An array for optional fields
|
32
|
+
def self.optionals
|
33
|
+
%w[
|
34
|
+
reason
|
35
|
+
]
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for nullable fields
|
39
|
+
def self.nullables
|
40
|
+
[]
|
41
|
+
end
|
42
|
+
|
43
|
+
def initialize(reason = SKIP)
|
44
|
+
@reason = reason unless reason == SKIP
|
45
|
+
end
|
46
|
+
|
47
|
+
# Creates an instance of the object from a hash.
|
48
|
+
def self.from_hash(hash)
|
49
|
+
return nil unless hash
|
50
|
+
|
51
|
+
# Extract variables from the hash.
|
52
|
+
reason = hash.key?('reason') ? hash['reason'] : SKIP
|
53
|
+
|
54
|
+
# Create object from extracted values.
|
55
|
+
EpisodeRestrictionObject.new(reason)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# ErrorObject Model.
|
8
|
+
class ErrorObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The HTTP status code (also returned in the response header; see [Response
|
13
|
+
# Status
|
14
|
+
# Codes](/documentation/web-api/concepts/api-calls#response-status-codes)
|
15
|
+
# for more information).
|
16
|
+
# @return [Integer]
|
17
|
+
attr_accessor :status
|
18
|
+
|
19
|
+
# A short description of the cause of the error.
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :message
|
22
|
+
|
23
|
+
# A mapping from model property names to API property names.
|
24
|
+
def self.names
|
25
|
+
@_hash = {} if @_hash.nil?
|
26
|
+
@_hash['status'] = 'status'
|
27
|
+
@_hash['message'] = 'message'
|
28
|
+
@_hash
|
29
|
+
end
|
30
|
+
|
31
|
+
# An array for optional fields
|
32
|
+
def self.optionals
|
33
|
+
[]
|
34
|
+
end
|
35
|
+
|
36
|
+
# An array for nullable fields
|
37
|
+
def self.nullables
|
38
|
+
[]
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize(status = nil, message = nil)
|
42
|
+
@status = status
|
43
|
+
@message = message
|
44
|
+
end
|
45
|
+
|
46
|
+
# Creates an instance of the object from a hash.
|
47
|
+
def self.from_hash(hash)
|
48
|
+
return nil unless hash
|
49
|
+
|
50
|
+
# Extract variables from the hash.
|
51
|
+
status = hash.key?('status') ? hash['status'] : nil
|
52
|
+
message = hash.key?('message') ? hash['message'] : nil
|
53
|
+
|
54
|
+
# Create object from extracted values.
|
55
|
+
ErrorObject.new(status,
|
56
|
+
message)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# ExplicitContentSettingsObject Model.
|
8
|
+
class ExplicitContentSettingsObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# When `true`, indicates that explicit content should not be played.
|
13
|
+
# @return [TrueClass | FalseClass]
|
14
|
+
attr_accessor :filter_enabled
|
15
|
+
|
16
|
+
# When `true`, indicates that the explicit content setting is locked and
|
17
|
+
# can't be changed by the user.
|
18
|
+
# @return [TrueClass | FalseClass]
|
19
|
+
attr_accessor :filter_locked
|
20
|
+
|
21
|
+
# A mapping from model property names to API property names.
|
22
|
+
def self.names
|
23
|
+
@_hash = {} if @_hash.nil?
|
24
|
+
@_hash['filter_enabled'] = 'filter_enabled'
|
25
|
+
@_hash['filter_locked'] = 'filter_locked'
|
26
|
+
@_hash
|
27
|
+
end
|
28
|
+
|
29
|
+
# An array for optional fields
|
30
|
+
def self.optionals
|
31
|
+
%w[
|
32
|
+
filter_enabled
|
33
|
+
filter_locked
|
34
|
+
]
|
35
|
+
end
|
36
|
+
|
37
|
+
# An array for nullable fields
|
38
|
+
def self.nullables
|
39
|
+
[]
|
40
|
+
end
|
41
|
+
|
42
|
+
def initialize(filter_enabled = SKIP, filter_locked = SKIP)
|
43
|
+
@filter_enabled = filter_enabled unless filter_enabled == SKIP
|
44
|
+
@filter_locked = filter_locked unless filter_locked == SKIP
|
45
|
+
end
|
46
|
+
|
47
|
+
# Creates an instance of the object from a hash.
|
48
|
+
def self.from_hash(hash)
|
49
|
+
return nil unless hash
|
50
|
+
|
51
|
+
# Extract variables from the hash.
|
52
|
+
filter_enabled =
|
53
|
+
hash.key?('filter_enabled') ? hash['filter_enabled'] : SKIP
|
54
|
+
filter_locked = hash.key?('filter_locked') ? hash['filter_locked'] : SKIP
|
55
|
+
|
56
|
+
# Create object from extracted values.
|
57
|
+
ExplicitContentSettingsObject.new(filter_enabled,
|
58
|
+
filter_locked)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# ExternalIdObject Model.
|
8
|
+
class ExternalIdObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# [International Standard Recording
|
13
|
+
# Code](http://en.wikipedia.org/wiki/International_Standard_Recording_Code)
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :isrc
|
16
|
+
|
17
|
+
# [International Article
|
18
|
+
# Number](http://en.wikipedia.org/wiki/International_Article_Number_%28EAN%2
|
19
|
+
# 9)
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :ean
|
22
|
+
|
23
|
+
# [Universal Product
|
24
|
+
# Code](http://en.wikipedia.org/wiki/Universal_Product_Code)
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :upc
|
27
|
+
|
28
|
+
# A mapping from model property names to API property names.
|
29
|
+
def self.names
|
30
|
+
@_hash = {} if @_hash.nil?
|
31
|
+
@_hash['isrc'] = 'isrc'
|
32
|
+
@_hash['ean'] = 'ean'
|
33
|
+
@_hash['upc'] = 'upc'
|
34
|
+
@_hash
|
35
|
+
end
|
36
|
+
|
37
|
+
# An array for optional fields
|
38
|
+
def self.optionals
|
39
|
+
%w[
|
40
|
+
isrc
|
41
|
+
ean
|
42
|
+
upc
|
43
|
+
]
|
44
|
+
end
|
45
|
+
|
46
|
+
# An array for nullable fields
|
47
|
+
def self.nullables
|
48
|
+
[]
|
49
|
+
end
|
50
|
+
|
51
|
+
def initialize(isrc = SKIP, ean = SKIP, upc = SKIP)
|
52
|
+
@isrc = isrc unless isrc == SKIP
|
53
|
+
@ean = ean unless ean == SKIP
|
54
|
+
@upc = upc unless upc == SKIP
|
55
|
+
end
|
56
|
+
|
57
|
+
# Creates an instance of the object from a hash.
|
58
|
+
def self.from_hash(hash)
|
59
|
+
return nil unless hash
|
60
|
+
|
61
|
+
# Extract variables from the hash.
|
62
|
+
isrc = hash.key?('isrc') ? hash['isrc'] : SKIP
|
63
|
+
ean = hash.key?('ean') ? hash['ean'] : SKIP
|
64
|
+
upc = hash.key?('upc') ? hash['upc'] : SKIP
|
65
|
+
|
66
|
+
# Create object from extracted values.
|
67
|
+
ExternalIdObject.new(isrc,
|
68
|
+
ean,
|
69
|
+
upc)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# ExternalUrlObject Model.
|
8
|
+
class ExternalUrlObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The [Spotify URL](/documentation/web-api/concepts/spotify-uris-ids) for
|
13
|
+
# the object.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :spotify
|
16
|
+
|
17
|
+
# A mapping from model property names to API property names.
|
18
|
+
def self.names
|
19
|
+
@_hash = {} if @_hash.nil?
|
20
|
+
@_hash['spotify'] = 'spotify'
|
21
|
+
@_hash
|
22
|
+
end
|
23
|
+
|
24
|
+
# An array for optional fields
|
25
|
+
def self.optionals
|
26
|
+
%w[
|
27
|
+
spotify
|
28
|
+
]
|
29
|
+
end
|
30
|
+
|
31
|
+
# An array for nullable fields
|
32
|
+
def self.nullables
|
33
|
+
[]
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize(spotify = SKIP)
|
37
|
+
@spotify = spotify unless spotify == SKIP
|
38
|
+
end
|
39
|
+
|
40
|
+
# Creates an instance of the object from a hash.
|
41
|
+
def self.from_hash(hash)
|
42
|
+
return nil unless hash
|
43
|
+
|
44
|
+
# Extract variables from the hash.
|
45
|
+
spotify = hash.key?('spotify') ? hash['spotify'] : SKIP
|
46
|
+
|
47
|
+
# Create object from extracted values.
|
48
|
+
ExternalUrlObject.new(spotify)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# FollowersObject Model.
|
8
|
+
class FollowersObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# This will always be set to null, as the Web API does not support it at the
|
13
|
+
# moment.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :href
|
16
|
+
|
17
|
+
# The total number of followers.
|
18
|
+
# @return [Integer]
|
19
|
+
attr_accessor :total
|
20
|
+
|
21
|
+
# A mapping from model property names to API property names.
|
22
|
+
def self.names
|
23
|
+
@_hash = {} if @_hash.nil?
|
24
|
+
@_hash['href'] = 'href'
|
25
|
+
@_hash['total'] = 'total'
|
26
|
+
@_hash
|
27
|
+
end
|
28
|
+
|
29
|
+
# An array for optional fields
|
30
|
+
def self.optionals
|
31
|
+
%w[
|
32
|
+
href
|
33
|
+
total
|
34
|
+
]
|
35
|
+
end
|
36
|
+
|
37
|
+
# An array for nullable fields
|
38
|
+
def self.nullables
|
39
|
+
%w[
|
40
|
+
href
|
41
|
+
]
|
42
|
+
end
|
43
|
+
|
44
|
+
def initialize(href = SKIP, total = SKIP)
|
45
|
+
@href = href unless href == SKIP
|
46
|
+
@total = total unless total == SKIP
|
47
|
+
end
|
48
|
+
|
49
|
+
# Creates an instance of the object from a hash.
|
50
|
+
def self.from_hash(hash)
|
51
|
+
return nil unless hash
|
52
|
+
|
53
|
+
# Extract variables from the hash.
|
54
|
+
href = hash.key?('href') ? hash['href'] : SKIP
|
55
|
+
total = hash.key?('total') ? hash['total'] : SKIP
|
56
|
+
|
57
|
+
# Create object from extracted values.
|
58
|
+
FollowersObject.new(href,
|
59
|
+
total)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# ImageObject Model.
|
8
|
+
class ImageObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The source URL of the image.
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :url
|
15
|
+
|
16
|
+
# The image height in pixels.
|
17
|
+
# @return [Integer]
|
18
|
+
attr_accessor :height
|
19
|
+
|
20
|
+
# The image width in pixels.
|
21
|
+
# @return [Integer]
|
22
|
+
attr_accessor :width
|
23
|
+
|
24
|
+
# A mapping from model property names to API property names.
|
25
|
+
def self.names
|
26
|
+
@_hash = {} if @_hash.nil?
|
27
|
+
@_hash['url'] = 'url'
|
28
|
+
@_hash['height'] = 'height'
|
29
|
+
@_hash['width'] = 'width'
|
30
|
+
@_hash
|
31
|
+
end
|
32
|
+
|
33
|
+
# An array for optional fields
|
34
|
+
def self.optionals
|
35
|
+
[]
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for nullable fields
|
39
|
+
def self.nullables
|
40
|
+
%w[
|
41
|
+
height
|
42
|
+
width
|
43
|
+
]
|
44
|
+
end
|
45
|
+
|
46
|
+
def initialize(url = nil, height = nil, width = nil)
|
47
|
+
@url = url
|
48
|
+
@height = height
|
49
|
+
@width = width
|
50
|
+
end
|
51
|
+
|
52
|
+
# Creates an instance of the object from a hash.
|
53
|
+
def self.from_hash(hash)
|
54
|
+
return nil unless hash
|
55
|
+
|
56
|
+
# Extract variables from the hash.
|
57
|
+
url = hash.key?('url') ? hash['url'] : nil
|
58
|
+
height = hash.key?('height') ? hash['height'] : nil
|
59
|
+
width = hash.key?('width') ? hash['width'] : nil
|
60
|
+
|
61
|
+
# Create object from extracted values.
|
62
|
+
ImageObject.new(url,
|
63
|
+
height,
|
64
|
+
width)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# If `include_external=audio` is specified it signals that the client can play
|
8
|
+
# externally hosted audio content, and marks the content as playable in the
|
9
|
+
# response. By default externally hosted audio content is marked as unplayable
|
10
|
+
# in the response.
|
11
|
+
class IncludeExternalEnum
|
12
|
+
INCLUDE_EXTERNAL_ENUM = [
|
13
|
+
# TODO: Write general description for AUDIO
|
14
|
+
AUDIO = 'audio'.freeze
|
15
|
+
].freeze
|
16
|
+
|
17
|
+
def self.validate(value)
|
18
|
+
return false if value.nil?
|
19
|
+
|
20
|
+
INCLUDE_EXTERNAL_ENUM.include?(value)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|