Class: Spotted::Models::SearchRetrieveResponse::Albums::Item

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/spotted/models/search_retrieve_response.rb

Defined Under Namespace

Modules: AlbumType, ReleaseDatePrecision, Type

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id: , album_type: , artists: , available_markets: , external_urls: , href: , images: , name: , release_date: , release_date_precision: , total_tracks: , type: , uri: , restrictions: nil) ⇒ Object

Some parameter documentations has been truncated, see Spotted::Models::SearchRetrieveResponse::Albums::Item for more details.

Parameters:

  • id (String) (defaults to: )

    The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the album

  • album_type (Symbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::AlbumType) (defaults to: )

    The type of the album.

  • artists (Array<Spotted::Models::SimplifiedArtistObject>) (defaults to: )

    The artists of the album. Each artist object includes a link in ‘href` to more d

  • available_markets (Array<String>) (defaults to: )

    The markets in which the album is available: [ISO 3166-1 alpha-2 country codes](

  • external_urls (Spotted::Models::ExternalURLObject) (defaults to: )

    Known external URLs for this album.

  • href (String) (defaults to: )

    A link to the Web API endpoint providing full details of the album.

  • images (Array<Spotted::Models::ImageObject>) (defaults to: )

    The cover art for the album in various sizes, widest first.

  • name (String) (defaults to: )

    The name of the album. In case of an album takedown, the value may be an empty s

  • release_date (String) (defaults to: )

    The date the album was first released.

  • release_date_precision (Symbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::ReleaseDatePrecision) (defaults to: )

    The precision with which ‘release_date` value is known.

  • total_tracks (Integer) (defaults to: )

    The number of tracks in the album.

  • type (Symbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::Type) (defaults to: )

    The object type.

  • uri (String) (defaults to: )

    The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the albu

  • restrictions (Spotted::Models::AlbumRestrictionObject) (defaults to: nil)

    Included in the response when a content restriction is applied.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/spotted/models/search_retrieve_response.rb', line 113

class Item < Spotted::Internal::Type::BaseModel
  # @!attribute id
  #   The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
  #   album.
  #
  #   @return [String]
  required :id, String

  # @!attribute album_type
  #   The type of the album.
  #
  #   @return [Symbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::AlbumType]
  required :album_type, enum: -> { Spotted::Models::SearchRetrieveResponse::Albums::Item::AlbumType }

  # @!attribute artists
  #   The artists of the album. Each artist object includes a link in `href` to more
  #   detailed information about the artist.
  #
  #   @return [Array<Spotted::Models::SimplifiedArtistObject>]
  required :artists, -> { Spotted::Internal::Type::ArrayOf[Spotted::SimplifiedArtistObject] }

  # @!attribute available_markets
  #   The markets in which the album is available:
  #   [ISO 3166-1 alpha-2 country codes](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
  #   _**NOTE**: an album is considered available in a market when at least 1 of its
  #   tracks is available in that market._
  #
  #   @return [Array<String>]
  required :available_markets, Spotted::Internal::Type::ArrayOf[String]

  # @!attribute external_urls
  #   Known external URLs for this album.
  #
  #   @return [Spotted::Models::ExternalURLObject]
  required :external_urls, -> { Spotted::ExternalURLObject }

  # @!attribute href
  #   A link to the Web API endpoint providing full details of the album.
  #
  #   @return [String]
  required :href, String

  # @!attribute images
  #   The cover art for the album in various sizes, widest first.
  #
  #   @return [Array<Spotted::Models::ImageObject>]
  required :images, -> { Spotted::Internal::Type::ArrayOf[Spotted::ImageObject] }

  # @!attribute name
  #   The name of the album. In case of an album takedown, the value may be an empty
  #   string.
  #
  #   @return [String]
  required :name, String

  # @!attribute release_date
  #   The date the album was first released.
  #
  #   @return [String]
  required :release_date, String

  # @!attribute release_date_precision
  #   The precision with which `release_date` value is known.
  #
  #   @return [Symbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::ReleaseDatePrecision]
  required :release_date_precision,
           enum: -> { Spotted::Models::SearchRetrieveResponse::Albums::Item::ReleaseDatePrecision }

  # @!attribute total_tracks
  #   The number of tracks in the album.
  #
  #   @return [Integer]
  required :total_tracks, Integer

  # @!attribute type
  #   The object type.
  #
  #   @return [Symbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::Type]
  required :type, enum: -> { Spotted::Models::SearchRetrieveResponse::Albums::Item::Type }

  # @!attribute uri
  #   The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
  #   album.
  #
  #   @return [String]
  required :uri, String

  # @!attribute restrictions
  #   Included in the response when a content restriction is applied.
  #
  #   @return [Spotted::Models::AlbumRestrictionObject, nil]
  optional :restrictions, -> { Spotted::AlbumRestrictionObject }

  # @!method initialize(id:, album_type:, artists:, available_markets:, external_urls:, href:, images:, name:, release_date:, release_date_precision:, total_tracks:, type:, uri:, restrictions: nil)
  #   Some parameter documentations has been truncated, see
  #   {Spotted::Models::SearchRetrieveResponse::Albums::Item} for more details.
  #
  #   @param id [String] The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the album
  #
  #   @param album_type [Symbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::AlbumType] The type of the album.
  #
  #   @param artists [Array<Spotted::Models::SimplifiedArtistObject>] The artists of the album. Each artist object includes a link in `href` to more d
  #
  #   @param available_markets [Array<String>] The markets in which the album is available: [ISO 3166-1 alpha-2 country codes](
  #
  #   @param external_urls [Spotted::Models::ExternalURLObject] Known external URLs for this album.
  #
  #   @param href [String] A link to the Web API endpoint providing full details of the album.
  #
  #   @param images [Array<Spotted::Models::ImageObject>] The cover art for the album in various sizes, widest first.
  #
  #   @param name [String] The name of the album. In case of an album takedown, the value may be an empty s
  #
  #   @param release_date [String] The date the album was first released.
  #
  #   @param release_date_precision [Symbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::ReleaseDatePrecision] The precision with which `release_date` value is known.
  #
  #   @param total_tracks [Integer] The number of tracks in the album.
  #
  #   @param type [Symbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::Type] The object type.
  #
  #   @param uri [String] The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the albu
  #
  #   @param restrictions [Spotted::Models::AlbumRestrictionObject] Included in the response when a content restriction is applied.

  # The type of the album.
  #
  # @see Spotted::Models::SearchRetrieveResponse::Albums::Item#album_type
  module AlbumType
    extend Spotted::Internal::Type::Enum

    ALBUM = :album
    SINGLE = :single
    COMPILATION = :compilation

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # The precision with which `release_date` value is known.
  #
  # @see Spotted::Models::SearchRetrieveResponse::Albums::Item#release_date_precision
  module ReleaseDatePrecision
    extend Spotted::Internal::Type::Enum

    YEAR = :year
    MONTH = :month
    DAY = :day

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # The object type.
  #
  # @see Spotted::Models::SearchRetrieveResponse::Albums::Item#type
  module Type
    extend Spotted::Internal::Type::Enum

    ALBUM = :album

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#album_typeSymbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::AlbumType

The type of the album.



125
# File 'lib/spotted/models/search_retrieve_response.rb', line 125

required :album_type, enum: -> { Spotted::Models::SearchRetrieveResponse::Albums::Item::AlbumType }

#artistsArray<Spotted::Models::SimplifiedArtistObject>

The artists of the album. Each artist object includes a link in ‘href` to more detailed information about the artist.



132
# File 'lib/spotted/models/search_retrieve_response.rb', line 132

required :artists, -> { Spotted::Internal::Type::ArrayOf[Spotted::SimplifiedArtistObject] }

#available_marketsArray<String>

The markets in which the album is available: [ISO 3166-1 alpha-2 country codes](en.wikipedia.org/wiki/ISO_3166-1_alpha-2). _NOTE: an album is considered available in a market when at least 1 of its tracks is available in that market._

Returns:

  • (Array<String>)


141
# File 'lib/spotted/models/search_retrieve_response.rb', line 141

required :available_markets, Spotted::Internal::Type::ArrayOf[String]

#external_urlsSpotted::Models::ExternalURLObject

Known external URLs for this album.



147
# File 'lib/spotted/models/search_retrieve_response.rb', line 147

required :external_urls, -> { Spotted::ExternalURLObject }

#hrefString

A link to the Web API endpoint providing full details of the album.

Returns:

  • (String)


153
# File 'lib/spotted/models/search_retrieve_response.rb', line 153

required :href, String

#idString

The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the album.

Returns:

  • (String)


119
# File 'lib/spotted/models/search_retrieve_response.rb', line 119

required :id, String

#imagesArray<Spotted::Models::ImageObject>

The cover art for the album in various sizes, widest first.

Returns:



159
# File 'lib/spotted/models/search_retrieve_response.rb', line 159

required :images, -> { Spotted::Internal::Type::ArrayOf[Spotted::ImageObject] }

#nameString

The name of the album. In case of an album takedown, the value may be an empty string.

Returns:

  • (String)


166
# File 'lib/spotted/models/search_retrieve_response.rb', line 166

required :name, String

#release_dateString

The date the album was first released.

Returns:

  • (String)


172
# File 'lib/spotted/models/search_retrieve_response.rb', line 172

required :release_date, String

#release_date_precisionSymbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::ReleaseDatePrecision

The precision with which ‘release_date` value is known.



178
179
# File 'lib/spotted/models/search_retrieve_response.rb', line 178

required :release_date_precision,
enum: -> { Spotted::Models::SearchRetrieveResponse::Albums::Item::ReleaseDatePrecision }

#restrictionsSpotted::Models::AlbumRestrictionObject?

Included in the response when a content restriction is applied.



204
# File 'lib/spotted/models/search_retrieve_response.rb', line 204

optional :restrictions, -> { Spotted::AlbumRestrictionObject }

#total_tracksInteger

The number of tracks in the album.

Returns:

  • (Integer)


185
# File 'lib/spotted/models/search_retrieve_response.rb', line 185

required :total_tracks, Integer

#typeSymbol, Spotted::Models::SearchRetrieveResponse::Albums::Item::Type

The object type.



191
# File 'lib/spotted/models/search_retrieve_response.rb', line 191

required :type, enum: -> { Spotted::Models::SearchRetrieveResponse::Albums::Item::Type }

#uriString

The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the album.

Returns:

  • (String)


198
# File 'lib/spotted/models/search_retrieve_response.rb', line 198

required :uri, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/spotted/models/search_retrieve_response.rb', line 248