Class: Spotted::Models::ChapterListResponse::Chapter

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

Defined Under Namespace

Modules: 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: , 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: , type: , uri: , available_markets: nil, restrictions: nil, resume_point: nil) ⇒ Object

Some parameter documentations has been truncated, see Spotted::Models::ChapterListResponse::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::ChapterListResponse::Chapter::ReleaseDatePrecision) (defaults to: )

    The precision with which ‘release_date` value is known.

  • type (Symbol, Spotted::Models::ChapterListResponse::Chapter::Type) (defaults to: )

    The object type.

  • 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



15
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
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/spotted/models/chapter_list_response.rb', line 15

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::ChapterListResponse::Chapter::ReleaseDatePrecision]
  required :release_date_precision,
           enum: -> { Spotted::Models::ChapterListResponse::Chapter::ReleaseDatePrecision }

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

  # @!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:, type:, uri:, available_markets: nil, restrictions: nil, resume_point: nil)
  #   Some parameter documentations has been truncated, see
  #   {Spotted::Models::ChapterListResponse::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::ChapterListResponse::Chapter::ReleaseDatePrecision] The precision with which `release_date` value is known.
  #
  #   @param type [Symbol, Spotted::Models::ChapterListResponse::Chapter::Type] The object type.
  #
  #   @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

  # The precision with which `release_date` value is known.
  #
  # @see Spotted::Models::ChapterListResponse::Chapter#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::ChapterListResponse::Chapter#type
  module Type
    extend Spotted::Internal::Type::Enum

    EPISODE = :episode

    # @!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)


30
# File 'lib/spotted/models/chapter_list_response.rb', line 30

required :audio_preview_url, String, nil?: true

#audiobookSpotted::Models::AudiobookBase

The audiobook for which the chapter belongs.



36
# File 'lib/spotted/models/chapter_list_response.rb', line 36

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)


139
# File 'lib/spotted/models/chapter_list_response.rb', line 139

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

#chapter_numberInteger

The number of the chapter

Returns:

  • (Integer)


42
# File 'lib/spotted/models/chapter_list_response.rb', line 42

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)


49
# File 'lib/spotted/models/chapter_list_response.rb', line 49

required :description, String

#duration_msInteger

The chapter length in milliseconds.

Returns:

  • (Integer)


55
# File 'lib/spotted/models/chapter_list_response.rb', line 55

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)


62
# File 'lib/spotted/models/chapter_list_response.rb', line 62

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

#external_urlsSpotted::Models::ExternalURLObject

External URLs for this chapter.



68
# File 'lib/spotted/models/chapter_list_response.rb', line 68

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

#hrefString

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

Returns:

  • (String)


74
# File 'lib/spotted/models/chapter_list_response.rb', line 74

required :href, String

#html_descriptionString

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

Returns:

  • (String)


80
# File 'lib/spotted/models/chapter_list_response.rb', line 80

required :html_description, String

#idString

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

Returns:

  • (String)


21
# File 'lib/spotted/models/chapter_list_response.rb', line 21

required :id, String

#imagesArray<Spotted::Models::ImageObject>

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

Returns:



86
# File 'lib/spotted/models/chapter_list_response.rb', line 86

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

#is_playableBoolean

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

Returns:

  • (Boolean)


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

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>)


99
# File 'lib/spotted/models/chapter_list_response.rb', line 99

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

#nameString

The name of the chapter.

Returns:

  • (String)


105
# File 'lib/spotted/models/chapter_list_response.rb', line 105

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)


112
# File 'lib/spotted/models/chapter_list_response.rb', line 112

required :release_date, String

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

The precision with which ‘release_date` value is known.



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

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

#restrictionsSpotted::Models::ChapterRestrictionObject?

Included in the response when a content restriction is applied.



145
# File 'lib/spotted/models/chapter_list_response.rb', line 145

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’.



152
# File 'lib/spotted/models/chapter_list_response.rb', line 152

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

#typeSymbol, Spotted::Models::ChapterListResponse::Chapter::Type

The object type.



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

required :type, enum: -> { Spotted::Models::ChapterListResponse::Chapter::Type }

#uriString

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

Returns:

  • (String)


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

required :uri, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/spotted/models/chapter_list_response.rb', line 210