dodopayments 2.5.0 → 2.7.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +1 -1
- data/lib/dodopayments/internal/util.rb +3 -1
- data/lib/dodopayments/models/discount.rb +8 -1
- data/lib/dodopayments/models/discount_create_params.rb +9 -1
- data/lib/dodopayments/models/discount_update_params.rb +9 -1
- data/lib/dodopayments/models/license_key.rb +33 -10
- data/lib/dodopayments/models/license_key_create_params.rb +54 -0
- data/lib/dodopayments/models/license_key_list_params.rb +20 -1
- data/lib/dodopayments/models/product.rb +228 -1
- data/lib/dodopayments/models/product_create_params.rb +15 -1
- data/lib/dodopayments/models/product_list_response.rb +225 -1
- data/lib/dodopayments/models/product_update_params.rb +16 -1
- data/lib/dodopayments/models/webhook_event_type.rb +4 -0
- data/lib/dodopayments/models/webhook_payload.rb +176 -3
- data/lib/dodopayments/models.rb +2 -0
- data/lib/dodopayments/resources/discounts.rb +6 -2
- data/lib/dodopayments/resources/license_keys.rb +37 -1
- data/lib/dodopayments/resources/products.rb +6 -2
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +1 -0
- data/rbi/dodopayments/models/discount.rbi +6 -0
- data/rbi/dodopayments/models/discount_create_params.rbi +11 -0
- data/rbi/dodopayments/models/discount_update_params.rbi +8 -0
- data/rbi/dodopayments/models/license_key.rbi +39 -8
- data/rbi/dodopayments/models/license_key_create_params.rbi +78 -0
- data/rbi/dodopayments/models/license_key_list_params.rbi +44 -0
- data/rbi/dodopayments/models/product.rbi +425 -0
- data/rbi/dodopayments/models/product_create_params.rbi +8 -0
- data/rbi/dodopayments/models/product_list_response.rbi +436 -0
- data/rbi/dodopayments/models/product_update_params.rbi +10 -0
- data/rbi/dodopayments/models/webhook_event_type.rbi +20 -0
- data/rbi/dodopayments/models/webhook_payload.rbi +267 -4
- data/rbi/dodopayments/models.rbi +2 -0
- data/rbi/dodopayments/resources/discounts.rbi +6 -0
- data/rbi/dodopayments/resources/license_keys.rbi +28 -0
- data/rbi/dodopayments/resources/products.rbi +7 -0
- data/sig/dodopayments/models/discount.rbs +5 -0
- data/sig/dodopayments/models/discount_create_params.rbs +7 -0
- data/sig/dodopayments/models/discount_update_params.rbs +5 -0
- data/sig/dodopayments/models/license_key.rbs +21 -5
- data/sig/dodopayments/models/license_key_create_params.rbs +46 -0
- data/sig/dodopayments/models/license_key_list_params.rbs +20 -0
- data/sig/dodopayments/models/product.rbs +206 -0
- data/sig/dodopayments/models/product_create_params.rbs +5 -0
- data/sig/dodopayments/models/product_list_response.rbs +206 -0
- data/sig/dodopayments/models/product_update_params.rbs +5 -0
- data/sig/dodopayments/models/webhook_event_type.rbs +8 -0
- data/sig/dodopayments/models/webhook_payload.rbs +158 -0
- data/sig/dodopayments/models.rbs +2 -0
- data/sig/dodopayments/resources/discounts.rbs +2 -0
- data/sig/dodopayments/resources/license_keys.rbs +10 -0
- data/sig/dodopayments/resources/products.rbs +2 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad6fd99bd99f0b47dd01ced82f3e6b5ee34fb1bd74c23eca5f723ed3abeeabce
|
|
4
|
+
data.tar.gz: 45c8c7bdae64cb27ce240c3577e8b39a9f721070dc9e1495b6eec4294c802cf2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 621b34cd3f74fd0a3d7727a88a65aa1d9804e99cf7f82fd6e8be9c40255b8401b5dbbb16d23b2979daebca253069c278727f7a24684c57e2b1d2dae72738486e
|
|
7
|
+
data.tar.gz: fd4644f5b51f70f66cb5be50fc5e337d825bec5a85318a20f97550cc9503c45db65318cebe2b45a5022b8bba546f890b98db88309b1fd5ee285fa32de95b47ef
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.7.0 (2026-04-14)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.6.0...v2.7.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.6.0...v2.7.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** update openapi spec to v1.95.3 ([f06c818](https://github.com/dodopayments/dodopayments-ruby/commit/f06c818716c04073a76fea8624f781a69ef1a7d2))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* multipart encoding for file arrays ([dadec9c](https://github.com/dodopayments/dodopayments-ruby/commit/dadec9cee7f50218fb778deea6e3371d8331d4bb))
|
|
15
|
+
|
|
16
|
+
## 2.6.0 (2026-04-08)
|
|
17
|
+
|
|
18
|
+
Full Changelog: [v2.5.0...v2.6.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.5.0...v2.6.0)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **api:** updated openapi spec to v1.94.2 ([6cad8c2](https://github.com/dodopayments/dodopayments-ruby/commit/6cad8c211713ce096110682f4af14b3b82fa3b6d))
|
|
23
|
+
|
|
3
24
|
## 2.5.0 (2026-04-01)
|
|
4
25
|
|
|
5
26
|
Full Changelog: [v2.4.1...v2.5.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.4.1...v2.5.0)
|
data/README.md
CHANGED
|
@@ -610,6 +610,7 @@ module Dodopayments
|
|
|
610
610
|
#
|
|
611
611
|
# @return [Array(String, Enumerable<String>)]
|
|
612
612
|
private def encode_multipart_streaming(body)
|
|
613
|
+
# rubocop:disable Style/CaseEquality
|
|
613
614
|
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
|
|
614
615
|
boundary = SecureRandom.urlsafe_base64(46)
|
|
615
616
|
|
|
@@ -619,7 +620,7 @@ module Dodopayments
|
|
|
619
620
|
in Hash
|
|
620
621
|
body.each do |key, val|
|
|
621
622
|
case val
|
|
622
|
-
in Array if val.all? { primitive?(_1) }
|
|
623
|
+
in Array if val.all? { primitive?(_1) || Dodopayments::Internal::Type::FileInput === _1 }
|
|
623
624
|
val.each do |v|
|
|
624
625
|
write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
|
|
625
626
|
end
|
|
@@ -635,6 +636,7 @@ module Dodopayments
|
|
|
635
636
|
|
|
636
637
|
fused_io = fused_enum(strio) { closing.each(&:call) }
|
|
637
638
|
[boundary, fused_io]
|
|
639
|
+
# rubocop:enable Style/CaseEquality
|
|
638
640
|
end
|
|
639
641
|
|
|
640
642
|
# @api private
|
|
@@ -38,6 +38,11 @@ module Dodopayments
|
|
|
38
38
|
# @return [String]
|
|
39
39
|
required :discount_id, String
|
|
40
40
|
|
|
41
|
+
# @!attribute metadata
|
|
42
|
+
#
|
|
43
|
+
# @return [Hash{Symbol=>String}]
|
|
44
|
+
required :metadata, Dodopayments::Internal::Type::HashOf[String]
|
|
45
|
+
|
|
41
46
|
# @!attribute preserve_on_plan_change
|
|
42
47
|
# Whether this discount should be preserved when a subscription changes plans.
|
|
43
48
|
# Default: false (discount is removed on plan change)
|
|
@@ -89,7 +94,7 @@ module Dodopayments
|
|
|
89
94
|
# @return [Integer, nil]
|
|
90
95
|
optional :usage_limit, Integer, nil?: true
|
|
91
96
|
|
|
92
|
-
# @!method initialize(amount:, business_id:, code:, created_at:, discount_id:, preserve_on_plan_change:, restricted_to:, times_used:, type:, expires_at: nil, name: nil, subscription_cycles: nil, usage_limit: nil)
|
|
97
|
+
# @!method initialize(amount:, business_id:, code:, created_at:, discount_id:, metadata:, preserve_on_plan_change:, restricted_to:, times_used:, type:, expires_at: nil, name: nil, subscription_cycles: nil, usage_limit: nil)
|
|
93
98
|
# Some parameter documentations has been truncated, see
|
|
94
99
|
# {Dodopayments::Models::Discount} for more details.
|
|
95
100
|
#
|
|
@@ -103,6 +108,8 @@ module Dodopayments
|
|
|
103
108
|
#
|
|
104
109
|
# @param discount_id [String] The unique discount ID
|
|
105
110
|
#
|
|
111
|
+
# @param metadata [Hash{Symbol=>String}]
|
|
112
|
+
#
|
|
106
113
|
# @param preserve_on_plan_change [Boolean] Whether this discount should be preserved when a subscription changes plans.
|
|
107
114
|
#
|
|
108
115
|
# @param restricted_to [Array<String>] List of product IDs to which this discount is restricted.
|
|
@@ -41,6 +41,12 @@ module Dodopayments
|
|
|
41
41
|
# @return [Time, nil]
|
|
42
42
|
optional :expires_at, Time, nil?: true
|
|
43
43
|
|
|
44
|
+
# @!attribute metadata
|
|
45
|
+
# Additional metadata for the discount
|
|
46
|
+
#
|
|
47
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
48
|
+
optional :metadata, Dodopayments::Internal::Type::HashOf[String]
|
|
49
|
+
|
|
44
50
|
# @!attribute name
|
|
45
51
|
#
|
|
46
52
|
# @return [String, nil]
|
|
@@ -73,7 +79,7 @@ module Dodopayments
|
|
|
73
79
|
# @return [Integer, nil]
|
|
74
80
|
optional :usage_limit, Integer, nil?: true
|
|
75
81
|
|
|
76
|
-
# @!method initialize(amount:, type:, code: nil, expires_at: nil, name: nil, preserve_on_plan_change: nil, restricted_to: nil, subscription_cycles: nil, usage_limit: nil, request_options: {})
|
|
82
|
+
# @!method initialize(amount:, type:, code: nil, expires_at: nil, metadata: nil, name: nil, preserve_on_plan_change: nil, restricted_to: nil, subscription_cycles: nil, usage_limit: nil, request_options: {})
|
|
77
83
|
# Some parameter documentations has been truncated, see
|
|
78
84
|
# {Dodopayments::Models::DiscountCreateParams} for more details.
|
|
79
85
|
#
|
|
@@ -85,6 +91,8 @@ module Dodopayments
|
|
|
85
91
|
#
|
|
86
92
|
# @param expires_at [Time, nil] When the discount expires, if ever.
|
|
87
93
|
#
|
|
94
|
+
# @param metadata [Hash{Symbol=>String}] Additional metadata for the discount
|
|
95
|
+
#
|
|
88
96
|
# @param name [String, nil]
|
|
89
97
|
#
|
|
90
98
|
# @param preserve_on_plan_change [Boolean] Whether this discount should be preserved when a subscription changes plans.
|
|
@@ -35,6 +35,12 @@ module Dodopayments
|
|
|
35
35
|
# @return [Time, nil]
|
|
36
36
|
optional :expires_at, Time, nil?: true
|
|
37
37
|
|
|
38
|
+
# @!attribute metadata
|
|
39
|
+
# Additional metadata for the discount
|
|
40
|
+
#
|
|
41
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
42
|
+
optional :metadata, Dodopayments::Internal::Type::HashOf[String], nil?: true
|
|
43
|
+
|
|
38
44
|
# @!attribute name
|
|
39
45
|
#
|
|
40
46
|
# @return [String, nil]
|
|
@@ -73,7 +79,7 @@ module Dodopayments
|
|
|
73
79
|
# @return [Integer, nil]
|
|
74
80
|
optional :usage_limit, Integer, nil?: true
|
|
75
81
|
|
|
76
|
-
# @!method initialize(discount_id:, amount: nil, code: nil, expires_at: nil, name: nil, preserve_on_plan_change: nil, restricted_to: nil, subscription_cycles: nil, type: nil, usage_limit: nil, request_options: {})
|
|
82
|
+
# @!method initialize(discount_id:, amount: nil, code: nil, expires_at: nil, metadata: nil, name: nil, preserve_on_plan_change: nil, restricted_to: nil, subscription_cycles: nil, type: nil, usage_limit: nil, request_options: {})
|
|
77
83
|
# Some parameter documentations has been truncated, see
|
|
78
84
|
# {Dodopayments::Models::DiscountUpdateParams} for more details.
|
|
79
85
|
#
|
|
@@ -85,6 +91,8 @@ module Dodopayments
|
|
|
85
91
|
#
|
|
86
92
|
# @param expires_at [Time, nil]
|
|
87
93
|
#
|
|
94
|
+
# @param metadata [Hash{Symbol=>String}, nil] Additional metadata for the discount
|
|
95
|
+
#
|
|
88
96
|
# @param name [String, nil]
|
|
89
97
|
#
|
|
90
98
|
# @param preserve_on_plan_change [Boolean, nil] Whether this discount should be preserved when a subscription changes plans.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Dodopayments
|
|
4
4
|
module Models
|
|
5
|
-
# @see Dodopayments::Resources::LicenseKeys#
|
|
5
|
+
# @see Dodopayments::Resources::LicenseKeys#create
|
|
6
6
|
class LicenseKey < Dodopayments::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
8
|
# The unique identifier of the license key.
|
|
@@ -40,18 +40,19 @@ module Dodopayments
|
|
|
40
40
|
# @return [String]
|
|
41
41
|
required :key, String
|
|
42
42
|
|
|
43
|
-
# @!attribute payment_id
|
|
44
|
-
# The unique identifier of the payment associated with the license key.
|
|
45
|
-
#
|
|
46
|
-
# @return [String]
|
|
47
|
-
required :payment_id, String
|
|
48
|
-
|
|
49
43
|
# @!attribute product_id
|
|
50
44
|
# The unique identifier of the product associated with the license key.
|
|
51
45
|
#
|
|
52
46
|
# @return [String]
|
|
53
47
|
required :product_id, String
|
|
54
48
|
|
|
49
|
+
# @!attribute source
|
|
50
|
+
# The source of the license key - 'auto' for keys generated by
|
|
51
|
+
# payment/subscription flows, 'import' for merchant-imported keys.
|
|
52
|
+
#
|
|
53
|
+
# @return [Symbol, Dodopayments::Models::LicenseKey::Source]
|
|
54
|
+
required :source, enum: -> { Dodopayments::LicenseKey::Source }
|
|
55
|
+
|
|
55
56
|
# @!attribute status
|
|
56
57
|
# The current status of the license key (e.g., active, inactive, expired).
|
|
57
58
|
#
|
|
@@ -70,6 +71,12 @@ module Dodopayments
|
|
|
70
71
|
# @return [Time, nil]
|
|
71
72
|
optional :expires_at, Time, nil?: true
|
|
72
73
|
|
|
74
|
+
# @!attribute payment_id
|
|
75
|
+
# The unique identifier of the payment associated with the license key, if any.
|
|
76
|
+
#
|
|
77
|
+
# @return [String, nil]
|
|
78
|
+
optional :payment_id, String, nil?: true
|
|
79
|
+
|
|
73
80
|
# @!attribute subscription_id
|
|
74
81
|
# The unique identifier of the subscription associated with the license key, if
|
|
75
82
|
# any.
|
|
@@ -77,7 +84,7 @@ module Dodopayments
|
|
|
77
84
|
# @return [String, nil]
|
|
78
85
|
optional :subscription_id, String, nil?: true
|
|
79
86
|
|
|
80
|
-
# @!method initialize(id:, business_id:, created_at:, customer_id:, instances_count:, key:,
|
|
87
|
+
# @!method initialize(id:, business_id:, created_at:, customer_id:, instances_count:, key:, product_id:, source:, status:, activations_limit: nil, expires_at: nil, payment_id: nil, subscription_id: nil)
|
|
81
88
|
# Some parameter documentations has been truncated, see
|
|
82
89
|
# {Dodopayments::Models::LicenseKey} for more details.
|
|
83
90
|
#
|
|
@@ -93,17 +100,33 @@ module Dodopayments
|
|
|
93
100
|
#
|
|
94
101
|
# @param key [String] The license key string.
|
|
95
102
|
#
|
|
96
|
-
# @param payment_id [String] The unique identifier of the payment associated with the license key.
|
|
97
|
-
#
|
|
98
103
|
# @param product_id [String] The unique identifier of the product associated with the license key.
|
|
99
104
|
#
|
|
105
|
+
# @param source [Symbol, Dodopayments::Models::LicenseKey::Source] The source of the license key - 'auto' for keys generated by payment/subscriptio
|
|
106
|
+
#
|
|
100
107
|
# @param status [Symbol, Dodopayments::Models::LicenseKeyStatus] The current status of the license key (e.g., active, inactive, expired).
|
|
101
108
|
#
|
|
102
109
|
# @param activations_limit [Integer, nil] The maximum number of activations allowed for this license key.
|
|
103
110
|
#
|
|
104
111
|
# @param expires_at [Time, nil] The timestamp indicating when the license key expires, in UTC.
|
|
105
112
|
#
|
|
113
|
+
# @param payment_id [String, nil] The unique identifier of the payment associated with the license key, if any.
|
|
114
|
+
#
|
|
106
115
|
# @param subscription_id [String, nil] The unique identifier of the subscription associated with the license key, if an
|
|
116
|
+
|
|
117
|
+
# The source of the license key - 'auto' for keys generated by
|
|
118
|
+
# payment/subscription flows, 'import' for merchant-imported keys.
|
|
119
|
+
#
|
|
120
|
+
# @see Dodopayments::Models::LicenseKey#source
|
|
121
|
+
module Source
|
|
122
|
+
extend Dodopayments::Internal::Type::Enum
|
|
123
|
+
|
|
124
|
+
AUTO = :auto
|
|
125
|
+
IMPORT = :import
|
|
126
|
+
|
|
127
|
+
# @!method self.values
|
|
128
|
+
# @return [Array<Symbol>]
|
|
129
|
+
end
|
|
107
130
|
end
|
|
108
131
|
end
|
|
109
132
|
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# @see Dodopayments::Resources::LicenseKeys#create
|
|
6
|
+
class LicenseKeyCreateParams < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute customer_id
|
|
11
|
+
# The customer this license key belongs to.
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :customer_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute key
|
|
17
|
+
# The license key string to import.
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
required :key, String
|
|
21
|
+
|
|
22
|
+
# @!attribute product_id
|
|
23
|
+
# The product this license key is for.
|
|
24
|
+
#
|
|
25
|
+
# @return [String]
|
|
26
|
+
required :product_id, String
|
|
27
|
+
|
|
28
|
+
# @!attribute activations_limit
|
|
29
|
+
# Maximum number of activations allowed. Null means unlimited.
|
|
30
|
+
#
|
|
31
|
+
# @return [Integer, nil]
|
|
32
|
+
optional :activations_limit, Integer, nil?: true
|
|
33
|
+
|
|
34
|
+
# @!attribute expires_at
|
|
35
|
+
# Expiration timestamp. Null means the key never expires.
|
|
36
|
+
#
|
|
37
|
+
# @return [Time, nil]
|
|
38
|
+
optional :expires_at, Time, nil?: true
|
|
39
|
+
|
|
40
|
+
# @!method initialize(customer_id:, key:, product_id:, activations_limit: nil, expires_at: nil, request_options: {})
|
|
41
|
+
# @param customer_id [String] The customer this license key belongs to.
|
|
42
|
+
#
|
|
43
|
+
# @param key [String] The license key string to import.
|
|
44
|
+
#
|
|
45
|
+
# @param product_id [String] The product this license key is for.
|
|
46
|
+
#
|
|
47
|
+
# @param activations_limit [Integer, nil] Maximum number of activations allowed. Null means unlimited.
|
|
48
|
+
#
|
|
49
|
+
# @param expires_at [Time, nil] Expiration timestamp. Null means the key never expires.
|
|
50
|
+
#
|
|
51
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -43,13 +43,19 @@ module Dodopayments
|
|
|
43
43
|
# @return [String, nil]
|
|
44
44
|
optional :product_id, String
|
|
45
45
|
|
|
46
|
+
# @!attribute source
|
|
47
|
+
# Filter by license key source
|
|
48
|
+
#
|
|
49
|
+
# @return [Symbol, Dodopayments::Models::LicenseKeyListParams::Source, nil]
|
|
50
|
+
optional :source, enum: -> { Dodopayments::LicenseKeyListParams::Source }
|
|
51
|
+
|
|
46
52
|
# @!attribute status
|
|
47
53
|
# Filter by license key status
|
|
48
54
|
#
|
|
49
55
|
# @return [Symbol, Dodopayments::Models::LicenseKeyListParams::Status, nil]
|
|
50
56
|
optional :status, enum: -> { Dodopayments::LicenseKeyListParams::Status }
|
|
51
57
|
|
|
52
|
-
# @!method initialize(created_at_gte: nil, created_at_lte: nil, customer_id: nil, page_number: nil, page_size: nil, product_id: nil, status: nil, request_options: {})
|
|
58
|
+
# @!method initialize(created_at_gte: nil, created_at_lte: nil, customer_id: nil, page_number: nil, page_size: nil, product_id: nil, source: nil, status: nil, request_options: {})
|
|
53
59
|
# @param created_at_gte [Time] Filter license keys created on or after this timestamp
|
|
54
60
|
#
|
|
55
61
|
# @param created_at_lte [Time] Filter license keys created on or before this timestamp
|
|
@@ -62,10 +68,23 @@ module Dodopayments
|
|
|
62
68
|
#
|
|
63
69
|
# @param product_id [String] Filter by product ID
|
|
64
70
|
#
|
|
71
|
+
# @param source [Symbol, Dodopayments::Models::LicenseKeyListParams::Source] Filter by license key source
|
|
72
|
+
#
|
|
65
73
|
# @param status [Symbol, Dodopayments::Models::LicenseKeyListParams::Status] Filter by license key status
|
|
66
74
|
#
|
|
67
75
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
68
76
|
|
|
77
|
+
# Filter by license key source
|
|
78
|
+
module Source
|
|
79
|
+
extend Dodopayments::Internal::Type::Enum
|
|
80
|
+
|
|
81
|
+
AUTO = :auto
|
|
82
|
+
IMPORT = :import
|
|
83
|
+
|
|
84
|
+
# @!method self.values
|
|
85
|
+
# @return [Array<Symbol>]
|
|
86
|
+
end
|
|
87
|
+
|
|
69
88
|
# Filter by license key status
|
|
70
89
|
module Status
|
|
71
90
|
extend Dodopayments::Internal::Type::Enum
|
|
@@ -28,6 +28,12 @@ module Dodopayments
|
|
|
28
28
|
required :credit_entitlements,
|
|
29
29
|
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::CreditEntitlementMappingResponse] }
|
|
30
30
|
|
|
31
|
+
# @!attribute entitlements
|
|
32
|
+
# Attached entitlements (integration-based access grants)
|
|
33
|
+
#
|
|
34
|
+
# @return [Array<Dodopayments::Models::Product::Entitlement>]
|
|
35
|
+
required :entitlements, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Product::Entitlement] }
|
|
36
|
+
|
|
31
37
|
# @!attribute is_recurring
|
|
32
38
|
# Indicates if the product is recurring (e.g., subscriptions).
|
|
33
39
|
#
|
|
@@ -35,6 +41,8 @@ module Dodopayments
|
|
|
35
41
|
required :is_recurring, Dodopayments::Internal::Type::Boolean
|
|
36
42
|
|
|
37
43
|
# @!attribute license_key_enabled
|
|
44
|
+
# @deprecated
|
|
45
|
+
#
|
|
38
46
|
# Indicates whether the product requires a license key.
|
|
39
47
|
#
|
|
40
48
|
# @return [Boolean]
|
|
@@ -94,12 +102,16 @@ module Dodopayments
|
|
|
94
102
|
optional :image, String, nil?: true
|
|
95
103
|
|
|
96
104
|
# @!attribute license_key_activation_message
|
|
105
|
+
# @deprecated
|
|
106
|
+
#
|
|
97
107
|
# Message sent upon license key activation, if applicable.
|
|
98
108
|
#
|
|
99
109
|
# @return [String, nil]
|
|
100
110
|
optional :license_key_activation_message, String, nil?: true
|
|
101
111
|
|
|
102
112
|
# @!attribute license_key_activations_limit
|
|
113
|
+
# @deprecated
|
|
114
|
+
#
|
|
103
115
|
# Limit on the number of activations for the license key, if enabled.
|
|
104
116
|
#
|
|
105
117
|
# @return [Integer, nil]
|
|
@@ -123,7 +135,7 @@ module Dodopayments
|
|
|
123
135
|
# @return [String, nil]
|
|
124
136
|
optional :product_collection_id, String, nil?: true
|
|
125
137
|
|
|
126
|
-
# @!method initialize(brand_id:, business_id:, created_at:, credit_entitlements:, is_recurring:, license_key_enabled:, metadata:, price:, product_id:, tax_category:, updated_at:, addons: nil, description: nil, digital_product_delivery: nil, image: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, name: nil, product_collection_id: nil)
|
|
138
|
+
# @!method initialize(brand_id:, business_id:, created_at:, credit_entitlements:, entitlements:, is_recurring:, license_key_enabled:, metadata:, price:, product_id:, tax_category:, updated_at:, addons: nil, description: nil, digital_product_delivery: nil, image: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, name: nil, product_collection_id: nil)
|
|
127
139
|
# @param brand_id [String]
|
|
128
140
|
#
|
|
129
141
|
# @param business_id [String] Unique identifier for the business to which the product belongs.
|
|
@@ -132,6 +144,8 @@ module Dodopayments
|
|
|
132
144
|
#
|
|
133
145
|
# @param credit_entitlements [Array<Dodopayments::Models::CreditEntitlementMappingResponse>] Attached credit entitlements with settings
|
|
134
146
|
#
|
|
147
|
+
# @param entitlements [Array<Dodopayments::Models::Product::Entitlement>] Attached entitlements (integration-based access grants)
|
|
148
|
+
#
|
|
135
149
|
# @param is_recurring [Boolean] Indicates if the product is recurring (e.g., subscriptions).
|
|
136
150
|
#
|
|
137
151
|
# @param license_key_enabled [Boolean] Indicates whether the product requires a license key.
|
|
@@ -163,6 +177,219 @@ module Dodopayments
|
|
|
163
177
|
# @param name [String, nil] Name of the product, optional.
|
|
164
178
|
#
|
|
165
179
|
# @param product_collection_id [String, nil] The product collection ID this product belongs to, if any
|
|
180
|
+
|
|
181
|
+
class Entitlement < Dodopayments::Internal::Type::BaseModel
|
|
182
|
+
# @!attribute id
|
|
183
|
+
#
|
|
184
|
+
# @return [String]
|
|
185
|
+
required :id, String
|
|
186
|
+
|
|
187
|
+
# @!attribute integration_config
|
|
188
|
+
# Platform-specific configuration for an entitlement. Each variant uses unique
|
|
189
|
+
# field names so `#[serde(untagged)]` can disambiguate correctly.
|
|
190
|
+
#
|
|
191
|
+
# @return [Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig]
|
|
192
|
+
required :integration_config, union: -> { Dodopayments::Product::Entitlement::IntegrationConfig }
|
|
193
|
+
|
|
194
|
+
# @!attribute integration_type
|
|
195
|
+
#
|
|
196
|
+
# @return [Symbol, Dodopayments::Models::Product::Entitlement::IntegrationType]
|
|
197
|
+
required :integration_type, enum: -> { Dodopayments::Product::Entitlement::IntegrationType }
|
|
198
|
+
|
|
199
|
+
# @!attribute name
|
|
200
|
+
#
|
|
201
|
+
# @return [String]
|
|
202
|
+
required :name, String
|
|
203
|
+
|
|
204
|
+
# @!attribute description
|
|
205
|
+
#
|
|
206
|
+
# @return [String, nil]
|
|
207
|
+
optional :description, String, nil?: true
|
|
208
|
+
|
|
209
|
+
# @!method initialize(id:, integration_config:, integration_type:, name:, description: nil)
|
|
210
|
+
# Some parameter documentations has been truncated, see
|
|
211
|
+
# {Dodopayments::Models::Product::Entitlement} for more details.
|
|
212
|
+
#
|
|
213
|
+
# Summary of an entitlement attached to a product
|
|
214
|
+
#
|
|
215
|
+
# @param id [String]
|
|
216
|
+
#
|
|
217
|
+
# @param integration_config [Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig] Platform-specific configuration for an entitlement.
|
|
218
|
+
#
|
|
219
|
+
# @param integration_type [Symbol, Dodopayments::Models::Product::Entitlement::IntegrationType]
|
|
220
|
+
#
|
|
221
|
+
# @param name [String]
|
|
222
|
+
#
|
|
223
|
+
# @param description [String, nil]
|
|
224
|
+
|
|
225
|
+
# Platform-specific configuration for an entitlement. Each variant uses unique
|
|
226
|
+
# field names so `#[serde(untagged)]` can disambiguate correctly.
|
|
227
|
+
#
|
|
228
|
+
# @see Dodopayments::Models::Product::Entitlement#integration_config
|
|
229
|
+
module IntegrationConfig
|
|
230
|
+
extend Dodopayments::Internal::Type::Union
|
|
231
|
+
|
|
232
|
+
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::GitHubConfig }
|
|
233
|
+
|
|
234
|
+
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::DiscordConfig }
|
|
235
|
+
|
|
236
|
+
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::TelegramConfig }
|
|
237
|
+
|
|
238
|
+
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::FigmaConfig }
|
|
239
|
+
|
|
240
|
+
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::FramerConfig }
|
|
241
|
+
|
|
242
|
+
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::NotionConfig }
|
|
243
|
+
|
|
244
|
+
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::DigitalFilesConfig }
|
|
245
|
+
|
|
246
|
+
variant -> { Dodopayments::Product::Entitlement::IntegrationConfig::LicenseKeyConfig }
|
|
247
|
+
|
|
248
|
+
class GitHubConfig < Dodopayments::Internal::Type::BaseModel
|
|
249
|
+
# @!attribute permission
|
|
250
|
+
# One of: pull, push, admin, maintain, triage
|
|
251
|
+
#
|
|
252
|
+
# @return [String]
|
|
253
|
+
required :permission, String
|
|
254
|
+
|
|
255
|
+
# @!attribute target_id
|
|
256
|
+
#
|
|
257
|
+
# @return [String]
|
|
258
|
+
required :target_id, String
|
|
259
|
+
|
|
260
|
+
# @!method initialize(permission:, target_id:)
|
|
261
|
+
# @param permission [String] One of: pull, push, admin, maintain, triage
|
|
262
|
+
#
|
|
263
|
+
# @param target_id [String]
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
class DiscordConfig < Dodopayments::Internal::Type::BaseModel
|
|
267
|
+
# @!attribute guild_id
|
|
268
|
+
#
|
|
269
|
+
# @return [String]
|
|
270
|
+
required :guild_id, String
|
|
271
|
+
|
|
272
|
+
# @!attribute role_id
|
|
273
|
+
#
|
|
274
|
+
# @return [String, nil]
|
|
275
|
+
optional :role_id, String, nil?: true
|
|
276
|
+
|
|
277
|
+
# @!method initialize(guild_id:, role_id: nil)
|
|
278
|
+
# @param guild_id [String]
|
|
279
|
+
# @param role_id [String, nil]
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
class TelegramConfig < Dodopayments::Internal::Type::BaseModel
|
|
283
|
+
# @!attribute chat_id
|
|
284
|
+
#
|
|
285
|
+
# @return [String]
|
|
286
|
+
required :chat_id, String
|
|
287
|
+
|
|
288
|
+
# @!method initialize(chat_id:)
|
|
289
|
+
# @param chat_id [String]
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
class FigmaConfig < Dodopayments::Internal::Type::BaseModel
|
|
293
|
+
# @!attribute figma_file_id
|
|
294
|
+
#
|
|
295
|
+
# @return [String]
|
|
296
|
+
required :figma_file_id, String
|
|
297
|
+
|
|
298
|
+
# @!method initialize(figma_file_id:)
|
|
299
|
+
# @param figma_file_id [String]
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
class FramerConfig < Dodopayments::Internal::Type::BaseModel
|
|
303
|
+
# @!attribute framer_template_id
|
|
304
|
+
#
|
|
305
|
+
# @return [String]
|
|
306
|
+
required :framer_template_id, String
|
|
307
|
+
|
|
308
|
+
# @!method initialize(framer_template_id:)
|
|
309
|
+
# @param framer_template_id [String]
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
class NotionConfig < Dodopayments::Internal::Type::BaseModel
|
|
313
|
+
# @!attribute notion_template_id
|
|
314
|
+
#
|
|
315
|
+
# @return [String]
|
|
316
|
+
required :notion_template_id, String
|
|
317
|
+
|
|
318
|
+
# @!method initialize(notion_template_id:)
|
|
319
|
+
# @param notion_template_id [String]
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
class DigitalFilesConfig < Dodopayments::Internal::Type::BaseModel
|
|
323
|
+
# @!attribute digital_file_ids
|
|
324
|
+
#
|
|
325
|
+
# @return [Array<String>]
|
|
326
|
+
required :digital_file_ids, Dodopayments::Internal::Type::ArrayOf[String]
|
|
327
|
+
|
|
328
|
+
# @!attribute external_url
|
|
329
|
+
#
|
|
330
|
+
# @return [String, nil]
|
|
331
|
+
optional :external_url, String, nil?: true
|
|
332
|
+
|
|
333
|
+
# @!attribute instructions
|
|
334
|
+
#
|
|
335
|
+
# @return [String, nil]
|
|
336
|
+
optional :instructions, String, nil?: true
|
|
337
|
+
|
|
338
|
+
# @!method initialize(digital_file_ids:, external_url: nil, instructions: nil)
|
|
339
|
+
# @param digital_file_ids [Array<String>]
|
|
340
|
+
# @param external_url [String, nil]
|
|
341
|
+
# @param instructions [String, nil]
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
class LicenseKeyConfig < Dodopayments::Internal::Type::BaseModel
|
|
345
|
+
# @!attribute activation_message
|
|
346
|
+
#
|
|
347
|
+
# @return [String, nil]
|
|
348
|
+
optional :activation_message, String, nil?: true
|
|
349
|
+
|
|
350
|
+
# @!attribute activations_limit
|
|
351
|
+
#
|
|
352
|
+
# @return [Integer, nil]
|
|
353
|
+
optional :activations_limit, Integer, nil?: true
|
|
354
|
+
|
|
355
|
+
# @!attribute duration_count
|
|
356
|
+
#
|
|
357
|
+
# @return [Integer, nil]
|
|
358
|
+
optional :duration_count, Integer, nil?: true
|
|
359
|
+
|
|
360
|
+
# @!attribute duration_interval
|
|
361
|
+
#
|
|
362
|
+
# @return [String, nil]
|
|
363
|
+
optional :duration_interval, String, nil?: true
|
|
364
|
+
|
|
365
|
+
# @!method initialize(activation_message: nil, activations_limit: nil, duration_count: nil, duration_interval: nil)
|
|
366
|
+
# @param activation_message [String, nil]
|
|
367
|
+
# @param activations_limit [Integer, nil]
|
|
368
|
+
# @param duration_count [Integer, nil]
|
|
369
|
+
# @param duration_interval [String, nil]
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
# @!method self.variants
|
|
373
|
+
# @return [Array(Dodopayments::Models::Product::Entitlement::IntegrationConfig::GitHubConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DiscordConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::TelegramConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FigmaConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::FramerConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::NotionConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::DigitalFilesConfig, Dodopayments::Models::Product::Entitlement::IntegrationConfig::LicenseKeyConfig)]
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
# @see Dodopayments::Models::Product::Entitlement#integration_type
|
|
377
|
+
module IntegrationType
|
|
378
|
+
extend Dodopayments::Internal::Type::Enum
|
|
379
|
+
|
|
380
|
+
DISCORD = :discord
|
|
381
|
+
TELEGRAM = :telegram
|
|
382
|
+
GITHUB = :github
|
|
383
|
+
FIGMA = :figma
|
|
384
|
+
FRAMER = :framer
|
|
385
|
+
NOTION = :notion
|
|
386
|
+
DIGITAL_FILES = :digital_files
|
|
387
|
+
LICENSE_KEY = :license_key
|
|
388
|
+
|
|
389
|
+
# @!method self.values
|
|
390
|
+
# @return [Array<Symbol>]
|
|
391
|
+
end
|
|
392
|
+
end
|
|
166
393
|
end
|
|
167
394
|
end
|
|
168
395
|
end
|