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
@@ -6,171 +6,11 @@ module Spotted
6
6
  class ShowListResponse < Spotted::Internal::Type::BaseModel
7
7
  # @!attribute shows
8
8
  #
9
- # @return [Array<Spotted::Models::ShowListResponse::Show>]
10
- required :shows, -> { Spotted::Internal::Type::ArrayOf[Spotted::Models::ShowListResponse::Show] }
9
+ # @return [Array<Spotted::Models::ShowBase>]
10
+ required :shows, -> { Spotted::Internal::Type::ArrayOf[Spotted::ShowBase] }
11
11
 
12
12
  # @!method initialize(shows:)
13
- # @param shows [Array<Spotted::Models::ShowListResponse::Show>]
14
-
15
- class Show < Spotted::Internal::Type::BaseModel
16
- # @!attribute id
17
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show.
18
- #
19
- # @return [String]
20
- required :id, String
21
-
22
- # @!attribute available_markets
23
- # A list of the countries in which the show can be played, identified by their
24
- # [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.
25
- #
26
- # @return [Array<String>]
27
- required :available_markets, Spotted::Internal::Type::ArrayOf[String]
28
-
29
- # @!attribute copyrights
30
- # The copyright statements of the show.
31
- #
32
- # @return [Array<Spotted::Models::CopyrightObject>]
33
- required :copyrights, -> { Spotted::Internal::Type::ArrayOf[Spotted::CopyrightObject] }
34
-
35
- # @!attribute description
36
- # A description of the show. HTML tags are stripped away from this field, use
37
- # `html_description` field in case HTML tags are needed.
38
- #
39
- # @return [String]
40
- required :description, String
41
-
42
- # @!attribute explicit
43
- # Whether or not the show has explicit content (true = yes it does; false = no it
44
- # does not OR unknown).
45
- #
46
- # @return [Boolean]
47
- required :explicit, Spotted::Internal::Type::Boolean
48
-
49
- # @!attribute external_urls
50
- # External URLs for this show.
51
- #
52
- # @return [Spotted::Models::ExternalURLObject]
53
- required :external_urls, -> { Spotted::ExternalURLObject }
54
-
55
- # @!attribute href
56
- # A link to the Web API endpoint providing full details of the show.
57
- #
58
- # @return [String]
59
- required :href, String
60
-
61
- # @!attribute html_description
62
- # A description of the show. This field may contain HTML tags.
63
- #
64
- # @return [String]
65
- required :html_description, String
66
-
67
- # @!attribute images
68
- # The cover art for the show in various sizes, widest first.
69
- #
70
- # @return [Array<Spotted::Models::ImageObject>]
71
- required :images, -> { Spotted::Internal::Type::ArrayOf[Spotted::ImageObject] }
72
-
73
- # @!attribute is_externally_hosted
74
- # True if all of the shows episodes are hosted outside of Spotify's CDN. This
75
- # field might be `null` in some cases.
76
- #
77
- # @return [Boolean]
78
- required :is_externally_hosted, Spotted::Internal::Type::Boolean
79
-
80
- # @!attribute languages
81
- # A list of the languages used in the show, identified by their
82
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
83
- #
84
- # @return [Array<String>]
85
- required :languages, Spotted::Internal::Type::ArrayOf[String]
86
-
87
- # @!attribute media_type
88
- # The media type of the show.
89
- #
90
- # @return [String]
91
- required :media_type, String
92
-
93
- # @!attribute name
94
- # The name of the episode.
95
- #
96
- # @return [String]
97
- required :name, String
98
-
99
- # @!attribute publisher
100
- # The publisher of the show.
101
- #
102
- # @return [String]
103
- required :publisher, String
104
-
105
- # @!attribute total_episodes
106
- # The total number of episodes in the show.
107
- #
108
- # @return [Integer]
109
- required :total_episodes, Integer
110
-
111
- # @!attribute type
112
- # The object type.
113
- #
114
- # @return [Symbol, Spotted::Models::ShowListResponse::Show::Type]
115
- required :type, enum: -> { Spotted::Models::ShowListResponse::Show::Type }
116
-
117
- # @!attribute uri
118
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
119
- # show.
120
- #
121
- # @return [String]
122
- required :uri, String
123
-
124
- # @!method initialize(id:, available_markets:, copyrights:, description:, explicit:, external_urls:, href:, html_description:, images:, is_externally_hosted:, languages:, media_type:, name:, publisher:, total_episodes:, type:, uri:)
125
- # Some parameter documentations has been truncated, see
126
- # {Spotted::Models::ShowListResponse::Show} for more details.
127
- #
128
- # @param id [String] The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show.
129
- #
130
- # @param available_markets [Array<String>] A list of the countries in which the show can be played, identified by their [IS
131
- #
132
- # @param copyrights [Array<Spotted::Models::CopyrightObject>] The copyright statements of the show.
133
- #
134
- # @param description [String] A description of the show. HTML tags are stripped away from this field, use `htm
135
- #
136
- # @param explicit [Boolean] Whether or not the show has explicit content (true = yes it does; false = no it
137
- #
138
- # @param external_urls [Spotted::Models::ExternalURLObject] External URLs for this show.
139
- #
140
- # @param href [String] A link to the Web API endpoint providing full details of the show.
141
- #
142
- # @param html_description [String] A description of the show. This field may contain HTML tags.
143
- #
144
- # @param images [Array<Spotted::Models::ImageObject>] The cover art for the show in various sizes, widest first.
145
- #
146
- # @param is_externally_hosted [Boolean] True if all of the shows episodes are hosted outside of Spotify's CDN. This fiel
147
- #
148
- # @param languages [Array<String>] A list of the languages used in the show, identified by their [ISO 639](https://
149
- #
150
- # @param media_type [String] The media type of the show.
151
- #
152
- # @param name [String] The name of the episode.
153
- #
154
- # @param publisher [String] The publisher of the show.
155
- #
156
- # @param total_episodes [Integer] The total number of episodes in the show.
157
- #
158
- # @param type [Symbol, Spotted::Models::ShowListResponse::Show::Type] The object type.
159
- #
160
- # @param uri [String] The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the show
161
-
162
- # The object type.
163
- #
164
- # @see Spotted::Models::ShowListResponse::Show#type
165
- module Type
166
- extend Spotted::Internal::Type::Enum
167
-
168
- SHOW = :show
169
-
170
- # @!method self.values
171
- # @return [Array<Symbol>]
172
- end
173
- end
13
+ # @param shows [Array<Spotted::Models::ShowBase>]
174
14
  end
175
15
  end
176
16
  end
@@ -3,162 +3,19 @@
3
3
  module Spotted
4
4
  module Models
5
5
  # @see Spotted::Resources::Shows#retrieve
6
- class ShowRetrieveResponse < Spotted::Internal::Type::BaseModel
7
- # @!attribute id
8
- # The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show.
9
- #
10
- # @return [String]
11
- required :id, String
12
-
13
- # @!attribute available_markets
14
- # A list of the countries in which the show can be played, identified by their
15
- # [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code.
16
- #
17
- # @return [Array<String>]
18
- required :available_markets, Spotted::Internal::Type::ArrayOf[String]
19
-
20
- # @!attribute copyrights
21
- # The copyright statements of the show.
22
- #
23
- # @return [Array<Spotted::Models::CopyrightObject>]
24
- required :copyrights, -> { Spotted::Internal::Type::ArrayOf[Spotted::CopyrightObject] }
25
-
26
- # @!attribute description
27
- # A description of the show. HTML tags are stripped away from this field, use
28
- # `html_description` field in case HTML tags are needed.
29
- #
30
- # @return [String]
31
- required :description, String
32
-
6
+ class ShowRetrieveResponse < Spotted::Models::ShowBase
33
7
  # @!attribute episodes
34
8
  # The episodes of the show.
35
9
  #
36
10
  # @return [Spotted::Models::ShowRetrieveResponse::Episodes]
37
11
  required :episodes, -> { Spotted::Models::ShowRetrieveResponse::Episodes }
38
12
 
39
- # @!attribute explicit
40
- # Whether or not the show has explicit content (true = yes it does; false = no it
41
- # does not OR unknown).
42
- #
43
- # @return [Boolean]
44
- required :explicit, Spotted::Internal::Type::Boolean
45
-
46
- # @!attribute external_urls
47
- # External URLs for this show.
48
- #
49
- # @return [Spotted::Models::ExternalURLObject]
50
- required :external_urls, -> { Spotted::ExternalURLObject }
51
-
52
- # @!attribute href
53
- # A link to the Web API endpoint providing full details of the show.
54
- #
55
- # @return [String]
56
- required :href, String
57
-
58
- # @!attribute html_description
59
- # A description of the show. This field may contain HTML tags.
60
- #
61
- # @return [String]
62
- required :html_description, String
63
-
64
- # @!attribute images
65
- # The cover art for the show in various sizes, widest first.
66
- #
67
- # @return [Array<Spotted::Models::ImageObject>]
68
- required :images, -> { Spotted::Internal::Type::ArrayOf[Spotted::ImageObject] }
69
-
70
- # @!attribute is_externally_hosted
71
- # True if all of the shows episodes are hosted outside of Spotify's CDN. This
72
- # field might be `null` in some cases.
73
- #
74
- # @return [Boolean]
75
- required :is_externally_hosted, Spotted::Internal::Type::Boolean
76
-
77
- # @!attribute languages
78
- # A list of the languages used in the show, identified by their
79
- # [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code.
80
- #
81
- # @return [Array<String>]
82
- required :languages, Spotted::Internal::Type::ArrayOf[String]
83
-
84
- # @!attribute media_type
85
- # The media type of the show.
86
- #
87
- # @return [String]
88
- required :media_type, String
89
-
90
- # @!attribute name
91
- # The name of the episode.
92
- #
93
- # @return [String]
94
- required :name, String
95
-
96
- # @!attribute publisher
97
- # The publisher of the show.
98
- #
99
- # @return [String]
100
- required :publisher, String
101
-
102
- # @!attribute total_episodes
103
- # The total number of episodes in the show.
104
- #
105
- # @return [Integer]
106
- required :total_episodes, Integer
107
-
108
- # @!attribute type
109
- # The object type.
110
- #
111
- # @return [Symbol, Spotted::Models::ShowRetrieveResponse::Type]
112
- required :type, enum: -> { Spotted::Models::ShowRetrieveResponse::Type }
113
-
114
- # @!attribute uri
115
- # The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the
116
- # show.
117
- #
118
- # @return [String]
119
- required :uri, String
120
-
121
- # @!method initialize(id:, available_markets:, copyrights:, description:, episodes:, explicit:, external_urls:, href:, html_description:, images:, is_externally_hosted:, languages:, media_type:, name:, publisher:, total_episodes:, type:, uri:)
13
+ # @!method initialize(episodes:)
122
14
  # Some parameter documentations has been truncated, see
123
15
  # {Spotted::Models::ShowRetrieveResponse} for more details.
124
16
  #
125
- # @param id [String] The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show.
126
- #
127
- # @param available_markets [Array<String>] A list of the countries in which the show can be played, identified by their [IS
128
- #
129
- # @param copyrights [Array<Spotted::Models::CopyrightObject>] The copyright statements of the show.
130
- #
131
- # @param description [String] A description of the show. HTML tags are stripped away from this field, use `htm
132
- #
133
17
  # @param episodes [Spotted::Models::ShowRetrieveResponse::Episodes] The episodes of the show.
134
- #
135
- # @param explicit [Boolean] Whether or not the show has explicit content (true = yes it does; false = no it
136
- #
137
- # @param external_urls [Spotted::Models::ExternalURLObject] External URLs for this show.
138
- #
139
- # @param href [String] A link to the Web API endpoint providing full details of the show.
140
- #
141
- # @param html_description [String] A description of the show. This field may contain HTML tags.
142
- #
143
- # @param images [Array<Spotted::Models::ImageObject>] The cover art for the show in various sizes, widest first.
144
- #
145
- # @param is_externally_hosted [Boolean] True if all of the shows episodes are hosted outside of Spotify's CDN. This fiel
146
- #
147
- # @param languages [Array<String>] A list of the languages used in the show, identified by their [ISO 639](https://
148
- #
149
- # @param media_type [String] The media type of the show.
150
- #
151
- # @param name [String] The name of the episode.
152
- #
153
- # @param publisher [String] The publisher of the show.
154
- #
155
- # @param total_episodes [Integer] The total number of episodes in the show.
156
- #
157
- # @param type [Symbol, Spotted::Models::ShowRetrieveResponse::Type] The object type.
158
- #
159
- # @param uri [String] The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the show
160
18
 
161
- # @see Spotted::Models::ShowRetrieveResponse#episodes
162
19
  class Episodes < Spotted::Internal::Type::BaseModel
163
20
  # @!attribute href
164
21
  # A link to the Web API endpoint returning the full result of the request
@@ -221,18 +78,6 @@ module Spotted
221
78
  #
222
79
  # @param total [Integer] The total number of items available to return.
223
80
  end
224
-
225
- # The object type.
226
- #
227
- # @see Spotted::Models::ShowRetrieveResponse#type
228
- module Type
229
- extend Spotted::Internal::Type::Enum
230
-
231
- SHOW = :show
232
-
233
- # @!method self.values
234
- # @return [Array<Symbol>]
235
- end
236
81
  end
237
82
  end
238
83
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotted
4
+ module Models
5
+ # @type [Spotted::Internal::Type::Converter]
6
+ UnwrapWebhookEvent = Spotted::Internal::Type::Unknown
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotted
4
+ module Models
5
+ # @see Spotted::Resources::Webhooks#unwrap
6
+ class WebhookUnwrapParams < Spotted::Internal::Type::BaseModel
7
+ extend Spotted::Internal::Type::RequestParameters::Converter
8
+ include Spotted::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [Spotted::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -61,6 +61,8 @@ module Spotted
61
61
 
62
62
  AudioAnalysisRetrieveParams = Spotted::Models::AudioAnalysisRetrieveParams
63
63
 
64
+ AudiobookBase = Spotted::Models::AudiobookBase
65
+
64
66
  AudiobookListChaptersParams = Spotted::Models::AudiobookListChaptersParams
65
67
 
66
68
  AudiobookListParams = Spotted::Models::AudiobookListParams
@@ -136,6 +138,8 @@ module Spotted
136
138
 
137
139
  SearchRetrieveParams = Spotted::Models::SearchRetrieveParams
138
140
 
141
+ ShowBase = Spotted::Models::ShowBase
142
+
139
143
  ShowListEpisodesParams = Spotted::Models::ShowListEpisodesParams
140
144
 
141
145
  ShowListParams = Spotted::Models::ShowListParams
@@ -162,7 +166,12 @@ module Spotted
162
166
 
163
167
  TrackRetrieveParams = Spotted::Models::TrackRetrieveParams
164
168
 
169
+ # @type [Spotted::Internal::Type::Converter]
170
+ UnwrapWebhookEvent = Spotted::Models::UnwrapWebhookEvent
171
+
165
172
  UserRetrieveProfileParams = Spotted::Models::UserRetrieveProfileParams
166
173
 
167
174
  Users = Spotted::Models::Users
175
+
176
+ WebhookUnwrapParams = Spotted::Models::WebhookUnwrapParams
168
177
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotted
4
+ module Resources
5
+ class Webhooks
6
+ # @param payload [String] The raw webhook payload as a string
7
+ #
8
+ # @return [Object]
9
+ def unwrap(payload)
10
+ parsed = JSON.parse(payload, symbolize_names: true)
11
+ Spotted::Internal::Type::Converter.coerce(Spotted::Models::UnwrapWebhookEvent, parsed)
12
+ end
13
+
14
+ # @api private
15
+ #
16
+ # @param client [Spotted::Client]
17
+ def initialize(client:)
18
+ @client = client
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotted
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/spotted.rb CHANGED
@@ -54,7 +54,9 @@ require_relative "spotted/internal/transport/pooled_net_requester"
54
54
  require_relative "spotted/client"
55
55
  require_relative "spotted/internal/oauth2"
56
56
  require_relative "spotted/internal/cursor_url_page"
57
+ require_relative "spotted/models/audiobook_base"
57
58
  require_relative "spotted/models/playlist_user_object"
59
+ require_relative "spotted/models/show_base"
58
60
  require_relative "spotted/models/album_list_params"
59
61
  require_relative "spotted/models/album_list_response"
60
62
  require_relative "spotted/models/album_list_tracks_params"
@@ -218,11 +220,13 @@ require_relative "spotted/models/track_list_response"
218
220
  require_relative "spotted/models/track_object"
219
221
  require_relative "spotted/models/track_restriction_object"
220
222
  require_relative "spotted/models/track_retrieve_params"
223
+ require_relative "spotted/models/unwrap_webhook_event"
221
224
  require_relative "spotted/models/user_retrieve_profile_params"
222
225
  require_relative "spotted/models/user_retrieve_profile_response"
223
226
  require_relative "spotted/models/users/playlist_create_params"
224
227
  require_relative "spotted/models/users/playlist_create_response"
225
228
  require_relative "spotted/models/users/playlist_list_params"
229
+ require_relative "spotted/models/webhook_unwrap_params"
226
230
  require_relative "spotted/models"
227
231
  require_relative "spotted/resources/albums"
228
232
  require_relative "spotted/resources/artists"
@@ -255,3 +259,4 @@ require_relative "spotted/resources/shows"
255
259
  require_relative "spotted/resources/tracks"
256
260
  require_relative "spotted/resources/users"
257
261
  require_relative "spotted/resources/users/playlists"
262
+ require_relative "spotted/resources/webhooks"
@@ -61,6 +61,9 @@ module Spotted
61
61
  sig { returns(Spotted::Resources::Recommendations) }
62
62
  attr_reader :recommendations
63
63
 
64
+ sig { returns(Spotted::Resources::Webhooks) }
65
+ attr_reader :webhooks
66
+
64
67
  sig { returns(Spotted::Resources::Markets) }
65
68
  attr_reader :markets
66
69
 
@@ -176,6 +176,11 @@ module Spotted
176
176
  private def auth_headers
177
177
  end
178
178
 
179
+ # @api private
180
+ sig { returns(String) }
181
+ private def user_agent
182
+ end
183
+
179
184
  # @api private
180
185
  sig { returns(String) }
181
186
  private def generate_idempotency_key
@@ -31,7 +31,7 @@ module Spotted
31
31
  #
32
32
  # Assumes superclass fields are totally defined before fields are accessed /
33
33
  # defined on subclasses.
34
- sig { params(child: T.self_type).void }
34
+ sig { params(child: Spotted::Internal::Type::BaseModel).void }
35
35
  def inherited(child)
36
36
  end
37
37
 
@@ -274,9 +274,13 @@ module Spotted
274
274
 
275
275
  # Create a new instance of a model.
276
276
  sig do
277
- params(data: T.any(T::Hash[Symbol, T.anything], T.self_type)).returns(
278
- T.attached_class
279
- )
277
+ params(
278
+ data:
279
+ T.any(
280
+ T::Hash[Symbol, T.anything],
281
+ Spotted::Internal::Type::BaseModel
282
+ )
283
+ ).returns(T.attached_class)
280
284
  end
281
285
  def self.new(data = {})
282
286
  end