spotted 0.1.0 → 0.3.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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/spotted/client.rb +4 -0
  5. data/lib/spotted/internal/transport/base_client.rb +7 -1
  6. data/lib/spotted/models/audiobook_base.rb +182 -0
  7. data/lib/spotted/models/audiobook_list_response.rb +2 -174
  8. data/lib/spotted/models/audiobook_retrieve_response.rb +2 -174
  9. data/lib/spotted/models/chapter_list_response.rb +3 -183
  10. data/lib/spotted/models/chapter_retrieve_response.rb +3 -183
  11. data/lib/spotted/models/episode_object.rb +3 -166
  12. data/lib/spotted/models/me/audiobook_list_response.rb +2 -174
  13. data/lib/spotted/models/me/show_list_response.rb +3 -166
  14. data/lib/spotted/models/search_retrieve_response.rb +6 -345
  15. data/lib/spotted/models/show_base.rb +165 -0
  16. data/lib/spotted/models/show_list_response.rb +3 -163
  17. data/lib/spotted/models/show_retrieve_response.rb +2 -157
  18. data/lib/spotted/models/unwrap_webhook_event.rb +8 -0
  19. data/lib/spotted/models/webhook_unwrap_params.rb +14 -0
  20. data/lib/spotted/models.rb +9 -0
  21. data/lib/spotted/resources/webhooks.rb +22 -0
  22. data/lib/spotted/version.rb +1 -1
  23. data/lib/spotted.rb +5 -0
  24. data/rbi/spotted/client.rbi +3 -0
  25. data/rbi/spotted/internal/transport/base_client.rbi +5 -0
  26. data/rbi/spotted/internal/type/base_model.rbi +8 -4
  27. data/rbi/spotted/models/audiobook_base.rbi +219 -0
  28. data/rbi/spotted/models/audiobook_list_response.rbi +4 -212
  29. data/rbi/spotted/models/audiobook_retrieve_response.rbi +4 -209
  30. data/rbi/spotted/models/chapter_list_response.rbi +4 -249
  31. data/rbi/spotted/models/chapter_retrieve_response.rbi +4 -245
  32. data/rbi/spotted/models/episode_object.rbi +4 -199
  33. data/rbi/spotted/models/me/audiobook_list_response.rbi +4 -212
  34. data/rbi/spotted/models/me/show_list_response.rbi +6 -227
  35. data/rbi/spotted/models/search_retrieve_response.rbi +6 -473
  36. data/rbi/spotted/models/show_base.rbi +194 -0
  37. data/rbi/spotted/models/show_list_response.rbi +5 -216
  38. data/rbi/spotted/models/show_retrieve_response.rbi +4 -182
  39. data/rbi/spotted/models/unwrap_webhook_event.rbi +7 -0
  40. data/rbi/spotted/models/webhook_unwrap_params.rbi +27 -0
  41. data/rbi/spotted/models.rbi +12 -0
  42. data/rbi/spotted/resources/webhooks.rbi +19 -0
  43. data/sig/spotted/client.rbs +2 -0
  44. data/sig/spotted/internal/transport/base_client.rbs +2 -0
  45. data/sig/spotted/models/audiobook_base.rbs +122 -0
  46. data/sig/spotted/models/audiobook_list_response.rbs +8 -111
  47. data/sig/spotted/models/audiobook_retrieve_response.rbs +8 -113
  48. data/sig/spotted/models/chapter_list_response.rbs +4 -123
  49. data/sig/spotted/models/chapter_retrieve_response.rbs +4 -123
  50. data/sig/spotted/models/episode_object.rbs +4 -111
  51. data/sig/spotted/models/me/audiobook_list_response.rbs +8 -111
  52. data/sig/spotted/models/me/show_list_response.rbs +5 -121
  53. data/sig/spotted/models/search_retrieve_response.rbs +8 -234
  54. data/sig/spotted/models/show_base.rbs +110 -0
  55. data/sig/spotted/models/show_list_response.rbs +4 -116
  56. data/sig/spotted/models/show_retrieve_response.rbs +8 -101
  57. data/sig/spotted/models/unwrap_webhook_event.rbs +5 -0
  58. data/sig/spotted/models/webhook_unwrap_params.rbs +15 -0
  59. data/sig/spotted/models.rbs +8 -0
  60. data/sig/spotted/resources/webhooks.rbs +9 -0
  61. metadata +17 -2
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Spotted
4
4
  module Models
5
- class AudiobookRetrieveResponse < Spotted::Internal::Type::BaseModel
5
+ class AudiobookRetrieveResponse < Spotted::Models::AudiobookBase
6
6
  OrHash =
7
7
  T.type_alias do
8
8
  T.any(
@@ -11,21 +11,6 @@ module Spotted
11
11
  )
12
12
  end
13
13
 
14
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
15
- # audiobook.
16
- sig { returns(String) }
17
- attr_accessor :id
18
-
19
- # The author(s) for the audiobook.
20
- sig { returns(T::Array[Spotted::AuthorObject]) }
21
- attr_accessor :authors
22
-
23
- # A list of the countries in which the audiobook can be played, identified by
24
- # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
25
- # code.
26
- sig { returns(T::Array[String]) }
27
- attr_accessor :available_markets
28
-
29
14
  # The chapters of the audiobook.
30
15
  sig { returns(Spotted::Models::AudiobookRetrieveResponse::Chapters) }
31
16
  attr_reader :chapters
@@ -37,183 +22,20 @@ module Spotted
37
22
  end
38
23
  attr_writer :chapters
39
24
 
40
- # The copyright statements of the audiobook.
41
- sig { returns(T::Array[Spotted::CopyrightObject]) }
42
- attr_accessor :copyrights
43
-
44
- # A description of the audiobook. HTML tags are stripped away from this field, use
45
- # `html_description` field in case HTML tags are needed.
46
- sig { returns(String) }
47
- attr_accessor :description
48
-
49
- # Whether or not the audiobook has explicit content (true = yes it does; false =
50
- # no it does not OR unknown).
51
- sig { returns(T::Boolean) }
52
- attr_accessor :explicit
53
-
54
- # External URLs for this audiobook.
55
- sig { returns(Spotted::ExternalURLObject) }
56
- attr_reader :external_urls
57
-
58
- sig { params(external_urls: Spotted::ExternalURLObject::OrHash).void }
59
- attr_writer :external_urls
60
-
61
- # A link to the Web API endpoint providing full details of the audiobook.
62
- sig { returns(String) }
63
- attr_accessor :href
64
-
65
- # A description of the audiobook. This field may contain HTML tags.
66
- sig { returns(String) }
67
- attr_accessor :html_description
68
-
69
- # The cover art for the audiobook in various sizes, widest first.
70
- sig { returns(T::Array[Spotted::ImageObject]) }
71
- attr_accessor :images
72
-
73
- # A list of the languages used in the audiobook, identified by their
74
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
75
- sig { returns(T::Array[String]) }
76
- attr_accessor :languages
77
-
78
- # The media type of the audiobook.
79
- sig { returns(String) }
80
- attr_accessor :media_type
81
-
82
- # The name of the audiobook.
83
- sig { returns(String) }
84
- attr_accessor :name
85
-
86
- # The narrator(s) for the audiobook.
87
- sig { returns(T::Array[Spotted::NarratorObject]) }
88
- attr_accessor :narrators
89
-
90
- # The publisher of the audiobook.
91
- sig { returns(String) }
92
- attr_accessor :publisher
93
-
94
- # The number of chapters in this audiobook.
95
- sig { returns(Integer) }
96
- attr_accessor :total_chapters
97
-
98
- # The object type.
99
- sig do
100
- returns(Spotted::Models::AudiobookRetrieveResponse::Type::TaggedSymbol)
101
- end
102
- attr_accessor :type
103
-
104
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
105
- # audiobook.
106
- sig { returns(String) }
107
- attr_accessor :uri
108
-
109
- # The edition of the audiobook.
110
- sig { returns(T.nilable(String)) }
111
- attr_reader :edition
112
-
113
- sig { params(edition: String).void }
114
- attr_writer :edition
115
-
116
25
  sig do
117
26
  params(
118
- id: String,
119
- authors: T::Array[Spotted::AuthorObject::OrHash],
120
- available_markets: T::Array[String],
121
- chapters:
122
- Spotted::Models::AudiobookRetrieveResponse::Chapters::OrHash,
123
- copyrights: T::Array[Spotted::CopyrightObject::OrHash],
124
- description: String,
125
- explicit: T::Boolean,
126
- external_urls: Spotted::ExternalURLObject::OrHash,
127
- href: String,
128
- html_description: String,
129
- images: T::Array[Spotted::ImageObject::OrHash],
130
- languages: T::Array[String],
131
- media_type: String,
132
- name: String,
133
- narrators: T::Array[Spotted::NarratorObject::OrHash],
134
- publisher: String,
135
- total_chapters: Integer,
136
- type: Spotted::Models::AudiobookRetrieveResponse::Type::OrSymbol,
137
- uri: String,
138
- edition: String
27
+ chapters: Spotted::Models::AudiobookRetrieveResponse::Chapters::OrHash
139
28
  ).returns(T.attached_class)
140
29
  end
141
30
  def self.new(
142
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
143
- # audiobook.
144
- id:,
145
- # The author(s) for the audiobook.
146
- authors:,
147
- # A list of the countries in which the audiobook can be played, identified by
148
- # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
149
- # code.
150
- available_markets:,
151
31
  # The chapters of the audiobook.
152
- chapters:,
153
- # The copyright statements of the audiobook.
154
- copyrights:,
155
- # A description of the audiobook. HTML tags are stripped away from this field, use
156
- # `html_description` field in case HTML tags are needed.
157
- description:,
158
- # Whether or not the audiobook has explicit content (true = yes it does; false =
159
- # no it does not OR unknown).
160
- explicit:,
161
- # External URLs for this audiobook.
162
- external_urls:,
163
- # A link to the Web API endpoint providing full details of the audiobook.
164
- href:,
165
- # A description of the audiobook. This field may contain HTML tags.
166
- html_description:,
167
- # The cover art for the audiobook in various sizes, widest first.
168
- images:,
169
- # A list of the languages used in the audiobook, identified by their
170
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
171
- languages:,
172
- # The media type of the audiobook.
173
- media_type:,
174
- # The name of the audiobook.
175
- name:,
176
- # The narrator(s) for the audiobook.
177
- narrators:,
178
- # The publisher of the audiobook.
179
- publisher:,
180
- # The number of chapters in this audiobook.
181
- total_chapters:,
182
- # The object type.
183
- type:,
184
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
185
- # audiobook.
186
- uri:,
187
- # The edition of the audiobook.
188
- edition: nil
32
+ chapters:
189
33
  )
190
34
  end
191
35
 
192
36
  sig do
193
37
  override.returns(
194
- {
195
- id: String,
196
- authors: T::Array[Spotted::AuthorObject],
197
- available_markets: T::Array[String],
198
- chapters: Spotted::Models::AudiobookRetrieveResponse::Chapters,
199
- copyrights: T::Array[Spotted::CopyrightObject],
200
- description: String,
201
- explicit: T::Boolean,
202
- external_urls: Spotted::ExternalURLObject,
203
- href: String,
204
- html_description: String,
205
- images: T::Array[Spotted::ImageObject],
206
- languages: T::Array[String],
207
- media_type: String,
208
- name: String,
209
- narrators: T::Array[Spotted::NarratorObject],
210
- publisher: String,
211
- total_chapters: Integer,
212
- type:
213
- Spotted::Models::AudiobookRetrieveResponse::Type::TaggedSymbol,
214
- uri: String,
215
- edition: String
216
- }
38
+ { chapters: Spotted::Models::AudiobookRetrieveResponse::Chapters }
217
39
  )
218
40
  end
219
41
  def to_hash
@@ -300,33 +122,6 @@ module Spotted
300
122
  def to_hash
301
123
  end
302
124
  end
303
-
304
- # The object type.
305
- module Type
306
- extend Spotted::Internal::Type::Enum
307
-
308
- TaggedSymbol =
309
- T.type_alias do
310
- T.all(Symbol, Spotted::Models::AudiobookRetrieveResponse::Type)
311
- end
312
- OrSymbol = T.type_alias { T.any(Symbol, String) }
313
-
314
- AUDIOBOOK =
315
- T.let(
316
- :audiobook,
317
- Spotted::Models::AudiobookRetrieveResponse::Type::TaggedSymbol
318
- )
319
-
320
- sig do
321
- override.returns(
322
- T::Array[
323
- Spotted::Models::AudiobookRetrieveResponse::Type::TaggedSymbol
324
- ]
325
- )
326
- end
327
- def self.values
328
- end
329
- end
330
125
  end
331
126
  end
332
127
  end
@@ -51,17 +51,10 @@ module Spotted
51
51
  attr_accessor :audio_preview_url
52
52
 
53
53
  # The audiobook for which the chapter belongs.
54
- sig do
55
- returns(Spotted::Models::ChapterListResponse::Chapter::Audiobook)
56
- end
54
+ sig { returns(Spotted::AudiobookBase) }
57
55
  attr_reader :audiobook
58
56
 
59
- sig do
60
- params(
61
- audiobook:
62
- Spotted::Models::ChapterListResponse::Chapter::Audiobook::OrHash
63
- ).void
64
- end
57
+ sig { params(audiobook: Spotted::AudiobookBase::OrHash).void }
65
58
  attr_writer :audiobook
66
59
 
67
60
  # The number of the chapter
@@ -169,8 +162,7 @@ module Spotted
169
162
  params(
170
163
  id: String,
171
164
  audio_preview_url: T.nilable(String),
172
- audiobook:
173
- Spotted::Models::ChapterListResponse::Chapter::Audiobook::OrHash,
165
+ audiobook: Spotted::AudiobookBase::OrHash,
174
166
  chapter_number: Integer,
175
167
  description: String,
176
168
  duration_ms: Integer,
@@ -252,8 +244,7 @@ module Spotted
252
244
  {
253
245
  id: String,
254
246
  audio_preview_url: T.nilable(String),
255
- audiobook:
256
- Spotted::Models::ChapterListResponse::Chapter::Audiobook,
247
+ audiobook: Spotted::AudiobookBase,
257
248
  chapter_number: Integer,
258
249
  description: String,
259
250
  duration_ms: Integer,
@@ -280,242 +271,6 @@ module Spotted
280
271
  def to_hash
281
272
  end
282
273
 
283
- class Audiobook < Spotted::Internal::Type::BaseModel
284
- OrHash =
285
- T.type_alias do
286
- T.any(
287
- Spotted::Models::ChapterListResponse::Chapter::Audiobook,
288
- Spotted::Internal::AnyHash
289
- )
290
- end
291
-
292
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
293
- # audiobook.
294
- sig { returns(String) }
295
- attr_accessor :id
296
-
297
- # The author(s) for the audiobook.
298
- sig { returns(T::Array[Spotted::AuthorObject]) }
299
- attr_accessor :authors
300
-
301
- # A list of the countries in which the audiobook can be played, identified by
302
- # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
303
- # code.
304
- sig { returns(T::Array[String]) }
305
- attr_accessor :available_markets
306
-
307
- # The copyright statements of the audiobook.
308
- sig { returns(T::Array[Spotted::CopyrightObject]) }
309
- attr_accessor :copyrights
310
-
311
- # A description of the audiobook. HTML tags are stripped away from this field, use
312
- # `html_description` field in case HTML tags are needed.
313
- sig { returns(String) }
314
- attr_accessor :description
315
-
316
- # Whether or not the audiobook has explicit content (true = yes it does; false =
317
- # no it does not OR unknown).
318
- sig { returns(T::Boolean) }
319
- attr_accessor :explicit
320
-
321
- # External URLs for this audiobook.
322
- sig { returns(Spotted::ExternalURLObject) }
323
- attr_reader :external_urls
324
-
325
- sig { params(external_urls: Spotted::ExternalURLObject::OrHash).void }
326
- attr_writer :external_urls
327
-
328
- # A link to the Web API endpoint providing full details of the audiobook.
329
- sig { returns(String) }
330
- attr_accessor :href
331
-
332
- # A description of the audiobook. This field may contain HTML tags.
333
- sig { returns(String) }
334
- attr_accessor :html_description
335
-
336
- # The cover art for the audiobook in various sizes, widest first.
337
- sig { returns(T::Array[Spotted::ImageObject]) }
338
- attr_accessor :images
339
-
340
- # A list of the languages used in the audiobook, identified by their
341
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
342
- sig { returns(T::Array[String]) }
343
- attr_accessor :languages
344
-
345
- # The media type of the audiobook.
346
- sig { returns(String) }
347
- attr_accessor :media_type
348
-
349
- # The name of the audiobook.
350
- sig { returns(String) }
351
- attr_accessor :name
352
-
353
- # The narrator(s) for the audiobook.
354
- sig { returns(T::Array[Spotted::NarratorObject]) }
355
- attr_accessor :narrators
356
-
357
- # The publisher of the audiobook.
358
- sig { returns(String) }
359
- attr_accessor :publisher
360
-
361
- # The number of chapters in this audiobook.
362
- sig { returns(Integer) }
363
- attr_accessor :total_chapters
364
-
365
- # The object type.
366
- sig do
367
- returns(
368
- Spotted::Models::ChapterListResponse::Chapter::Audiobook::Type::TaggedSymbol
369
- )
370
- end
371
- attr_accessor :type
372
-
373
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
374
- # audiobook.
375
- sig { returns(String) }
376
- attr_accessor :uri
377
-
378
- # The edition of the audiobook.
379
- sig { returns(T.nilable(String)) }
380
- attr_reader :edition
381
-
382
- sig { params(edition: String).void }
383
- attr_writer :edition
384
-
385
- # The audiobook for which the chapter belongs.
386
- sig do
387
- params(
388
- id: String,
389
- authors: T::Array[Spotted::AuthorObject::OrHash],
390
- available_markets: T::Array[String],
391
- copyrights: T::Array[Spotted::CopyrightObject::OrHash],
392
- description: String,
393
- explicit: T::Boolean,
394
- external_urls: Spotted::ExternalURLObject::OrHash,
395
- href: String,
396
- html_description: String,
397
- images: T::Array[Spotted::ImageObject::OrHash],
398
- languages: T::Array[String],
399
- media_type: String,
400
- name: String,
401
- narrators: T::Array[Spotted::NarratorObject::OrHash],
402
- publisher: String,
403
- total_chapters: Integer,
404
- type:
405
- Spotted::Models::ChapterListResponse::Chapter::Audiobook::Type::OrSymbol,
406
- uri: String,
407
- edition: String
408
- ).returns(T.attached_class)
409
- end
410
- def self.new(
411
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
412
- # audiobook.
413
- id:,
414
- # The author(s) for the audiobook.
415
- authors:,
416
- # A list of the countries in which the audiobook can be played, identified by
417
- # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
418
- # code.
419
- available_markets:,
420
- # The copyright statements of the audiobook.
421
- copyrights:,
422
- # A description of the audiobook. HTML tags are stripped away from this field, use
423
- # `html_description` field in case HTML tags are needed.
424
- description:,
425
- # Whether or not the audiobook has explicit content (true = yes it does; false =
426
- # no it does not OR unknown).
427
- explicit:,
428
- # External URLs for this audiobook.
429
- external_urls:,
430
- # A link to the Web API endpoint providing full details of the audiobook.
431
- href:,
432
- # A description of the audiobook. This field may contain HTML tags.
433
- html_description:,
434
- # The cover art for the audiobook in various sizes, widest first.
435
- images:,
436
- # A list of the languages used in the audiobook, identified by their
437
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
438
- languages:,
439
- # The media type of the audiobook.
440
- media_type:,
441
- # The name of the audiobook.
442
- name:,
443
- # The narrator(s) for the audiobook.
444
- narrators:,
445
- # The publisher of the audiobook.
446
- publisher:,
447
- # The number of chapters in this audiobook.
448
- total_chapters:,
449
- # The object type.
450
- type:,
451
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
452
- # audiobook.
453
- uri:,
454
- # The edition of the audiobook.
455
- edition: nil
456
- )
457
- end
458
-
459
- sig do
460
- override.returns(
461
- {
462
- id: String,
463
- authors: T::Array[Spotted::AuthorObject],
464
- available_markets: T::Array[String],
465
- copyrights: T::Array[Spotted::CopyrightObject],
466
- description: String,
467
- explicit: T::Boolean,
468
- external_urls: Spotted::ExternalURLObject,
469
- href: String,
470
- html_description: String,
471
- images: T::Array[Spotted::ImageObject],
472
- languages: T::Array[String],
473
- media_type: String,
474
- name: String,
475
- narrators: T::Array[Spotted::NarratorObject],
476
- publisher: String,
477
- total_chapters: Integer,
478
- type:
479
- Spotted::Models::ChapterListResponse::Chapter::Audiobook::Type::TaggedSymbol,
480
- uri: String,
481
- edition: String
482
- }
483
- )
484
- end
485
- def to_hash
486
- end
487
-
488
- # The object type.
489
- module Type
490
- extend Spotted::Internal::Type::Enum
491
-
492
- TaggedSymbol =
493
- T.type_alias do
494
- T.all(
495
- Symbol,
496
- Spotted::Models::ChapterListResponse::Chapter::Audiobook::Type
497
- )
498
- end
499
- OrSymbol = T.type_alias { T.any(Symbol, String) }
500
-
501
- AUDIOBOOK =
502
- T.let(
503
- :audiobook,
504
- Spotted::Models::ChapterListResponse::Chapter::Audiobook::Type::TaggedSymbol
505
- )
506
-
507
- sig do
508
- override.returns(
509
- T::Array[
510
- Spotted::Models::ChapterListResponse::Chapter::Audiobook::Type::TaggedSymbol
511
- ]
512
- )
513
- end
514
- def self.values
515
- end
516
- end
517
- end
518
-
519
274
  # The precision with which `release_date` value is known.
520
275
  module ReleaseDatePrecision
521
276
  extend Spotted::Internal::Type::Enum