dodopayments 2.18.0 → 2.19.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 +16 -0
- data/README.md +1 -1
- data/lib/dodopayments/models/attach_addon.rb +3 -1
- data/lib/dodopayments/models/checkout_session_flags.rb +12 -1
- data/lib/dodopayments/models/checkout_session_request.rb +5 -3
- data/lib/dodopayments/models/credit_entitlement.rb +2 -1
- data/lib/dodopayments/models/credit_entitlement_cart_response.rb +2 -1
- data/lib/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rb +5 -3
- data/lib/dodopayments/models/credit_entitlements/balance_list_grants_response.rb +24 -3
- data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +3 -3
- data/lib/dodopayments/models/customer.rb +3 -3
- data/lib/dodopayments/models/customer_create_params.rb +3 -3
- data/lib/dodopayments/models/customer_limited_details.rb +3 -3
- data/lib/dodopayments/models/customer_list_entitlement_grants_params.rb +85 -0
- data/lib/dodopayments/models/customer_update_params.rb +5 -3
- data/lib/dodopayments/models/discount.rb +4 -3
- data/lib/dodopayments/models/discount_create_params.rb +3 -3
- data/lib/dodopayments/models/discount_detail.rb +3 -3
- data/lib/dodopayments/models/discount_update_params.rb +5 -3
- data/lib/dodopayments/models/entitlement.rb +5 -5
- data/lib/dodopayments/models/entitlement_create_params.rb +5 -5
- data/lib/dodopayments/models/entitlement_integration_type.rb +1 -0
- data/lib/dodopayments/models/entitlement_list_params.rb +1 -0
- data/lib/dodopayments/models/entitlement_update_params.rb +12 -5
- data/lib/dodopayments/models/entitlements/entitlement_grant.rb +13 -4
- data/lib/dodopayments/models/feature.rb +26 -0
- data/lib/dodopayments/models/feature_type.rb +15 -0
- data/lib/dodopayments/models/integration_config.rb +30 -1
- data/lib/dodopayments/models/integration_config_response.rb +22 -1
- data/lib/dodopayments/models/license_key_duration.rb +3 -1
- data/lib/dodopayments/models/metadata.rb +15 -1
- data/lib/dodopayments/models/payment.rb +5 -5
- data/lib/dodopayments/models/payment_create_params.rb +3 -3
- data/lib/dodopayments/models/payment_create_response.rb +3 -3
- data/lib/dodopayments/models/payment_list_response.rb +4 -3
- data/lib/dodopayments/models/product.rb +3 -3
- data/lib/dodopayments/models/product_create_params.rb +3 -3
- data/lib/dodopayments/models/product_entitlement_summary.rb +2 -2
- data/lib/dodopayments/models/product_list_response.rb +3 -3
- data/lib/dodopayments/models/product_update_params.rb +5 -3
- data/lib/dodopayments/models/refund.rb +3 -3
- data/lib/dodopayments/models/refund_create_params.rb +3 -3
- data/lib/dodopayments/models/subscription.rb +3 -3
- data/lib/dodopayments/models/subscription_charge_params.rb +5 -3
- data/lib/dodopayments/models/subscription_create_params.rb +3 -3
- data/lib/dodopayments/models/subscription_create_response.rb +3 -3
- data/lib/dodopayments/models/subscription_list_response.rb +3 -3
- data/lib/dodopayments/models/subscription_update_params.rb +18 -4
- data/lib/dodopayments/models/time_interval.rb +1 -0
- data/lib/dodopayments/models/update_subscription_plan_req.rb +5 -3
- data/lib/dodopayments/models.rb +8 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +2 -2
- data/lib/dodopayments/resources/credit_entitlements/balances.rb +1 -1
- data/lib/dodopayments/resources/customers.rb +35 -2
- data/lib/dodopayments/resources/discounts.rb +2 -2
- data/lib/dodopayments/resources/entitlements.rb +4 -4
- data/lib/dodopayments/resources/payments.rb +1 -1
- data/lib/dodopayments/resources/products.rb +2 -2
- data/lib/dodopayments/resources/refunds.rb +1 -1
- data/lib/dodopayments/resources/subscriptions.rb +5 -5
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +3 -0
- data/rbi/dodopayments/models/attach_addon.rbi +6 -1
- data/rbi/dodopayments/models/checkout_session_flags.rbi +17 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +9 -3
- data/rbi/dodopayments/models/credit_entitlement.rbi +2 -0
- data/rbi/dodopayments/models/credit_entitlement_cart_response.rbi +2 -0
- data/rbi/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbi +11 -3
- data/rbi/dodopayments/models/credit_entitlements/balance_list_grants_response.rbi +13 -3
- data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +3 -3
- data/rbi/dodopayments/models/customer.rbi +12 -4
- data/rbi/dodopayments/models/customer_create_params.rbi +12 -4
- data/rbi/dodopayments/models/customer_limited_details.rbi +12 -4
- data/rbi/dodopayments/models/customer_list_entitlement_grants_params.rbi +229 -0
- data/rbi/dodopayments/models/customer_update_params.rbi +9 -3
- data/rbi/dodopayments/models/discount.rbi +5 -3
- data/rbi/dodopayments/models/discount_create_params.rbi +12 -4
- data/rbi/dodopayments/models/discount_detail.rbi +3 -3
- data/rbi/dodopayments/models/discount_update_params.rbi +9 -3
- data/rbi/dodopayments/models/entitlement.rbi +4 -3
- data/rbi/dodopayments/models/entitlement_create_params.rbi +15 -4
- data/rbi/dodopayments/models/entitlement_integration_type.rbi +5 -0
- data/rbi/dodopayments/models/entitlement_list_params.rbi +5 -0
- data/rbi/dodopayments/models/entitlement_update_params.rbi +22 -3
- data/rbi/dodopayments/models/entitlements/entitlement_grant.rbi +16 -3
- data/rbi/dodopayments/models/feature.rbi +46 -0
- data/rbi/dodopayments/models/feature_type.rbi +21 -0
- data/rbi/dodopayments/models/integration_config.rbi +50 -0
- data/rbi/dodopayments/models/integration_config_response.rbi +44 -0
- data/rbi/dodopayments/models/license_key_duration.rbi +6 -1
- data/rbi/dodopayments/models/metadata.rbi +12 -1
- data/rbi/dodopayments/models/payment.rbi +5 -5
- data/rbi/dodopayments/models/payment_create_params.rbi +12 -4
- data/rbi/dodopayments/models/payment_create_response.rbi +3 -3
- data/rbi/dodopayments/models/payment_list_response.rbi +5 -3
- data/rbi/dodopayments/models/product.rbi +3 -3
- data/rbi/dodopayments/models/product_create_params.rbi +12 -4
- data/rbi/dodopayments/models/product_entitlement_summary.rbi +1 -0
- data/rbi/dodopayments/models/product_list_response.rbi +3 -3
- data/rbi/dodopayments/models/product_update_params.rbi +9 -3
- data/rbi/dodopayments/models/refund.rbi +3 -3
- data/rbi/dodopayments/models/refund_create_params.rbi +12 -4
- data/rbi/dodopayments/models/subscription.rbi +3 -3
- data/rbi/dodopayments/models/subscription_charge_params.rbi +9 -3
- data/rbi/dodopayments/models/subscription_create_params.rbi +12 -4
- data/rbi/dodopayments/models/subscription_create_response.rbi +3 -3
- data/rbi/dodopayments/models/subscription_list_response.rbi +3 -3
- data/rbi/dodopayments/models/subscription_update_params.rbi +13 -3
- data/rbi/dodopayments/models/time_interval.rbi +1 -0
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +9 -3
- data/rbi/dodopayments/models.rbi +9 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +4 -2
- data/rbi/dodopayments/resources/credit_entitlements/balances.rbi +2 -1
- data/rbi/dodopayments/resources/customers.rbi +36 -2
- data/rbi/dodopayments/resources/discounts.rbi +3 -2
- data/rbi/dodopayments/resources/entitlements.rbi +10 -2
- data/rbi/dodopayments/resources/payments.rbi +1 -1
- data/rbi/dodopayments/resources/products.rbi +3 -2
- data/rbi/dodopayments/resources/refunds.rbi +1 -1
- data/rbi/dodopayments/resources/subscriptions.rbi +10 -5
- data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
- data/sig/dodopayments/models/customer_list_entitlement_grants_params.rbs +98 -0
- data/sig/dodopayments/models/entitlement_integration_type.rbs +2 -0
- data/sig/dodopayments/models/entitlement_list_params.rbs +2 -0
- data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +5 -0
- data/sig/dodopayments/models/feature.rbs +22 -0
- data/sig/dodopayments/models/feature_type.rbs +13 -0
- data/sig/dodopayments/models/integration_config.rbs +21 -1
- data/sig/dodopayments/models/integration_config_response.rbs +21 -1
- data/sig/dodopayments/models/metadata.rbs +9 -1
- data/sig/dodopayments/models.rbs +8 -0
- data/sig/dodopayments/resources/customers.rbs +9 -0
- metadata +11 -2
|
@@ -24,10 +24,18 @@ module Dodopayments
|
|
|
24
24
|
attr_accessor :name
|
|
25
25
|
|
|
26
26
|
# Additional metadata associated with the customer
|
|
27
|
-
sig
|
|
27
|
+
sig do
|
|
28
|
+
returns(
|
|
29
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
30
|
+
)
|
|
31
|
+
end
|
|
28
32
|
attr_reader :metadata
|
|
29
33
|
|
|
30
|
-
sig
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants]
|
|
37
|
+
).void
|
|
38
|
+
end
|
|
31
39
|
attr_writer :metadata
|
|
32
40
|
|
|
33
41
|
# Phone number of the customer
|
|
@@ -39,7 +47,7 @@ module Dodopayments
|
|
|
39
47
|
customer_id: String,
|
|
40
48
|
email: String,
|
|
41
49
|
name: String,
|
|
42
|
-
metadata: T::Hash[Symbol,
|
|
50
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
43
51
|
phone_number: T.nilable(String)
|
|
44
52
|
).returns(T.attached_class)
|
|
45
53
|
end
|
|
@@ -63,7 +71,7 @@ module Dodopayments
|
|
|
63
71
|
customer_id: String,
|
|
64
72
|
email: String,
|
|
65
73
|
name: String,
|
|
66
|
-
metadata: T::Hash[Symbol,
|
|
74
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
67
75
|
phone_number: T.nilable(String)
|
|
68
76
|
}
|
|
69
77
|
)
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class CustomerListEntitlementGrantsParams < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Dodopayments::CustomerListEntitlementGrantsParams,
|
|
13
|
+
Dodopayments::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :customer_id
|
|
19
|
+
|
|
20
|
+
# Filter by integration type (e.g. `feature_flag`)
|
|
21
|
+
sig do
|
|
22
|
+
returns(
|
|
23
|
+
T.nilable(
|
|
24
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::OrSymbol
|
|
25
|
+
)
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
attr_reader :integration_type
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
integration_type:
|
|
33
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::OrSymbol
|
|
34
|
+
).void
|
|
35
|
+
end
|
|
36
|
+
attr_writer :integration_type
|
|
37
|
+
|
|
38
|
+
# Page number (default 0)
|
|
39
|
+
sig { returns(T.nilable(Integer)) }
|
|
40
|
+
attr_reader :page_number
|
|
41
|
+
|
|
42
|
+
sig { params(page_number: Integer).void }
|
|
43
|
+
attr_writer :page_number
|
|
44
|
+
|
|
45
|
+
# Page size (default 10, max 100)
|
|
46
|
+
sig { returns(T.nilable(Integer)) }
|
|
47
|
+
attr_reader :page_size
|
|
48
|
+
|
|
49
|
+
sig { params(page_size: Integer).void }
|
|
50
|
+
attr_writer :page_size
|
|
51
|
+
|
|
52
|
+
# Filter by grant status
|
|
53
|
+
sig do
|
|
54
|
+
returns(
|
|
55
|
+
T.nilable(
|
|
56
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::OrSymbol
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
attr_reader :status
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
params(
|
|
64
|
+
status:
|
|
65
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::OrSymbol
|
|
66
|
+
).void
|
|
67
|
+
end
|
|
68
|
+
attr_writer :status
|
|
69
|
+
|
|
70
|
+
sig do
|
|
71
|
+
params(
|
|
72
|
+
customer_id: String,
|
|
73
|
+
integration_type:
|
|
74
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::OrSymbol,
|
|
75
|
+
page_number: Integer,
|
|
76
|
+
page_size: Integer,
|
|
77
|
+
status:
|
|
78
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::OrSymbol,
|
|
79
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
80
|
+
).returns(T.attached_class)
|
|
81
|
+
end
|
|
82
|
+
def self.new(
|
|
83
|
+
customer_id:,
|
|
84
|
+
# Filter by integration type (e.g. `feature_flag`)
|
|
85
|
+
integration_type: nil,
|
|
86
|
+
# Page number (default 0)
|
|
87
|
+
page_number: nil,
|
|
88
|
+
# Page size (default 10, max 100)
|
|
89
|
+
page_size: nil,
|
|
90
|
+
# Filter by grant status
|
|
91
|
+
status: nil,
|
|
92
|
+
request_options: {}
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
sig do
|
|
97
|
+
override.returns(
|
|
98
|
+
{
|
|
99
|
+
customer_id: String,
|
|
100
|
+
integration_type:
|
|
101
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::OrSymbol,
|
|
102
|
+
page_number: Integer,
|
|
103
|
+
page_size: Integer,
|
|
104
|
+
status:
|
|
105
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::OrSymbol,
|
|
106
|
+
request_options: Dodopayments::RequestOptions
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
def to_hash
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Filter by integration type (e.g. `feature_flag`)
|
|
114
|
+
module IntegrationType
|
|
115
|
+
extend Dodopayments::Internal::Type::Enum
|
|
116
|
+
|
|
117
|
+
TaggedSymbol =
|
|
118
|
+
T.type_alias do
|
|
119
|
+
T.all(
|
|
120
|
+
Symbol,
|
|
121
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
125
|
+
|
|
126
|
+
DISCORD =
|
|
127
|
+
T.let(
|
|
128
|
+
:discord,
|
|
129
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
130
|
+
)
|
|
131
|
+
TELEGRAM =
|
|
132
|
+
T.let(
|
|
133
|
+
:telegram,
|
|
134
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
135
|
+
)
|
|
136
|
+
GITHUB =
|
|
137
|
+
T.let(
|
|
138
|
+
:github,
|
|
139
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
140
|
+
)
|
|
141
|
+
FIGMA =
|
|
142
|
+
T.let(
|
|
143
|
+
:figma,
|
|
144
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
145
|
+
)
|
|
146
|
+
FRAMER =
|
|
147
|
+
T.let(
|
|
148
|
+
:framer,
|
|
149
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
150
|
+
)
|
|
151
|
+
NOTION =
|
|
152
|
+
T.let(
|
|
153
|
+
:notion,
|
|
154
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
155
|
+
)
|
|
156
|
+
DIGITAL_FILES =
|
|
157
|
+
T.let(
|
|
158
|
+
:digital_files,
|
|
159
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
160
|
+
)
|
|
161
|
+
LICENSE_KEY =
|
|
162
|
+
T.let(
|
|
163
|
+
:license_key,
|
|
164
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
165
|
+
)
|
|
166
|
+
FEATURE_FLAG =
|
|
167
|
+
T.let(
|
|
168
|
+
:feature_flag,
|
|
169
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
sig do
|
|
173
|
+
override.returns(
|
|
174
|
+
T::Array[
|
|
175
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::TaggedSymbol
|
|
176
|
+
]
|
|
177
|
+
)
|
|
178
|
+
end
|
|
179
|
+
def self.values
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Filter by grant status
|
|
184
|
+
module Status
|
|
185
|
+
extend Dodopayments::Internal::Type::Enum
|
|
186
|
+
|
|
187
|
+
TaggedSymbol =
|
|
188
|
+
T.type_alias do
|
|
189
|
+
T.all(
|
|
190
|
+
Symbol,
|
|
191
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status
|
|
192
|
+
)
|
|
193
|
+
end
|
|
194
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
195
|
+
|
|
196
|
+
PENDING =
|
|
197
|
+
T.let(
|
|
198
|
+
:Pending,
|
|
199
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::TaggedSymbol
|
|
200
|
+
)
|
|
201
|
+
DELIVERED =
|
|
202
|
+
T.let(
|
|
203
|
+
:Delivered,
|
|
204
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::TaggedSymbol
|
|
205
|
+
)
|
|
206
|
+
FAILED =
|
|
207
|
+
T.let(
|
|
208
|
+
:Failed,
|
|
209
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::TaggedSymbol
|
|
210
|
+
)
|
|
211
|
+
REVOKED =
|
|
212
|
+
T.let(
|
|
213
|
+
:Revoked,
|
|
214
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::TaggedSymbol
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
sig do
|
|
218
|
+
override.returns(
|
|
219
|
+
T::Array[
|
|
220
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::TaggedSymbol
|
|
221
|
+
]
|
|
222
|
+
)
|
|
223
|
+
end
|
|
224
|
+
def self.values
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
@@ -21,7 +21,11 @@ module Dodopayments
|
|
|
21
21
|
attr_accessor :email
|
|
22
22
|
|
|
23
23
|
# Additional metadata for the customer
|
|
24
|
-
sig
|
|
24
|
+
sig do
|
|
25
|
+
returns(
|
|
26
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
27
|
+
)
|
|
28
|
+
end
|
|
25
29
|
attr_accessor :metadata
|
|
26
30
|
|
|
27
31
|
sig { returns(T.nilable(String)) }
|
|
@@ -34,7 +38,8 @@ module Dodopayments
|
|
|
34
38
|
params(
|
|
35
39
|
customer_id: String,
|
|
36
40
|
email: T.nilable(String),
|
|
37
|
-
metadata:
|
|
41
|
+
metadata:
|
|
42
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
38
43
|
name: T.nilable(String),
|
|
39
44
|
phone_number: T.nilable(String),
|
|
40
45
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
@@ -56,7 +61,8 @@ module Dodopayments
|
|
|
56
61
|
{
|
|
57
62
|
customer_id: String,
|
|
58
63
|
email: T.nilable(String),
|
|
59
|
-
metadata:
|
|
64
|
+
metadata:
|
|
65
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
60
66
|
name: T.nilable(String),
|
|
61
67
|
phone_number: T.nilable(String),
|
|
62
68
|
request_options: Dodopayments::RequestOptions
|
|
@@ -28,7 +28,8 @@ module Dodopayments
|
|
|
28
28
|
sig { returns(String) }
|
|
29
29
|
attr_accessor :discount_id
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
32
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
32
33
|
attr_accessor :metadata
|
|
33
34
|
|
|
34
35
|
# Whether this discount should be preserved when a subscription changes plans.
|
|
@@ -73,7 +74,7 @@ module Dodopayments
|
|
|
73
74
|
code: String,
|
|
74
75
|
created_at: Time,
|
|
75
76
|
discount_id: String,
|
|
76
|
-
metadata: T::Hash[Symbol,
|
|
77
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
77
78
|
preserve_on_plan_change: T::Boolean,
|
|
78
79
|
restricted_to: T::Array[String],
|
|
79
80
|
times_used: Integer,
|
|
@@ -95,6 +96,7 @@ module Dodopayments
|
|
|
95
96
|
created_at:,
|
|
96
97
|
# The unique discount ID
|
|
97
98
|
discount_id:,
|
|
99
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
98
100
|
metadata:,
|
|
99
101
|
# Whether this discount should be preserved when a subscription changes plans.
|
|
100
102
|
# Default: false (discount is removed on plan change)
|
|
@@ -126,7 +128,7 @@ module Dodopayments
|
|
|
126
128
|
code: String,
|
|
127
129
|
created_at: Time,
|
|
128
130
|
discount_id: String,
|
|
129
|
-
metadata: T::Hash[Symbol,
|
|
131
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
130
132
|
preserve_on_plan_change: T::Boolean,
|
|
131
133
|
restricted_to: T::Array[String],
|
|
132
134
|
times_used: Integer,
|
|
@@ -37,10 +37,18 @@ module Dodopayments
|
|
|
37
37
|
attr_accessor :expires_at
|
|
38
38
|
|
|
39
39
|
# Additional metadata for the discount
|
|
40
|
-
sig
|
|
40
|
+
sig do
|
|
41
|
+
returns(
|
|
42
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
43
|
+
)
|
|
44
|
+
end
|
|
41
45
|
attr_reader :metadata
|
|
42
46
|
|
|
43
|
-
sig
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants]
|
|
50
|
+
).void
|
|
51
|
+
end
|
|
44
52
|
attr_writer :metadata
|
|
45
53
|
|
|
46
54
|
sig { returns(T.nilable(String)) }
|
|
@@ -74,7 +82,7 @@ module Dodopayments
|
|
|
74
82
|
type: Dodopayments::DiscountType::OrSymbol,
|
|
75
83
|
code: T.nilable(String),
|
|
76
84
|
expires_at: T.nilable(Time),
|
|
77
|
-
metadata: T::Hash[Symbol,
|
|
85
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
78
86
|
name: T.nilable(String),
|
|
79
87
|
preserve_on_plan_change: T::Boolean,
|
|
80
88
|
restricted_to: T.nilable(T::Array[String]),
|
|
@@ -123,7 +131,7 @@ module Dodopayments
|
|
|
123
131
|
type: Dodopayments::DiscountType::OrSymbol,
|
|
124
132
|
code: T.nilable(String),
|
|
125
133
|
expires_at: T.nilable(Time),
|
|
126
|
-
metadata: T::Hash[Symbol,
|
|
134
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
127
135
|
name: T.nilable(String),
|
|
128
136
|
preserve_on_plan_change: T::Boolean,
|
|
129
137
|
restricted_to: T.nilable(T::Array[String]),
|
|
@@ -29,7 +29,7 @@ module Dodopayments
|
|
|
29
29
|
attr_accessor :discount_id
|
|
30
30
|
|
|
31
31
|
# Additional metadata
|
|
32
|
-
sig { returns(T::Hash[Symbol,
|
|
32
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
33
33
|
attr_accessor :metadata
|
|
34
34
|
|
|
35
35
|
# Position of this discount in the stack (0-based)
|
|
@@ -82,7 +82,7 @@ module Dodopayments
|
|
|
82
82
|
code: String,
|
|
83
83
|
created_at: Time,
|
|
84
84
|
discount_id: String,
|
|
85
|
-
metadata: T::Hash[Symbol,
|
|
85
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
86
86
|
position: Integer,
|
|
87
87
|
preserve_on_plan_change: T::Boolean,
|
|
88
88
|
restricted_to: T::Array[String],
|
|
@@ -140,7 +140,7 @@ module Dodopayments
|
|
|
140
140
|
code: String,
|
|
141
141
|
created_at: Time,
|
|
142
142
|
discount_id: String,
|
|
143
|
-
metadata: T::Hash[Symbol,
|
|
143
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
144
144
|
position: Integer,
|
|
145
145
|
preserve_on_plan_change: T::Boolean,
|
|
146
146
|
restricted_to: T::Array[String],
|
|
@@ -32,7 +32,11 @@ module Dodopayments
|
|
|
32
32
|
attr_accessor :expires_at
|
|
33
33
|
|
|
34
34
|
# Additional metadata for the discount
|
|
35
|
-
sig
|
|
35
|
+
sig do
|
|
36
|
+
returns(
|
|
37
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
38
|
+
)
|
|
39
|
+
end
|
|
36
40
|
attr_accessor :metadata
|
|
37
41
|
|
|
38
42
|
sig { returns(T.nilable(String)) }
|
|
@@ -67,7 +71,8 @@ module Dodopayments
|
|
|
67
71
|
amount: T.nilable(Integer),
|
|
68
72
|
code: T.nilable(String),
|
|
69
73
|
expires_at: T.nilable(Time),
|
|
70
|
-
metadata:
|
|
74
|
+
metadata:
|
|
75
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
71
76
|
name: T.nilable(String),
|
|
72
77
|
preserve_on_plan_change: T.nilable(T::Boolean),
|
|
73
78
|
restricted_to: T.nilable(T::Array[String]),
|
|
@@ -114,7 +119,8 @@ module Dodopayments
|
|
|
114
119
|
amount: T.nilable(Integer),
|
|
115
120
|
code: T.nilable(String),
|
|
116
121
|
expires_at: T.nilable(Time),
|
|
117
|
-
metadata:
|
|
122
|
+
metadata:
|
|
123
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
118
124
|
name: T.nilable(String),
|
|
119
125
|
preserve_on_plan_change: T.nilable(T::Boolean),
|
|
120
126
|
restricted_to: T.nilable(T::Array[String]),
|
|
@@ -35,7 +35,7 @@ module Dodopayments
|
|
|
35
35
|
attr_accessor :is_active
|
|
36
36
|
|
|
37
37
|
# Arbitrary key-value metadata supplied at creation or via PATCH.
|
|
38
|
-
sig { returns(T::Hash[Symbol,
|
|
38
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
39
39
|
attr_accessor :metadata
|
|
40
40
|
|
|
41
41
|
# Display name supplied at creation.
|
|
@@ -59,6 +59,7 @@ module Dodopayments
|
|
|
59
59
|
created_at: Time,
|
|
60
60
|
integration_config:
|
|
61
61
|
T.any(
|
|
62
|
+
Dodopayments::IntegrationConfigResponse::FeatureFlagConfig::OrHash,
|
|
62
63
|
Dodopayments::IntegrationConfigResponse::GitHubConfig::OrHash,
|
|
63
64
|
Dodopayments::IntegrationConfigResponse::DiscordConfig::OrHash,
|
|
64
65
|
Dodopayments::IntegrationConfigResponse::TelegramConfig::OrHash,
|
|
@@ -70,7 +71,7 @@ module Dodopayments
|
|
|
70
71
|
),
|
|
71
72
|
integration_type: Dodopayments::EntitlementIntegrationType::OrSymbol,
|
|
72
73
|
is_active: T::Boolean,
|
|
73
|
-
metadata: T::Hash[Symbol,
|
|
74
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
74
75
|
name: String,
|
|
75
76
|
updated_at: Time,
|
|
76
77
|
description: T.nilable(String)
|
|
@@ -113,7 +114,7 @@ module Dodopayments
|
|
|
113
114
|
integration_type:
|
|
114
115
|
Dodopayments::EntitlementIntegrationType::TaggedSymbol,
|
|
115
116
|
is_active: T::Boolean,
|
|
116
|
-
metadata: T::Hash[Symbol,
|
|
117
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
117
118
|
name: String,
|
|
118
119
|
updated_at: Time,
|
|
119
120
|
description: T.nilable(String)
|
|
@@ -18,6 +18,7 @@ module Dodopayments
|
|
|
18
18
|
sig do
|
|
19
19
|
returns(
|
|
20
20
|
T.any(
|
|
21
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig,
|
|
21
22
|
Dodopayments::IntegrationConfig::GitHubConfig,
|
|
22
23
|
Dodopayments::IntegrationConfig::DiscordConfig,
|
|
23
24
|
Dodopayments::IntegrationConfig::TelegramConfig,
|
|
@@ -44,16 +45,25 @@ module Dodopayments
|
|
|
44
45
|
attr_accessor :description
|
|
45
46
|
|
|
46
47
|
# Additional metadata for the entitlement
|
|
47
|
-
sig
|
|
48
|
+
sig do
|
|
49
|
+
returns(
|
|
50
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
51
|
+
)
|
|
52
|
+
end
|
|
48
53
|
attr_reader :metadata
|
|
49
54
|
|
|
50
|
-
sig
|
|
55
|
+
sig do
|
|
56
|
+
params(
|
|
57
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants]
|
|
58
|
+
).void
|
|
59
|
+
end
|
|
51
60
|
attr_writer :metadata
|
|
52
61
|
|
|
53
62
|
sig do
|
|
54
63
|
params(
|
|
55
64
|
integration_config:
|
|
56
65
|
T.any(
|
|
66
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig::OrHash,
|
|
57
67
|
Dodopayments::IntegrationConfig::GitHubConfig::OrHash,
|
|
58
68
|
Dodopayments::IntegrationConfig::DiscordConfig::OrHash,
|
|
59
69
|
Dodopayments::IntegrationConfig::TelegramConfig::OrHash,
|
|
@@ -66,7 +76,7 @@ module Dodopayments
|
|
|
66
76
|
integration_type: Dodopayments::EntitlementIntegrationType::OrSymbol,
|
|
67
77
|
name: String,
|
|
68
78
|
description: T.nilable(String),
|
|
69
|
-
metadata: T::Hash[Symbol,
|
|
79
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
70
80
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
71
81
|
).returns(T.attached_class)
|
|
72
82
|
end
|
|
@@ -90,6 +100,7 @@ module Dodopayments
|
|
|
90
100
|
{
|
|
91
101
|
integration_config:
|
|
92
102
|
T.any(
|
|
103
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig,
|
|
93
104
|
Dodopayments::IntegrationConfig::GitHubConfig,
|
|
94
105
|
Dodopayments::IntegrationConfig::DiscordConfig,
|
|
95
106
|
Dodopayments::IntegrationConfig::TelegramConfig,
|
|
@@ -103,7 +114,7 @@ module Dodopayments
|
|
|
103
114
|
Dodopayments::EntitlementIntegrationType::OrSymbol,
|
|
104
115
|
name: String,
|
|
105
116
|
description: T.nilable(String),
|
|
106
|
-
metadata: T::Hash[Symbol,
|
|
117
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
107
118
|
request_options: Dodopayments::RequestOptions
|
|
108
119
|
}
|
|
109
120
|
)
|
|
@@ -130,6 +130,11 @@ module Dodopayments
|
|
|
130
130
|
:license_key,
|
|
131
131
|
Dodopayments::EntitlementListParams::IntegrationType::TaggedSymbol
|
|
132
132
|
)
|
|
133
|
+
FEATURE_FLAG =
|
|
134
|
+
T.let(
|
|
135
|
+
:feature_flag,
|
|
136
|
+
Dodopayments::EntitlementListParams::IntegrationType::TaggedSymbol
|
|
137
|
+
)
|
|
133
138
|
|
|
134
139
|
sig do
|
|
135
140
|
override.returns(
|
|
@@ -22,10 +22,15 @@ module Dodopayments
|
|
|
22
22
|
|
|
23
23
|
# Integration-specific configuration supplied when creating or updating an
|
|
24
24
|
# entitlement. The shape required matches the entitlement's `integration_type`.
|
|
25
|
+
#
|
|
26
|
+
# Untagged enum: variants are matched in order. `FeatureFlag` must precede
|
|
27
|
+
# `LicenseKey`, whose fields are all optional and would otherwise match a
|
|
28
|
+
# `feature_flag` config.
|
|
25
29
|
sig do
|
|
26
30
|
returns(
|
|
27
31
|
T.nilable(
|
|
28
32
|
T.any(
|
|
33
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig,
|
|
29
34
|
Dodopayments::IntegrationConfig::GitHubConfig,
|
|
30
35
|
Dodopayments::IntegrationConfig::DiscordConfig,
|
|
31
36
|
Dodopayments::IntegrationConfig::TelegramConfig,
|
|
@@ -40,7 +45,12 @@ module Dodopayments
|
|
|
40
45
|
end
|
|
41
46
|
attr_accessor :integration_config
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
49
|
+
sig do
|
|
50
|
+
returns(
|
|
51
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
52
|
+
)
|
|
53
|
+
end
|
|
44
54
|
attr_accessor :metadata
|
|
45
55
|
|
|
46
56
|
sig { returns(T.nilable(String)) }
|
|
@@ -53,6 +63,7 @@ module Dodopayments
|
|
|
53
63
|
integration_config:
|
|
54
64
|
T.nilable(
|
|
55
65
|
T.any(
|
|
66
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig::OrHash,
|
|
56
67
|
Dodopayments::IntegrationConfig::GitHubConfig::OrHash,
|
|
57
68
|
Dodopayments::IntegrationConfig::DiscordConfig::OrHash,
|
|
58
69
|
Dodopayments::IntegrationConfig::TelegramConfig::OrHash,
|
|
@@ -63,7 +74,8 @@ module Dodopayments
|
|
|
63
74
|
Dodopayments::IntegrationConfig::LicenseKeyConfig::OrHash
|
|
64
75
|
)
|
|
65
76
|
),
|
|
66
|
-
metadata:
|
|
77
|
+
metadata:
|
|
78
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
67
79
|
name: T.nilable(String),
|
|
68
80
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
69
81
|
).returns(T.attached_class)
|
|
@@ -73,7 +85,12 @@ module Dodopayments
|
|
|
73
85
|
description: nil,
|
|
74
86
|
# Integration-specific configuration supplied when creating or updating an
|
|
75
87
|
# entitlement. The shape required matches the entitlement's `integration_type`.
|
|
88
|
+
#
|
|
89
|
+
# Untagged enum: variants are matched in order. `FeatureFlag` must precede
|
|
90
|
+
# `LicenseKey`, whose fields are all optional and would otherwise match a
|
|
91
|
+
# `feature_flag` config.
|
|
76
92
|
integration_config: nil,
|
|
93
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
77
94
|
metadata: nil,
|
|
78
95
|
name: nil,
|
|
79
96
|
request_options: {}
|
|
@@ -88,6 +105,7 @@ module Dodopayments
|
|
|
88
105
|
integration_config:
|
|
89
106
|
T.nilable(
|
|
90
107
|
T.any(
|
|
108
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig,
|
|
91
109
|
Dodopayments::IntegrationConfig::GitHubConfig,
|
|
92
110
|
Dodopayments::IntegrationConfig::DiscordConfig,
|
|
93
111
|
Dodopayments::IntegrationConfig::TelegramConfig,
|
|
@@ -98,7 +116,8 @@ module Dodopayments
|
|
|
98
116
|
Dodopayments::IntegrationConfig::LicenseKeyConfig
|
|
99
117
|
)
|
|
100
118
|
),
|
|
101
|
-
metadata:
|
|
119
|
+
metadata:
|
|
120
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
102
121
|
name: T.nilable(String),
|
|
103
122
|
request_options: Dodopayments::RequestOptions
|
|
104
123
|
}
|