spotted 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/spotted/models/audiobook_base.rb +182 -0
  5. data/lib/spotted/models/audiobook_list_response.rb +2 -174
  6. data/lib/spotted/models/audiobook_retrieve_response.rb +2 -174
  7. data/lib/spotted/models/chapter_list_response.rb +3 -183
  8. data/lib/spotted/models/chapter_retrieve_response.rb +3 -183
  9. data/lib/spotted/models/episode_object.rb +3 -166
  10. data/lib/spotted/models/me/audiobook_list_response.rb +2 -174
  11. data/lib/spotted/models/me/show_list_response.rb +3 -166
  12. data/lib/spotted/models/search_retrieve_response.rb +6 -345
  13. data/lib/spotted/models/show_base.rb +165 -0
  14. data/lib/spotted/models/show_list_response.rb +3 -163
  15. data/lib/spotted/models/show_retrieve_response.rb +2 -157
  16. data/lib/spotted/models.rb +4 -0
  17. data/lib/spotted/version.rb +1 -1
  18. data/lib/spotted.rb +2 -0
  19. data/rbi/spotted/models/audiobook_base.rbi +219 -0
  20. data/rbi/spotted/models/audiobook_list_response.rbi +4 -212
  21. data/rbi/spotted/models/audiobook_retrieve_response.rbi +4 -209
  22. data/rbi/spotted/models/chapter_list_response.rbi +4 -249
  23. data/rbi/spotted/models/chapter_retrieve_response.rbi +4 -245
  24. data/rbi/spotted/models/episode_object.rbi +4 -199
  25. data/rbi/spotted/models/me/audiobook_list_response.rbi +4 -212
  26. data/rbi/spotted/models/me/show_list_response.rbi +6 -227
  27. data/rbi/spotted/models/search_retrieve_response.rbi +6 -473
  28. data/rbi/spotted/models/show_base.rbi +194 -0
  29. data/rbi/spotted/models/show_list_response.rbi +5 -216
  30. data/rbi/spotted/models/show_retrieve_response.rbi +4 -182
  31. data/rbi/spotted/models.rbi +4 -0
  32. data/sig/spotted/models/audiobook_base.rbs +122 -0
  33. data/sig/spotted/models/audiobook_list_response.rbs +8 -111
  34. data/sig/spotted/models/audiobook_retrieve_response.rbs +8 -113
  35. data/sig/spotted/models/chapter_list_response.rbs +4 -123
  36. data/sig/spotted/models/chapter_retrieve_response.rbs +4 -123
  37. data/sig/spotted/models/episode_object.rbs +4 -111
  38. data/sig/spotted/models/me/audiobook_list_response.rbs +8 -111
  39. data/sig/spotted/models/me/show_list_response.rbs +5 -121
  40. data/sig/spotted/models/search_retrieve_response.rbs +8 -234
  41. data/sig/spotted/models/show_base.rbs +110 -0
  42. data/sig/spotted/models/show_list_response.rbs +4 -116
  43. data/sig/spotted/models/show_retrieve_response.rbs +8 -101
  44. data/sig/spotted/models.rbs +4 -0
  45. metadata +7 -1
@@ -80,10 +80,10 @@ module Spotted
80
80
  attr_accessor :release_date_precision
81
81
 
82
82
  # The show on which the episode belongs.
83
- sig { returns(Spotted::EpisodeObject::Show) }
83
+ sig { returns(Spotted::ShowBase) }
84
84
  attr_reader :show
85
85
 
86
- sig { params(show: Spotted::EpisodeObject::Show::OrHash).void }
86
+ sig { params(show: Spotted::ShowBase::OrHash).void }
87
87
  attr_writer :show
88
88
 
89
89
  # The object type.
@@ -139,7 +139,7 @@ module Spotted
139
139
  release_date: String,
140
140
  release_date_precision:
141
141
  Spotted::EpisodeObject::ReleaseDatePrecision::OrSymbol,
142
- show: Spotted::EpisodeObject::Show::OrHash,
142
+ show: Spotted::ShowBase::OrHash,
143
143
  type: Spotted::EpisodeObject::Type::OrSymbol,
144
144
  uri: String,
145
145
  language: String,
@@ -222,7 +222,7 @@ module Spotted
222
222
  release_date: String,
223
223
  release_date_precision:
224
224
  Spotted::EpisodeObject::ReleaseDatePrecision::TaggedSymbol,
225
- show: Spotted::EpisodeObject::Show,
225
+ show: Spotted::ShowBase,
226
226
  type: Spotted::EpisodeObject::Type::TaggedSymbol,
227
227
  uri: String,
228
228
  language: String,
@@ -269,201 +269,6 @@ module Spotted
269
269
  end
270
270
  end
271
271
 
272
- class Show < Spotted::Internal::Type::BaseModel
273
- OrHash =
274
- T.type_alias do
275
- T.any(Spotted::EpisodeObject::Show, Spotted::Internal::AnyHash)
276
- end
277
-
278
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show.
279
- sig { returns(String) }
280
- attr_accessor :id
281
-
282
- # A list of the countries in which the show can be played, identified by their
283
- # [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.
284
- sig { returns(T::Array[String]) }
285
- attr_accessor :available_markets
286
-
287
- # The copyright statements of the show.
288
- sig { returns(T::Array[Spotted::CopyrightObject]) }
289
- attr_accessor :copyrights
290
-
291
- # A description of the show. HTML tags are stripped away from this field, use
292
- # `html_description` field in case HTML tags are needed.
293
- sig { returns(String) }
294
- attr_accessor :description
295
-
296
- # Whether or not the show has explicit content (true = yes it does; false = no it
297
- # does not OR unknown).
298
- sig { returns(T::Boolean) }
299
- attr_accessor :explicit
300
-
301
- # External URLs for this show.
302
- sig { returns(Spotted::ExternalURLObject) }
303
- attr_reader :external_urls
304
-
305
- sig { params(external_urls: Spotted::ExternalURLObject::OrHash).void }
306
- attr_writer :external_urls
307
-
308
- # A link to the Web API endpoint providing full details of the show.
309
- sig { returns(String) }
310
- attr_accessor :href
311
-
312
- # A description of the show. This field may contain HTML tags.
313
- sig { returns(String) }
314
- attr_accessor :html_description
315
-
316
- # The cover art for the show in various sizes, widest first.
317
- sig { returns(T::Array[Spotted::ImageObject]) }
318
- attr_accessor :images
319
-
320
- # True if all of the shows episodes are hosted outside of Spotify's CDN. This
321
- # field might be `null` in some cases.
322
- sig { returns(T::Boolean) }
323
- attr_accessor :is_externally_hosted
324
-
325
- # A list of the languages used in the show, identified by their
326
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
327
- sig { returns(T::Array[String]) }
328
- attr_accessor :languages
329
-
330
- # The media type of the show.
331
- sig { returns(String) }
332
- attr_accessor :media_type
333
-
334
- # The name of the episode.
335
- sig { returns(String) }
336
- attr_accessor :name
337
-
338
- # The publisher of the show.
339
- sig { returns(String) }
340
- attr_accessor :publisher
341
-
342
- # The total number of episodes in the show.
343
- sig { returns(Integer) }
344
- attr_accessor :total_episodes
345
-
346
- # The object type.
347
- sig { returns(Spotted::EpisodeObject::Show::Type::TaggedSymbol) }
348
- attr_accessor :type
349
-
350
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
351
- # show.
352
- sig { returns(String) }
353
- attr_accessor :uri
354
-
355
- # The show on which the episode belongs.
356
- sig do
357
- params(
358
- id: String,
359
- available_markets: T::Array[String],
360
- copyrights: T::Array[Spotted::CopyrightObject::OrHash],
361
- description: String,
362
- explicit: T::Boolean,
363
- external_urls: Spotted::ExternalURLObject::OrHash,
364
- href: String,
365
- html_description: String,
366
- images: T::Array[Spotted::ImageObject::OrHash],
367
- is_externally_hosted: T::Boolean,
368
- languages: T::Array[String],
369
- media_type: String,
370
- name: String,
371
- publisher: String,
372
- total_episodes: Integer,
373
- type: Spotted::EpisodeObject::Show::Type::OrSymbol,
374
- uri: String
375
- ).returns(T.attached_class)
376
- end
377
- def self.new(
378
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show.
379
- id:,
380
- # A list of the countries in which the show can be played, identified by their
381
- # [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.
382
- available_markets:,
383
- # The copyright statements of the show.
384
- copyrights:,
385
- # A description of the show. HTML tags are stripped away from this field, use
386
- # `html_description` field in case HTML tags are needed.
387
- description:,
388
- # Whether or not the show has explicit content (true = yes it does; false = no it
389
- # does not OR unknown).
390
- explicit:,
391
- # External URLs for this show.
392
- external_urls:,
393
- # A link to the Web API endpoint providing full details of the show.
394
- href:,
395
- # A description of the show. This field may contain HTML tags.
396
- html_description:,
397
- # The cover art for the show in various sizes, widest first.
398
- images:,
399
- # True if all of the shows episodes are hosted outside of Spotify's CDN. This
400
- # field might be `null` in some cases.
401
- is_externally_hosted:,
402
- # A list of the languages used in the show, identified by their
403
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
404
- languages:,
405
- # The media type of the show.
406
- media_type:,
407
- # The name of the episode.
408
- name:,
409
- # The publisher of the show.
410
- publisher:,
411
- # The total number of episodes in the show.
412
- total_episodes:,
413
- # The object type.
414
- type:,
415
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
416
- # show.
417
- uri:
418
- )
419
- end
420
-
421
- sig do
422
- override.returns(
423
- {
424
- id: String,
425
- available_markets: T::Array[String],
426
- copyrights: T::Array[Spotted::CopyrightObject],
427
- description: String,
428
- explicit: T::Boolean,
429
- external_urls: Spotted::ExternalURLObject,
430
- href: String,
431
- html_description: String,
432
- images: T::Array[Spotted::ImageObject],
433
- is_externally_hosted: T::Boolean,
434
- languages: T::Array[String],
435
- media_type: String,
436
- name: String,
437
- publisher: String,
438
- total_episodes: Integer,
439
- type: Spotted::EpisodeObject::Show::Type::TaggedSymbol,
440
- uri: String
441
- }
442
- )
443
- end
444
- def to_hash
445
- end
446
-
447
- # The object type.
448
- module Type
449
- extend Spotted::Internal::Type::Enum
450
-
451
- TaggedSymbol =
452
- T.type_alias { T.all(Symbol, Spotted::EpisodeObject::Show::Type) }
453
- OrSymbol = T.type_alias { T.any(Symbol, String) }
454
-
455
- SHOW = T.let(:show, Spotted::EpisodeObject::Show::Type::TaggedSymbol)
456
-
457
- sig do
458
- override.returns(
459
- T::Array[Spotted::EpisodeObject::Show::Type::TaggedSymbol]
460
- )
461
- end
462
- def self.values
463
- end
464
- end
465
- end
466
-
467
272
  # The object type.
468
273
  module Type
469
274
  extend Spotted::Internal::Type::Enum
@@ -69,7 +69,7 @@ module Spotted
69
69
  def to_hash
70
70
  end
71
71
 
72
- class Audiobook < Spotted::Internal::Type::BaseModel
72
+ class Audiobook < Spotted::Models::AudiobookBase
73
73
  OrHash =
74
74
  T.type_alias do
75
75
  T.any(
@@ -78,21 +78,6 @@ module Spotted
78
78
  )
79
79
  end
80
80
 
81
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
82
- # audiobook.
83
- sig { returns(String) }
84
- attr_accessor :id
85
-
86
- # The author(s) for the audiobook.
87
- sig { returns(T::Array[Spotted::AuthorObject]) }
88
- attr_accessor :authors
89
-
90
- # A list of the countries in which the audiobook can be played, identified by
91
- # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
92
- # code.
93
- sig { returns(T::Array[String]) }
94
- attr_accessor :available_markets
95
-
96
81
  # The chapters of the audiobook.
97
82
  sig do
98
83
  returns(
@@ -109,187 +94,24 @@ module Spotted
109
94
  end
110
95
  attr_writer :chapters
111
96
 
112
- # The copyright statements of the audiobook.
113
- sig { returns(T::Array[Spotted::CopyrightObject]) }
114
- attr_accessor :copyrights
115
-
116
- # A description of the audiobook. HTML tags are stripped away from this field, use
117
- # `html_description` field in case HTML tags are needed.
118
- sig { returns(String) }
119
- attr_accessor :description
120
-
121
- # Whether or not the audiobook has explicit content (true = yes it does; false =
122
- # no it does not OR unknown).
123
- sig { returns(T::Boolean) }
124
- attr_accessor :explicit
125
-
126
- # External URLs for this audiobook.
127
- sig { returns(Spotted::ExternalURLObject) }
128
- attr_reader :external_urls
129
-
130
- sig { params(external_urls: Spotted::ExternalURLObject::OrHash).void }
131
- attr_writer :external_urls
132
-
133
- # A link to the Web API endpoint providing full details of the audiobook.
134
- sig { returns(String) }
135
- attr_accessor :href
136
-
137
- # A description of the audiobook. This field may contain HTML tags.
138
- sig { returns(String) }
139
- attr_accessor :html_description
140
-
141
- # The cover art for the audiobook in various sizes, widest first.
142
- sig { returns(T::Array[Spotted::ImageObject]) }
143
- attr_accessor :images
144
-
145
- # A list of the languages used in the audiobook, identified by their
146
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
147
- sig { returns(T::Array[String]) }
148
- attr_accessor :languages
149
-
150
- # The media type of the audiobook.
151
- sig { returns(String) }
152
- attr_accessor :media_type
153
-
154
- # The name of the audiobook.
155
- sig { returns(String) }
156
- attr_accessor :name
157
-
158
- # The narrator(s) for the audiobook.
159
- sig { returns(T::Array[Spotted::NarratorObject]) }
160
- attr_accessor :narrators
161
-
162
- # The publisher of the audiobook.
163
- sig { returns(String) }
164
- attr_accessor :publisher
165
-
166
- # The number of chapters in this audiobook.
167
- sig { returns(Integer) }
168
- attr_accessor :total_chapters
169
-
170
- # The object type.
171
- sig do
172
- returns(
173
- Spotted::Models::Me::AudiobookListResponse::Audiobook::Type::TaggedSymbol
174
- )
175
- end
176
- attr_accessor :type
177
-
178
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
179
- # audiobook.
180
- sig { returns(String) }
181
- attr_accessor :uri
182
-
183
- # The edition of the audiobook.
184
- sig { returns(T.nilable(String)) }
185
- attr_reader :edition
186
-
187
- sig { params(edition: String).void }
188
- attr_writer :edition
189
-
190
97
  # Information about the audiobook.
191
98
  sig do
192
99
  params(
193
- id: String,
194
- authors: T::Array[Spotted::AuthorObject::OrHash],
195
- available_markets: T::Array[String],
196
100
  chapters:
197
- Spotted::Models::Me::AudiobookListResponse::Audiobook::Chapters::OrHash,
198
- copyrights: T::Array[Spotted::CopyrightObject::OrHash],
199
- description: String,
200
- explicit: T::Boolean,
201
- external_urls: Spotted::ExternalURLObject::OrHash,
202
- href: String,
203
- html_description: String,
204
- images: T::Array[Spotted::ImageObject::OrHash],
205
- languages: T::Array[String],
206
- media_type: String,
207
- name: String,
208
- narrators: T::Array[Spotted::NarratorObject::OrHash],
209
- publisher: String,
210
- total_chapters: Integer,
211
- type:
212
- Spotted::Models::Me::AudiobookListResponse::Audiobook::Type::OrSymbol,
213
- uri: String,
214
- edition: String
101
+ Spotted::Models::Me::AudiobookListResponse::Audiobook::Chapters::OrHash
215
102
  ).returns(T.attached_class)
216
103
  end
217
104
  def self.new(
218
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
219
- # audiobook.
220
- id:,
221
- # The author(s) for the audiobook.
222
- authors:,
223
- # A list of the countries in which the audiobook can be played, identified by
224
- # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
225
- # code.
226
- available_markets:,
227
105
  # The chapters of the audiobook.
228
- chapters:,
229
- # The copyright statements of the audiobook.
230
- copyrights:,
231
- # A description of the audiobook. HTML tags are stripped away from this field, use
232
- # `html_description` field in case HTML tags are needed.
233
- description:,
234
- # Whether or not the audiobook has explicit content (true = yes it does; false =
235
- # no it does not OR unknown).
236
- explicit:,
237
- # External URLs for this audiobook.
238
- external_urls:,
239
- # A link to the Web API endpoint providing full details of the audiobook.
240
- href:,
241
- # A description of the audiobook. This field may contain HTML tags.
242
- html_description:,
243
- # The cover art for the audiobook in various sizes, widest first.
244
- images:,
245
- # A list of the languages used in the audiobook, identified by their
246
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
247
- languages:,
248
- # The media type of the audiobook.
249
- media_type:,
250
- # The name of the audiobook.
251
- name:,
252
- # The narrator(s) for the audiobook.
253
- narrators:,
254
- # The publisher of the audiobook.
255
- publisher:,
256
- # The number of chapters in this audiobook.
257
- total_chapters:,
258
- # The object type.
259
- type:,
260
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
261
- # audiobook.
262
- uri:,
263
- # The edition of the audiobook.
264
- edition: nil
106
+ chapters:
265
107
  )
266
108
  end
267
109
 
268
110
  sig do
269
111
  override.returns(
270
112
  {
271
- id: String,
272
- authors: T::Array[Spotted::AuthorObject],
273
- available_markets: T::Array[String],
274
113
  chapters:
275
- Spotted::Models::Me::AudiobookListResponse::Audiobook::Chapters,
276
- copyrights: T::Array[Spotted::CopyrightObject],
277
- description: String,
278
- explicit: T::Boolean,
279
- external_urls: Spotted::ExternalURLObject,
280
- href: String,
281
- html_description: String,
282
- images: T::Array[Spotted::ImageObject],
283
- languages: T::Array[String],
284
- media_type: String,
285
- name: String,
286
- narrators: T::Array[Spotted::NarratorObject],
287
- publisher: String,
288
- total_chapters: Integer,
289
- type:
290
- Spotted::Models::Me::AudiobookListResponse::Audiobook::Type::TaggedSymbol,
291
- uri: String,
292
- edition: String
114
+ Spotted::Models::Me::AudiobookListResponse::Audiobook::Chapters
293
115
  }
294
116
  )
295
117
  end
@@ -377,36 +199,6 @@ module Spotted
377
199
  def to_hash
378
200
  end
379
201
  end
380
-
381
- # The object type.
382
- module Type
383
- extend Spotted::Internal::Type::Enum
384
-
385
- TaggedSymbol =
386
- T.type_alias do
387
- T.all(
388
- Symbol,
389
- Spotted::Models::Me::AudiobookListResponse::Audiobook::Type
390
- )
391
- end
392
- OrSymbol = T.type_alias { T.any(Symbol, String) }
393
-
394
- AUDIOBOOK =
395
- T.let(
396
- :audiobook,
397
- Spotted::Models::Me::AudiobookListResponse::Audiobook::Type::TaggedSymbol
398
- )
399
-
400
- sig do
401
- override.returns(
402
- T::Array[
403
- Spotted::Models::Me::AudiobookListResponse::Audiobook::Type::TaggedSymbol
404
- ]
405
- )
406
- end
407
- def self.values
408
- end
409
- end
410
202
  end
411
203
  end
412
204
  end