spotted 0.11.0 → 0.12.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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/spotted/client.rb +60 -1
  5. data/lib/spotted/models/album_bulk_retrieve_response.rb +13 -25
  6. data/lib/spotted/models/album_retrieve_response.rb +13 -25
  7. data/lib/spotted/models/artist_list_albums_response.rb +5 -17
  8. data/lib/spotted/models/audio_analysis_retrieve_response.rb +3 -8
  9. data/lib/spotted/models/audiobook_base.rb +4 -16
  10. data/lib/spotted/models/audiobook_bulk_retrieve_response.rb +8 -8
  11. data/lib/spotted/models/audiobook_retrieve_response.rb +8 -8
  12. data/lib/spotted/models/browse/category_list_response.rb +9 -9
  13. data/lib/spotted/models/browse_get_new_releases_response.rb +14 -26
  14. data/lib/spotted/models/chapter_bulk_retrieve_response.rb +5 -17
  15. data/lib/spotted/models/chapter_retrieve_response.rb +5 -17
  16. data/lib/spotted/models/episode_object.rb +5 -17
  17. data/lib/spotted/models/me/album_list_response.rb +13 -25
  18. data/lib/spotted/models/me/audiobook_list_response.rb +8 -8
  19. data/lib/spotted/models/me/following_bulk_retrieve_params.rb +5 -15
  20. data/lib/spotted/models/paging_playlist_object.rb +8 -8
  21. data/lib/spotted/models/playlist_retrieve_response.rb +8 -8
  22. data/lib/spotted/models/search_query_response.rb +54 -66
  23. data/lib/spotted/models/show_base.rb +4 -16
  24. data/lib/spotted/models/show_retrieve_response.rb +8 -8
  25. data/lib/spotted/models/simplified_chapter_object.rb +5 -17
  26. data/lib/spotted/models/simplified_episode_object.rb +5 -17
  27. data/lib/spotted/models/track_object.rb +5 -17
  28. data/lib/spotted/models/users/playlist_create_response.rb +8 -8
  29. data/lib/spotted/resources/me/following.rb +3 -3
  30. data/lib/spotted/resources/playlists/images.rb +3 -3
  31. data/lib/spotted/version.rb +1 -1
  32. data/rbi/spotted/models/album_bulk_retrieve_response.rbi +21 -52
  33. data/rbi/spotted/models/album_retrieve_response.rbi +21 -43
  34. data/rbi/spotted/models/artist_list_albums_response.rbi +7 -36
  35. data/rbi/spotted/models/audio_analysis_retrieve_response.rbi +3 -8
  36. data/rbi/spotted/models/audiobook_base.rbi +7 -25
  37. data/rbi/spotted/models/audiobook_bulk_retrieve_response.rbi +16 -9
  38. data/rbi/spotted/models/audiobook_retrieve_response.rbi +14 -9
  39. data/rbi/spotted/models/browse/category_list_response.rbi +31 -19
  40. data/rbi/spotted/models/browse_get_new_releases_response.rbi +38 -62
  41. data/rbi/spotted/models/chapter_bulk_retrieve_response.rbi +7 -43
  42. data/rbi/spotted/models/chapter_retrieve_response.rbi +7 -36
  43. data/rbi/spotted/models/episode_object.rbi +7 -24
  44. data/rbi/spotted/models/me/album_list_response.rbi +23 -52
  45. data/rbi/spotted/models/me/audiobook_list_response.rbi +18 -9
  46. data/rbi/spotted/models/me/following_bulk_retrieve_params.rbi +5 -34
  47. data/rbi/spotted/models/paging_playlist_object.rbi +14 -9
  48. data/rbi/spotted/models/playlist_retrieve_response.rbi +14 -9
  49. data/rbi/spotted/models/search_query_response.rbi +96 -101
  50. data/rbi/spotted/models/show_base.rbi +7 -23
  51. data/rbi/spotted/models/show_retrieve_response.rbi +14 -9
  52. data/rbi/spotted/models/simplified_chapter_object.rbi +7 -27
  53. data/rbi/spotted/models/simplified_episode_object.rbi +7 -27
  54. data/rbi/spotted/models/track_object.rbi +7 -26
  55. data/rbi/spotted/models/users/playlist_create_response.rbi +14 -9
  56. data/rbi/spotted/resources/me/following.rbi +3 -3
  57. data/rbi/spotted/resources/playlists/images.rbi +1 -1
  58. data/sig/spotted/models/album_bulk_retrieve_response.rbs +17 -23
  59. data/sig/spotted/models/album_retrieve_response.rbs +17 -23
  60. data/sig/spotted/models/artist_list_albums_response.rbs +5 -15
  61. data/sig/spotted/models/audio_analysis_retrieve_response.rbs +3 -8
  62. data/sig/spotted/models/audiobook_base.rbs +5 -15
  63. data/sig/spotted/models/audiobook_bulk_retrieve_response.rbs +12 -8
  64. data/sig/spotted/models/audiobook_retrieve_response.rbs +12 -8
  65. data/sig/spotted/models/browse/category_list_response.rbs +12 -8
  66. data/sig/spotted/models/browse_get_new_releases_response.rbs +17 -23
  67. data/sig/spotted/models/chapter_bulk_retrieve_response.rbs +5 -15
  68. data/sig/spotted/models/chapter_retrieve_response.rbs +5 -15
  69. data/sig/spotted/models/episode_object.rbs +5 -15
  70. data/sig/spotted/models/me/album_list_response.rbs +17 -23
  71. data/sig/spotted/models/me/audiobook_list_response.rbs +12 -8
  72. data/sig/spotted/models/me/following_bulk_retrieve_params.rbs +4 -18
  73. data/sig/spotted/models/paging_playlist_object.rbs +12 -8
  74. data/sig/spotted/models/playlist_retrieve_response.rbs +12 -8
  75. data/sig/spotted/models/search_query_response.rbs +75 -63
  76. data/sig/spotted/models/show_base.rbs +5 -15
  77. data/sig/spotted/models/show_retrieve_response.rbs +12 -8
  78. data/sig/spotted/models/simplified_chapter_object.rbs +5 -15
  79. data/sig/spotted/models/simplified_episode_object.rbs +5 -15
  80. data/sig/spotted/models/track_object.rbs +5 -15
  81. data/sig/spotted/models/users/playlist_create_response.rbs +12 -8
  82. data/sig/spotted/resources/me/following.rbs +1 -1
  83. data/sig/spotted/resources/playlists/images.rbs +1 -1
  84. metadata +2 -2
@@ -101,11 +101,7 @@ module Spotted
101
101
  attr_accessor :total_tracks
102
102
 
103
103
  # The object type.
104
- sig do
105
- returns(
106
- Spotted::Models::AlbumBulkRetrieveResponse::Album::Type::TaggedSymbol
107
- )
108
- end
104
+ sig { returns(Symbol) }
109
105
  attr_accessor :type
110
106
 
111
107
  # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
@@ -202,8 +198,6 @@ module Spotted
202
198
  release_date_precision:
203
199
  Spotted::Models::AlbumBulkRetrieveResponse::Album::ReleaseDatePrecision::OrSymbol,
204
200
  total_tracks: Integer,
205
- type:
206
- Spotted::Models::AlbumBulkRetrieveResponse::Album::Type::OrSymbol,
207
201
  uri: String,
208
202
  artists: T::Array[Spotted::SimplifiedArtistObject::OrHash],
209
203
  copyrights: T::Array[Spotted::CopyrightObject::OrHash],
@@ -213,7 +207,8 @@ module Spotted
213
207
  popularity: Integer,
214
208
  restrictions: Spotted::AlbumRestrictionObject::OrHash,
215
209
  tracks:
216
- Spotted::Models::AlbumBulkRetrieveResponse::Album::Tracks::OrHash
210
+ Spotted::Models::AlbumBulkRetrieveResponse::Album::Tracks::OrHash,
211
+ type: Symbol
217
212
  ).returns(T.attached_class)
218
213
  end
219
214
  def self.new(
@@ -242,8 +237,6 @@ module Spotted
242
237
  release_date_precision:,
243
238
  # The number of tracks in the album.
244
239
  total_tracks:,
245
- # The object type.
246
- type:,
247
240
  # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
248
241
  # album.
249
242
  uri:,
@@ -264,7 +257,9 @@ module Spotted
264
257
  # Included in the response when a content restriction is applied.
265
258
  restrictions: nil,
266
259
  # The tracks of the album.
267
- tracks: nil
260
+ tracks: nil,
261
+ # The object type.
262
+ type: :album
268
263
  )
269
264
  end
270
265
 
@@ -283,8 +278,7 @@ module Spotted
283
278
  release_date_precision:
284
279
  Spotted::Models::AlbumBulkRetrieveResponse::Album::ReleaseDatePrecision::TaggedSymbol,
285
280
  total_tracks: Integer,
286
- type:
287
- Spotted::Models::AlbumBulkRetrieveResponse::Album::Type::TaggedSymbol,
281
+ type: Symbol,
288
282
  uri: String,
289
283
  artists: T::Array[Spotted::SimplifiedArtistObject],
290
284
  copyrights: T::Array[Spotted::CopyrightObject],
@@ -380,36 +374,6 @@ module Spotted
380
374
  end
381
375
  end
382
376
 
383
- # The object type.
384
- module Type
385
- extend Spotted::Internal::Type::Enum
386
-
387
- TaggedSymbol =
388
- T.type_alias do
389
- T.all(
390
- Symbol,
391
- Spotted::Models::AlbumBulkRetrieveResponse::Album::Type
392
- )
393
- end
394
- OrSymbol = T.type_alias { T.any(Symbol, String) }
395
-
396
- ALBUM =
397
- T.let(
398
- :album,
399
- Spotted::Models::AlbumBulkRetrieveResponse::Album::Type::TaggedSymbol
400
- )
401
-
402
- sig do
403
- override.returns(
404
- T::Array[
405
- Spotted::Models::AlbumBulkRetrieveResponse::Album::Type::TaggedSymbol
406
- ]
407
- )
408
- end
409
- def self.values
410
- end
411
- end
412
-
413
377
  class Tracks < Spotted::Internal::Type::BaseModel
414
378
  OrHash =
415
379
  T.type_alias do
@@ -423,9 +387,6 @@ module Spotted
423
387
  sig { returns(String) }
424
388
  attr_accessor :href
425
389
 
426
- sig { returns(T::Array[Spotted::SimplifiedTrackObject]) }
427
- attr_accessor :items
428
-
429
390
  # The maximum number of items in the response (as set in the query or by default).
430
391
  sig { returns(Integer) }
431
392
  attr_accessor :limit
@@ -446,22 +407,29 @@ module Spotted
446
407
  sig { returns(Integer) }
447
408
  attr_accessor :total
448
409
 
410
+ sig { returns(T.nilable(T::Array[Spotted::SimplifiedTrackObject])) }
411
+ attr_reader :items
412
+
413
+ sig do
414
+ params(items: T::Array[Spotted::SimplifiedTrackObject::OrHash]).void
415
+ end
416
+ attr_writer :items
417
+
449
418
  # The tracks of the album.
450
419
  sig do
451
420
  params(
452
421
  href: String,
453
- items: T::Array[Spotted::SimplifiedTrackObject::OrHash],
454
422
  limit: Integer,
455
423
  next_: T.nilable(String),
456
424
  offset: Integer,
457
425
  previous: T.nilable(String),
458
- total: Integer
426
+ total: Integer,
427
+ items: T::Array[Spotted::SimplifiedTrackObject::OrHash]
459
428
  ).returns(T.attached_class)
460
429
  end
461
430
  def self.new(
462
431
  # A link to the Web API endpoint returning the full result of the request
463
432
  href:,
464
- items:,
465
433
  # The maximum number of items in the response (as set in the query or by default).
466
434
  limit:,
467
435
  # URL to the next page of items. ( `null` if none)
@@ -471,7 +439,8 @@ module Spotted
471
439
  # URL to the previous page of items. ( `null` if none)
472
440
  previous:,
473
441
  # The total number of items available to return.
474
- total:
442
+ total:,
443
+ items: nil
475
444
  )
476
445
  end
477
446
 
@@ -479,12 +448,12 @@ module Spotted
479
448
  override.returns(
480
449
  {
481
450
  href: String,
482
- items: T::Array[Spotted::SimplifiedTrackObject],
483
451
  limit: Integer,
484
452
  next_: T.nilable(String),
485
453
  offset: Integer,
486
454
  previous: T.nilable(String),
487
- total: Integer
455
+ total: Integer,
456
+ items: T::Array[Spotted::SimplifiedTrackObject]
488
457
  }
489
458
  )
490
459
  end
@@ -66,9 +66,7 @@ module Spotted
66
66
  attr_accessor :total_tracks
67
67
 
68
68
  # The object type.
69
- sig do
70
- returns(Spotted::Models::AlbumRetrieveResponse::Type::TaggedSymbol)
71
- end
69
+ sig { returns(Symbol) }
72
70
  attr_accessor :type
73
71
 
74
72
  # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
@@ -156,7 +154,6 @@ module Spotted
156
154
  release_date_precision:
157
155
  Spotted::Models::AlbumRetrieveResponse::ReleaseDatePrecision::OrSymbol,
158
156
  total_tracks: Integer,
159
- type: Spotted::Models::AlbumRetrieveResponse::Type::OrSymbol,
160
157
  uri: String,
161
158
  artists: T::Array[Spotted::SimplifiedArtistObject::OrHash],
162
159
  copyrights: T::Array[Spotted::CopyrightObject::OrHash],
@@ -165,7 +162,8 @@ module Spotted
165
162
  label: String,
166
163
  popularity: Integer,
167
164
  restrictions: Spotted::AlbumRestrictionObject::OrHash,
168
- tracks: Spotted::Models::AlbumRetrieveResponse::Tracks::OrHash
165
+ tracks: Spotted::Models::AlbumRetrieveResponse::Tracks::OrHash,
166
+ type: Symbol
169
167
  ).returns(T.attached_class)
170
168
  end
171
169
  def self.new(
@@ -194,8 +192,6 @@ module Spotted
194
192
  release_date_precision:,
195
193
  # The number of tracks in the album.
196
194
  total_tracks:,
197
- # The object type.
198
- type:,
199
195
  # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
200
196
  # album.
201
197
  uri:,
@@ -216,7 +212,9 @@ module Spotted
216
212
  # Included in the response when a content restriction is applied.
217
213
  restrictions: nil,
218
214
  # The tracks of the album.
219
- tracks: nil
215
+ tracks: nil,
216
+ # The object type.
217
+ type: :album
220
218
  )
221
219
  end
222
220
 
@@ -235,7 +233,7 @@ module Spotted
235
233
  release_date_precision:
236
234
  Spotted::Models::AlbumRetrieveResponse::ReleaseDatePrecision::TaggedSymbol,
237
235
  total_tracks: Integer,
238
- type: Spotted::Models::AlbumRetrieveResponse::Type::TaggedSymbol,
236
+ type: Symbol,
239
237
  uri: String,
240
238
  artists: T::Array[Spotted::SimplifiedArtistObject],
241
239
  copyrights: T::Array[Spotted::CopyrightObject],
@@ -328,31 +326,6 @@ module Spotted
328
326
  end
329
327
  end
330
328
 
331
- # The object type.
332
- module Type
333
- extend Spotted::Internal::Type::Enum
334
-
335
- TaggedSymbol =
336
- T.type_alias do
337
- T.all(Symbol, Spotted::Models::AlbumRetrieveResponse::Type)
338
- end
339
- OrSymbol = T.type_alias { T.any(Symbol, String) }
340
-
341
- ALBUM =
342
- T.let(
343
- :album,
344
- Spotted::Models::AlbumRetrieveResponse::Type::TaggedSymbol
345
- )
346
-
347
- sig do
348
- override.returns(
349
- T::Array[Spotted::Models::AlbumRetrieveResponse::Type::TaggedSymbol]
350
- )
351
- end
352
- def self.values
353
- end
354
- end
355
-
356
329
  class Tracks < Spotted::Internal::Type::BaseModel
357
330
  OrHash =
358
331
  T.type_alias do
@@ -366,9 +339,6 @@ module Spotted
366
339
  sig { returns(String) }
367
340
  attr_accessor :href
368
341
 
369
- sig { returns(T::Array[Spotted::SimplifiedTrackObject]) }
370
- attr_accessor :items
371
-
372
342
  # The maximum number of items in the response (as set in the query or by default).
373
343
  sig { returns(Integer) }
374
344
  attr_accessor :limit
@@ -389,22 +359,29 @@ module Spotted
389
359
  sig { returns(Integer) }
390
360
  attr_accessor :total
391
361
 
362
+ sig { returns(T.nilable(T::Array[Spotted::SimplifiedTrackObject])) }
363
+ attr_reader :items
364
+
365
+ sig do
366
+ params(items: T::Array[Spotted::SimplifiedTrackObject::OrHash]).void
367
+ end
368
+ attr_writer :items
369
+
392
370
  # The tracks of the album.
393
371
  sig do
394
372
  params(
395
373
  href: String,
396
- items: T::Array[Spotted::SimplifiedTrackObject::OrHash],
397
374
  limit: Integer,
398
375
  next_: T.nilable(String),
399
376
  offset: Integer,
400
377
  previous: T.nilable(String),
401
- total: Integer
378
+ total: Integer,
379
+ items: T::Array[Spotted::SimplifiedTrackObject::OrHash]
402
380
  ).returns(T.attached_class)
403
381
  end
404
382
  def self.new(
405
383
  # A link to the Web API endpoint returning the full result of the request
406
384
  href:,
407
- items:,
408
385
  # The maximum number of items in the response (as set in the query or by default).
409
386
  limit:,
410
387
  # URL to the next page of items. ( `null` if none)
@@ -414,7 +391,8 @@ module Spotted
414
391
  # URL to the previous page of items. ( `null` if none)
415
392
  previous:,
416
393
  # The total number of items available to return.
417
- total:
394
+ total:,
395
+ items: nil
418
396
  )
419
397
  end
420
398
 
@@ -422,12 +400,12 @@ module Spotted
422
400
  override.returns(
423
401
  {
424
402
  href: String,
425
- items: T::Array[Spotted::SimplifiedTrackObject],
426
403
  limit: Integer,
427
404
  next_: T.nilable(String),
428
405
  offset: Integer,
429
406
  previous: T.nilable(String),
430
- total: Integer
407
+ total: Integer,
408
+ items: T::Array[Spotted::SimplifiedTrackObject]
431
409
  }
432
410
  )
433
411
  end
@@ -81,9 +81,7 @@ module Spotted
81
81
  attr_accessor :total_tracks
82
82
 
83
83
  # The object type.
84
- sig do
85
- returns(Spotted::Models::ArtistListAlbumsResponse::Type::TaggedSymbol)
86
- end
84
+ sig { returns(Symbol) }
87
85
  attr_accessor :type
88
86
 
89
87
  # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
@@ -115,9 +113,9 @@ module Spotted
115
113
  release_date_precision:
116
114
  Spotted::Models::ArtistListAlbumsResponse::ReleaseDatePrecision::OrSymbol,
117
115
  total_tracks: Integer,
118
- type: Spotted::Models::ArtistListAlbumsResponse::Type::OrSymbol,
119
116
  uri: String,
120
- restrictions: Spotted::AlbumRestrictionObject::OrHash
117
+ restrictions: Spotted::AlbumRestrictionObject::OrHash,
118
+ type: Symbol
121
119
  ).returns(T.attached_class)
122
120
  end
123
121
  def self.new(
@@ -151,13 +149,13 @@ module Spotted
151
149
  release_date_precision:,
152
150
  # The number of tracks in the album.
153
151
  total_tracks:,
154
- # The object type.
155
- type:,
156
152
  # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
157
153
  # album.
158
154
  uri:,
159
155
  # Included in the response when a content restriction is applied.
160
- restrictions: nil
156
+ restrictions: nil,
157
+ # The object type.
158
+ type: :album
161
159
  )
162
160
  end
163
161
 
@@ -179,7 +177,7 @@ module Spotted
179
177
  release_date_precision:
180
178
  Spotted::Models::ArtistListAlbumsResponse::ReleaseDatePrecision::TaggedSymbol,
181
179
  total_tracks: Integer,
182
- type: Spotted::Models::ArtistListAlbumsResponse::Type::TaggedSymbol,
180
+ type: Symbol,
183
181
  uri: String,
184
182
  restrictions: Spotted::AlbumRestrictionObject
185
183
  }
@@ -306,33 +304,6 @@ module Spotted
306
304
  def self.values
307
305
  end
308
306
  end
309
-
310
- # The object type.
311
- module Type
312
- extend Spotted::Internal::Type::Enum
313
-
314
- TaggedSymbol =
315
- T.type_alias do
316
- T.all(Symbol, Spotted::Models::ArtistListAlbumsResponse::Type)
317
- end
318
- OrSymbol = T.type_alias { T.any(Symbol, String) }
319
-
320
- ALBUM =
321
- T.let(
322
- :album,
323
- Spotted::Models::ArtistListAlbumsResponse::Type::TaggedSymbol
324
- )
325
-
326
- sig do
327
- override.returns(
328
- T::Array[
329
- Spotted::Models::ArtistListAlbumsResponse::Type::TaggedSymbol
330
- ]
331
- )
332
- end
333
- def self.values
334
- end
335
- end
336
307
  end
337
308
  end
338
309
  end
@@ -489,22 +489,17 @@ module Spotted
489
489
  end
490
490
  OrFloat = T.type_alias { Float }
491
491
 
492
- # No result
493
- MINUS_1 =
492
+ MODE_NO_RESULT =
494
493
  T.let(
495
494
  -1,
496
495
  Spotted::Models::AudioAnalysisRetrieveResponse::Section::Mode::TaggedFloat
497
496
  )
498
-
499
- # Minor
500
- MODE_0 =
497
+ MODE_MINOR =
501
498
  T.let(
502
499
  0,
503
500
  Spotted::Models::AudioAnalysisRetrieveResponse::Section::Mode::TaggedFloat
504
501
  )
505
-
506
- # Major
507
- MODE_1 =
502
+ MODE_MAJOR =
508
503
  T.let(
509
504
  1,
510
505
  Spotted::Models::AudioAnalysisRetrieveResponse::Section::Mode::TaggedFloat
@@ -82,7 +82,7 @@ module Spotted
82
82
  attr_accessor :total_chapters
83
83
 
84
84
  # The object type.
85
- sig { returns(Spotted::AudiobookBase::Type::TaggedSymbol) }
85
+ sig { returns(Symbol) }
86
86
  attr_accessor :type
87
87
 
88
88
  # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
@@ -115,9 +115,9 @@ module Spotted
115
115
  narrators: T::Array[Spotted::NarratorObject::OrHash],
116
116
  publisher: String,
117
117
  total_chapters: Integer,
118
- type: Spotted::AudiobookBase::Type::OrSymbol,
119
118
  uri: String,
120
- edition: String
119
+ edition: String,
120
+ type: Symbol
121
121
  ).returns(T.attached_class)
122
122
  end
123
123
  def self.new(
@@ -159,13 +159,13 @@ module Spotted
159
159
  publisher:,
160
160
  # The number of chapters in this audiobook.
161
161
  total_chapters:,
162
- # The object type.
163
- type:,
164
162
  # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
165
163
  # audiobook.
166
164
  uri:,
167
165
  # The edition of the audiobook.
168
- edition: nil
166
+ edition: nil,
167
+ # The object type.
168
+ type: :audiobook
169
169
  )
170
170
  end
171
171
 
@@ -188,7 +188,7 @@ module Spotted
188
188
  narrators: T::Array[Spotted::NarratorObject],
189
189
  publisher: String,
190
190
  total_chapters: Integer,
191
- type: Spotted::AudiobookBase::Type::TaggedSymbol,
191
+ type: Symbol,
192
192
  uri: String,
193
193
  edition: String
194
194
  }
@@ -196,24 +196,6 @@ module Spotted
196
196
  end
197
197
  def to_hash
198
198
  end
199
-
200
- # The object type.
201
- module Type
202
- extend Spotted::Internal::Type::Enum
203
-
204
- TaggedSymbol =
205
- T.type_alias { T.all(Symbol, Spotted::AudiobookBase::Type) }
206
- OrSymbol = T.type_alias { T.any(Symbol, String) }
207
-
208
- AUDIOBOOK =
209
- T.let(:audiobook, Spotted::AudiobookBase::Type::TaggedSymbol)
210
-
211
- sig do
212
- override.returns(T::Array[Spotted::AudiobookBase::Type::TaggedSymbol])
213
- end
214
- def self.values
215
- end
216
- end
217
199
  end
218
200
  end
219
201
  end
@@ -103,9 +103,6 @@ module Spotted
103
103
  sig { returns(String) }
104
104
  attr_accessor :href
105
105
 
106
- sig { returns(T::Array[Spotted::SimplifiedChapterObject]) }
107
- attr_accessor :items
108
-
109
106
  # The maximum number of items in the response (as set in the query or by default).
110
107
  sig { returns(Integer) }
111
108
  attr_accessor :limit
@@ -126,22 +123,31 @@ module Spotted
126
123
  sig { returns(Integer) }
127
124
  attr_accessor :total
128
125
 
126
+ sig { returns(T.nilable(T::Array[Spotted::SimplifiedChapterObject])) }
127
+ attr_reader :items
128
+
129
+ sig do
130
+ params(
131
+ items: T::Array[Spotted::SimplifiedChapterObject::OrHash]
132
+ ).void
133
+ end
134
+ attr_writer :items
135
+
129
136
  # The chapters of the audiobook.
130
137
  sig do
131
138
  params(
132
139
  href: String,
133
- items: T::Array[Spotted::SimplifiedChapterObject::OrHash],
134
140
  limit: Integer,
135
141
  next_: T.nilable(String),
136
142
  offset: Integer,
137
143
  previous: T.nilable(String),
138
- total: Integer
144
+ total: Integer,
145
+ items: T::Array[Spotted::SimplifiedChapterObject::OrHash]
139
146
  ).returns(T.attached_class)
140
147
  end
141
148
  def self.new(
142
149
  # A link to the Web API endpoint returning the full result of the request
143
150
  href:,
144
- items:,
145
151
  # The maximum number of items in the response (as set in the query or by default).
146
152
  limit:,
147
153
  # URL to the next page of items. ( `null` if none)
@@ -151,7 +157,8 @@ module Spotted
151
157
  # URL to the previous page of items. ( `null` if none)
152
158
  previous:,
153
159
  # The total number of items available to return.
154
- total:
160
+ total:,
161
+ items: nil
155
162
  )
156
163
  end
157
164
 
@@ -159,12 +166,12 @@ module Spotted
159
166
  override.returns(
160
167
  {
161
168
  href: String,
162
- items: T::Array[Spotted::SimplifiedChapterObject],
163
169
  limit: Integer,
164
170
  next_: T.nilable(String),
165
171
  offset: Integer,
166
172
  previous: T.nilable(String),
167
- total: Integer
173
+ total: Integer,
174
+ items: T::Array[Spotted::SimplifiedChapterObject]
168
175
  }
169
176
  )
170
177
  end
@@ -54,9 +54,6 @@ module Spotted
54
54
  sig { returns(String) }
55
55
  attr_accessor :href
56
56
 
57
- sig { returns(T::Array[Spotted::SimplifiedChapterObject]) }
58
- attr_accessor :items
59
-
60
57
  # The maximum number of items in the response (as set in the query or by default).
61
58
  sig { returns(Integer) }
62
59
  attr_accessor :limit
@@ -77,22 +74,29 @@ module Spotted
77
74
  sig { returns(Integer) }
78
75
  attr_accessor :total
79
76
 
77
+ sig { returns(T.nilable(T::Array[Spotted::SimplifiedChapterObject])) }
78
+ attr_reader :items
79
+
80
+ sig do
81
+ params(items: T::Array[Spotted::SimplifiedChapterObject::OrHash]).void
82
+ end
83
+ attr_writer :items
84
+
80
85
  # The chapters of the audiobook.
81
86
  sig do
82
87
  params(
83
88
  href: String,
84
- items: T::Array[Spotted::SimplifiedChapterObject::OrHash],
85
89
  limit: Integer,
86
90
  next_: T.nilable(String),
87
91
  offset: Integer,
88
92
  previous: T.nilable(String),
89
- total: Integer
93
+ total: Integer,
94
+ items: T::Array[Spotted::SimplifiedChapterObject::OrHash]
90
95
  ).returns(T.attached_class)
91
96
  end
92
97
  def self.new(
93
98
  # A link to the Web API endpoint returning the full result of the request
94
99
  href:,
95
- items:,
96
100
  # The maximum number of items in the response (as set in the query or by default).
97
101
  limit:,
98
102
  # URL to the next page of items. ( `null` if none)
@@ -102,7 +106,8 @@ module Spotted
102
106
  # URL to the previous page of items. ( `null` if none)
103
107
  previous:,
104
108
  # The total number of items available to return.
105
- total:
109
+ total:,
110
+ items: nil
106
111
  )
107
112
  end
108
113
 
@@ -110,12 +115,12 @@ module Spotted
110
115
  override.returns(
111
116
  {
112
117
  href: String,
113
- items: T::Array[Spotted::SimplifiedChapterObject],
114
118
  limit: Integer,
115
119
  next_: T.nilable(String),
116
120
  offset: Integer,
117
121
  previous: T.nilable(String),
118
- total: Integer
122
+ total: Integer,
123
+ items: T::Array[Spotted::SimplifiedChapterObject]
119
124
  }
120
125
  )
121
126
  end