dodopayments 2.9.0 → 2.9.1

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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/digital_product_delivery.rb +14 -7
  5. data/lib/dodopayments/models/digital_product_delivery_file.rb +12 -5
  6. data/lib/dodopayments/models/entitlement.rb +31 -20
  7. data/lib/dodopayments/models/entitlement_create_params.rb +3 -3
  8. data/lib/dodopayments/models/entitlement_grant_created_webhook_event.rb +6 -1
  9. data/lib/dodopayments/models/entitlement_grant_delivered_webhook_event.rb +6 -1
  10. data/lib/dodopayments/models/entitlement_grant_failed_webhook_event.rb +6 -1
  11. data/lib/dodopayments/models/entitlement_grant_revoked_webhook_event.rb +6 -1
  12. data/lib/dodopayments/models/entitlement_update_params.rb +3 -3
  13. data/lib/dodopayments/models/entitlements/entitlement_grant.rb +50 -32
  14. data/lib/dodopayments/models/entitlements/file_upload_response.rb +3 -3
  15. data/lib/dodopayments/models/entitlements/license_key_grant.rb +14 -9
  16. data/lib/dodopayments/models/integration_config.rb +70 -27
  17. data/lib/dodopayments/models/integration_config_response.rb +88 -48
  18. data/lib/dodopayments/models/product.rb +3 -5
  19. data/lib/dodopayments/models/product_entitlement_summary.rb +5 -5
  20. data/lib/dodopayments/models/webhook_payload.rb +5 -0
  21. data/lib/dodopayments/resources/entitlements/files.rb +3 -10
  22. data/lib/dodopayments/resources/entitlements/grants.rb +2 -4
  23. data/lib/dodopayments/resources/entitlements.rb +2 -2
  24. data/lib/dodopayments/version.rb +1 -1
  25. data/rbi/dodopayments/models/digital_product_delivery.rbi +15 -5
  26. data/rbi/dodopayments/models/digital_product_delivery_file.rbi +11 -0
  27. data/rbi/dodopayments/models/entitlement.rbi +35 -20
  28. data/rbi/dodopayments/models/entitlement_create_params.rbi +8 -5
  29. data/rbi/dodopayments/models/entitlement_grant_created_webhook_event.rbi +4 -0
  30. data/rbi/dodopayments/models/entitlement_grant_delivered_webhook_event.rbi +4 -0
  31. data/rbi/dodopayments/models/entitlement_grant_failed_webhook_event.rbi +4 -0
  32. data/rbi/dodopayments/models/entitlement_grant_revoked_webhook_event.rbi +4 -0
  33. data/rbi/dodopayments/models/entitlement_update_params.rbi +4 -4
  34. data/rbi/dodopayments/models/entitlements/entitlement_grant.rbi +54 -20
  35. data/rbi/dodopayments/models/entitlements/file_upload_response.rbi +4 -4
  36. data/rbi/dodopayments/models/entitlements/license_key_grant.rbi +10 -4
  37. data/rbi/dodopayments/models/integration_config.rbi +141 -26
  38. data/rbi/dodopayments/models/integration_config_response.rbi +153 -38
  39. data/rbi/dodopayments/models/product.rbi +4 -8
  40. data/rbi/dodopayments/models/product_entitlement_summary.rbi +8 -8
  41. data/rbi/dodopayments/models/webhook_payload.rbi +2 -0
  42. data/rbi/dodopayments/resources/entitlements/files.rbi +3 -10
  43. data/rbi/dodopayments/resources/entitlements/grants.rbi +2 -4
  44. data/rbi/dodopayments/resources/entitlements.rbi +4 -4
  45. data/sig/dodopayments/models/entitlement.rbs +8 -10
  46. data/sig/dodopayments/models/entitlement_create_params.rbs +6 -4
  47. data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +4 -11
  48. data/sig/dodopayments/models/integration_config.rbs +28 -4
  49. data/sig/dodopayments/models/integration_config_response.rbs +28 -9
  50. data/sig/dodopayments/resources/entitlements.rbs +1 -1
  51. metadata +2 -2
@@ -2,10 +2,10 @@
2
2
 
3
3
  module Dodopayments
4
4
  module Models
5
- # Public-facing variant of [`IntegrationConfig`]. Mirrors every variant shape on
6
- # the wire EXCEPT `DigitalFiles`, which is replaced with a hydrated
7
- # `digital_files` object (resolved download URLs etc.). The persisted JSONB stays
8
- # ID-only via [`IntegrationConfig`]; this enum is response-only.
5
+ # Integration-specific configuration on an entitlement read response.
6
+ #
7
+ # For `digital_files` entitlements the response includes presigned download URLs
8
+ # for each attached file; other integrations match the shape supplied at creation.
9
9
  module IntegrationConfigResponse
10
10
  extend Dodopayments::Internal::Type::Union
11
11
 
@@ -32,23 +32,94 @@ module Dodopayments
32
32
  )
33
33
  end
34
34
 
35
- sig { returns(String) }
35
+ # Permission to grant on the repository.
36
+ sig do
37
+ returns(
38
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
39
+ )
40
+ end
36
41
  attr_accessor :permission
37
42
 
43
+ # Repository or organisation slug to grant access to.
38
44
  sig { returns(String) }
39
45
  attr_accessor :target_id
40
46
 
41
47
  sig do
42
- params(permission: String, target_id: String).returns(
43
- T.attached_class
44
- )
48
+ params(
49
+ permission:
50
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::OrSymbol,
51
+ target_id: String
52
+ ).returns(T.attached_class)
45
53
  end
46
- def self.new(permission:, target_id:)
54
+ def self.new(
55
+ # Permission to grant on the repository.
56
+ permission:,
57
+ # Repository or organisation slug to grant access to.
58
+ target_id:
59
+ )
47
60
  end
48
61
 
49
- sig { override.returns({ permission: String, target_id: String }) }
62
+ sig do
63
+ override.returns(
64
+ {
65
+ permission:
66
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol,
67
+ target_id: String
68
+ }
69
+ )
70
+ end
50
71
  def to_hash
51
72
  end
73
+
74
+ # Permission to grant on the repository.
75
+ module Permission
76
+ extend Dodopayments::Internal::Type::Enum
77
+
78
+ TaggedSymbol =
79
+ T.type_alias do
80
+ T.all(
81
+ Symbol,
82
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission
83
+ )
84
+ end
85
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
86
+
87
+ PULL =
88
+ T.let(
89
+ :pull,
90
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
91
+ )
92
+ PUSH =
93
+ T.let(
94
+ :push,
95
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
96
+ )
97
+ ADMIN =
98
+ T.let(
99
+ :admin,
100
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
101
+ )
102
+ MAINTAIN =
103
+ T.let(
104
+ :maintain,
105
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
106
+ )
107
+ TRIAGE =
108
+ T.let(
109
+ :triage,
110
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
111
+ )
112
+
113
+ sig do
114
+ override.returns(
115
+ T::Array[
116
+ Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
117
+ ]
118
+ )
119
+ end
120
+ def self.values
121
+ end
122
+ end
52
123
  end
53
124
 
54
125
  class DiscordConfig < Dodopayments::Internal::Type::BaseModel
@@ -60,9 +131,11 @@ module Dodopayments
60
131
  )
61
132
  end
62
133
 
134
+ # Discord guild (server) ID.
63
135
  sig { returns(String) }
64
136
  attr_accessor :guild_id
65
137
 
138
+ # Optional Discord role to assign within the guild.
66
139
  sig { returns(T.nilable(String)) }
67
140
  attr_accessor :role_id
68
141
 
@@ -71,7 +144,12 @@ module Dodopayments
71
144
  T.attached_class
72
145
  )
73
146
  end
74
- def self.new(guild_id:, role_id: nil)
147
+ def self.new(
148
+ # Discord guild (server) ID.
149
+ guild_id:,
150
+ # Optional Discord role to assign within the guild.
151
+ role_id: nil
152
+ )
75
153
  end
76
154
 
77
155
  sig do
@@ -90,11 +168,15 @@ module Dodopayments
90
168
  )
91
169
  end
92
170
 
171
+ # Telegram chat ID. For groups this is typically a negative integer.
93
172
  sig { returns(String) }
94
173
  attr_accessor :chat_id
95
174
 
96
175
  sig { params(chat_id: String).returns(T.attached_class) }
97
- def self.new(chat_id:)
176
+ def self.new(
177
+ # Telegram chat ID. For groups this is typically a negative integer.
178
+ chat_id:
179
+ )
98
180
  end
99
181
 
100
182
  sig { override.returns({ chat_id: String }) }
@@ -111,11 +193,15 @@ module Dodopayments
111
193
  )
112
194
  end
113
195
 
196
+ # Figma file identifier to grant access to.
114
197
  sig { returns(String) }
115
198
  attr_accessor :figma_file_id
116
199
 
117
200
  sig { params(figma_file_id: String).returns(T.attached_class) }
118
- def self.new(figma_file_id:)
201
+ def self.new(
202
+ # Figma file identifier to grant access to.
203
+ figma_file_id:
204
+ )
119
205
  end
120
206
 
121
207
  sig { override.returns({ figma_file_id: String }) }
@@ -132,11 +218,15 @@ module Dodopayments
132
218
  )
133
219
  end
134
220
 
221
+ # Framer template identifier to grant access to.
135
222
  sig { returns(String) }
136
223
  attr_accessor :framer_template_id
137
224
 
138
225
  sig { params(framer_template_id: String).returns(T.attached_class) }
139
- def self.new(framer_template_id:)
226
+ def self.new(
227
+ # Framer template identifier to grant access to.
228
+ framer_template_id:
229
+ )
140
230
  end
141
231
 
142
232
  sig { override.returns({ framer_template_id: String }) }
@@ -153,11 +243,15 @@ module Dodopayments
153
243
  )
154
244
  end
155
245
 
246
+ # Notion template identifier to grant access to.
156
247
  sig { returns(String) }
157
248
  attr_accessor :notion_template_id
158
249
 
159
250
  sig { params(notion_template_id: String).returns(T.attached_class) }
160
- def self.new(notion_template_id:)
251
+ def self.new(
252
+ # Notion template identifier to grant access to.
253
+ notion_template_id:
254
+ )
161
255
  end
162
256
 
163
257
  sig { override.returns({ notion_template_id: String }) }
@@ -174,10 +268,8 @@ module Dodopayments
174
268
  )
175
269
  end
176
270
 
177
- # Populated digital-files payload for entitlement read surfaces. Mirrors
178
- # `DigitalProductDelivery` but is sourced from an entitlement's
179
- # `integration_config` (not a grant) and tags each file with its origin (`legacy`
180
- # vs `ee`).
271
+ # Populated digital-files payload with each file's metadata and a short-lived
272
+ # presigned download URL.
181
273
  sig do
182
274
  returns(
183
275
  Dodopayments::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles
@@ -200,10 +292,8 @@ module Dodopayments
200
292
  ).returns(T.attached_class)
201
293
  end
202
294
  def self.new(
203
- # Populated digital-files payload for entitlement read surfaces. Mirrors
204
- # `DigitalProductDelivery` but is sourced from an entitlement's
205
- # `integration_config` (not a grant) and tags each file with its origin (`legacy`
206
- # vs `ee`).
295
+ # Populated digital-files payload with each file's metadata and a short-lived
296
+ # presigned download URL.
207
297
  digital_files:
208
298
  )
209
299
  end
@@ -228,6 +318,7 @@ module Dodopayments
228
318
  )
229
319
  end
230
320
 
321
+ # One entry per attached file.
231
322
  sig do
232
323
  returns(
233
324
  T::Array[
@@ -237,16 +328,17 @@ module Dodopayments
237
328
  end
238
329
  attr_accessor :files
239
330
 
331
+ # Optional external URL, passed through from the entitlement configuration.
240
332
  sig { returns(T.nilable(String)) }
241
333
  attr_accessor :external_url
242
334
 
335
+ # Optional human-readable delivery instructions, passed through from the
336
+ # entitlement configuration.
243
337
  sig { returns(T.nilable(String)) }
244
338
  attr_accessor :instructions
245
339
 
246
- # Populated digital-files payload for entitlement read surfaces. Mirrors
247
- # `DigitalProductDelivery` but is sourced from an entitlement's
248
- # `integration_config` (not a grant) and tags each file with its origin (`legacy`
249
- # vs `ee`).
340
+ # Populated digital-files payload with each file's metadata and a short-lived
341
+ # presigned download URL.
250
342
  sig do
251
343
  params(
252
344
  files:
@@ -257,7 +349,15 @@ module Dodopayments
257
349
  instructions: T.nilable(String)
258
350
  ).returns(T.attached_class)
259
351
  end
260
- def self.new(files:, external_url: nil, instructions: nil)
352
+ def self.new(
353
+ # One entry per attached file.
354
+ files:,
355
+ # Optional external URL, passed through from the entitlement configuration.
356
+ external_url: nil,
357
+ # Optional human-readable delivery instructions, passed through from the
358
+ # entitlement configuration.
359
+ instructions: nil
360
+ )
261
361
  end
262
362
 
263
363
  sig do
@@ -284,6 +384,7 @@ module Dodopayments
284
384
  )
285
385
  end
286
386
 
387
+ # Short-lived presigned URL for downloading the file.
287
388
  sig { returns(String) }
288
389
  attr_accessor :download_url
289
390
 
@@ -291,44 +392,45 @@ module Dodopayments
291
392
  sig { returns(Integer) }
292
393
  attr_accessor :expires_in
293
394
 
395
+ # Identifier of the attached file.
294
396
  sig { returns(String) }
295
397
  attr_accessor :file_id
296
398
 
399
+ # Original filename of the attached file.
297
400
  sig { returns(String) }
298
401
  attr_accessor :filename
299
402
 
300
- # `"legacy"` for files in `product_files`, `"ee"` for files managed by the
301
- # Entitlements Engine.
302
- sig { returns(String) }
303
- attr_accessor :source
304
-
403
+ # Optional content-type declared at upload.
305
404
  sig { returns(T.nilable(String)) }
306
405
  attr_accessor :content_type
307
406
 
407
+ # Optional size of the file in bytes.
308
408
  sig { returns(T.nilable(Integer)) }
309
409
  attr_accessor :file_size
310
410
 
411
+ # One file in a resolved digital-files payload.
311
412
  sig do
312
413
  params(
313
414
  download_url: String,
314
415
  expires_in: Integer,
315
416
  file_id: String,
316
417
  filename: String,
317
- source: String,
318
418
  content_type: T.nilable(String),
319
419
  file_size: T.nilable(Integer)
320
420
  ).returns(T.attached_class)
321
421
  end
322
422
  def self.new(
423
+ # Short-lived presigned URL for downloading the file.
323
424
  download_url:,
324
425
  # Seconds until `download_url` expires.
325
426
  expires_in:,
427
+ # Identifier of the attached file.
326
428
  file_id:,
429
+ # Original filename of the attached file.
327
430
  filename:,
328
- # `"legacy"` for files in `product_files`, `"ee"` for files managed by the
329
- # Entitlements Engine.
330
- source:,
431
+ # Optional content-type declared at upload.
331
432
  content_type: nil,
433
+ # Optional size of the file in bytes.
332
434
  file_size: nil
333
435
  )
334
436
  end
@@ -340,7 +442,6 @@ module Dodopayments
340
442
  expires_in: Integer,
341
443
  file_id: String,
342
444
  filename: String,
343
- source: String,
344
445
  content_type: T.nilable(String),
345
446
  file_size: T.nilable(Integer)
346
447
  }
@@ -361,15 +462,22 @@ module Dodopayments
361
462
  )
362
463
  end
363
464
 
465
+ # Optional message displayed when a customer activates the license key (≤ 2500
466
+ # characters).
364
467
  sig { returns(T.nilable(String)) }
365
468
  attr_accessor :activation_message
366
469
 
470
+ # Maximum activations allowed per issued license key. Omit for unlimited.
367
471
  sig { returns(T.nilable(Integer)) }
368
472
  attr_accessor :activations_limit
369
473
 
474
+ # Validity duration of issued license keys. Provide both `duration_count` and
475
+ # `duration_interval` together for a fixed duration; omit both for non-expiring
476
+ # keys.
370
477
  sig { returns(T.nilable(Integer)) }
371
478
  attr_accessor :duration_count
372
479
 
480
+ # Unit of `duration_count`.
373
481
  sig { returns(T.nilable(Dodopayments::TimeInterval::TaggedSymbol)) }
374
482
  attr_accessor :duration_interval
375
483
 
@@ -382,9 +490,16 @@ module Dodopayments
382
490
  ).returns(T.attached_class)
383
491
  end
384
492
  def self.new(
493
+ # Optional message displayed when a customer activates the license key (≤ 2500
494
+ # characters).
385
495
  activation_message: nil,
496
+ # Maximum activations allowed per issued license key. Omit for unlimited.
386
497
  activations_limit: nil,
498
+ # Validity duration of issued license keys. Provide both `duration_count` and
499
+ # `duration_interval` together for a fixed duration; omit both for non-expiring
500
+ # keys.
387
501
  duration_count: nil,
502
+ # Unit of `duration_count`.
388
503
  duration_interval: nil
389
504
  )
390
505
  end
@@ -63,10 +63,8 @@ module Dodopayments
63
63
  sig { returns(T.nilable(String)) }
64
64
  attr_accessor :description
65
65
 
66
- # Digital-product-delivery payload for a grant. Populated for grants whose
67
- # entitlement has `integration_type = 'digital_files'`. `files` carries presigned
68
- # download URLs; the source (EE service or legacy in-process S3 presigning) is
69
- # opaque to the caller.
66
+ # Digital-product-delivery payload, present on grants for `digital_files`
67
+ # entitlements. Each file carries a short-lived presigned download URL.
70
68
  sig { returns(T.nilable(Dodopayments::DigitalProductDelivery)) }
71
69
  attr_reader :digital_product_delivery
72
70
 
@@ -172,10 +170,8 @@ module Dodopayments
172
170
  addons: nil,
173
171
  # Description of the product, optional.
174
172
  description: nil,
175
- # Digital-product-delivery payload for a grant. Populated for grants whose
176
- # entitlement has `integration_type = 'digital_files'`. `files` carries presigned
177
- # download URLs; the source (EE service or legacy in-process S3 presigning) is
178
- # opaque to the caller.
173
+ # Digital-product-delivery payload, present on grants for `digital_files`
174
+ # entitlements. Each file carries a short-lived presigned download URL.
179
175
  digital_product_delivery: nil,
180
176
  # URL of the product image, optional.
181
177
  image: nil,
@@ -14,10 +14,10 @@ module Dodopayments
14
14
  sig { returns(String) }
15
15
  attr_accessor :id
16
16
 
17
- # Public-facing variant of [`IntegrationConfig`]. Mirrors every variant shape on
18
- # the wire EXCEPT `DigitalFiles`, which is replaced with a hydrated
19
- # `digital_files` object (resolved download URLs etc.). The persisted JSONB stays
20
- # ID-only via [`IntegrationConfig`]; this enum is response-only.
17
+ # Integration-specific configuration on an entitlement read response.
18
+ #
19
+ # For `digital_files` entitlements the response includes presigned download URLs
20
+ # for each attached file; other integrations match the shape supplied at creation.
21
21
  sig { returns(Dodopayments::IntegrationConfigResponse::Variants) }
22
22
  attr_accessor :integration_config
23
23
 
@@ -57,10 +57,10 @@ module Dodopayments
57
57
  end
58
58
  def self.new(
59
59
  id:,
60
- # Public-facing variant of [`IntegrationConfig`]. Mirrors every variant shape on
61
- # the wire EXCEPT `DigitalFiles`, which is replaced with a hydrated
62
- # `digital_files` object (resolved download URLs etc.). The persisted JSONB stays
63
- # ID-only via [`IntegrationConfig`]; this enum is response-only.
60
+ # Integration-specific configuration on an entitlement read response.
61
+ #
62
+ # For `digital_files` entitlements the response includes presigned download URLs
63
+ # for each attached file; other integrations match the shape supplied at creation.
64
64
  integration_config:,
65
65
  integration_type:,
66
66
  name:,
@@ -1034,6 +1034,8 @@ module Dodopayments
1034
1034
  end
1035
1035
  attr_accessor :payload_type
1036
1036
 
1037
+ # Detailed view of a single entitlement grant: who it's for, its lifecycle state,
1038
+ # and any integration-specific delivery payload.
1037
1039
  sig do
1038
1040
  params(
1039
1041
  payload_type:
@@ -4,10 +4,7 @@ module Dodopayments
4
4
  module Resources
5
5
  class Entitlements
6
6
  class Files
7
- # Companion to `post_entitlement_file`. Deletes the file from the Entitlements
8
- # Engine (force=true) and atomically removes the `file_id` from the entitlement's
9
- # `integration_config.digital_file_ids` JSONB array. EE delete happens first; if
10
- # it fails we surface the error and leave local state untouched.
7
+ # Detach a previously-attached file from a `digital_files` entitlement.
11
8
  sig do
12
9
  params(
13
10
  file_id: String,
@@ -16,7 +13,7 @@ module Dodopayments
16
13
  ).void
17
14
  end
18
15
  def delete(
19
- # Digital file Id from EE
16
+ # Identifier of the attached file
20
17
  file_id,
21
18
  # Entitlement Id
22
19
  id:,
@@ -24,11 +21,7 @@ module Dodopayments
24
21
  )
25
22
  end
26
23
 
27
- # Streams a multipart/form-data body to the Entitlements Engine
28
- # (`POST /api/digital-files/dodo/files/upload`) and appends the returned `file_id`
29
- # to the entitlement's `integration_config.digital_file_ids` using a JSONB array
30
- # append. Compensates EE-side on local DB write failure (best-effort delete of the
31
- # just-uploaded file).
24
+ # Attach a file to a `digital_files` entitlement. Per-file size cap: 500 MiB.
32
25
  sig do
33
26
  params(
34
27
  id: String,
@@ -35,10 +35,8 @@ module Dodopayments
35
35
  )
36
36
  end
37
37
 
38
- # Revokes a single entitlement grant for the caller's business. For LicenseKey
39
- # integrations, also disables the backing license key. Idempotent: re-revoking an
40
- # already-revoked grant returns 200 with current state. The revocation reason is
41
- # always set to "manual" for API-initiated revocations.
38
+ # Revoke a single grant. Idempotent: re-revoking an already-revoked grant returns
39
+ # the grant in its current state.
42
40
  sig do
43
41
  params(
44
42
  grant_id: String,
@@ -26,7 +26,7 @@ module Dodopayments
26
26
  integration_type: Dodopayments::EntitlementIntegrationType::OrSymbol,
27
27
  name: String,
28
28
  description: T.nilable(String),
29
- metadata: T.nilable(T::Hash[Symbol, String]),
29
+ metadata: T::Hash[Symbol, String],
30
30
  request_options: Dodopayments::RequestOptions::OrHash
31
31
  ).returns(Dodopayments::Entitlement)
32
32
  end
@@ -39,7 +39,7 @@ module Dodopayments
39
39
  name:,
40
40
  # Optional description
41
41
  description: nil,
42
- # Optional user-facing metadata
42
+ # Additional metadata for the entitlement
43
43
  metadata: nil,
44
44
  request_options: {}
45
45
  )
@@ -86,8 +86,8 @@ module Dodopayments
86
86
  # Entitlement ID
87
87
  id,
88
88
  description: nil,
89
- # Platform-specific configuration for an entitlement. Each variant uses unique
90
- # field names so `#[serde(untagged)]` can disambiguate correctly.
89
+ # Integration-specific configuration supplied when creating or updating an
90
+ # entitlement. The shape required matches the entitlement's `integration_type`.
91
91
  integration_config: nil,
92
92
  metadata: nil,
93
93
  name: nil,
@@ -8,10 +8,10 @@ module Dodopayments
8
8
  integration_config: Dodopayments::Models::integration_config_response,
9
9
  integration_type: Dodopayments::Models::entitlement_integration_type,
10
10
  is_active: bool,
11
+ metadata: ::Hash[Symbol, String],
11
12
  name: String,
12
13
  updated_at: Time,
13
- description: String?,
14
- metadata: top
14
+ description: String?
15
15
  }
16
16
 
17
17
  class Entitlement < Dodopayments::Internal::Type::BaseModel
@@ -27,16 +27,14 @@ module Dodopayments
27
27
 
28
28
  attr_accessor is_active: bool
29
29
 
30
+ attr_accessor metadata: ::Hash[Symbol, String]
31
+
30
32
  attr_accessor name: String
31
33
 
32
34
  attr_accessor updated_at: Time
33
35
 
34
36
  attr_accessor description: String?
35
37
 
36
- attr_reader metadata: top?
37
-
38
- def metadata=: (top) -> top
39
-
40
38
  def initialize: (
41
39
  id: String,
42
40
  business_id: String,
@@ -44,10 +42,10 @@ module Dodopayments
44
42
  integration_config: Dodopayments::Models::integration_config_response,
45
43
  integration_type: Dodopayments::Models::entitlement_integration_type,
46
44
  is_active: bool,
45
+ metadata: ::Hash[Symbol, String],
47
46
  name: String,
48
47
  updated_at: Time,
49
- ?description: String?,
50
- ?metadata: top
48
+ ?description: String?
51
49
  ) -> void
52
50
 
53
51
  def to_hash: -> {
@@ -57,10 +55,10 @@ module Dodopayments
57
55
  integration_config: Dodopayments::Models::integration_config_response,
58
56
  integration_type: Dodopayments::Models::entitlement_integration_type,
59
57
  is_active: bool,
58
+ metadata: ::Hash[Symbol, String],
60
59
  name: String,
61
60
  updated_at: Time,
62
- description: String?,
63
- metadata: top
61
+ description: String?
64
62
  }
65
63
  end
66
64
  end
@@ -6,7 +6,7 @@ module Dodopayments
6
6
  integration_type: Dodopayments::Models::entitlement_integration_type,
7
7
  name: String,
8
8
  description: String?,
9
- metadata: ::Hash[Symbol, String]?
9
+ metadata: ::Hash[Symbol, String]
10
10
  }
11
11
  & Dodopayments::Internal::Type::request_parameters
12
12
 
@@ -22,14 +22,16 @@ module Dodopayments
22
22
 
23
23
  attr_accessor description: String?
24
24
 
25
- attr_accessor metadata: ::Hash[Symbol, String]?
25
+ attr_reader metadata: ::Hash[Symbol, String]?
26
+
27
+ def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String]
26
28
 
27
29
  def initialize: (
28
30
  integration_config: Dodopayments::Models::integration_config,
29
31
  integration_type: Dodopayments::Models::entitlement_integration_type,
30
32
  name: String,
31
33
  ?description: String?,
32
- ?metadata: ::Hash[Symbol, String]?,
34
+ ?metadata: ::Hash[Symbol, String],
33
35
  ?request_options: Dodopayments::request_opts
34
36
  ) -> void
35
37
 
@@ -38,7 +40,7 @@ module Dodopayments
38
40
  integration_type: Dodopayments::Models::entitlement_integration_type,
39
41
  name: String,
40
42
  description: String?,
41
- metadata: ::Hash[Symbol, String]?,
43
+ metadata: ::Hash[Symbol, String],
42
44
  request_options: Dodopayments::RequestOptions
43
45
  }
44
46
  end