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
@@ -5,35 +5,40 @@ module Dodopayments
5
5
  module Entitlements
6
6
  class LicenseKeyGrant < Dodopayments::Internal::Type::BaseModel
7
7
  # @!attribute activations_used
8
+ # Number of activations consumed so far.
8
9
  #
9
10
  # @return [Integer]
10
11
  required :activations_used, Integer
11
12
 
12
13
  # @!attribute key
14
+ # Issued license key.
13
15
  #
14
16
  # @return [String]
15
17
  required :key, String
16
18
 
17
19
  # @!attribute activations_limit
20
+ # Maximum activations allowed by the entitlement, when set.
18
21
  #
19
22
  # @return [Integer, nil]
20
23
  optional :activations_limit, Integer, nil?: true
21
24
 
22
25
  # @!attribute expires_at
26
+ # When the license key expires, when applicable.
23
27
  #
24
28
  # @return [Time, nil]
25
29
  optional :expires_at, Time, nil?: true
26
30
 
27
31
  # @!method initialize(activations_used:, key:, activations_limit: nil, expires_at: nil)
28
- # Nested representation of license-key grant fields. Present only when the grant's
29
- # entitlement has `integration_type = 'license_key'` and a row exists in
30
- # `license_keys`. The grant's top-level `status` is the source of truth for the
31
- # grant's lifecycle no per-license-key status is exposed here.
32
- #
33
- # @param activations_used [Integer]
34
- # @param key [String]
35
- # @param activations_limit [Integer, nil]
36
- # @param expires_at [Time, nil]
32
+ # License-key delivery payload, present on grants for `license_key` entitlements.
33
+ # The grant's top-level `status` is the source of truth for the grant's lifecycle.
34
+ #
35
+ # @param activations_used [Integer] Number of activations consumed so far.
36
+ #
37
+ # @param key [String] Issued license key.
38
+ #
39
+ # @param activations_limit [Integer, nil] Maximum activations allowed by the entitlement, when set.
40
+ #
41
+ # @param expires_at [Time, nil] When the license key expires, when applicable.
37
42
  end
38
43
  end
39
44
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Dodopayments
4
4
  module Models
5
- # Platform-specific configuration for an entitlement. Each variant uses unique
6
- # field names so `#[serde(untagged)]` can disambiguate correctly.
5
+ # Integration-specific configuration supplied when creating or updating an
6
+ # entitlement. The shape required matches the entitlement's `integration_type`.
7
7
  module IntegrationConfig
8
8
  extend Dodopayments::Internal::Type::Union
9
9
 
@@ -25,103 +25,133 @@ module Dodopayments
25
25
 
26
26
  class GitHubConfig < Dodopayments::Internal::Type::BaseModel
27
27
  # @!attribute permission
28
- # One of: pull, push, admin, maintain, triage
28
+ # Permission to grant on the repository.
29
29
  #
30
- # @return [String]
31
- required :permission, String
30
+ # @return [Symbol, Dodopayments::Models::IntegrationConfig::GitHubConfig::Permission]
31
+ required :permission, enum: -> { Dodopayments::IntegrationConfig::GitHubConfig::Permission }
32
32
 
33
33
  # @!attribute target_id
34
+ # Repository or organisation slug to grant access to.
34
35
  #
35
36
  # @return [String]
36
37
  required :target_id, String
37
38
 
38
39
  # @!method initialize(permission:, target_id:)
39
- # @param permission [String] One of: pull, push, admin, maintain, triage
40
+ # @param permission [Symbol, Dodopayments::Models::IntegrationConfig::GitHubConfig::Permission] Permission to grant on the repository.
41
+ #
42
+ # @param target_id [String] Repository or organisation slug to grant access to.
43
+
44
+ # Permission to grant on the repository.
40
45
  #
41
- # @param target_id [String]
46
+ # @see Dodopayments::Models::IntegrationConfig::GitHubConfig#permission
47
+ module Permission
48
+ extend Dodopayments::Internal::Type::Enum
49
+
50
+ PULL = :pull
51
+ PUSH = :push
52
+ ADMIN = :admin
53
+ MAINTAIN = :maintain
54
+ TRIAGE = :triage
55
+
56
+ # @!method self.values
57
+ # @return [Array<Symbol>]
58
+ end
42
59
  end
43
60
 
44
61
  class DiscordConfig < Dodopayments::Internal::Type::BaseModel
45
62
  # @!attribute guild_id
63
+ # Discord guild (server) ID.
46
64
  #
47
65
  # @return [String]
48
66
  required :guild_id, String
49
67
 
50
68
  # @!attribute role_id
69
+ # Optional Discord role to assign within the guild.
51
70
  #
52
71
  # @return [String, nil]
53
72
  optional :role_id, String, nil?: true
54
73
 
55
74
  # @!method initialize(guild_id:, role_id: nil)
56
- # @param guild_id [String]
57
- # @param role_id [String, nil]
75
+ # @param guild_id [String] Discord guild (server) ID.
76
+ #
77
+ # @param role_id [String, nil] Optional Discord role to assign within the guild.
58
78
  end
59
79
 
60
80
  class TelegramConfig < Dodopayments::Internal::Type::BaseModel
61
81
  # @!attribute chat_id
82
+ # Telegram chat ID. For groups this is typically a negative integer.
62
83
  #
63
84
  # @return [String]
64
85
  required :chat_id, String
65
86
 
66
87
  # @!method initialize(chat_id:)
67
- # @param chat_id [String]
88
+ # @param chat_id [String] Telegram chat ID. For groups this is typically a negative integer.
68
89
  end
69
90
 
70
91
  class FigmaConfig < Dodopayments::Internal::Type::BaseModel
71
92
  # @!attribute figma_file_id
93
+ # Figma file identifier to grant access to.
72
94
  #
73
95
  # @return [String]
74
96
  required :figma_file_id, String
75
97
 
76
98
  # @!method initialize(figma_file_id:)
77
- # @param figma_file_id [String]
99
+ # @param figma_file_id [String] Figma file identifier to grant access to.
78
100
  end
79
101
 
80
102
  class FramerConfig < Dodopayments::Internal::Type::BaseModel
81
103
  # @!attribute framer_template_id
104
+ # Framer template identifier to grant access to.
82
105
  #
83
106
  # @return [String]
84
107
  required :framer_template_id, String
85
108
 
86
109
  # @!method initialize(framer_template_id:)
87
- # @param framer_template_id [String]
110
+ # @param framer_template_id [String] Framer template identifier to grant access to.
88
111
  end
89
112
 
90
113
  class NotionConfig < Dodopayments::Internal::Type::BaseModel
91
114
  # @!attribute notion_template_id
115
+ # Notion template identifier to grant access to.
92
116
  #
93
117
  # @return [String]
94
118
  required :notion_template_id, String
95
119
 
96
120
  # @!method initialize(notion_template_id:)
97
- # @param notion_template_id [String]
121
+ # @param notion_template_id [String] Notion template identifier to grant access to.
98
122
  end
99
123
 
100
124
  class DigitalFilesConfig < Dodopayments::Internal::Type::BaseModel
101
125
  # @!attribute digital_file_ids
126
+ # Files attached to this entitlement. Add files via
127
+ # `POST /entitlements/{id}/files` and remove them via
128
+ # `DELETE /entitlements/{id}/files/{file_id}`.
102
129
  #
103
130
  # @return [Array<String>]
104
131
  required :digital_file_ids, Dodopayments::Internal::Type::ArrayOf[String]
105
132
 
106
133
  # @!attribute external_url
134
+ # Optional external URL shown to the customer alongside the files.
107
135
  #
108
136
  # @return [String, nil]
109
137
  optional :external_url, String, nil?: true
110
138
 
111
139
  # @!attribute instructions
140
+ # Optional human-readable delivery instructions shown to the customer alongside
141
+ # the files.
112
142
  #
113
143
  # @return [String, nil]
114
144
  optional :instructions, String, nil?: true
115
145
 
116
146
  # @!attribute legacy_file_ids
117
- # Three-way patchable field (mirrors the credit_entitlements pattern):
147
+ # Three-way patchable list of legacy file identifiers:
118
148
  #
119
- # - omitted → preserve persisted (`None`)
120
- # - `null` → clear (`Some(None)`)
121
- # - `[...]` → replace (`Some(Some(...))`)
149
+ # - omitted → preserve the current value
150
+ # - `null` → clear
151
+ # - `[...]` → replace
122
152
  #
123
- # On Create / storage we collapse "clear" and empty-array to `None` so the
124
- # persisted JSONB never carries a `null` legacy_file_ids key.
153
+ # On create, an omitted field, an explicit `null`, or an empty array all result in
154
+ # no legacy files attached.
125
155
  #
126
156
  # @return [Array<String>, nil]
127
157
  optional :legacy_file_ids, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
@@ -130,41 +160,54 @@ module Dodopayments
130
160
  # Some parameter documentations has been truncated, see
131
161
  # {Dodopayments::Models::IntegrationConfig::DigitalFilesConfig} for more details.
132
162
  #
133
- # @param digital_file_ids [Array<String>]
163
+ # @param digital_file_ids [Array<String>] Files attached to this entitlement. Add files via
134
164
  #
135
- # @param external_url [String, nil]
165
+ # @param external_url [String, nil] Optional external URL shown to the customer alongside the files.
136
166
  #
137
- # @param instructions [String, nil]
167
+ # @param instructions [String, nil] Optional human-readable delivery instructions shown to the customer
138
168
  #
139
- # @param legacy_file_ids [Array<String>, nil] Three-way patchable field (mirrors the credit_entitlements pattern):
169
+ # @param legacy_file_ids [Array<String>, nil] Three-way patchable list of legacy file identifiers:
140
170
  end
141
171
 
142
172
  class LicenseKeyConfig < Dodopayments::Internal::Type::BaseModel
143
173
  # @!attribute activation_message
174
+ # Optional message displayed when a customer activates the license key (≤ 2500
175
+ # characters).
144
176
  #
145
177
  # @return [String, nil]
146
178
  optional :activation_message, String, nil?: true
147
179
 
148
180
  # @!attribute activations_limit
181
+ # Maximum activations allowed per issued license key. Omit for unlimited.
149
182
  #
150
183
  # @return [Integer, nil]
151
184
  optional :activations_limit, Integer, nil?: true
152
185
 
153
186
  # @!attribute duration_count
187
+ # Validity duration of issued license keys. Provide both `duration_count` and
188
+ # `duration_interval` together for a fixed duration; omit both for non-expiring
189
+ # keys.
154
190
  #
155
191
  # @return [Integer, nil]
156
192
  optional :duration_count, Integer, nil?: true
157
193
 
158
194
  # @!attribute duration_interval
195
+ # Unit of `duration_count`.
159
196
  #
160
197
  # @return [Symbol, Dodopayments::Models::TimeInterval, nil]
161
198
  optional :duration_interval, enum: -> { Dodopayments::TimeInterval }, nil?: true
162
199
 
163
200
  # @!method initialize(activation_message: nil, activations_limit: nil, duration_count: nil, duration_interval: nil)
164
- # @param activation_message [String, nil]
165
- # @param activations_limit [Integer, nil]
166
- # @param duration_count [Integer, nil]
167
- # @param duration_interval [Symbol, Dodopayments::Models::TimeInterval, nil]
201
+ # Some parameter documentations has been truncated, see
202
+ # {Dodopayments::Models::IntegrationConfig::LicenseKeyConfig} for more details.
203
+ #
204
+ # @param activation_message [String, nil] Optional message displayed when a customer activates the license
205
+ #
206
+ # @param activations_limit [Integer, nil] Maximum activations allowed per issued license key. Omit for unlimited.
207
+ #
208
+ # @param duration_count [Integer, nil] Validity duration of issued license keys. Provide both
209
+ #
210
+ # @param duration_interval [Symbol, Dodopayments::Models::TimeInterval, nil] Unit of `duration_count`.
168
211
  end
169
212
 
170
213
  # @!method self.variants
@@ -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
 
@@ -27,82 +27,106 @@ module Dodopayments
27
27
 
28
28
  class GitHubConfig < Dodopayments::Internal::Type::BaseModel
29
29
  # @!attribute permission
30
+ # Permission to grant on the repository.
30
31
  #
31
- # @return [String]
32
- required :permission, String
32
+ # @return [Symbol, Dodopayments::Models::IntegrationConfigResponse::GitHubConfig::Permission]
33
+ required :permission, enum: -> { Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission }
33
34
 
34
35
  # @!attribute target_id
36
+ # Repository or organisation slug to grant access to.
35
37
  #
36
38
  # @return [String]
37
39
  required :target_id, String
38
40
 
39
41
  # @!method initialize(permission:, target_id:)
40
- # @param permission [String]
41
- # @param target_id [String]
42
+ # @param permission [Symbol, Dodopayments::Models::IntegrationConfigResponse::GitHubConfig::Permission] Permission to grant on the repository.
43
+ #
44
+ # @param target_id [String] Repository or organisation slug to grant access to.
45
+
46
+ # Permission to grant on the repository.
47
+ #
48
+ # @see Dodopayments::Models::IntegrationConfigResponse::GitHubConfig#permission
49
+ module Permission
50
+ extend Dodopayments::Internal::Type::Enum
51
+
52
+ PULL = :pull
53
+ PUSH = :push
54
+ ADMIN = :admin
55
+ MAINTAIN = :maintain
56
+ TRIAGE = :triage
57
+
58
+ # @!method self.values
59
+ # @return [Array<Symbol>]
60
+ end
42
61
  end
43
62
 
44
63
  class DiscordConfig < Dodopayments::Internal::Type::BaseModel
45
64
  # @!attribute guild_id
65
+ # Discord guild (server) ID.
46
66
  #
47
67
  # @return [String]
48
68
  required :guild_id, String
49
69
 
50
70
  # @!attribute role_id
71
+ # Optional Discord role to assign within the guild.
51
72
  #
52
73
  # @return [String, nil]
53
74
  optional :role_id, String, nil?: true
54
75
 
55
76
  # @!method initialize(guild_id:, role_id: nil)
56
- # @param guild_id [String]
57
- # @param role_id [String, nil]
77
+ # @param guild_id [String] Discord guild (server) ID.
78
+ #
79
+ # @param role_id [String, nil] Optional Discord role to assign within the guild.
58
80
  end
59
81
 
60
82
  class TelegramConfig < Dodopayments::Internal::Type::BaseModel
61
83
  # @!attribute chat_id
84
+ # Telegram chat ID. For groups this is typically a negative integer.
62
85
  #
63
86
  # @return [String]
64
87
  required :chat_id, String
65
88
 
66
89
  # @!method initialize(chat_id:)
67
- # @param chat_id [String]
90
+ # @param chat_id [String] Telegram chat ID. For groups this is typically a negative integer.
68
91
  end
69
92
 
70
93
  class FigmaConfig < Dodopayments::Internal::Type::BaseModel
71
94
  # @!attribute figma_file_id
95
+ # Figma file identifier to grant access to.
72
96
  #
73
97
  # @return [String]
74
98
  required :figma_file_id, String
75
99
 
76
100
  # @!method initialize(figma_file_id:)
77
- # @param figma_file_id [String]
101
+ # @param figma_file_id [String] Figma file identifier to grant access to.
78
102
  end
79
103
 
80
104
  class FramerConfig < Dodopayments::Internal::Type::BaseModel
81
105
  # @!attribute framer_template_id
106
+ # Framer template identifier to grant access to.
82
107
  #
83
108
  # @return [String]
84
109
  required :framer_template_id, String
85
110
 
86
111
  # @!method initialize(framer_template_id:)
87
- # @param framer_template_id [String]
112
+ # @param framer_template_id [String] Framer template identifier to grant access to.
88
113
  end
89
114
 
90
115
  class NotionConfig < Dodopayments::Internal::Type::BaseModel
91
116
  # @!attribute notion_template_id
117
+ # Notion template identifier to grant access to.
92
118
  #
93
119
  # @return [String]
94
120
  required :notion_template_id, String
95
121
 
96
122
  # @!method initialize(notion_template_id:)
97
- # @param notion_template_id [String]
123
+ # @param notion_template_id [String] Notion template identifier to grant access to.
98
124
  end
99
125
 
100
126
  class DigitalFilesConfig < Dodopayments::Internal::Type::BaseModel
101
127
  # @!attribute digital_files
102
- # Populated digital-files payload for entitlement read surfaces. Mirrors
103
- # `DigitalProductDelivery` but is sourced from an entitlement's
104
- # `integration_config` (not a grant) and tags each file with its origin (`legacy`
105
- # vs `ee`).
128
+ # Populated digital-files payload with each file's metadata and a short-lived
129
+ # presigned download URL.
106
130
  #
107
131
  # @return [Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles]
108
132
  required :digital_files, -> { Dodopayments::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles }
@@ -112,38 +136,47 @@ module Dodopayments
112
136
  # {Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig} for more
113
137
  # details.
114
138
  #
115
- # @param digital_files [Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles] Populated digital-files payload for entitlement read surfaces. Mirrors
139
+ # @param digital_files [Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles] Populated digital-files payload with each file's metadata and a
116
140
 
117
141
  # @see Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig#digital_files
118
142
  class DigitalFiles < Dodopayments::Internal::Type::BaseModel
119
143
  # @!attribute files
144
+ # One entry per attached file.
120
145
  #
121
146
  # @return [Array<Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles::File>]
122
147
  required :files,
123
148
  -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles::File] }
124
149
 
125
150
  # @!attribute external_url
151
+ # Optional external URL, passed through from the entitlement configuration.
126
152
  #
127
153
  # @return [String, nil]
128
154
  optional :external_url, String, nil?: true
129
155
 
130
156
  # @!attribute instructions
157
+ # Optional human-readable delivery instructions, passed through from the
158
+ # entitlement configuration.
131
159
  #
132
160
  # @return [String, nil]
133
161
  optional :instructions, String, nil?: true
134
162
 
135
163
  # @!method initialize(files:, external_url: nil, instructions: nil)
136
- # Populated digital-files payload for entitlement read surfaces. Mirrors
137
- # `DigitalProductDelivery` but is sourced from an entitlement's
138
- # `integration_config` (not a grant) and tags each file with its origin (`legacy`
139
- # vs `ee`).
164
+ # Some parameter documentations has been truncated, see
165
+ # {Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles}
166
+ # for more details.
167
+ #
168
+ # Populated digital-files payload with each file's metadata and a short-lived
169
+ # presigned download URL.
170
+ #
171
+ # @param files [Array<Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles::File>] One entry per attached file.
140
172
  #
141
- # @param files [Array<Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles::File>]
142
- # @param external_url [String, nil]
143
- # @param instructions [String, nil]
173
+ # @param external_url [String, nil] Optional external URL, passed through from the entitlement
174
+ #
175
+ # @param instructions [String, nil] Optional human-readable delivery instructions, passed through from
144
176
 
145
177
  class File < Dodopayments::Internal::Type::BaseModel
146
178
  # @!attribute download_url
179
+ # Short-lived presigned URL for downloading the file.
147
180
  #
148
181
  # @return [String]
149
182
  required :download_url, String
@@ -155,80 +188,87 @@ module Dodopayments
155
188
  required :expires_in, Integer
156
189
 
157
190
  # @!attribute file_id
191
+ # Identifier of the attached file.
158
192
  #
159
193
  # @return [String]
160
194
  required :file_id, String
161
195
 
162
196
  # @!attribute filename
197
+ # Original filename of the attached file.
163
198
  #
164
199
  # @return [String]
165
200
  required :filename, String
166
201
 
167
- # @!attribute source
168
- # `"legacy"` for files in `product_files`, `"ee"` for files managed by the
169
- # Entitlements Engine.
170
- #
171
- # @return [String]
172
- required :source, String
173
-
174
202
  # @!attribute content_type
203
+ # Optional content-type declared at upload.
175
204
  #
176
205
  # @return [String, nil]
177
206
  optional :content_type, String, nil?: true
178
207
 
179
208
  # @!attribute file_size
209
+ # Optional size of the file in bytes.
180
210
  #
181
211
  # @return [Integer, nil]
182
212
  optional :file_size, Integer, nil?: true
183
213
 
184
- # @!method initialize(download_url:, expires_in:, file_id:, filename:, source:, content_type: nil, file_size: nil)
185
- # Some parameter documentations has been truncated, see
186
- # {Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig::DigitalFiles::File}
187
- # for more details.
214
+ # @!method initialize(download_url:, expires_in:, file_id:, filename:, content_type: nil, file_size: nil)
215
+ # One file in a resolved digital-files payload.
188
216
  #
189
- # @param download_url [String]
217
+ # @param download_url [String] Short-lived presigned URL for downloading the file.
190
218
  #
191
219
  # @param expires_in [Integer] Seconds until `download_url` expires.
192
220
  #
193
- # @param file_id [String]
194
- #
195
- # @param filename [String]
221
+ # @param file_id [String] Identifier of the attached file.
196
222
  #
197
- # @param source [String] `"legacy"` for files in `product_files`, `"ee"` for files managed by the
223
+ # @param filename [String] Original filename of the attached file.
198
224
  #
199
- # @param content_type [String, nil]
225
+ # @param content_type [String, nil] Optional content-type declared at upload.
200
226
  #
201
- # @param file_size [Integer, nil]
227
+ # @param file_size [Integer, nil] Optional size of the file in bytes.
202
228
  end
203
229
  end
204
230
  end
205
231
 
206
232
  class LicenseKeyConfig < Dodopayments::Internal::Type::BaseModel
207
233
  # @!attribute activation_message
234
+ # Optional message displayed when a customer activates the license key (≤ 2500
235
+ # characters).
208
236
  #
209
237
  # @return [String, nil]
210
238
  optional :activation_message, String, nil?: true
211
239
 
212
240
  # @!attribute activations_limit
241
+ # Maximum activations allowed per issued license key. Omit for unlimited.
213
242
  #
214
243
  # @return [Integer, nil]
215
244
  optional :activations_limit, Integer, nil?: true
216
245
 
217
246
  # @!attribute duration_count
247
+ # Validity duration of issued license keys. Provide both `duration_count` and
248
+ # `duration_interval` together for a fixed duration; omit both for non-expiring
249
+ # keys.
218
250
  #
219
251
  # @return [Integer, nil]
220
252
  optional :duration_count, Integer, nil?: true
221
253
 
222
254
  # @!attribute duration_interval
255
+ # Unit of `duration_count`.
223
256
  #
224
257
  # @return [Symbol, Dodopayments::Models::TimeInterval, nil]
225
258
  optional :duration_interval, enum: -> { Dodopayments::TimeInterval }, nil?: true
226
259
 
227
260
  # @!method initialize(activation_message: nil, activations_limit: nil, duration_count: nil, duration_interval: nil)
228
- # @param activation_message [String, nil]
229
- # @param activations_limit [Integer, nil]
230
- # @param duration_count [Integer, nil]
231
- # @param duration_interval [Symbol, Dodopayments::Models::TimeInterval, nil]
261
+ # Some parameter documentations has been truncated, see
262
+ # {Dodopayments::Models::IntegrationConfigResponse::LicenseKeyConfig} for more
263
+ # details.
264
+ #
265
+ # @param activation_message [String, nil] Optional message displayed when a customer activates the license
266
+ #
267
+ # @param activations_limit [Integer, nil] Maximum activations allowed per issued license key. Omit for unlimited.
268
+ #
269
+ # @param duration_count [Integer, nil] Validity duration of issued license keys. Provide both
270
+ #
271
+ # @param duration_interval [Symbol, Dodopayments::Models::TimeInterval, nil] Unit of `duration_count`.
232
272
  end
233
273
 
234
274
  # @!method self.variants
@@ -92,10 +92,8 @@ module Dodopayments
92
92
  optional :description, String, nil?: true
93
93
 
94
94
  # @!attribute digital_product_delivery
95
- # Digital-product-delivery payload for a grant. Populated for grants whose
96
- # entitlement has `integration_type = 'digital_files'`. `files` carries presigned
97
- # download URLs; the source (EE service or legacy in-process S3 presigning) is
98
- # opaque to the caller.
95
+ # Digital-product-delivery payload, present on grants for `digital_files`
96
+ # entitlements. Each file carries a short-lived presigned download URL.
99
97
  #
100
98
  # @return [Dodopayments::Models::DigitalProductDelivery, nil]
101
99
  optional :digital_product_delivery, -> { Dodopayments::DigitalProductDelivery }, nil?: true
@@ -172,7 +170,7 @@ module Dodopayments
172
170
  #
173
171
  # @param description [String, nil] Description of the product, optional.
174
172
  #
175
- # @param digital_product_delivery [Dodopayments::Models::DigitalProductDelivery, nil] Digital-product-delivery payload for a grant. Populated for grants whose
173
+ # @param digital_product_delivery [Dodopayments::Models::DigitalProductDelivery, nil] Digital-product-delivery payload, present on grants for `digital_files`
176
174
  #
177
175
  # @param image [String, nil] URL of the product image, optional.
178
176
  #
@@ -9,10 +9,10 @@ module Dodopayments
9
9
  required :id, String
10
10
 
11
11
  # @!attribute integration_config
12
- # Public-facing variant of [`IntegrationConfig`]. Mirrors every variant shape on
13
- # the wire EXCEPT `DigitalFiles`, which is replaced with a hydrated
14
- # `digital_files` object (resolved download URLs etc.). The persisted JSONB stays
15
- # ID-only via [`IntegrationConfig`]; this enum is response-only.
12
+ # Integration-specific configuration on an entitlement read response.
13
+ #
14
+ # For `digital_files` entitlements the response includes presigned download URLs
15
+ # for each attached file; other integrations match the shape supplied at creation.
16
16
  #
17
17
  # @return [Dodopayments::Models::IntegrationConfigResponse::GitHubConfig, Dodopayments::Models::IntegrationConfigResponse::DiscordConfig, Dodopayments::Models::IntegrationConfigResponse::TelegramConfig, Dodopayments::Models::IntegrationConfigResponse::FigmaConfig, Dodopayments::Models::IntegrationConfigResponse::FramerConfig, Dodopayments::Models::IntegrationConfigResponse::NotionConfig, Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig, Dodopayments::Models::IntegrationConfigResponse::LicenseKeyConfig]
18
18
  required :integration_config, union: -> { Dodopayments::IntegrationConfigResponse }
@@ -45,7 +45,7 @@ module Dodopayments
45
45
  #
46
46
  # @param id [String]
47
47
  #
48
- # @param integration_config [Dodopayments::Models::IntegrationConfigResponse::GitHubConfig, Dodopayments::Models::IntegrationConfigResponse::DiscordConfig, Dodopayments::Models::IntegrationConfigResponse::TelegramConfig, Dodopayments::Models::IntegrationConfigResponse::FigmaConfig, Dodopayments::Models::IntegrationConfigResponse::FramerConfig, Dodopayments::Models::IntegrationConfigResponse::NotionConfig, Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig, Dodopayments::Models::IntegrationConfigResponse::LicenseKeyConfig] Public-facing variant of [`IntegrationConfig`]. Mirrors every variant
48
+ # @param integration_config [Dodopayments::Models::IntegrationConfigResponse::GitHubConfig, Dodopayments::Models::IntegrationConfigResponse::DiscordConfig, Dodopayments::Models::IntegrationConfigResponse::TelegramConfig, Dodopayments::Models::IntegrationConfigResponse::FigmaConfig, Dodopayments::Models::IntegrationConfigResponse::FramerConfig, Dodopayments::Models::IntegrationConfigResponse::NotionConfig, Dodopayments::Models::IntegrationConfigResponse::DigitalFilesConfig, Dodopayments::Models::IntegrationConfigResponse::LicenseKeyConfig] Integration-specific configuration on an entitlement read response.
49
49
  #
50
50
  # @param integration_type [Symbol, Dodopayments::Models::EntitlementIntegrationType]
51
51
  #
@@ -65,6 +65,8 @@ module Dodopayments
65
65
 
66
66
  variant -> { Dodopayments::WebhookPayload::Data::DunningAttempt }
67
67
 
68
+ # Detailed view of a single entitlement grant: who it's for, its
69
+ # lifecycle state, and any integration-specific delivery payload.
68
70
  variant -> { Dodopayments::WebhookPayload::Data::EntitlementGrant }
69
71
 
70
72
  class Payment < Dodopayments::Models::Payment
@@ -421,6 +423,9 @@ module Dodopayments
421
423
  required :payload_type, enum: -> { Dodopayments::WebhookPayload::Data::EntitlementGrant::PayloadType }
422
424
 
423
425
  # @!method initialize(payload_type:)
426
+ # Detailed view of a single entitlement grant: who it's for, its lifecycle state,
427
+ # and any integration-specific delivery payload.
428
+ #
424
429
  # @param payload_type [Symbol, Dodopayments::Models::WebhookPayload::Data::EntitlementGrant::PayloadType]
425
430
 
426
431
  module PayloadType