spotify-apimatic-sdk 1.0.0
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.
- checksums.yaml +7 -0
- data/LICENSE +30 -0
- data/README.md +170 -0
- data/bin/console +15 -0
- data/lib/spotify_web_api/api_helper.rb +10 -0
- data/lib/spotify_web_api/client.rb +165 -0
- data/lib/spotify_web_api/configuration.rb +244 -0
- data/lib/spotify_web_api/controllers/albums_controller.rb +297 -0
- data/lib/spotify_web_api/controllers/artists_controller.rb +188 -0
- data/lib/spotify_web_api/controllers/audiobooks_controller.rb +258 -0
- data/lib/spotify_web_api/controllers/base_controller.rb +60 -0
- data/lib/spotify_web_api/controllers/categories_controller.rb +84 -0
- data/lib/spotify_web_api/controllers/chapters_controller.rb +82 -0
- data/lib/spotify_web_api/controllers/episodes_controller.rb +241 -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 +525 -0
- data/lib/spotify_web_api/controllers/playlists_controller.rb +538 -0
- data/lib/spotify_web_api/controllers/search_controller.rb +61 -0
- data/lib/spotify_web_api/controllers/shows_controller.rb +263 -0
- data/lib/spotify_web_api/controllers/tracks_controller.rb +534 -0
- data/lib/spotify_web_api/controllers/users_controller.rb +402 -0
- data/lib/spotify_web_api/exceptions/api_exception.rb +21 -0
- data/lib/spotify_web_api/exceptions/bad_request_exception.rb +46 -0
- data/lib/spotify_web_api/exceptions/forbidden_exception.rb +46 -0
- data/lib/spotify_web_api/exceptions/not_found_exception.rb +46 -0
- data/lib/spotify_web_api/exceptions/o_auth_provider_exception.rb +64 -0
- data/lib/spotify_web_api/exceptions/too_many_requests_exception.rb +46 -0
- data/lib/spotify_web_api/exceptions/unauthorized_exception.rb +46 -0
- data/lib/spotify_web_api/http/api_response.rb +19 -0
- data/lib/spotify_web_api/http/auth/o_auth2.rb +164 -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/http/proxy_settings.rb +22 -0
- data/lib/spotify_web_api/models/album_base.rb +189 -0
- data/lib/spotify_web_api/models/album_group_enum.rb +44 -0
- data/lib/spotify_web_api/models/album_object.rb +273 -0
- data/lib/spotify_web_api/models/album_restriction_object.rb +75 -0
- data/lib/spotify_web_api/models/album_type_enum.rb +40 -0
- data/lib/spotify_web_api/models/artist_discography_album_object.rb +216 -0
- data/lib/spotify_web_api/models/artist_object.rb +174 -0
- data/lib/spotify_web_api/models/audio_analysis_object.rb +171 -0
- data/lib/spotify_web_api/models/audio_features_object.rb +273 -0
- data/lib/spotify_web_api/models/audiobook_base.rb +270 -0
- data/lib/spotify_web_api/models/audiobook_object.rb +278 -0
- data/lib/spotify_web_api/models/author_object.rb +62 -0
- data/lib/spotify_web_api/models/base_model.rb +110 -0
- data/lib/spotify_web_api/models/categories.rb +125 -0
- data/lib/spotify_web_api/models/category_object.rb +95 -0
- data/lib/spotify_web_api/models/chapter_base.rb +265 -0
- data/lib/spotify_web_api/models/chapter_object.rb +273 -0
- data/lib/spotify_web_api/models/chapter_restriction_object.rb +71 -0
- data/lib/spotify_web_api/models/context_object.rb +102 -0
- data/lib/spotify_web_api/models/copyright_object.rb +82 -0
- data/lib/spotify_web_api/models/currently_playing_context_object.rb +168 -0
- data/lib/spotify_web_api/models/currently_playing_object.rb +138 -0
- data/lib/spotify_web_api/models/cursor_object.rb +71 -0
- data/lib/spotify_web_api/models/cursor_paged_artists.rb +60 -0
- data/lib/spotify_web_api/models/cursor_paging_object.rb +102 -0
- data/lib/spotify_web_api/models/cursor_paging_play_history_object.rb +120 -0
- data/lib/spotify_web_api/models/cursor_paging_simplified_artist_object.rb +120 -0
- data/lib/spotify_web_api/models/device_object.rb +153 -0
- data/lib/spotify_web_api/models/disallows_object.rb +171 -0
- data/lib/spotify_web_api/models/episode_base.rb +263 -0
- data/lib/spotify_web_api/models/episode_object.rb +368 -0
- data/lib/spotify_web_api/models/episode_restriction_object.rb +80 -0
- data/lib/spotify_web_api/models/error_object.rb +71 -0
- data/lib/spotify_web_api/models/explicit_content_settings_object.rb +74 -0
- data/lib/spotify_web_api/models/external_id_object.rb +94 -0
- data/lib/spotify_web_api/models/external_url_object.rb +73 -0
- data/lib/spotify_web_api/models/followers_object.rb +84 -0
- data/lib/spotify_web_api/models/image_object.rb +106 -0
- data/lib/spotify_web_api/models/include_external_enum.rb +29 -0
- data/lib/spotify_web_api/models/item_type1_enum.rb +26 -0
- data/lib/spotify_web_api/models/item_type2_enum.rb +36 -0
- data/lib/spotify_web_api/models/item_type3_enum.rb +36 -0
- data/lib/spotify_web_api/models/item_type_enum.rb +56 -0
- data/lib/spotify_web_api/models/linked_track_object.rb +113 -0
- data/lib/spotify_web_api/models/many_albums.rb +69 -0
- data/lib/spotify_web_api/models/many_artists.rb +69 -0
- data/lib/spotify_web_api/models/many_audio_features.rb +69 -0
- data/lib/spotify_web_api/models/many_audiobooks.rb +69 -0
- data/lib/spotify_web_api/models/many_chapters.rb +69 -0
- data/lib/spotify_web_api/models/many_devices.rb +69 -0
- data/lib/spotify_web_api/models/many_episodes.rb +69 -0
- data/lib/spotify_web_api/models/many_genres.rb +60 -0
- data/lib/spotify_web_api/models/many_simplified_shows.rb +69 -0
- data/lib/spotify_web_api/models/many_tracks.rb +69 -0
- data/lib/spotify_web_api/models/markets.rb +62 -0
- data/lib/spotify_web_api/models/me_albums_request.rb +67 -0
- data/lib/spotify_web_api/models/me_episodes_request.rb +64 -0
- data/lib/spotify_web_api/models/me_episodes_request1.rb +66 -0
- data/lib/spotify_web_api/models/me_following_request.rb +65 -0
- data/lib/spotify_web_api/models/me_following_request1.rb +67 -0
- data/lib/spotify_web_api/models/me_player_play_request.rb +103 -0
- data/lib/spotify_web_api/models/me_player_request.rb +75 -0
- data/lib/spotify_web_api/models/me_shows_request.rb +67 -0
- data/lib/spotify_web_api/models/me_tracks_request.rb +65 -0
- data/lib/spotify_web_api/models/me_tracks_request1.rb +67 -0
- data/lib/spotify_web_api/models/meta.rb +127 -0
- data/lib/spotify_web_api/models/mode_enum.rb +50 -0
- data/lib/spotify_web_api/models/narrator_object.rb +62 -0
- data/lib/spotify_web_api/models/o_auth_provider_error_enum.rb +62 -0
- data/lib/spotify_web_api/models/o_auth_scope_enum.rb +124 -0
- data/lib/spotify_web_api/models/o_auth_token.rb +96 -0
- data/lib/spotify_web_api/models/paged_albums.rb +60 -0
- data/lib/spotify_web_api/models/paged_categories.rb +60 -0
- data/lib/spotify_web_api/models/paging_artist_discography_album_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_artist_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_featured_playlist_object.rb +71 -0
- data/lib/spotify_web_api/models/paging_object.rb +107 -0
- data/lib/spotify_web_api/models/paging_playlist_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_playlist_track_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_saved_album_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_saved_audiobook_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_saved_episode_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_saved_show_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_saved_track_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_simplified_album_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_simplified_audiobook_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_simplified_chapter_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_simplified_episode_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_simplified_show_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_simplified_track_object.rb +125 -0
- data/lib/spotify_web_api/models/paging_track_object.rb +125 -0
- data/lib/spotify_web_api/models/play_history_object.rb +90 -0
- data/lib/spotify_web_api/models/playlist_object.rb +213 -0
- data/lib/spotify_web_api/models/playlist_owner_object.rb +124 -0
- data/lib/spotify_web_api/models/playlist_snapshot_id.rb +62 -0
- data/lib/spotify_web_api/models/playlist_track_object.rb +116 -0
- data/lib/spotify_web_api/models/playlist_tracks_ref_object.rb +72 -0
- data/lib/spotify_web_api/models/playlist_user_object.rb +122 -0
- data/lib/spotify_web_api/models/playlists_followers_request.rb +63 -0
- data/lib/spotify_web_api/models/playlists_request.rb +96 -0
- data/lib/spotify_web_api/models/playlists_tracks_request.rb +84 -0
- data/lib/spotify_web_api/models/playlists_tracks_request1.rb +112 -0
- data/lib/spotify_web_api/models/playlists_tracks_request2.rb +87 -0
- data/lib/spotify_web_api/models/private_user_object.rb +200 -0
- data/lib/spotify_web_api/models/public_user_object.rb +144 -0
- data/lib/spotify_web_api/models/queue_object.rb +86 -0
- data/lib/spotify_web_api/models/reason_enum.rb +43 -0
- data/lib/spotify_web_api/models/recommendation_seed_object.rb +120 -0
- data/lib/spotify_web_api/models/recommendations_object.rb +86 -0
- data/lib/spotify_web_api/models/release_date_precision_enum.rb +40 -0
- data/lib/spotify_web_api/models/resume_point_object.rb +84 -0
- data/lib/spotify_web_api/models/saved_album_object.rb +85 -0
- data/lib/spotify_web_api/models/saved_audiobook_object.rb +85 -0
- data/lib/spotify_web_api/models/saved_episode_object.rb +82 -0
- data/lib/spotify_web_api/models/saved_show_object.rb +85 -0
- data/lib/spotify_web_api/models/saved_track_object.rb +85 -0
- data/lib/spotify_web_api/models/search_items.rb +122 -0
- data/lib/spotify_web_api/models/section_object.rb +201 -0
- data/lib/spotify_web_api/models/segment_object.rb +184 -0
- data/lib/spotify_web_api/models/show_base.rb +327 -0
- data/lib/spotify_web_api/models/show_object.rb +243 -0
- data/lib/spotify_web_api/models/simplified_album_object.rb +284 -0
- data/lib/spotify_web_api/models/simplified_artist_object.rb +122 -0
- data/lib/spotify_web_api/models/simplified_playlist_object.rb +203 -0
- data/lib/spotify_web_api/models/simplified_track_object.rb +251 -0
- data/lib/spotify_web_api/models/time_interval_object.rb +81 -0
- data/lib/spotify_web_api/models/track.rb +367 -0
- data/lib/spotify_web_api/models/track1.rb +62 -0
- data/lib/spotify_web_api/models/track_object.rb +301 -0
- data/lib/spotify_web_api/models/track_restriction_object.rb +80 -0
- data/lib/spotify_web_api/models/type2_enum.rb +26 -0
- data/lib/spotify_web_api/models/type3_enum.rb +26 -0
- data/lib/spotify_web_api/models/type4_enum.rb +26 -0
- data/lib/spotify_web_api/models/type5_enum.rb +26 -0
- data/lib/spotify_web_api/models/type6_enum.rb +26 -0
- data/lib/spotify_web_api/models/type8_enum.rb +26 -0
- data/lib/spotify_web_api/models/type9_enum.rb +26 -0
- data/lib/spotify_web_api/models/type_enum.rb +26 -0
- data/lib/spotify_web_api/models/users_playlists_request.rb +101 -0
- data/lib/spotify_web_api/utilities/date_time_helper.rb +11 -0
- data/lib/spotify_web_api/utilities/file_wrapper.rb +28 -0
- data/lib/spotify_web_api/utilities/union_type_lookup.rb +73 -0
- data/lib/spotify_web_api.rb +200 -0
- metadata +264 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# Track1 Model.
|
|
8
|
+
class Track1 < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Spotify URI
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :uri
|
|
15
|
+
|
|
16
|
+
# A mapping from model property names to API property names.
|
|
17
|
+
def self.names
|
|
18
|
+
@_hash = {} if @_hash.nil?
|
|
19
|
+
@_hash['uri'] = 'uri'
|
|
20
|
+
@_hash
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# An array for optional fields
|
|
24
|
+
def self.optionals
|
|
25
|
+
%w[
|
|
26
|
+
uri
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(uri = SKIP)
|
|
36
|
+
@uri = uri unless uri == SKIP
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates an instance of the object from a hash.
|
|
40
|
+
def self.from_hash(hash)
|
|
41
|
+
return nil unless hash
|
|
42
|
+
|
|
43
|
+
# Extract variables from the hash.
|
|
44
|
+
uri = hash.key?('uri') ? hash['uri'] : SKIP
|
|
45
|
+
|
|
46
|
+
# Create object from extracted values.
|
|
47
|
+
Track1.new(uri)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Provides a human-readable string representation of the object.
|
|
51
|
+
def to_s
|
|
52
|
+
class_name = self.class.name.split('::').last
|
|
53
|
+
"<#{class_name} uri: #{@uri}>"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
57
|
+
def inspect
|
|
58
|
+
class_name = self.class.name.split('::').last
|
|
59
|
+
"<#{class_name} uri: #{@uri.inspect}>"
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# TrackObject Model.
|
|
8
|
+
class TrackObject < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The album on which the track appears. The album object includes a link in
|
|
13
|
+
# `href` to full information about the album.
|
|
14
|
+
# @return [SimplifiedAlbumObject]
|
|
15
|
+
attr_accessor :album
|
|
16
|
+
|
|
17
|
+
# The artists who performed the track. Each artist object includes a link in
|
|
18
|
+
# `href` to more detailed information about the artist.
|
|
19
|
+
# @return [Array[ArtistObject]]
|
|
20
|
+
attr_accessor :artists
|
|
21
|
+
|
|
22
|
+
# A list of the countries in which the track can be played, identified by
|
|
23
|
+
# their [ISO 3166-1
|
|
24
|
+
# alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.
|
|
25
|
+
# @return [Array[String]]
|
|
26
|
+
attr_accessor :available_markets
|
|
27
|
+
|
|
28
|
+
# The disc number (usually `1` unless the album consists of more than one
|
|
29
|
+
# disc).
|
|
30
|
+
# @return [Integer]
|
|
31
|
+
attr_accessor :disc_number
|
|
32
|
+
|
|
33
|
+
# The track length in milliseconds.
|
|
34
|
+
# @return [Integer]
|
|
35
|
+
attr_accessor :duration_ms
|
|
36
|
+
|
|
37
|
+
# Whether or not the track has explicit lyrics ( `true` = yes it does;
|
|
38
|
+
# `false` = no it does not OR unknown).
|
|
39
|
+
# @return [TrueClass | FalseClass]
|
|
40
|
+
attr_accessor :explicit
|
|
41
|
+
|
|
42
|
+
# Known external IDs for the track.
|
|
43
|
+
# @return [ExternalIdObject]
|
|
44
|
+
attr_accessor :external_ids
|
|
45
|
+
|
|
46
|
+
# Known external URLs for this track.
|
|
47
|
+
# @return [ExternalUrlObject]
|
|
48
|
+
attr_accessor :external_urls
|
|
49
|
+
|
|
50
|
+
# A link to the Web API endpoint providing full details of the track.
|
|
51
|
+
# @return [String]
|
|
52
|
+
attr_accessor :href
|
|
53
|
+
|
|
54
|
+
# The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
|
|
55
|
+
# track.
|
|
56
|
+
# @return [String]
|
|
57
|
+
attr_accessor :id
|
|
58
|
+
|
|
59
|
+
# Part of the response when [Track
|
|
60
|
+
# Relinking](/documentation/web-api/concepts/track-relinking) is applied. If
|
|
61
|
+
# `true`, the track is playable in the given market. Otherwise `false`.
|
|
62
|
+
# @return [TrueClass | FalseClass]
|
|
63
|
+
attr_accessor :is_playable
|
|
64
|
+
|
|
65
|
+
# Part of the response when [Track
|
|
66
|
+
# Relinking](/documentation/web-api/concepts/track-relinking) is applied,
|
|
67
|
+
# and the requested track has been replaced with different track. The track
|
|
68
|
+
# in the `linked_from` object contains information about the originally
|
|
69
|
+
# requested track.
|
|
70
|
+
# @return [LinkedTrackObject]
|
|
71
|
+
attr_accessor :linked_from
|
|
72
|
+
|
|
73
|
+
# Included in the response when a content restriction is applied.
|
|
74
|
+
# @return [TrackRestrictionObject]
|
|
75
|
+
attr_accessor :restrictions
|
|
76
|
+
|
|
77
|
+
# The name of the track.
|
|
78
|
+
# @return [String]
|
|
79
|
+
attr_accessor :name
|
|
80
|
+
|
|
81
|
+
# The popularity of the track. The value will be between 0 and 100, with 100
|
|
82
|
+
# being the most popular.<br/>The popularity of a track is a value between 0
|
|
83
|
+
# and 100, with 100 being the most popular. The popularity is calculated by
|
|
84
|
+
# algorithm and is based, in the most part, on the total number of plays the
|
|
85
|
+
# track has had and how recent those plays are.<br/>Generally speaking,
|
|
86
|
+
# songs that are being played a lot now will have a higher popularity than
|
|
87
|
+
# songs that were played a lot in the past. Duplicate tracks (e.g. the same
|
|
88
|
+
# track from a single and an album) are rated independently. Artist and
|
|
89
|
+
# album popularity is derived mathematically from track popularity.
|
|
90
|
+
# _**Note**: the popularity value may lag actual popularity by a few days:
|
|
91
|
+
# the value is not updated in real time._
|
|
92
|
+
# @return [Integer]
|
|
93
|
+
attr_accessor :popularity
|
|
94
|
+
|
|
95
|
+
# A link to a 30 second preview (MP3 format) of the track. Can be `null`
|
|
96
|
+
# @return [String]
|
|
97
|
+
attr_accessor :preview_url
|
|
98
|
+
|
|
99
|
+
# The number of the track. If an album has several discs, the track number
|
|
100
|
+
# is the number on the specified disc.
|
|
101
|
+
# @return [Integer]
|
|
102
|
+
attr_accessor :track_number
|
|
103
|
+
|
|
104
|
+
# The object type: "track".
|
|
105
|
+
# @return [Type3Enum]
|
|
106
|
+
attr_accessor :type
|
|
107
|
+
|
|
108
|
+
# The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for
|
|
109
|
+
# the track.
|
|
110
|
+
# @return [String]
|
|
111
|
+
attr_accessor :uri
|
|
112
|
+
|
|
113
|
+
# Whether or not the track is from a local file.
|
|
114
|
+
# @return [TrueClass | FalseClass]
|
|
115
|
+
attr_accessor :is_local
|
|
116
|
+
|
|
117
|
+
# A mapping from model property names to API property names.
|
|
118
|
+
def self.names
|
|
119
|
+
@_hash = {} if @_hash.nil?
|
|
120
|
+
@_hash['album'] = 'album'
|
|
121
|
+
@_hash['artists'] = 'artists'
|
|
122
|
+
@_hash['available_markets'] = 'available_markets'
|
|
123
|
+
@_hash['disc_number'] = 'disc_number'
|
|
124
|
+
@_hash['duration_ms'] = 'duration_ms'
|
|
125
|
+
@_hash['explicit'] = 'explicit'
|
|
126
|
+
@_hash['external_ids'] = 'external_ids'
|
|
127
|
+
@_hash['external_urls'] = 'external_urls'
|
|
128
|
+
@_hash['href'] = 'href'
|
|
129
|
+
@_hash['id'] = 'id'
|
|
130
|
+
@_hash['is_playable'] = 'is_playable'
|
|
131
|
+
@_hash['linked_from'] = 'linked_from'
|
|
132
|
+
@_hash['restrictions'] = 'restrictions'
|
|
133
|
+
@_hash['name'] = 'name'
|
|
134
|
+
@_hash['popularity'] = 'popularity'
|
|
135
|
+
@_hash['preview_url'] = 'preview_url'
|
|
136
|
+
@_hash['track_number'] = 'track_number'
|
|
137
|
+
@_hash['type'] = 'type'
|
|
138
|
+
@_hash['uri'] = 'uri'
|
|
139
|
+
@_hash['is_local'] = 'is_local'
|
|
140
|
+
@_hash
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# An array for optional fields
|
|
144
|
+
def self.optionals
|
|
145
|
+
%w[
|
|
146
|
+
album
|
|
147
|
+
artists
|
|
148
|
+
available_markets
|
|
149
|
+
disc_number
|
|
150
|
+
duration_ms
|
|
151
|
+
explicit
|
|
152
|
+
external_ids
|
|
153
|
+
external_urls
|
|
154
|
+
href
|
|
155
|
+
id
|
|
156
|
+
is_playable
|
|
157
|
+
linked_from
|
|
158
|
+
restrictions
|
|
159
|
+
name
|
|
160
|
+
popularity
|
|
161
|
+
preview_url
|
|
162
|
+
track_number
|
|
163
|
+
type
|
|
164
|
+
uri
|
|
165
|
+
is_local
|
|
166
|
+
]
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# An array for nullable fields
|
|
170
|
+
def self.nullables
|
|
171
|
+
%w[
|
|
172
|
+
preview_url
|
|
173
|
+
]
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
def initialize(album = SKIP, artists = SKIP, available_markets = SKIP,
|
|
177
|
+
disc_number = SKIP, duration_ms = SKIP, explicit = SKIP,
|
|
178
|
+
external_ids = SKIP, external_urls = SKIP, href = SKIP,
|
|
179
|
+
id = SKIP, is_playable = SKIP, linked_from = SKIP,
|
|
180
|
+
restrictions = SKIP, name = SKIP, popularity = SKIP,
|
|
181
|
+
preview_url = SKIP, track_number = SKIP, type = SKIP,
|
|
182
|
+
uri = SKIP, is_local = SKIP)
|
|
183
|
+
@album = album unless album == SKIP
|
|
184
|
+
@artists = artists unless artists == SKIP
|
|
185
|
+
@available_markets = available_markets unless available_markets == SKIP
|
|
186
|
+
@disc_number = disc_number unless disc_number == SKIP
|
|
187
|
+
@duration_ms = duration_ms unless duration_ms == SKIP
|
|
188
|
+
@explicit = explicit unless explicit == SKIP
|
|
189
|
+
@external_ids = external_ids unless external_ids == SKIP
|
|
190
|
+
@external_urls = external_urls unless external_urls == SKIP
|
|
191
|
+
@href = href unless href == SKIP
|
|
192
|
+
@id = id unless id == SKIP
|
|
193
|
+
@is_playable = is_playable unless is_playable == SKIP
|
|
194
|
+
@linked_from = linked_from unless linked_from == SKIP
|
|
195
|
+
@restrictions = restrictions unless restrictions == SKIP
|
|
196
|
+
@name = name unless name == SKIP
|
|
197
|
+
@popularity = popularity unless popularity == SKIP
|
|
198
|
+
@preview_url = preview_url unless preview_url == SKIP
|
|
199
|
+
@track_number = track_number unless track_number == SKIP
|
|
200
|
+
@type = type unless type == SKIP
|
|
201
|
+
@uri = uri unless uri == SKIP
|
|
202
|
+
@is_local = is_local unless is_local == SKIP
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Creates an instance of the object from a hash.
|
|
206
|
+
def self.from_hash(hash)
|
|
207
|
+
return nil unless hash
|
|
208
|
+
|
|
209
|
+
# Extract variables from the hash.
|
|
210
|
+
album = SimplifiedAlbumObject.from_hash(hash['album']) if hash['album']
|
|
211
|
+
# Parameter is an array, so we need to iterate through it
|
|
212
|
+
artists = nil
|
|
213
|
+
unless hash['artists'].nil?
|
|
214
|
+
artists = []
|
|
215
|
+
hash['artists'].each do |structure|
|
|
216
|
+
artists << (ArtistObject.from_hash(structure) if structure)
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
artists = SKIP unless hash.key?('artists')
|
|
221
|
+
available_markets =
|
|
222
|
+
hash.key?('available_markets') ? hash['available_markets'] : SKIP
|
|
223
|
+
disc_number = hash.key?('disc_number') ? hash['disc_number'] : SKIP
|
|
224
|
+
duration_ms = hash.key?('duration_ms') ? hash['duration_ms'] : SKIP
|
|
225
|
+
explicit = hash.key?('explicit') ? hash['explicit'] : SKIP
|
|
226
|
+
external_ids = ExternalIdObject.from_hash(hash['external_ids']) if hash['external_ids']
|
|
227
|
+
external_urls = ExternalUrlObject.from_hash(hash['external_urls']) if hash['external_urls']
|
|
228
|
+
href = hash.key?('href') ? hash['href'] : SKIP
|
|
229
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
230
|
+
is_playable = hash.key?('is_playable') ? hash['is_playable'] : SKIP
|
|
231
|
+
linked_from = LinkedTrackObject.from_hash(hash['linked_from']) if hash['linked_from']
|
|
232
|
+
restrictions = TrackRestrictionObject.from_hash(hash['restrictions']) if
|
|
233
|
+
hash['restrictions']
|
|
234
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
|
235
|
+
popularity = hash.key?('popularity') ? hash['popularity'] : SKIP
|
|
236
|
+
preview_url = hash.key?('preview_url') ? hash['preview_url'] : SKIP
|
|
237
|
+
track_number = hash.key?('track_number') ? hash['track_number'] : SKIP
|
|
238
|
+
type = hash.key?('type') ? hash['type'] : SKIP
|
|
239
|
+
uri = hash.key?('uri') ? hash['uri'] : SKIP
|
|
240
|
+
is_local = hash.key?('is_local') ? hash['is_local'] : SKIP
|
|
241
|
+
|
|
242
|
+
# Create object from extracted values.
|
|
243
|
+
TrackObject.new(album,
|
|
244
|
+
artists,
|
|
245
|
+
available_markets,
|
|
246
|
+
disc_number,
|
|
247
|
+
duration_ms,
|
|
248
|
+
explicit,
|
|
249
|
+
external_ids,
|
|
250
|
+
external_urls,
|
|
251
|
+
href,
|
|
252
|
+
id,
|
|
253
|
+
is_playable,
|
|
254
|
+
linked_from,
|
|
255
|
+
restrictions,
|
|
256
|
+
name,
|
|
257
|
+
popularity,
|
|
258
|
+
preview_url,
|
|
259
|
+
track_number,
|
|
260
|
+
type,
|
|
261
|
+
uri,
|
|
262
|
+
is_local)
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Validates an instance of the object from a given value.
|
|
266
|
+
# @param [TrackObject | Hash] The value against the validation is performed.
|
|
267
|
+
def self.validate(value)
|
|
268
|
+
return true if value.instance_of? self
|
|
269
|
+
|
|
270
|
+
return false unless value.instance_of? Hash
|
|
271
|
+
|
|
272
|
+
true
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Provides a human-readable string representation of the object.
|
|
276
|
+
def to_s
|
|
277
|
+
class_name = self.class.name.split('::').last
|
|
278
|
+
"<#{class_name} album: #{@album}, artists: #{@artists}, available_markets:"\
|
|
279
|
+
" #{@available_markets}, disc_number: #{@disc_number}, duration_ms: #{@duration_ms},"\
|
|
280
|
+
" explicit: #{@explicit}, external_ids: #{@external_ids}, external_urls: #{@external_urls},"\
|
|
281
|
+
" href: #{@href}, id: #{@id}, is_playable: #{@is_playable}, linked_from: #{@linked_from},"\
|
|
282
|
+
" restrictions: #{@restrictions}, name: #{@name}, popularity: #{@popularity}, preview_url:"\
|
|
283
|
+
" #{@preview_url}, track_number: #{@track_number}, type: #{@type}, uri: #{@uri}, is_local:"\
|
|
284
|
+
" #{@is_local}>"
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
288
|
+
def inspect
|
|
289
|
+
class_name = self.class.name.split('::').last
|
|
290
|
+
"<#{class_name} album: #{@album.inspect}, artists: #{@artists.inspect}, available_markets:"\
|
|
291
|
+
" #{@available_markets.inspect}, disc_number: #{@disc_number.inspect}, duration_ms:"\
|
|
292
|
+
" #{@duration_ms.inspect}, explicit: #{@explicit.inspect}, external_ids:"\
|
|
293
|
+
" #{@external_ids.inspect}, external_urls: #{@external_urls.inspect}, href:"\
|
|
294
|
+
" #{@href.inspect}, id: #{@id.inspect}, is_playable: #{@is_playable.inspect}, linked_from:"\
|
|
295
|
+
" #{@linked_from.inspect}, restrictions: #{@restrictions.inspect}, name: #{@name.inspect},"\
|
|
296
|
+
" popularity: #{@popularity.inspect}, preview_url: #{@preview_url.inspect}, track_number:"\
|
|
297
|
+
" #{@track_number.inspect}, type: #{@type.inspect}, uri: #{@uri.inspect}, is_local:"\
|
|
298
|
+
" #{@is_local.inspect}>"
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# TrackRestrictionObject Model.
|
|
8
|
+
class TrackRestrictionObject < 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
|
+
TrackRestrictionObject.new(reason)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Validates an instance of the object from a given value.
|
|
59
|
+
# @param [TrackRestrictionObject | Hash] The value against the validation is performed.
|
|
60
|
+
def self.validate(value)
|
|
61
|
+
return true if value.instance_of? self
|
|
62
|
+
|
|
63
|
+
return false unless value.instance_of? Hash
|
|
64
|
+
|
|
65
|
+
true
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Provides a human-readable string representation of the object.
|
|
69
|
+
def to_s
|
|
70
|
+
class_name = self.class.name.split('::').last
|
|
71
|
+
"<#{class_name} reason: #{@reason}>"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
75
|
+
def inspect
|
|
76
|
+
class_name = self.class.name.split('::').last
|
|
77
|
+
"<#{class_name} reason: #{@reason.inspect}>"
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# The object type.
|
|
8
|
+
class Type2Enum
|
|
9
|
+
TYPE2_ENUM = [
|
|
10
|
+
# TODO: Write general description for ALBUM
|
|
11
|
+
ALBUM = 'album'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
TYPE2_ENUM.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = ALBUM)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# The object type: "track".
|
|
8
|
+
class Type3Enum
|
|
9
|
+
TYPE3_ENUM = [
|
|
10
|
+
# TODO: Write general description for TRACK
|
|
11
|
+
TRACK = 'track'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
TYPE3_ENUM.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = TRACK)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# The object type.
|
|
8
|
+
class Type4Enum
|
|
9
|
+
TYPE4_ENUM = [
|
|
10
|
+
# TODO: Write general description for USER
|
|
11
|
+
USER = 'user'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
TYPE4_ENUM.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = USER)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# The object type.
|
|
8
|
+
class Type5Enum
|
|
9
|
+
TYPE5_ENUM = [
|
|
10
|
+
# TODO: Write general description for EPISODE
|
|
11
|
+
EPISODE = 'episode'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
TYPE5_ENUM.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = EPISODE)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# The object type.
|
|
8
|
+
class Type6Enum
|
|
9
|
+
TYPE6_ENUM = [
|
|
10
|
+
# TODO: Write general description for SHOW
|
|
11
|
+
SHOW = 'show'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
TYPE6_ENUM.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = SHOW)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# The object type.
|
|
8
|
+
class Type8Enum
|
|
9
|
+
TYPE8_ENUM = [
|
|
10
|
+
# TODO: Write general description for AUDIO_FEATURES
|
|
11
|
+
AUDIO_FEATURES = 'audio_features'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
TYPE8_ENUM.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = AUDIO_FEATURES)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# The object type.
|
|
8
|
+
class Type9Enum
|
|
9
|
+
TYPE9_ENUM = [
|
|
10
|
+
# TODO: Write general description for AUDIOBOOK
|
|
11
|
+
AUDIOBOOK = 'audiobook'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
TYPE9_ENUM.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = AUDIOBOOK)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# spotify_web_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module SpotifyWebApi
|
|
7
|
+
# The object type.
|
|
8
|
+
class TypeEnum
|
|
9
|
+
TYPE_ENUM = [
|
|
10
|
+
# TODO: Write general description for ARTIST
|
|
11
|
+
ARTIST = 'artist'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
TYPE_ENUM.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = ARTIST)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|