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,74 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# RecommendationsObject Model.
|
8
|
+
class RecommendationsObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# An array of recommendation seed objects.
|
13
|
+
# @return [Array[RecommendationSeedObject]]
|
14
|
+
attr_accessor :seeds
|
15
|
+
|
16
|
+
# An array of track objects ordered according to the parameters supplied.
|
17
|
+
# @return [Array[TrackObject]]
|
18
|
+
attr_accessor :tracks
|
19
|
+
|
20
|
+
# A mapping from model property names to API property names.
|
21
|
+
def self.names
|
22
|
+
@_hash = {} if @_hash.nil?
|
23
|
+
@_hash['seeds'] = 'seeds'
|
24
|
+
@_hash['tracks'] = 'tracks'
|
25
|
+
@_hash
|
26
|
+
end
|
27
|
+
|
28
|
+
# An array for optional fields
|
29
|
+
def self.optionals
|
30
|
+
[]
|
31
|
+
end
|
32
|
+
|
33
|
+
# An array for nullable fields
|
34
|
+
def self.nullables
|
35
|
+
[]
|
36
|
+
end
|
37
|
+
|
38
|
+
def initialize(seeds = nil, tracks = nil)
|
39
|
+
@seeds = seeds
|
40
|
+
@tracks = tracks
|
41
|
+
end
|
42
|
+
|
43
|
+
# Creates an instance of the object from a hash.
|
44
|
+
def self.from_hash(hash)
|
45
|
+
return nil unless hash
|
46
|
+
|
47
|
+
# Extract variables from the hash.
|
48
|
+
# Parameter is an array, so we need to iterate through it
|
49
|
+
seeds = nil
|
50
|
+
unless hash['seeds'].nil?
|
51
|
+
seeds = []
|
52
|
+
hash['seeds'].each do |structure|
|
53
|
+
seeds << (RecommendationSeedObject.from_hash(structure) if structure)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
seeds = nil unless hash.key?('seeds')
|
58
|
+
# Parameter is an array, so we need to iterate through it
|
59
|
+
tracks = nil
|
60
|
+
unless hash['tracks'].nil?
|
61
|
+
tracks = []
|
62
|
+
hash['tracks'].each do |structure|
|
63
|
+
tracks << (TrackObject.from_hash(structure) if structure)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
tracks = nil unless hash.key?('tracks')
|
68
|
+
|
69
|
+
# Create object from extracted values.
|
70
|
+
RecommendationsObject.new(seeds,
|
71
|
+
tracks)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# The precision with which `release_date` value is known.
|
8
|
+
class ReleaseDatePrecisionEnum
|
9
|
+
RELEASE_DATE_PRECISION_ENUM = [
|
10
|
+
# TODO: Write general description for YEAR
|
11
|
+
YEAR = 'year'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for MONTH
|
14
|
+
MONTH = 'month'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for DAY
|
17
|
+
DAY = 'day'.freeze
|
18
|
+
].freeze
|
19
|
+
|
20
|
+
def self.validate(value)
|
21
|
+
return false if value.nil?
|
22
|
+
|
23
|
+
RELEASE_DATE_PRECISION_ENUM.include?(value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# ResumePointObject Model.
|
8
|
+
class ResumePointObject < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Whether or not the episode has been fully played by the user.
|
13
|
+
# @return [TrueClass | FalseClass]
|
14
|
+
attr_accessor :fully_played
|
15
|
+
|
16
|
+
# The user's most recent position in the episode in milliseconds.
|
17
|
+
# @return [Integer]
|
18
|
+
attr_accessor :resume_position_ms
|
19
|
+
|
20
|
+
# A mapping from model property names to API property names.
|
21
|
+
def self.names
|
22
|
+
@_hash = {} if @_hash.nil?
|
23
|
+
@_hash['fully_played'] = 'fully_played'
|
24
|
+
@_hash['resume_position_ms'] = 'resume_position_ms'
|
25
|
+
@_hash
|
26
|
+
end
|
27
|
+
|
28
|
+
# An array for optional fields
|
29
|
+
def self.optionals
|
30
|
+
%w[
|
31
|
+
fully_played
|
32
|
+
resume_position_ms
|
33
|
+
]
|
34
|
+
end
|
35
|
+
|
36
|
+
# An array for nullable fields
|
37
|
+
def self.nullables
|
38
|
+
[]
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize(fully_played = SKIP, resume_position_ms = SKIP)
|
42
|
+
@fully_played = fully_played unless fully_played == SKIP
|
43
|
+
@resume_position_ms = resume_position_ms unless resume_position_ms == SKIP
|
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
|
+
fully_played = hash.key?('fully_played') ? hash['fully_played'] : SKIP
|
52
|
+
resume_position_ms =
|
53
|
+
hash.key?('resume_position_ms') ? hash['resume_position_ms'] : SKIP
|
54
|
+
|
55
|
+
# Create object from extracted values.
|
56
|
+
ResumePointObject.new(fully_played,
|
57
|
+
resume_position_ms)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module SpotifyWebApi
|
8
|
+
# SavedAlbumObject Model.
|
9
|
+
class SavedAlbumObject < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# The date and time the album was saved
|
14
|
+
# Timestamps are returned in ISO 8601 format as Coordinated Universal Time
|
15
|
+
# (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ.
|
16
|
+
# If the time is imprecise (for example, the date/time of an album release),
|
17
|
+
# an additional field indicates the precision; see for example, release_date
|
18
|
+
# in an album object.
|
19
|
+
# @return [DateTime]
|
20
|
+
attr_accessor :added_at
|
21
|
+
|
22
|
+
# Information about the album.
|
23
|
+
# @return [AlbumObject]
|
24
|
+
attr_accessor :album
|
25
|
+
|
26
|
+
# A mapping from model property names to API property names.
|
27
|
+
def self.names
|
28
|
+
@_hash = {} if @_hash.nil?
|
29
|
+
@_hash['added_at'] = 'added_at'
|
30
|
+
@_hash['album'] = 'album'
|
31
|
+
@_hash
|
32
|
+
end
|
33
|
+
|
34
|
+
# An array for optional fields
|
35
|
+
def self.optionals
|
36
|
+
%w[
|
37
|
+
added_at
|
38
|
+
album
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for nullable fields
|
43
|
+
def self.nullables
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
def initialize(added_at = SKIP, album = SKIP)
|
48
|
+
@added_at = added_at unless added_at == SKIP
|
49
|
+
@album = album unless album == SKIP
|
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
|
+
added_at = if hash.key?('added_at')
|
58
|
+
(DateTimeHelper.from_rfc3339(hash['added_at']) if hash['added_at'])
|
59
|
+
else
|
60
|
+
SKIP
|
61
|
+
end
|
62
|
+
album = AlbumObject.from_hash(hash['album']) if hash['album']
|
63
|
+
|
64
|
+
# Create object from extracted values.
|
65
|
+
SavedAlbumObject.new(added_at,
|
66
|
+
album)
|
67
|
+
end
|
68
|
+
|
69
|
+
def to_custom_added_at
|
70
|
+
DateTimeHelper.to_rfc3339(added_at)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module SpotifyWebApi
|
8
|
+
# SavedAudiobookObject Model.
|
9
|
+
class SavedAudiobookObject < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# The date and time the audiobook was saved
|
14
|
+
# Timestamps are returned in ISO 8601 format as Coordinated Universal Time
|
15
|
+
# (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ.
|
16
|
+
# If the time is imprecise (for example, the date/time of an album release),
|
17
|
+
# an additional field indicates the precision; see for example, release_date
|
18
|
+
# in an album object.
|
19
|
+
# @return [DateTime]
|
20
|
+
attr_accessor :added_at
|
21
|
+
|
22
|
+
# Information about the audiobook.
|
23
|
+
# @return [AudiobookObject]
|
24
|
+
attr_accessor :audiobook
|
25
|
+
|
26
|
+
# A mapping from model property names to API property names.
|
27
|
+
def self.names
|
28
|
+
@_hash = {} if @_hash.nil?
|
29
|
+
@_hash['added_at'] = 'added_at'
|
30
|
+
@_hash['audiobook'] = 'audiobook'
|
31
|
+
@_hash
|
32
|
+
end
|
33
|
+
|
34
|
+
# An array for optional fields
|
35
|
+
def self.optionals
|
36
|
+
%w[
|
37
|
+
added_at
|
38
|
+
audiobook
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for nullable fields
|
43
|
+
def self.nullables
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
def initialize(added_at = SKIP, audiobook = SKIP)
|
48
|
+
@added_at = added_at unless added_at == SKIP
|
49
|
+
@audiobook = audiobook unless audiobook == SKIP
|
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
|
+
added_at = if hash.key?('added_at')
|
58
|
+
(DateTimeHelper.from_rfc3339(hash['added_at']) if hash['added_at'])
|
59
|
+
else
|
60
|
+
SKIP
|
61
|
+
end
|
62
|
+
audiobook = AudiobookObject.from_hash(hash['audiobook']) if hash['audiobook']
|
63
|
+
|
64
|
+
# Create object from extracted values.
|
65
|
+
SavedAudiobookObject.new(added_at,
|
66
|
+
audiobook)
|
67
|
+
end
|
68
|
+
|
69
|
+
def to_custom_added_at
|
70
|
+
DateTimeHelper.to_rfc3339(added_at)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module SpotifyWebApi
|
8
|
+
# SavedEpisodeObject Model.
|
9
|
+
class SavedEpisodeObject < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# The date and time the episode was saved.
|
14
|
+
# Timestamps are returned in ISO 8601 format as Coordinated Universal Time
|
15
|
+
# (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ.
|
16
|
+
# @return [DateTime]
|
17
|
+
attr_accessor :added_at
|
18
|
+
|
19
|
+
# Information about the episode.
|
20
|
+
# @return [EpisodeObject]
|
21
|
+
attr_accessor :episode
|
22
|
+
|
23
|
+
# A mapping from model property names to API property names.
|
24
|
+
def self.names
|
25
|
+
@_hash = {} if @_hash.nil?
|
26
|
+
@_hash['added_at'] = 'added_at'
|
27
|
+
@_hash['episode'] = 'episode'
|
28
|
+
@_hash
|
29
|
+
end
|
30
|
+
|
31
|
+
# An array for optional fields
|
32
|
+
def self.optionals
|
33
|
+
%w[
|
34
|
+
added_at
|
35
|
+
episode
|
36
|
+
]
|
37
|
+
end
|
38
|
+
|
39
|
+
# An array for nullable fields
|
40
|
+
def self.nullables
|
41
|
+
[]
|
42
|
+
end
|
43
|
+
|
44
|
+
def initialize(added_at = SKIP, episode = SKIP)
|
45
|
+
@added_at = added_at unless added_at == SKIP
|
46
|
+
@episode = episode unless episode == 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
|
+
added_at = if hash.key?('added_at')
|
55
|
+
(DateTimeHelper.from_rfc3339(hash['added_at']) if hash['added_at'])
|
56
|
+
else
|
57
|
+
SKIP
|
58
|
+
end
|
59
|
+
episode = EpisodeObject.from_hash(hash['episode']) if hash['episode']
|
60
|
+
|
61
|
+
# Create object from extracted values.
|
62
|
+
SavedEpisodeObject.new(added_at,
|
63
|
+
episode)
|
64
|
+
end
|
65
|
+
|
66
|
+
def to_custom_added_at
|
67
|
+
DateTimeHelper.to_rfc3339(added_at)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module SpotifyWebApi
|
8
|
+
# SavedShowObject Model.
|
9
|
+
class SavedShowObject < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# The date and time the show was saved.
|
14
|
+
# Timestamps are returned in ISO 8601 format as Coordinated Universal Time
|
15
|
+
# (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ.
|
16
|
+
# If the time is imprecise (for example, the date/time of an album release),
|
17
|
+
# an additional field indicates the precision; see for example, release_date
|
18
|
+
# in an album object.
|
19
|
+
# @return [DateTime]
|
20
|
+
attr_accessor :added_at
|
21
|
+
|
22
|
+
# Information about the show.
|
23
|
+
# @return [ShowBase]
|
24
|
+
attr_accessor :show
|
25
|
+
|
26
|
+
# A mapping from model property names to API property names.
|
27
|
+
def self.names
|
28
|
+
@_hash = {} if @_hash.nil?
|
29
|
+
@_hash['added_at'] = 'added_at'
|
30
|
+
@_hash['show'] = 'show'
|
31
|
+
@_hash
|
32
|
+
end
|
33
|
+
|
34
|
+
# An array for optional fields
|
35
|
+
def self.optionals
|
36
|
+
%w[
|
37
|
+
added_at
|
38
|
+
show
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for nullable fields
|
43
|
+
def self.nullables
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
def initialize(added_at = SKIP, show = SKIP)
|
48
|
+
@added_at = added_at unless added_at == SKIP
|
49
|
+
@show = show unless show == SKIP
|
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
|
+
added_at = if hash.key?('added_at')
|
58
|
+
(DateTimeHelper.from_rfc3339(hash['added_at']) if hash['added_at'])
|
59
|
+
else
|
60
|
+
SKIP
|
61
|
+
end
|
62
|
+
show = ShowBase.from_hash(hash['show']) if hash['show']
|
63
|
+
|
64
|
+
# Create object from extracted values.
|
65
|
+
SavedShowObject.new(added_at,
|
66
|
+
show)
|
67
|
+
end
|
68
|
+
|
69
|
+
def to_custom_added_at
|
70
|
+
DateTimeHelper.to_rfc3339(added_at)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
module SpotifyWebApi
|
8
|
+
# SavedTrackObject Model.
|
9
|
+
class SavedTrackObject < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# The date and time the track was saved.
|
14
|
+
# Timestamps are returned in ISO 8601 format as Coordinated Universal Time
|
15
|
+
# (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ.
|
16
|
+
# If the time is imprecise (for example, the date/time of an album release),
|
17
|
+
# an additional field indicates the precision; see for example, release_date
|
18
|
+
# in an album object.
|
19
|
+
# @return [DateTime]
|
20
|
+
attr_accessor :added_at
|
21
|
+
|
22
|
+
# Information about the track.
|
23
|
+
# @return [TrackObject]
|
24
|
+
attr_accessor :track
|
25
|
+
|
26
|
+
# A mapping from model property names to API property names.
|
27
|
+
def self.names
|
28
|
+
@_hash = {} if @_hash.nil?
|
29
|
+
@_hash['added_at'] = 'added_at'
|
30
|
+
@_hash['track'] = 'track'
|
31
|
+
@_hash
|
32
|
+
end
|
33
|
+
|
34
|
+
# An array for optional fields
|
35
|
+
def self.optionals
|
36
|
+
%w[
|
37
|
+
added_at
|
38
|
+
track
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
# An array for nullable fields
|
43
|
+
def self.nullables
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
def initialize(added_at = SKIP, track = SKIP)
|
48
|
+
@added_at = added_at unless added_at == SKIP
|
49
|
+
@track = track unless track == SKIP
|
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
|
+
added_at = if hash.key?('added_at')
|
58
|
+
(DateTimeHelper.from_rfc3339(hash['added_at']) if hash['added_at'])
|
59
|
+
else
|
60
|
+
SKIP
|
61
|
+
end
|
62
|
+
track = TrackObject.from_hash(hash['track']) if hash['track']
|
63
|
+
|
64
|
+
# Create object from extracted values.
|
65
|
+
SavedTrackObject.new(added_at,
|
66
|
+
track)
|
67
|
+
end
|
68
|
+
|
69
|
+
def to_custom_added_at
|
70
|
+
DateTimeHelper.to_rfc3339(added_at)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
# spotify_web_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module SpotifyWebApi
|
7
|
+
# SearchItems Model.
|
8
|
+
class SearchItems < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [PagingTrackObject]
|
14
|
+
attr_accessor :tracks
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [PagingArtistObject]
|
18
|
+
attr_accessor :artists
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [PagingSimplifiedAlbumObject]
|
22
|
+
attr_accessor :albums
|
23
|
+
|
24
|
+
# TODO: Write general description for this method
|
25
|
+
# @return [PagingPlaylistObject]
|
26
|
+
attr_accessor :playlists
|
27
|
+
|
28
|
+
# TODO: Write general description for this method
|
29
|
+
# @return [PagingSimplifiedShowObject]
|
30
|
+
attr_accessor :shows
|
31
|
+
|
32
|
+
# TODO: Write general description for this method
|
33
|
+
# @return [PagingSimplifiedEpisodeObject]
|
34
|
+
attr_accessor :episodes
|
35
|
+
|
36
|
+
# TODO: Write general description for this method
|
37
|
+
# @return [PagingSimplifiedAudiobookObject]
|
38
|
+
attr_accessor :audiobooks
|
39
|
+
|
40
|
+
# A mapping from model property names to API property names.
|
41
|
+
def self.names
|
42
|
+
@_hash = {} if @_hash.nil?
|
43
|
+
@_hash['tracks'] = 'tracks'
|
44
|
+
@_hash['artists'] = 'artists'
|
45
|
+
@_hash['albums'] = 'albums'
|
46
|
+
@_hash['playlists'] = 'playlists'
|
47
|
+
@_hash['shows'] = 'shows'
|
48
|
+
@_hash['episodes'] = 'episodes'
|
49
|
+
@_hash['audiobooks'] = 'audiobooks'
|
50
|
+
@_hash
|
51
|
+
end
|
52
|
+
|
53
|
+
# An array for optional fields
|
54
|
+
def self.optionals
|
55
|
+
%w[
|
56
|
+
tracks
|
57
|
+
artists
|
58
|
+
albums
|
59
|
+
playlists
|
60
|
+
shows
|
61
|
+
episodes
|
62
|
+
audiobooks
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
66
|
+
# An array for nullable fields
|
67
|
+
def self.nullables
|
68
|
+
[]
|
69
|
+
end
|
70
|
+
|
71
|
+
def initialize(tracks = SKIP, artists = SKIP, albums = SKIP,
|
72
|
+
playlists = SKIP, shows = SKIP, episodes = SKIP,
|
73
|
+
audiobooks = SKIP)
|
74
|
+
@tracks = tracks unless tracks == SKIP
|
75
|
+
@artists = artists unless artists == SKIP
|
76
|
+
@albums = albums unless albums == SKIP
|
77
|
+
@playlists = playlists unless playlists == SKIP
|
78
|
+
@shows = shows unless shows == SKIP
|
79
|
+
@episodes = episodes unless episodes == SKIP
|
80
|
+
@audiobooks = audiobooks unless audiobooks == SKIP
|
81
|
+
end
|
82
|
+
|
83
|
+
# Creates an instance of the object from a hash.
|
84
|
+
def self.from_hash(hash)
|
85
|
+
return nil unless hash
|
86
|
+
|
87
|
+
# Extract variables from the hash.
|
88
|
+
tracks = PagingTrackObject.from_hash(hash['tracks']) if hash['tracks']
|
89
|
+
artists = PagingArtistObject.from_hash(hash['artists']) if hash['artists']
|
90
|
+
albums = PagingSimplifiedAlbumObject.from_hash(hash['albums']) if hash['albums']
|
91
|
+
playlists = PagingPlaylistObject.from_hash(hash['playlists']) if hash['playlists']
|
92
|
+
shows = PagingSimplifiedShowObject.from_hash(hash['shows']) if hash['shows']
|
93
|
+
episodes = PagingSimplifiedEpisodeObject.from_hash(hash['episodes']) if hash['episodes']
|
94
|
+
audiobooks = PagingSimplifiedAudiobookObject.from_hash(hash['audiobooks']) if
|
95
|
+
hash['audiobooks']
|
96
|
+
|
97
|
+
# Create object from extracted values.
|
98
|
+
SearchItems.new(tracks,
|
99
|
+
artists,
|
100
|
+
albums,
|
101
|
+
playlists,
|
102
|
+
shows,
|
103
|
+
episodes,
|
104
|
+
audiobooks)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|