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
@@ -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
@@ -24,19 +24,16 @@ module Spotted
24
24
  attr_writer :added_at
25
25
 
26
26
  # Information about the show.
27
- sig { returns(T.nilable(Spotted::Models::Me::ShowListResponse::Show)) }
27
+ sig { returns(T.nilable(Spotted::ShowBase)) }
28
28
  attr_reader :show
29
29
 
30
- sig do
31
- params(show: Spotted::Models::Me::ShowListResponse::Show::OrHash).void
32
- end
30
+ sig { params(show: Spotted::ShowBase::OrHash).void }
33
31
  attr_writer :show
34
32
 
35
33
  sig do
36
- params(
37
- added_at: Time,
38
- show: Spotted::Models::Me::ShowListResponse::Show::OrHash
39
- ).returns(T.attached_class)
34
+ params(added_at: Time, show: Spotted::ShowBase::OrHash).returns(
35
+ T.attached_class
36
+ )
40
37
  end
41
38
  def self.new(
42
39
  # The date and time the show was saved. Timestamps are returned in ISO 8601 format
@@ -50,227 +47,9 @@ module Spotted
50
47
  )
51
48
  end
52
49
 
53
- sig do
54
- override.returns(
55
- {
56
- added_at: Time,
57
- show: Spotted::Models::Me::ShowListResponse::Show
58
- }
59
- )
60
- end
50
+ sig { override.returns({ added_at: Time, show: Spotted::ShowBase }) }
61
51
  def to_hash
62
52
  end
63
-
64
- class Show < Spotted::Internal::Type::BaseModel
65
- OrHash =
66
- T.type_alias do
67
- T.any(
68
- Spotted::Models::Me::ShowListResponse::Show,
69
- Spotted::Internal::AnyHash
70
- )
71
- end
72
-
73
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show.
74
- sig { returns(String) }
75
- attr_accessor :id
76
-
77
- # A list of the countries in which the show can be played, identified by their
78
- # [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.
79
- sig { returns(T::Array[String]) }
80
- attr_accessor :available_markets
81
-
82
- # The copyright statements of the show.
83
- sig { returns(T::Array[Spotted::CopyrightObject]) }
84
- attr_accessor :copyrights
85
-
86
- # A description of the show. HTML tags are stripped away from this field, use
87
- # `html_description` field in case HTML tags are needed.
88
- sig { returns(String) }
89
- attr_accessor :description
90
-
91
- # Whether or not the show has explicit content (true = yes it does; false = no it
92
- # does not OR unknown).
93
- sig { returns(T::Boolean) }
94
- attr_accessor :explicit
95
-
96
- # External URLs for this show.
97
- sig { returns(Spotted::ExternalURLObject) }
98
- attr_reader :external_urls
99
-
100
- sig { params(external_urls: Spotted::ExternalURLObject::OrHash).void }
101
- attr_writer :external_urls
102
-
103
- # A link to the Web API endpoint providing full details of the show.
104
- sig { returns(String) }
105
- attr_accessor :href
106
-
107
- # A description of the show. This field may contain HTML tags.
108
- sig { returns(String) }
109
- attr_accessor :html_description
110
-
111
- # The cover art for the show in various sizes, widest first.
112
- sig { returns(T::Array[Spotted::ImageObject]) }
113
- attr_accessor :images
114
-
115
- # True if all of the shows episodes are hosted outside of Spotify's CDN. This
116
- # field might be `null` in some cases.
117
- sig { returns(T::Boolean) }
118
- attr_accessor :is_externally_hosted
119
-
120
- # A list of the languages used in the show, identified by their
121
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
122
- sig { returns(T::Array[String]) }
123
- attr_accessor :languages
124
-
125
- # The media type of the show.
126
- sig { returns(String) }
127
- attr_accessor :media_type
128
-
129
- # The name of the episode.
130
- sig { returns(String) }
131
- attr_accessor :name
132
-
133
- # The publisher of the show.
134
- sig { returns(String) }
135
- attr_accessor :publisher
136
-
137
- # The total number of episodes in the show.
138
- sig { returns(Integer) }
139
- attr_accessor :total_episodes
140
-
141
- # The object type.
142
- sig do
143
- returns(
144
- Spotted::Models::Me::ShowListResponse::Show::Type::TaggedSymbol
145
- )
146
- end
147
- attr_accessor :type
148
-
149
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
150
- # show.
151
- sig { returns(String) }
152
- attr_accessor :uri
153
-
154
- # Information about the show.
155
- sig do
156
- params(
157
- id: String,
158
- available_markets: T::Array[String],
159
- copyrights: T::Array[Spotted::CopyrightObject::OrHash],
160
- description: String,
161
- explicit: T::Boolean,
162
- external_urls: Spotted::ExternalURLObject::OrHash,
163
- href: String,
164
- html_description: String,
165
- images: T::Array[Spotted::ImageObject::OrHash],
166
- is_externally_hosted: T::Boolean,
167
- languages: T::Array[String],
168
- media_type: String,
169
- name: String,
170
- publisher: String,
171
- total_episodes: Integer,
172
- type: Spotted::Models::Me::ShowListResponse::Show::Type::OrSymbol,
173
- uri: String
174
- ).returns(T.attached_class)
175
- end
176
- def self.new(
177
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show.
178
- id:,
179
- # A list of the countries in which the show can be played, identified by their
180
- # [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.
181
- available_markets:,
182
- # The copyright statements of the show.
183
- copyrights:,
184
- # A description of the show. HTML tags are stripped away from this field, use
185
- # `html_description` field in case HTML tags are needed.
186
- description:,
187
- # Whether or not the show has explicit content (true = yes it does; false = no it
188
- # does not OR unknown).
189
- explicit:,
190
- # External URLs for this show.
191
- external_urls:,
192
- # A link to the Web API endpoint providing full details of the show.
193
- href:,
194
- # A description of the show. This field may contain HTML tags.
195
- html_description:,
196
- # The cover art for the show in various sizes, widest first.
197
- images:,
198
- # True if all of the shows episodes are hosted outside of Spotify's CDN. This
199
- # field might be `null` in some cases.
200
- is_externally_hosted:,
201
- # A list of the languages used in the show, identified by their
202
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
203
- languages:,
204
- # The media type of the show.
205
- media_type:,
206
- # The name of the episode.
207
- name:,
208
- # The publisher of the show.
209
- publisher:,
210
- # The total number of episodes in the show.
211
- total_episodes:,
212
- # The object type.
213
- type:,
214
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
215
- # show.
216
- uri:
217
- )
218
- end
219
-
220
- sig do
221
- override.returns(
222
- {
223
- id: String,
224
- available_markets: T::Array[String],
225
- copyrights: T::Array[Spotted::CopyrightObject],
226
- description: String,
227
- explicit: T::Boolean,
228
- external_urls: Spotted::ExternalURLObject,
229
- href: String,
230
- html_description: String,
231
- images: T::Array[Spotted::ImageObject],
232
- is_externally_hosted: T::Boolean,
233
- languages: T::Array[String],
234
- media_type: String,
235
- name: String,
236
- publisher: String,
237
- total_episodes: Integer,
238
- type:
239
- Spotted::Models::Me::ShowListResponse::Show::Type::TaggedSymbol,
240
- uri: String
241
- }
242
- )
243
- end
244
- def to_hash
245
- end
246
-
247
- # The object type.
248
- module Type
249
- extend Spotted::Internal::Type::Enum
250
-
251
- TaggedSymbol =
252
- T.type_alias do
253
- T.all(Symbol, Spotted::Models::Me::ShowListResponse::Show::Type)
254
- end
255
- OrSymbol = T.type_alias { T.any(Symbol, String) }
256
-
257
- SHOW =
258
- T.let(
259
- :show,
260
- Spotted::Models::Me::ShowListResponse::Show::Type::TaggedSymbol
261
- )
262
-
263
- sig do
264
- override.returns(
265
- T::Array[
266
- Spotted::Models::Me::ShowListResponse::Show::Type::TaggedSymbol
267
- ]
268
- )
269
- end
270
- def self.values
271
- end
272
- end
273
- end
274
53
  end
275
54
  end
276
55
  end