Class: Spotted::Models::TrackObject

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

Defined Under Namespace

Modules: Type Classes: Album

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: nil, album: nil, artists: nil, available_markets: nil, disc_number: nil, duration_ms: nil, explicit: nil, external_ids: nil, external_urls: nil, href: nil, is_local: nil, is_playable: nil, linked_from: nil, name: nil, popularity: nil, preview_url: nil, restrictions: nil, track_number: nil, type: nil, uri: nil) ⇒ Object

Some parameter documentations has been truncated, see Spotted::Models::TrackObject for more details.

Parameters:

  • id (String) (defaults to: nil)

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

  • album (Spotted::Models::TrackObject::Album) (defaults to: nil)

    The album on which the track appears. The album object includes a link in ‘href`

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

    The artists who performed the track. Each artist object includes a link in ‘href

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

    A list of the countries in which the track can be played, identified by their [I

  • disc_number (Integer) (defaults to: nil)

    The disc number (usually ‘1` unless the album consists of more than one disc).

  • duration_ms (Integer) (defaults to: nil)

    The track length in milliseconds.

  • explicit (Boolean) (defaults to: nil)

    Whether or not the track has explicit lyrics ( ‘true` = yes it does; `false` = n

  • external_ids (Spotted::Models::ExternalIDObject) (defaults to: nil)

    Known external IDs for the track.

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

    Known external URLs for this track.

  • href (String) (defaults to: nil)

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

  • is_local (Boolean) (defaults to: nil)

    Whether or not the track is from a local file.

  • is_playable (Boolean) (defaults to: nil)

    Part of the response when [Track Relinking](/documentation/web-api/concepts/trac

  • linked_from (Spotted::Models::LinkedTrackObject) (defaults to: nil)

    Part of the response when [Track Relinking](/documentation/web-api/concepts/trac

  • name (String) (defaults to: nil)

    The name of the track.

  • popularity (Integer) (defaults to: nil)

    The popularity of the track. The value will be between 0 and 100, with 100 being

  • preview_url (String, nil) (defaults to: nil)

    A link to a 30 second preview (MP3 format) of the track. Can be ‘null`

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

    Included in the response when a content restriction is applied.

  • track_number (Integer) (defaults to: nil)

    The number of the track. If an album has several discs, the track number is the

  • type (Symbol, Spotted::Models::TrackObject::Type) (defaults to: nil)

    The object type: “track”.

  • uri (String) (defaults to: nil)

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



# File 'lib/spotted/models/track_object.rb', line 149

Instance Attribute Details

#albumSpotted::Models::TrackObject::Album?

The album on which the track appears. The album object includes a link in ‘href` to full information about the album.



18
# File 'lib/spotted/models/track_object.rb', line 18

optional :album, -> { Spotted::TrackObject::Album }

#artistsArray<Spotted::Models::SimplifiedArtistObject>?

The artists who performed the track. Each artist object includes a link in ‘href` to more detailed information about the artist.



25
# File 'lib/spotted/models/track_object.rb', line 25

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

#available_marketsArray<String>?

A list of the countries in which the track can be played, identified by their [ISO 3166-1 alpha-2](en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.

Returns:

  • (Array<String>, nil)


32
# File 'lib/spotted/models/track_object.rb', line 32

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

#disc_numberInteger?

The disc number (usually ‘1` unless the album consists of more than one disc).

Returns:

  • (Integer, nil)


38
# File 'lib/spotted/models/track_object.rb', line 38

optional :disc_number, Integer

#duration_msInteger?

The track length in milliseconds.

Returns:

  • (Integer, nil)


44
# File 'lib/spotted/models/track_object.rb', line 44

optional :duration_ms, Integer

#explicitBoolean?

Whether or not the track has explicit lyrics ( ‘true` = yes it does; `false` = no it does not OR unknown).

Returns:

  • (Boolean, nil)


51
# File 'lib/spotted/models/track_object.rb', line 51

optional :explicit, Spotted::Internal::Type::Boolean

#external_idsSpotted::Models::ExternalIDObject?

Known external IDs for the track.



57
# File 'lib/spotted/models/track_object.rb', line 57

optional :external_ids, -> { Spotted::ExternalIDObject }

#external_urlsSpotted::Models::ExternalURLObject?

Known external URLs for this track.



63
# File 'lib/spotted/models/track_object.rb', line 63

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

#hrefString?

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

Returns:

  • (String, nil)


69
# File 'lib/spotted/models/track_object.rb', line 69

optional :href, String

#idString?

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

Returns:

  • (String, nil)


11
# File 'lib/spotted/models/track_object.rb', line 11

optional :id, String

#is_localBoolean?

Whether or not the track is from a local file.

Returns:

  • (Boolean, nil)


75
# File 'lib/spotted/models/track_object.rb', line 75

optional :is_local, Spotted::Internal::Type::Boolean

#is_playableBoolean?

Part of the response when [Track Relinking](/documentation/web-api/concepts/track-relinking) is applied. If ‘true`, the track is playable in the given market. Otherwise `false`.

Returns:

  • (Boolean, nil)


83
# File 'lib/spotted/models/track_object.rb', line 83

optional :is_playable, Spotted::Internal::Type::Boolean

#linked_fromSpotted::Models::LinkedTrackObject?

Part of the response when [Track Relinking](/documentation/web-api/concepts/track-relinking) is applied, and the requested track has been replaced with different track. The track in the ‘linked_from` object contains information about the originally requested track.



92
# File 'lib/spotted/models/track_object.rb', line 92

optional :linked_from, -> { Spotted::LinkedTrackObject }

#nameString?

The name of the track.

Returns:

  • (String, nil)


98
# File 'lib/spotted/models/track_object.rb', line 98

optional :name, String

#popularityInteger?

The popularity of the track. The value will be between 0 and 100, with 100 being the most popular.<br/>The popularity of a track is a value between 0 and 100, with 100 being the most popular. The popularity is calculated by algorithm and is based, in the most part, on the total number of plays the track has had and how recent those plays are.<br/>Generally speaking, songs that are being played a lot now will have a higher popularity than songs that were played a lot in the past. Duplicate tracks (e.g. the same track from a single and an album) are rated independently. Artist and album popularity is derived mathematically from track popularity. _Note: the popularity value may lag actual popularity by a few days: the value is not updated in real time._

Returns:

  • (Integer, nil)


113
# File 'lib/spotted/models/track_object.rb', line 113

optional :popularity, Integer

#preview_urlString?

Deprecated.

A link to a 30 second preview (MP3 format) of the track. Can be ‘null`

Returns:

  • (String, nil)


121
# File 'lib/spotted/models/track_object.rb', line 121

optional :preview_url, String, nil?: true

#restrictionsSpotted::Models::TrackRestrictionObject?

Included in the response when a content restriction is applied.



127
# File 'lib/spotted/models/track_object.rb', line 127

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

#track_numberInteger?

The number of the track. If an album has several discs, the track number is the number on the specified disc.

Returns:

  • (Integer, nil)


134
# File 'lib/spotted/models/track_object.rb', line 134

optional :track_number, Integer

#typeSymbol, ...

The object type: “track”.

Returns:



140
# File 'lib/spotted/models/track_object.rb', line 140

optional :type, enum: -> { Spotted::TrackObject::Type }

#uriString?

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

Returns:

  • (String, nil)


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

optional :uri, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/spotted/models/track_object.rb', line 357