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
@@ -0,0 +1,219 @@
1
+ # typed: strong
2
+
3
+ module Spotted
4
+ module Models
5
+ class AudiobookBase < Spotted::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Spotted::AudiobookBase, Spotted::Internal::AnyHash)
9
+ end
10
+
11
+ # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
12
+ # audiobook.
13
+ sig { returns(String) }
14
+ attr_accessor :id
15
+
16
+ # The author(s) for the audiobook.
17
+ sig { returns(T::Array[Spotted::AuthorObject]) }
18
+ attr_accessor :authors
19
+
20
+ # A list of the countries in which the audiobook can be played, identified by
21
+ # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
22
+ # code.
23
+ sig { returns(T::Array[String]) }
24
+ attr_accessor :available_markets
25
+
26
+ # The copyright statements of the audiobook.
27
+ sig { returns(T::Array[Spotted::CopyrightObject]) }
28
+ attr_accessor :copyrights
29
+
30
+ # A description of the audiobook. HTML tags are stripped away from this field, use
31
+ # `html_description` field in case HTML tags are needed.
32
+ sig { returns(String) }
33
+ attr_accessor :description
34
+
35
+ # Whether or not the audiobook has explicit content (true = yes it does; false =
36
+ # no it does not OR unknown).
37
+ sig { returns(T::Boolean) }
38
+ attr_accessor :explicit
39
+
40
+ # External URLs for this audiobook.
41
+ sig { returns(Spotted::ExternalURLObject) }
42
+ attr_reader :external_urls
43
+
44
+ sig { params(external_urls: Spotted::ExternalURLObject::OrHash).void }
45
+ attr_writer :external_urls
46
+
47
+ # A link to the Web API endpoint providing full details of the audiobook.
48
+ sig { returns(String) }
49
+ attr_accessor :href
50
+
51
+ # A description of the audiobook. This field may contain HTML tags.
52
+ sig { returns(String) }
53
+ attr_accessor :html_description
54
+
55
+ # The cover art for the audiobook in various sizes, widest first.
56
+ sig { returns(T::Array[Spotted::ImageObject]) }
57
+ attr_accessor :images
58
+
59
+ # A list of the languages used in the audiobook, identified by their
60
+ # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
61
+ sig { returns(T::Array[String]) }
62
+ attr_accessor :languages
63
+
64
+ # The media type of the audiobook.
65
+ sig { returns(String) }
66
+ attr_accessor :media_type
67
+
68
+ # The name of the audiobook.
69
+ sig { returns(String) }
70
+ attr_accessor :name
71
+
72
+ # The narrator(s) for the audiobook.
73
+ sig { returns(T::Array[Spotted::NarratorObject]) }
74
+ attr_accessor :narrators
75
+
76
+ # The publisher of the audiobook.
77
+ sig { returns(String) }
78
+ attr_accessor :publisher
79
+
80
+ # The number of chapters in this audiobook.
81
+ sig { returns(Integer) }
82
+ attr_accessor :total_chapters
83
+
84
+ # The object type.
85
+ sig { returns(Spotted::AudiobookBase::Type::TaggedSymbol) }
86
+ attr_accessor :type
87
+
88
+ # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
89
+ # audiobook.
90
+ sig { returns(String) }
91
+ attr_accessor :uri
92
+
93
+ # The edition of the audiobook.
94
+ sig { returns(T.nilable(String)) }
95
+ attr_reader :edition
96
+
97
+ sig { params(edition: String).void }
98
+ attr_writer :edition
99
+
100
+ sig do
101
+ params(
102
+ id: String,
103
+ authors: T::Array[Spotted::AuthorObject::OrHash],
104
+ available_markets: T::Array[String],
105
+ copyrights: T::Array[Spotted::CopyrightObject::OrHash],
106
+ description: String,
107
+ explicit: T::Boolean,
108
+ external_urls: Spotted::ExternalURLObject::OrHash,
109
+ href: String,
110
+ html_description: String,
111
+ images: T::Array[Spotted::ImageObject::OrHash],
112
+ languages: T::Array[String],
113
+ media_type: String,
114
+ name: String,
115
+ narrators: T::Array[Spotted::NarratorObject::OrHash],
116
+ publisher: String,
117
+ total_chapters: Integer,
118
+ type: Spotted::AudiobookBase::Type::OrSymbol,
119
+ uri: String,
120
+ edition: String
121
+ ).returns(T.attached_class)
122
+ end
123
+ def self.new(
124
+ # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
125
+ # audiobook.
126
+ id:,
127
+ # The author(s) for the audiobook.
128
+ authors:,
129
+ # A list of the countries in which the audiobook can be played, identified by
130
+ # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
131
+ # code.
132
+ available_markets:,
133
+ # The copyright statements of the audiobook.
134
+ copyrights:,
135
+ # A description of the audiobook. HTML tags are stripped away from this field, use
136
+ # `html_description` field in case HTML tags are needed.
137
+ description:,
138
+ # Whether or not the audiobook has explicit content (true = yes it does; false =
139
+ # no it does not OR unknown).
140
+ explicit:,
141
+ # External URLs for this audiobook.
142
+ external_urls:,
143
+ # A link to the Web API endpoint providing full details of the audiobook.
144
+ href:,
145
+ # A description of the audiobook. This field may contain HTML tags.
146
+ html_description:,
147
+ # The cover art for the audiobook in various sizes, widest first.
148
+ images:,
149
+ # A list of the languages used in the audiobook, identified by their
150
+ # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
151
+ languages:,
152
+ # The media type of the audiobook.
153
+ media_type:,
154
+ # The name of the audiobook.
155
+ name:,
156
+ # The narrator(s) for the audiobook.
157
+ narrators:,
158
+ # The publisher of the audiobook.
159
+ publisher:,
160
+ # The number of chapters in this audiobook.
161
+ total_chapters:,
162
+ # The object type.
163
+ type:,
164
+ # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
165
+ # audiobook.
166
+ uri:,
167
+ # The edition of the audiobook.
168
+ edition: nil
169
+ )
170
+ end
171
+
172
+ sig do
173
+ override.returns(
174
+ {
175
+ id: String,
176
+ authors: T::Array[Spotted::AuthorObject],
177
+ available_markets: T::Array[String],
178
+ copyrights: T::Array[Spotted::CopyrightObject],
179
+ description: String,
180
+ explicit: T::Boolean,
181
+ external_urls: Spotted::ExternalURLObject,
182
+ href: String,
183
+ html_description: String,
184
+ images: T::Array[Spotted::ImageObject],
185
+ languages: T::Array[String],
186
+ media_type: String,
187
+ name: String,
188
+ narrators: T::Array[Spotted::NarratorObject],
189
+ publisher: String,
190
+ total_chapters: Integer,
191
+ type: Spotted::AudiobookBase::Type::TaggedSymbol,
192
+ uri: String,
193
+ edition: String
194
+ }
195
+ )
196
+ end
197
+ def to_hash
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
+ end
218
+ end
219
+ end
@@ -36,7 +36,7 @@ module Spotted
36
36
  def to_hash
37
37
  end
38
38
 
39
- class Audiobook < Spotted::Internal::Type::BaseModel
39
+ class Audiobook < Spotted::Models::AudiobookBase
40
40
  OrHash =
41
41
  T.type_alias do
42
42
  T.any(
@@ -45,21 +45,6 @@ module Spotted
45
45
  )
46
46
  end
47
47
 
48
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
49
- # audiobook.
50
- sig { returns(String) }
51
- attr_accessor :id
52
-
53
- # The author(s) for the audiobook.
54
- sig { returns(T::Array[Spotted::AuthorObject]) }
55
- attr_accessor :authors
56
-
57
- # A list of the countries in which the audiobook can be played, identified by
58
- # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
59
- # code.
60
- sig { returns(T::Array[String]) }
61
- attr_accessor :available_markets
62
-
63
48
  # The chapters of the audiobook.
64
49
  sig do
65
50
  returns(Spotted::Models::AudiobookListResponse::Audiobook::Chapters)
@@ -74,186 +59,23 @@ module Spotted
74
59
  end
75
60
  attr_writer :chapters
76
61
 
77
- # The copyright statements of the audiobook.
78
- sig { returns(T::Array[Spotted::CopyrightObject]) }
79
- attr_accessor :copyrights
80
-
81
- # A description of the audiobook. HTML tags are stripped away from this field, use
82
- # `html_description` field in case HTML tags are needed.
83
- sig { returns(String) }
84
- attr_accessor :description
85
-
86
- # Whether or not the audiobook has explicit content (true = yes it does; false =
87
- # no it does not OR unknown).
88
- sig { returns(T::Boolean) }
89
- attr_accessor :explicit
90
-
91
- # External URLs for this audiobook.
92
- sig { returns(Spotted::ExternalURLObject) }
93
- attr_reader :external_urls
94
-
95
- sig { params(external_urls: Spotted::ExternalURLObject::OrHash).void }
96
- attr_writer :external_urls
97
-
98
- # A link to the Web API endpoint providing full details of the audiobook.
99
- sig { returns(String) }
100
- attr_accessor :href
101
-
102
- # A description of the audiobook. This field may contain HTML tags.
103
- sig { returns(String) }
104
- attr_accessor :html_description
105
-
106
- # The cover art for the audiobook in various sizes, widest first.
107
- sig { returns(T::Array[Spotted::ImageObject]) }
108
- attr_accessor :images
109
-
110
- # A list of the languages used in the audiobook, identified by their
111
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
112
- sig { returns(T::Array[String]) }
113
- attr_accessor :languages
114
-
115
- # The media type of the audiobook.
116
- sig { returns(String) }
117
- attr_accessor :media_type
118
-
119
- # The name of the audiobook.
120
- sig { returns(String) }
121
- attr_accessor :name
122
-
123
- # The narrator(s) for the audiobook.
124
- sig { returns(T::Array[Spotted::NarratorObject]) }
125
- attr_accessor :narrators
126
-
127
- # The publisher of the audiobook.
128
- sig { returns(String) }
129
- attr_accessor :publisher
130
-
131
- # The number of chapters in this audiobook.
132
- sig { returns(Integer) }
133
- attr_accessor :total_chapters
134
-
135
- # The object type.
136
- sig do
137
- returns(
138
- Spotted::Models::AudiobookListResponse::Audiobook::Type::TaggedSymbol
139
- )
140
- end
141
- attr_accessor :type
142
-
143
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
144
- # audiobook.
145
- sig { returns(String) }
146
- attr_accessor :uri
147
-
148
- # The edition of the audiobook.
149
- sig { returns(T.nilable(String)) }
150
- attr_reader :edition
151
-
152
- sig { params(edition: String).void }
153
- attr_writer :edition
154
-
155
62
  sig do
156
63
  params(
157
- id: String,
158
- authors: T::Array[Spotted::AuthorObject::OrHash],
159
- available_markets: T::Array[String],
160
64
  chapters:
161
- Spotted::Models::AudiobookListResponse::Audiobook::Chapters::OrHash,
162
- copyrights: T::Array[Spotted::CopyrightObject::OrHash],
163
- description: String,
164
- explicit: T::Boolean,
165
- external_urls: Spotted::ExternalURLObject::OrHash,
166
- href: String,
167
- html_description: String,
168
- images: T::Array[Spotted::ImageObject::OrHash],
169
- languages: T::Array[String],
170
- media_type: String,
171
- name: String,
172
- narrators: T::Array[Spotted::NarratorObject::OrHash],
173
- publisher: String,
174
- total_chapters: Integer,
175
- type:
176
- Spotted::Models::AudiobookListResponse::Audiobook::Type::OrSymbol,
177
- uri: String,
178
- edition: String
65
+ Spotted::Models::AudiobookListResponse::Audiobook::Chapters::OrHash
179
66
  ).returns(T.attached_class)
180
67
  end
181
68
  def self.new(
182
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the
183
- # audiobook.
184
- id:,
185
- # The author(s) for the audiobook.
186
- authors:,
187
- # A list of the countries in which the audiobook can be played, identified by
188
- # their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
189
- # code.
190
- available_markets:,
191
69
  # The chapters of the audiobook.
192
- chapters:,
193
- # The copyright statements of the audiobook.
194
- copyrights:,
195
- # A description of the audiobook. HTML tags are stripped away from this field, use
196
- # `html_description` field in case HTML tags are needed.
197
- description:,
198
- # Whether or not the audiobook has explicit content (true = yes it does; false =
199
- # no it does not OR unknown).
200
- explicit:,
201
- # External URLs for this audiobook.
202
- external_urls:,
203
- # A link to the Web API endpoint providing full details of the audiobook.
204
- href:,
205
- # A description of the audiobook. This field may contain HTML tags.
206
- html_description:,
207
- # The cover art for the audiobook in various sizes, widest first.
208
- images:,
209
- # A list of the languages used in the audiobook, identified by their
210
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
211
- languages:,
212
- # The media type of the audiobook.
213
- media_type:,
214
- # The name of the audiobook.
215
- name:,
216
- # The narrator(s) for the audiobook.
217
- narrators:,
218
- # The publisher of the audiobook.
219
- publisher:,
220
- # The number of chapters in this audiobook.
221
- total_chapters:,
222
- # The object type.
223
- type:,
224
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
225
- # audiobook.
226
- uri:,
227
- # The edition of the audiobook.
228
- edition: nil
70
+ chapters:
229
71
  )
230
72
  end
231
73
 
232
74
  sig do
233
75
  override.returns(
234
76
  {
235
- id: String,
236
- authors: T::Array[Spotted::AuthorObject],
237
- available_markets: T::Array[String],
238
77
  chapters:
239
- Spotted::Models::AudiobookListResponse::Audiobook::Chapters,
240
- copyrights: T::Array[Spotted::CopyrightObject],
241
- description: String,
242
- explicit: T::Boolean,
243
- external_urls: Spotted::ExternalURLObject,
244
- href: String,
245
- html_description: String,
246
- images: T::Array[Spotted::ImageObject],
247
- languages: T::Array[String],
248
- media_type: String,
249
- name: String,
250
- narrators: T::Array[Spotted::NarratorObject],
251
- publisher: String,
252
- total_chapters: Integer,
253
- type:
254
- Spotted::Models::AudiobookListResponse::Audiobook::Type::TaggedSymbol,
255
- uri: String,
256
- edition: String
78
+ Spotted::Models::AudiobookListResponse::Audiobook::Chapters
257
79
  }
258
80
  )
259
81
  end
@@ -341,36 +163,6 @@ module Spotted
341
163
  def to_hash
342
164
  end
343
165
  end
344
-
345
- # The object type.
346
- module Type
347
- extend Spotted::Internal::Type::Enum
348
-
349
- TaggedSymbol =
350
- T.type_alias do
351
- T.all(
352
- Symbol,
353
- Spotted::Models::AudiobookListResponse::Audiobook::Type
354
- )
355
- end
356
- OrSymbol = T.type_alias { T.any(Symbol, String) }
357
-
358
- AUDIOBOOK =
359
- T.let(
360
- :audiobook,
361
- Spotted::Models::AudiobookListResponse::Audiobook::Type::TaggedSymbol
362
- )
363
-
364
- sig do
365
- override.returns(
366
- T::Array[
367
- Spotted::Models::AudiobookListResponse::Audiobook::Type::TaggedSymbol
368
- ]
369
- )
370
- end
371
- def self.values
372
- end
373
- end
374
166
  end
375
167
  end
376
168
  end