Class: Spotted::Models::ChapterBulkRetrieveResponse::Chapter

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

Defined Under Namespace

Modules: ReleaseDatePrecision

Instance Attribute 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: , audio_preview_url: , audiobook: , chapter_number: , description: , duration_ms: , explicit: , external_urls: , href: , html_description: , images: , is_playable: , languages: , name: , release_date: , release_date_precision: , uri: , available_markets: nil, restrictions: nil, resume_point: nil, type: :episode) ⇒ Object

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

Parameters:

  • id (String) (defaults to: )

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

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

    A URL to a 30 second preview (MP3 format) of the chapter. ‘null` if not availabl

  • audiobook (Spotted::Models::AudiobookBase) (defaults to: )

    The audiobook for which the chapter belongs.

  • chapter_number (Integer) (defaults to: )

    The number of the chapter

  • description (String) (defaults to: )

    A description of the chapter. HTML tags are stripped away from this field, use ‘

  • duration_ms (Integer) (defaults to: )

    The chapter length in milliseconds.

  • explicit (Boolean) (defaults to: )

    Whether or not the chapter has explicit content (true = yes it does; false = no

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

    External URLs for this chapter.

  • href (String) (defaults to: )

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

  • html_description (String) (defaults to: )

    A description of the chapter. This field may contain HTML tags.

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

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

  • is_playable (Boolean) (defaults to: )

    True if the chapter is playable in the given market. Otherwise false.

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

    A list of the languages used in the chapter, identified by their [ISO 639-1](htt

  • name (String) (defaults to: )

    The name of the chapter.

  • release_date (String) (defaults to: )

    The date the chapter was first released, for example ‘“1981-12-15”`. Depending o

  • release_date_precision (Symbol, Spotted::Models::ChapterBulkRetrieveResponse::Chapter::ReleaseDatePrecision) (defaults to: )

    The precision with which ‘release_date` value is known.

  • uri (String) (defaults to: )

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

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

    A list of the countries in which the chapter can be played, identified by their

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

    Included in the response when a content restriction is applied.

  • resume_point (Spotted::Models::ResumePointObject) (defaults to: nil)

    The user’s most recent position in the chapter. Set if the supplied access token

  • type (Symbol, :episode) (defaults to: :episode)

    The object type.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 16

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

  # @!attribute audio_preview_url
  #   @deprecated
  #
  #   A URL to a 30 second preview (MP3 format) of the chapter. `null` if not
  #   available.
  #
  #   @return [String, nil]
  required :audio_preview_url, String, nil?: true

  # @!attribute audiobook
  #   The audiobook for which the chapter belongs.
  #
  #   @return [Spotted::Models::AudiobookBase]
  required :audiobook, -> { Spotted::AudiobookBase }

  # @!attribute chapter_number
  #   The number of the chapter
  #
  #   @return [Integer]
  required :chapter_number, Integer

  # @!attribute description
  #   A description of the chapter. HTML tags are stripped away from this field, use
  #   `html_description` field in case HTML tags are needed.
  #
  #   @return [String]
  required :description, String

  # @!attribute duration_ms
  #   The chapter length in milliseconds.
  #
  #   @return [Integer]
  required :duration_ms, Integer

  # @!attribute explicit
  #   Whether or not the chapter has explicit content (true = yes it does; false = no
  #   it does not OR unknown).
  #
  #   @return [Boolean]
  required :explicit, Spotted::Internal::Type::Boolean

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

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

  # @!attribute html_description
  #   A description of the chapter. This field may contain HTML tags.
  #
  #   @return [String]
  required :html_description, String

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

  # @!attribute is_playable
  #   True if the chapter is playable in the given market. Otherwise false.
  #
  #   @return [Boolean]
  required :is_playable, Spotted::Internal::Type::Boolean

  # @!attribute languages
  #   A list of the languages used in the chapter, identified by their
  #   [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639) code.
  #
  #   @return [Array<String>]
  required :languages, Spotted::Internal::Type::ArrayOf[String]

  # @!attribute name
  #   The name of the chapter.
  #
  #   @return [String]
  required :name, String

  # @!attribute release_date
  #   The date the chapter was first released, for example `"1981-12-15"`. Depending
  #   on the precision, it might be shown as `"1981"` or `"1981-12"`.
  #
  #   @return [String]
  required :release_date, String

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

  # @!attribute type
  #   The object type.
  #
  #   @return [Symbol, :episode]
  required :type, const: :episode

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

  # @!attribute available_markets
  #   A list of the countries in which the chapter can be played, identified by their
  #   [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.
  #
  #   @return [Array<String>, nil]
  optional :available_markets, Spotted::Internal::Type::ArrayOf[String]

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

  # @!attribute resume_point
  #   The user's most recent position in the chapter. Set if the supplied access token
  #   is a user token and has the scope 'user-read-playback-position'.
  #
  #   @return [Spotted::Models::ResumePointObject, nil]
  optional :resume_point, -> { Spotted::ResumePointObject }

  # @!method initialize(id:, audio_preview_url:, audiobook:, chapter_number:, description:, duration_ms:, explicit:, external_urls:, href:, html_description:, images:, is_playable:, languages:, name:, release_date:, release_date_precision:, uri:, available_markets: nil, restrictions: nil, resume_point: nil, type: :episode)
  #   Some parameter documentations has been truncated, see
  #   {Spotted::Models::ChapterBulkRetrieveResponse::Chapter} for more details.
  #
  #   @param id [String] The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the chapt
  #
  #   @param audio_preview_url [String, nil] A URL to a 30 second preview (MP3 format) of the chapter. `null` if not availabl
  #
  #   @param audiobook [Spotted::Models::AudiobookBase] The audiobook for which the chapter belongs.
  #
  #   @param chapter_number [Integer] The number of the chapter
  #
  #   @param description [String] A description of the chapter. HTML tags are stripped away from this field, use `
  #
  #   @param duration_ms [Integer] The chapter length in milliseconds.
  #
  #   @param explicit [Boolean] Whether or not the chapter has explicit content (true = yes it does; false = no
  #
  #   @param external_urls [Spotted::Models::ExternalURLObject] External URLs for this chapter.
  #
  #   @param href [String] A link to the Web API endpoint providing full details of the chapter.
  #
  #   @param html_description [String] A description of the chapter. This field may contain HTML tags.
  #
  #   @param images [Array<Spotted::Models::ImageObject>] The cover art for the chapter in various sizes, widest first.
  #
  #   @param is_playable [Boolean] True if the chapter is playable in the given market. Otherwise false.
  #
  #   @param languages [Array<String>] A list of the languages used in the chapter, identified by their [ISO 639-1](htt
  #
  #   @param name [String] The name of the chapter.
  #
  #   @param release_date [String] The date the chapter was first released, for example `"1981-12-15"`. Depending o
  #
  #   @param release_date_precision [Symbol, Spotted::Models::ChapterBulkRetrieveResponse::Chapter::ReleaseDatePrecision] The precision with which `release_date` value is known.
  #
  #   @param uri [String] The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the chap
  #
  #   @param available_markets [Array<String>] A list of the countries in which the chapter can be played, identified by their
  #
  #   @param restrictions [Spotted::Models::ChapterRestrictionObject] Included in the response when a content restriction is applied.
  #
  #   @param resume_point [Spotted::Models::ResumePointObject] The user's most recent position in the chapter. Set if the supplied access token
  #
  #   @param type [Symbol, :episode] The object type.

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

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

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

Instance Attribute Details

#audio_preview_urlString?

Deprecated.

A URL to a 30 second preview (MP3 format) of the chapter. ‘null` if not available.

Returns:

  • (String, nil)


31
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 31

required :audio_preview_url, String, nil?: true

#audiobookSpotted::Models::AudiobookBase

The audiobook for which the chapter belongs.



37
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 37

required :audiobook, -> { Spotted::AudiobookBase }

#available_marketsArray<String>?

A list of the countries in which the chapter 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)


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

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

#chapter_numberInteger

The number of the chapter

Returns:

  • (Integer)


43
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 43

required :chapter_number, Integer

#descriptionString

A description of the chapter. HTML tags are stripped away from this field, use ‘html_description` field in case HTML tags are needed.

Returns:

  • (String)


50
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 50

required :description, String

#duration_msInteger

The chapter length in milliseconds.

Returns:

  • (Integer)


56
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 56

required :duration_ms, Integer

#explicitBoolean

Whether or not the chapter has explicit content (true = yes it does; false = no it does not OR unknown).

Returns:

  • (Boolean)


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

required :explicit, Spotted::Internal::Type::Boolean

#external_urlsSpotted::Models::ExternalURLObject

External URLs for this chapter.



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

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

#hrefString

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

Returns:

  • (String)


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

required :href, String

#html_descriptionString

A description of the chapter. This field may contain HTML tags.

Returns:

  • (String)


81
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 81

required :html_description, String

#idString

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

Returns:

  • (String)


22
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 22

required :id, String

#imagesArray<Spotted::Models::ImageObject>

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

Returns:



87
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 87

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

#is_playableBoolean

True if the chapter is playable in the given market. Otherwise false.

Returns:

  • (Boolean)


93
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 93

required :is_playable, Spotted::Internal::Type::Boolean

#languagesArray<String>

A list of the languages used in the chapter, identified by their [ISO 639-1](en.wikipedia.org/wiki/ISO_639) code.

Returns:

  • (Array<String>)


100
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 100

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

#nameString

The name of the chapter.

Returns:

  • (String)


106
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 106

required :name, String

#release_dateString

The date the chapter was first released, for example ‘“1981-12-15”`. Depending on the precision, it might be shown as `“1981”` or `“1981-12”`.

Returns:

  • (String)


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

required :release_date, String

#release_date_precisionSymbol, Spotted::Models::ChapterBulkRetrieveResponse::Chapter::ReleaseDatePrecision

The precision with which ‘release_date` value is known.



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

required :release_date_precision,
enum: -> { Spotted::Models::ChapterBulkRetrieveResponse::Chapter::ReleaseDatePrecision }

#restrictionsSpotted::Models::ChapterRestrictionObject?

Included in the response when a content restriction is applied.



146
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 146

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

#resume_pointSpotted::Models::ResumePointObject?

The user’s most recent position in the chapter. Set if the supplied access token is a user token and has the scope ‘user-read-playback-position’.



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

optional :resume_point, -> { Spotted::ResumePointObject }

#typeSymbol, :episode

The object type.

Returns:

  • (Symbol, :episode)


126
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 126

required :type, const: :episode

#uriString

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

Returns:

  • (String)


133
# File 'lib/spotted/models/chapter_bulk_retrieve_response.rb', line 133

required :uri, String