dodopayments 2.10.0 → 2.11.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +9 -9
- data/lib/dodopayments/client.rb +4 -0
- data/lib/dodopayments/models/checkout_session_flags.rb +15 -1
- data/lib/dodopayments/models/checkout_session_request.rb +11 -1
- data/lib/dodopayments/models/checkout_session_response.rb +33 -1
- data/lib/dodopayments/models/discount_detail.rb +143 -0
- data/lib/dodopayments/models/filter_type.rb +71 -0
- data/lib/dodopayments/models/github_permission.rb +19 -0
- data/lib/dodopayments/models/integration_config.rb +3 -19
- data/lib/dodopayments/models/integration_config_response.rb +3 -19
- data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +22 -0
- data/lib/dodopayments/models/meter_filter.rb +3 -331
- data/lib/dodopayments/models/payment.rb +3 -141
- data/lib/dodopayments/models/payment_create_params.rb +11 -1
- data/lib/dodopayments/models/payment_method_types.rb +1 -0
- data/lib/dodopayments/models/product_collection.rb +74 -0
- data/lib/dodopayments/models/product_collection_create_params.rb +47 -0
- data/lib/dodopayments/models/product_collection_delete_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_list_params.rb +46 -0
- data/lib/dodopayments/models/product_collection_list_response.rb +65 -0
- data/lib/dodopayments/models/product_collection_retrieve_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_unarchive_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_unarchive_response.rb +33 -0
- data/lib/dodopayments/models/product_collection_update_images_params.rb +29 -0
- data/lib/dodopayments/models/product_collection_update_images_response.rb +25 -0
- data/lib/dodopayments/models/product_collection_update_params.rb +61 -0
- data/lib/dodopayments/models/product_collections/group_create_params.rb +22 -0
- data/lib/dodopayments/models/product_collections/group_delete_params.rb +28 -0
- data/lib/dodopayments/models/product_collections/group_product.rb +26 -0
- data/lib/dodopayments/models/product_collections/group_update_params.rb +59 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +41 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +15 -0
- data/lib/dodopayments/models/product_collections/groups/item_delete_params.rb +36 -0
- data/lib/dodopayments/models/product_collections/groups/item_update_params.rb +47 -0
- data/lib/dodopayments/models/product_collections/groups/product_collection_product.rb +132 -0
- data/lib/dodopayments/models/product_collections/product_collection_group_details.rb +42 -0
- data/lib/dodopayments/models/product_collections/product_collection_group_response.rb +39 -0
- data/lib/dodopayments/models/subscription.rb +13 -142
- data/lib/dodopayments/models/subscription_create_params.rb +11 -1
- data/lib/dodopayments/models/subscription_list_response.rb +10 -1
- data/lib/dodopayments/models/subscription_update_params.rb +12 -1
- data/lib/dodopayments/models/subscription_update_payment_method_params.rb +9 -9
- data/lib/dodopayments/models/webhook_event_type.rb +1 -5
- data/lib/dodopayments/models.rb +24 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
- data/lib/dodopayments/resources/invoices/payments.rb +18 -0
- data/lib/dodopayments/resources/payments.rb +3 -1
- data/lib/dodopayments/resources/product_collections/groups/items.rb +111 -0
- data/lib/dodopayments/resources/product_collections/groups.rb +109 -0
- data/lib/dodopayments/resources/product_collections.rb +179 -0
- data/lib/dodopayments/resources/subscriptions.rb +9 -5
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +29 -0
- data/rbi/dodopayments/client.rbi +3 -0
- data/rbi/dodopayments/models/checkout_session_flags.rbi +23 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +12 -0
- data/rbi/dodopayments/models/checkout_session_response.rbi +43 -5
- data/rbi/dodopayments/models/discount_detail.rbi +161 -0
- data/rbi/dodopayments/models/filter_type.rbi +112 -0
- data/rbi/dodopayments/models/github_permission.rbi +26 -0
- data/rbi/dodopayments/models/integration_config.rbi +3 -59
- data/rbi/dodopayments/models/integration_config_response.rbi +3 -59
- data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
- data/rbi/dodopayments/models/meter_filter.rbi +3 -572
- data/rbi/dodopayments/models/payment.rbi +3 -163
- data/rbi/dodopayments/models/payment_create_params.rbi +12 -0
- data/rbi/dodopayments/models/payment_method_types.rbi +1 -0
- data/rbi/dodopayments/models/product_collection.rbi +108 -0
- data/rbi/dodopayments/models/product_collection_create_params.rbi +82 -0
- data/rbi/dodopayments/models/product_collection_delete_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_list_params.rbi +82 -0
- data/rbi/dodopayments/models/product_collection_list_response.rbi +88 -0
- data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +56 -0
- data/rbi/dodopayments/models/product_collection_update_images_params.rbi +52 -0
- data/rbi/dodopayments/models/product_collection_update_images_response.rbi +40 -0
- data/rbi/dodopayments/models/product_collection_update_params.rbi +84 -0
- data/rbi/dodopayments/models/product_collections/group_create_params.rbi +40 -0
- data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
- data/rbi/dodopayments/models/product_collections/group_product.rbi +46 -0
- data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +68 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +17 -0
- data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +55 -0
- data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +68 -0
- data/rbi/dodopayments/models/product_collections/groups/product_collection_product.rbi +148 -0
- data/rbi/dodopayments/models/product_collections/product_collection_group_details.rbi +67 -0
- data/rbi/dodopayments/models/product_collections/product_collection_group_response.rbi +68 -0
- data/rbi/dodopayments/models/subscription.rbi +13 -164
- data/rbi/dodopayments/models/subscription_create_params.rbi +12 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +10 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +14 -0
- data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +16 -16
- data/rbi/dodopayments/models/webhook_event_type.rbi +4 -18
- data/rbi/dodopayments/models.rbi +31 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +10 -0
- data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
- data/rbi/dodopayments/resources/payments.rbi +5 -0
- data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
- data/rbi/dodopayments/resources/product_collections/groups.rbi +88 -0
- data/rbi/dodopayments/resources/product_collections.rbi +149 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +15 -4
- data/sig/dodopayments/client.rbs +2 -0
- data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
- data/sig/dodopayments/models/checkout_session_response.rbs +27 -3
- data/sig/dodopayments/models/discount_detail.rbs +95 -0
- data/sig/dodopayments/models/filter_type.rbs +52 -0
- data/sig/dodopayments/models/github_permission.rbs +17 -0
- data/sig/dodopayments/models/integration_config.rbs +4 -18
- data/sig/dodopayments/models/integration_config_response.rbs +4 -18
- data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
- data/sig/dodopayments/models/meter_filter.rbs +4 -252
- data/sig/dodopayments/models/payment.rbs +4 -96
- data/sig/dodopayments/models/payment_create_params.rbs +5 -0
- data/sig/dodopayments/models/payment_method_types.rbs +2 -0
- data/sig/dodopayments/models/product_collection.rbs +55 -0
- data/sig/dodopayments/models/product_collection_create_params.rbs +41 -0
- data/sig/dodopayments/models/product_collection_delete_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_list_params.rbs +49 -0
- data/sig/dodopayments/models/product_collection_list_response.rbs +50 -0
- data/sig/dodopayments/models/product_collection_retrieve_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_unarchive_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_unarchive_response.rbs +30 -0
- data/sig/dodopayments/models/product_collection_update_images_params.rbs +28 -0
- data/sig/dodopayments/models/product_collection_update_images_response.rbs +16 -0
- data/sig/dodopayments/models/product_collection_update_params.rbs +51 -0
- data/sig/dodopayments/models/product_collections/group_create_params.rbs +27 -0
- data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
- data/sig/dodopayments/models/product_collections/group_product.rbs +17 -0
- data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +40 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +12 -0
- data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +36 -0
- data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +40 -0
- data/sig/dodopayments/models/product_collections/groups/product_collection_product.rbs +99 -0
- data/sig/dodopayments/models/product_collections/product_collection_group_details.rbs +34 -0
- data/sig/dodopayments/models/product_collections/product_collection_group_response.rbs +39 -0
- data/sig/dodopayments/models/subscription.rbs +9 -96
- data/sig/dodopayments/models/subscription_create_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +9 -9
- data/sig/dodopayments/models/webhook_event_type.rbs +2 -10
- data/sig/dodopayments/models.rbs +24 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
- data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
- data/sig/dodopayments/resources/payments.rbs +1 -0
- data/sig/dodopayments/resources/product_collections/groups/items.rbs +33 -0
- data/sig/dodopayments/resources/product_collections/groups.rbs +34 -0
- data/sig/dodopayments/resources/product_collections.rbs +56 -0
- data/sig/dodopayments/resources/subscriptions.rbs +3 -1
- metadata +89 -2
|
@@ -71,6 +71,12 @@ module Dodopayments
|
|
|
71
71
|
end
|
|
72
72
|
attr_accessor :customer
|
|
73
73
|
|
|
74
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
75
|
+
# together with a valid tax id for a B2B purchase, this name is rendered on the
|
|
76
|
+
# invoice instead of the customer's personal name.
|
|
77
|
+
sig { returns(T.nilable(String)) }
|
|
78
|
+
attr_accessor :customer_business_name
|
|
79
|
+
|
|
74
80
|
# Customization for the checkout session page
|
|
75
81
|
sig { returns(T.nilable(Dodopayments::CheckoutSessionCustomization)) }
|
|
76
82
|
attr_reader :customization
|
|
@@ -186,6 +192,7 @@ module Dodopayments
|
|
|
186
192
|
Dodopayments::NewCustomer::OrHash
|
|
187
193
|
)
|
|
188
194
|
),
|
|
195
|
+
customer_business_name: T.nilable(String),
|
|
189
196
|
customization: Dodopayments::CheckoutSessionCustomization::OrHash,
|
|
190
197
|
discount_code: T.nilable(String),
|
|
191
198
|
discount_codes: T.nilable(T::Array[String]),
|
|
@@ -226,6 +233,10 @@ module Dodopayments
|
|
|
226
233
|
custom_fields: nil,
|
|
227
234
|
# Customer details for the session
|
|
228
235
|
customer: nil,
|
|
236
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
237
|
+
# together with a valid tax id for a B2B purchase, this name is rendered on the
|
|
238
|
+
# invoice instead of the customer's personal name.
|
|
239
|
+
customer_business_name: nil,
|
|
229
240
|
# Customization for the checkout session page
|
|
230
241
|
customization: nil,
|
|
231
242
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
@@ -287,6 +298,7 @@ module Dodopayments
|
|
|
287
298
|
Dodopayments::NewCustomer
|
|
288
299
|
)
|
|
289
300
|
),
|
|
301
|
+
customer_business_name: T.nilable(String),
|
|
290
302
|
customization: Dodopayments::CheckoutSessionCustomization,
|
|
291
303
|
discount_code: T.nilable(String),
|
|
292
304
|
discount_codes: T.nilable(T::Array[String]),
|
|
@@ -19,22 +19,60 @@ module Dodopayments
|
|
|
19
19
|
sig { returns(T.nilable(String)) }
|
|
20
20
|
attr_accessor :checkout_url
|
|
21
21
|
|
|
22
|
+
# Client secret used to load the Dodo Payments checkout SDK. Returned when
|
|
23
|
+
# `confirm: true` was passed and a PaymentIntent was created at session-creation
|
|
24
|
+
# time. `None` otherwise.
|
|
25
|
+
sig { returns(T.nilable(String)) }
|
|
26
|
+
attr_accessor :client_secret
|
|
27
|
+
|
|
28
|
+
# Underlying payment id when `confirm: true` was passed and a PaymentIntent was
|
|
29
|
+
# created at session-creation time. `None` otherwise.
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
attr_accessor :payment_id
|
|
32
|
+
|
|
33
|
+
# Publishable key for the Dodo Payments checkout SDK. Returned when
|
|
34
|
+
# `confirm: true` was passed and a PaymentIntent was created at session-creation
|
|
35
|
+
# time. `None` otherwise.
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
attr_accessor :publishable_key
|
|
38
|
+
|
|
22
39
|
sig do
|
|
23
|
-
params(
|
|
24
|
-
|
|
25
|
-
|
|
40
|
+
params(
|
|
41
|
+
session_id: String,
|
|
42
|
+
checkout_url: T.nilable(String),
|
|
43
|
+
client_secret: T.nilable(String),
|
|
44
|
+
payment_id: T.nilable(String),
|
|
45
|
+
publishable_key: T.nilable(String)
|
|
46
|
+
).returns(T.attached_class)
|
|
26
47
|
end
|
|
27
48
|
def self.new(
|
|
28
49
|
# The ID of the created checkout session
|
|
29
50
|
session_id:,
|
|
30
51
|
# Checkout url (None when payment_method_id is provided)
|
|
31
|
-
checkout_url: nil
|
|
52
|
+
checkout_url: nil,
|
|
53
|
+
# Client secret used to load the Dodo Payments checkout SDK. Returned when
|
|
54
|
+
# `confirm: true` was passed and a PaymentIntent was created at session-creation
|
|
55
|
+
# time. `None` otherwise.
|
|
56
|
+
client_secret: nil,
|
|
57
|
+
# Underlying payment id when `confirm: true` was passed and a PaymentIntent was
|
|
58
|
+
# created at session-creation time. `None` otherwise.
|
|
59
|
+
payment_id: nil,
|
|
60
|
+
# Publishable key for the Dodo Payments checkout SDK. Returned when
|
|
61
|
+
# `confirm: true` was passed and a PaymentIntent was created at session-creation
|
|
62
|
+
# time. `None` otherwise.
|
|
63
|
+
publishable_key: nil
|
|
32
64
|
)
|
|
33
65
|
end
|
|
34
66
|
|
|
35
67
|
sig do
|
|
36
68
|
override.returns(
|
|
37
|
-
{
|
|
69
|
+
{
|
|
70
|
+
session_id: String,
|
|
71
|
+
checkout_url: T.nilable(String),
|
|
72
|
+
client_secret: T.nilable(String),
|
|
73
|
+
payment_id: T.nilable(String),
|
|
74
|
+
publishable_key: T.nilable(String)
|
|
75
|
+
}
|
|
38
76
|
)
|
|
39
77
|
end
|
|
40
78
|
def to_hash
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class DiscountDetail < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Dodopayments::DiscountDetail, Dodopayments::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The discount amount (basis points for percentage, USD cents for flat)
|
|
12
|
+
sig { returns(Integer) }
|
|
13
|
+
attr_accessor :amount
|
|
14
|
+
|
|
15
|
+
# The business this discount belongs to
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :business_id
|
|
18
|
+
|
|
19
|
+
# The discount code
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :code
|
|
22
|
+
|
|
23
|
+
# Timestamp when the discount was created
|
|
24
|
+
sig { returns(Time) }
|
|
25
|
+
attr_accessor :created_at
|
|
26
|
+
|
|
27
|
+
# The unique discount ID
|
|
28
|
+
sig { returns(String) }
|
|
29
|
+
attr_accessor :discount_id
|
|
30
|
+
|
|
31
|
+
# Additional metadata
|
|
32
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
33
|
+
attr_accessor :metadata
|
|
34
|
+
|
|
35
|
+
# Position of this discount in the stack (0-based)
|
|
36
|
+
sig { returns(Integer) }
|
|
37
|
+
attr_accessor :position
|
|
38
|
+
|
|
39
|
+
# Whether this discount should be preserved when a subscription changes plans
|
|
40
|
+
sig { returns(T::Boolean) }
|
|
41
|
+
attr_accessor :preserve_on_plan_change
|
|
42
|
+
|
|
43
|
+
# List of product IDs to which this discount is restricted
|
|
44
|
+
sig { returns(T::Array[String]) }
|
|
45
|
+
attr_accessor :restricted_to
|
|
46
|
+
|
|
47
|
+
# How many times this discount has been used
|
|
48
|
+
sig { returns(Integer) }
|
|
49
|
+
attr_accessor :times_used
|
|
50
|
+
|
|
51
|
+
# The type of discount
|
|
52
|
+
sig { returns(Dodopayments::DiscountType::TaggedSymbol) }
|
|
53
|
+
attr_accessor :type
|
|
54
|
+
|
|
55
|
+
# Remaining billing cycles for this discount on this subscription (None for
|
|
56
|
+
# one-time payments)
|
|
57
|
+
sig { returns(T.nilable(Integer)) }
|
|
58
|
+
attr_accessor :cycles_remaining
|
|
59
|
+
|
|
60
|
+
# Optional date/time after which discount is expired
|
|
61
|
+
sig { returns(T.nilable(Time)) }
|
|
62
|
+
attr_accessor :expires_at
|
|
63
|
+
|
|
64
|
+
# Name for the Discount
|
|
65
|
+
sig { returns(T.nilable(String)) }
|
|
66
|
+
attr_accessor :name
|
|
67
|
+
|
|
68
|
+
# Number of subscription billing cycles this discount is valid for
|
|
69
|
+
sig { returns(T.nilable(Integer)) }
|
|
70
|
+
attr_accessor :subscription_cycles
|
|
71
|
+
|
|
72
|
+
# Usage limit for this discount, if any
|
|
73
|
+
sig { returns(T.nilable(Integer)) }
|
|
74
|
+
attr_accessor :usage_limit
|
|
75
|
+
|
|
76
|
+
# Response struct for a discount with its position in a stack and optional
|
|
77
|
+
# cycle-tracking information (for subscriptions).
|
|
78
|
+
sig do
|
|
79
|
+
params(
|
|
80
|
+
amount: Integer,
|
|
81
|
+
business_id: String,
|
|
82
|
+
code: String,
|
|
83
|
+
created_at: Time,
|
|
84
|
+
discount_id: String,
|
|
85
|
+
metadata: T::Hash[Symbol, String],
|
|
86
|
+
position: Integer,
|
|
87
|
+
preserve_on_plan_change: T::Boolean,
|
|
88
|
+
restricted_to: T::Array[String],
|
|
89
|
+
times_used: Integer,
|
|
90
|
+
type: Dodopayments::DiscountType::OrSymbol,
|
|
91
|
+
cycles_remaining: T.nilable(Integer),
|
|
92
|
+
expires_at: T.nilable(Time),
|
|
93
|
+
name: T.nilable(String),
|
|
94
|
+
subscription_cycles: T.nilable(Integer),
|
|
95
|
+
usage_limit: T.nilable(Integer)
|
|
96
|
+
).returns(T.attached_class)
|
|
97
|
+
end
|
|
98
|
+
def self.new(
|
|
99
|
+
# The discount amount (basis points for percentage, USD cents for flat)
|
|
100
|
+
amount:,
|
|
101
|
+
# The business this discount belongs to
|
|
102
|
+
business_id:,
|
|
103
|
+
# The discount code
|
|
104
|
+
code:,
|
|
105
|
+
# Timestamp when the discount was created
|
|
106
|
+
created_at:,
|
|
107
|
+
# The unique discount ID
|
|
108
|
+
discount_id:,
|
|
109
|
+
# Additional metadata
|
|
110
|
+
metadata:,
|
|
111
|
+
# Position of this discount in the stack (0-based)
|
|
112
|
+
position:,
|
|
113
|
+
# Whether this discount should be preserved when a subscription changes plans
|
|
114
|
+
preserve_on_plan_change:,
|
|
115
|
+
# List of product IDs to which this discount is restricted
|
|
116
|
+
restricted_to:,
|
|
117
|
+
# How many times this discount has been used
|
|
118
|
+
times_used:,
|
|
119
|
+
# The type of discount
|
|
120
|
+
type:,
|
|
121
|
+
# Remaining billing cycles for this discount on this subscription (None for
|
|
122
|
+
# one-time payments)
|
|
123
|
+
cycles_remaining: nil,
|
|
124
|
+
# Optional date/time after which discount is expired
|
|
125
|
+
expires_at: nil,
|
|
126
|
+
# Name for the Discount
|
|
127
|
+
name: nil,
|
|
128
|
+
# Number of subscription billing cycles this discount is valid for
|
|
129
|
+
subscription_cycles: nil,
|
|
130
|
+
# Usage limit for this discount, if any
|
|
131
|
+
usage_limit: nil
|
|
132
|
+
)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
sig do
|
|
136
|
+
override.returns(
|
|
137
|
+
{
|
|
138
|
+
amount: Integer,
|
|
139
|
+
business_id: String,
|
|
140
|
+
code: String,
|
|
141
|
+
created_at: Time,
|
|
142
|
+
discount_id: String,
|
|
143
|
+
metadata: T::Hash[Symbol, String],
|
|
144
|
+
position: Integer,
|
|
145
|
+
preserve_on_plan_change: T::Boolean,
|
|
146
|
+
restricted_to: T::Array[String],
|
|
147
|
+
times_used: Integer,
|
|
148
|
+
type: Dodopayments::DiscountType::TaggedSymbol,
|
|
149
|
+
cycles_remaining: T.nilable(Integer),
|
|
150
|
+
expires_at: T.nilable(Time),
|
|
151
|
+
name: T.nilable(String),
|
|
152
|
+
subscription_cycles: T.nilable(Integer),
|
|
153
|
+
usage_limit: T.nilable(Integer)
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
end
|
|
157
|
+
def to_hash
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# Filter clauses — either a flat list of `MeterFilterCondition`s or a list of
|
|
6
|
+
# nested `MeterFilter`s. Up to 3 levels of nesting are accepted; the limit is
|
|
7
|
+
# enforced at runtime.
|
|
8
|
+
module FilterType
|
|
9
|
+
extend Dodopayments::Internal::Type::Union
|
|
10
|
+
|
|
11
|
+
Variants =
|
|
12
|
+
T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
T::Array[Dodopayments::FilterType::MeterFilterConditionList],
|
|
15
|
+
T::Array[Dodopayments::MeterFilter]
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class MeterFilterConditionList < Dodopayments::Internal::Type::BaseModel
|
|
20
|
+
OrHash =
|
|
21
|
+
T.type_alias do
|
|
22
|
+
T.any(
|
|
23
|
+
Dodopayments::FilterType::MeterFilterConditionList,
|
|
24
|
+
Dodopayments::Internal::AnyHash
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Filter key to apply
|
|
29
|
+
sig { returns(String) }
|
|
30
|
+
attr_accessor :key
|
|
31
|
+
|
|
32
|
+
# Filter operator
|
|
33
|
+
sig { returns(Dodopayments::FilterOperator::OrSymbol) }
|
|
34
|
+
attr_accessor :operator
|
|
35
|
+
|
|
36
|
+
# Filter value - can be string, number, or boolean
|
|
37
|
+
sig do
|
|
38
|
+
returns(
|
|
39
|
+
Dodopayments::FilterType::MeterFilterConditionList::Value::Variants
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
attr_accessor :value
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
key: String,
|
|
47
|
+
operator: Dodopayments::FilterOperator::OrSymbol,
|
|
48
|
+
value:
|
|
49
|
+
Dodopayments::FilterType::MeterFilterConditionList::Value::Variants
|
|
50
|
+
).returns(T.attached_class)
|
|
51
|
+
end
|
|
52
|
+
def self.new(
|
|
53
|
+
# Filter key to apply
|
|
54
|
+
key:,
|
|
55
|
+
# Filter operator
|
|
56
|
+
operator:,
|
|
57
|
+
# Filter value - can be string, number, or boolean
|
|
58
|
+
value:
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
override.returns(
|
|
64
|
+
{
|
|
65
|
+
key: String,
|
|
66
|
+
operator: Dodopayments::FilterOperator::OrSymbol,
|
|
67
|
+
value:
|
|
68
|
+
Dodopayments::FilterType::MeterFilterConditionList::Value::Variants
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
def to_hash
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Filter value - can be string, number, or boolean
|
|
76
|
+
module Value
|
|
77
|
+
extend Dodopayments::Internal::Type::Union
|
|
78
|
+
|
|
79
|
+
Variants = T.type_alias { T.any(String, Float, T::Boolean) }
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
T::Array[
|
|
84
|
+
Dodopayments::FilterType::MeterFilterConditionList::Value::Variants
|
|
85
|
+
]
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
def self.variants
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
sig { override.returns(T::Array[Dodopayments::FilterType::Variants]) }
|
|
94
|
+
def self.variants
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
MeterFilterConditionListArray =
|
|
98
|
+
T.let(
|
|
99
|
+
Dodopayments::Internal::Type::ArrayOf[
|
|
100
|
+
Dodopayments::FilterType::MeterFilterConditionList
|
|
101
|
+
],
|
|
102
|
+
Dodopayments::Internal::Type::Converter
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
MeterFilterArray =
|
|
106
|
+
T.let(
|
|
107
|
+
Dodopayments::Internal::Type::ArrayOf[Dodopayments::MeterFilter],
|
|
108
|
+
Dodopayments::Internal::Type::Converter
|
|
109
|
+
)
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# Repository permission to grant on a `github` entitlement.
|
|
6
|
+
module GitHubPermission
|
|
7
|
+
extend Dodopayments::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol =
|
|
10
|
+
T.type_alias { T.all(Symbol, Dodopayments::GitHubPermission) }
|
|
11
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
12
|
+
|
|
13
|
+
PULL = T.let(:pull, Dodopayments::GitHubPermission::TaggedSymbol)
|
|
14
|
+
PUSH = T.let(:push, Dodopayments::GitHubPermission::TaggedSymbol)
|
|
15
|
+
ADMIN = T.let(:admin, Dodopayments::GitHubPermission::TaggedSymbol)
|
|
16
|
+
MAINTAIN = T.let(:maintain, Dodopayments::GitHubPermission::TaggedSymbol)
|
|
17
|
+
TRIAGE = T.let(:triage, Dodopayments::GitHubPermission::TaggedSymbol)
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
override.returns(T::Array[Dodopayments::GitHubPermission::TaggedSymbol])
|
|
21
|
+
end
|
|
22
|
+
def self.values
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -31,11 +31,7 @@ module Dodopayments
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# Permission to grant on the repository.
|
|
34
|
-
sig
|
|
35
|
-
returns(
|
|
36
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission::OrSymbol
|
|
37
|
-
)
|
|
38
|
-
end
|
|
34
|
+
sig { returns(Dodopayments::GitHubPermission::OrSymbol) }
|
|
39
35
|
attr_accessor :permission
|
|
40
36
|
|
|
41
37
|
# Repository or organisation slug to grant access to.
|
|
@@ -44,8 +40,7 @@ module Dodopayments
|
|
|
44
40
|
|
|
45
41
|
sig do
|
|
46
42
|
params(
|
|
47
|
-
permission:
|
|
48
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission::OrSymbol,
|
|
43
|
+
permission: Dodopayments::GitHubPermission::OrSymbol,
|
|
49
44
|
target_id: String
|
|
50
45
|
).returns(T.attached_class)
|
|
51
46
|
end
|
|
@@ -60,64 +55,13 @@ module Dodopayments
|
|
|
60
55
|
sig do
|
|
61
56
|
override.returns(
|
|
62
57
|
{
|
|
63
|
-
permission:
|
|
64
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission::OrSymbol,
|
|
58
|
+
permission: Dodopayments::GitHubPermission::OrSymbol,
|
|
65
59
|
target_id: String
|
|
66
60
|
}
|
|
67
61
|
)
|
|
68
62
|
end
|
|
69
63
|
def to_hash
|
|
70
64
|
end
|
|
71
|
-
|
|
72
|
-
# Permission to grant on the repository.
|
|
73
|
-
module Permission
|
|
74
|
-
extend Dodopayments::Internal::Type::Enum
|
|
75
|
-
|
|
76
|
-
TaggedSymbol =
|
|
77
|
-
T.type_alias do
|
|
78
|
-
T.all(
|
|
79
|
-
Symbol,
|
|
80
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission
|
|
81
|
-
)
|
|
82
|
-
end
|
|
83
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
84
|
-
|
|
85
|
-
PULL =
|
|
86
|
-
T.let(
|
|
87
|
-
:pull,
|
|
88
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission::TaggedSymbol
|
|
89
|
-
)
|
|
90
|
-
PUSH =
|
|
91
|
-
T.let(
|
|
92
|
-
:push,
|
|
93
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission::TaggedSymbol
|
|
94
|
-
)
|
|
95
|
-
ADMIN =
|
|
96
|
-
T.let(
|
|
97
|
-
:admin,
|
|
98
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission::TaggedSymbol
|
|
99
|
-
)
|
|
100
|
-
MAINTAIN =
|
|
101
|
-
T.let(
|
|
102
|
-
:maintain,
|
|
103
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission::TaggedSymbol
|
|
104
|
-
)
|
|
105
|
-
TRIAGE =
|
|
106
|
-
T.let(
|
|
107
|
-
:triage,
|
|
108
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission::TaggedSymbol
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
sig do
|
|
112
|
-
override.returns(
|
|
113
|
-
T::Array[
|
|
114
|
-
Dodopayments::IntegrationConfig::GitHubConfig::Permission::TaggedSymbol
|
|
115
|
-
]
|
|
116
|
-
)
|
|
117
|
-
end
|
|
118
|
-
def self.values
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
65
|
end
|
|
122
66
|
|
|
123
67
|
class DiscordConfig < Dodopayments::Internal::Type::BaseModel
|
|
@@ -33,11 +33,7 @@ module Dodopayments
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
# Permission to grant on the repository.
|
|
36
|
-
sig
|
|
37
|
-
returns(
|
|
38
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
|
|
39
|
-
)
|
|
40
|
-
end
|
|
36
|
+
sig { returns(Dodopayments::GitHubPermission::TaggedSymbol) }
|
|
41
37
|
attr_accessor :permission
|
|
42
38
|
|
|
43
39
|
# Repository or organisation slug to grant access to.
|
|
@@ -46,8 +42,7 @@ module Dodopayments
|
|
|
46
42
|
|
|
47
43
|
sig do
|
|
48
44
|
params(
|
|
49
|
-
permission:
|
|
50
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::OrSymbol,
|
|
45
|
+
permission: Dodopayments::GitHubPermission::OrSymbol,
|
|
51
46
|
target_id: String
|
|
52
47
|
).returns(T.attached_class)
|
|
53
48
|
end
|
|
@@ -62,64 +57,13 @@ module Dodopayments
|
|
|
62
57
|
sig do
|
|
63
58
|
override.returns(
|
|
64
59
|
{
|
|
65
|
-
permission:
|
|
66
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol,
|
|
60
|
+
permission: Dodopayments::GitHubPermission::TaggedSymbol,
|
|
67
61
|
target_id: String
|
|
68
62
|
}
|
|
69
63
|
)
|
|
70
64
|
end
|
|
71
65
|
def to_hash
|
|
72
66
|
end
|
|
73
|
-
|
|
74
|
-
# Permission to grant on the repository.
|
|
75
|
-
module Permission
|
|
76
|
-
extend Dodopayments::Internal::Type::Enum
|
|
77
|
-
|
|
78
|
-
TaggedSymbol =
|
|
79
|
-
T.type_alias do
|
|
80
|
-
T.all(
|
|
81
|
-
Symbol,
|
|
82
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission
|
|
83
|
-
)
|
|
84
|
-
end
|
|
85
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
86
|
-
|
|
87
|
-
PULL =
|
|
88
|
-
T.let(
|
|
89
|
-
:pull,
|
|
90
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
|
|
91
|
-
)
|
|
92
|
-
PUSH =
|
|
93
|
-
T.let(
|
|
94
|
-
:push,
|
|
95
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
|
|
96
|
-
)
|
|
97
|
-
ADMIN =
|
|
98
|
-
T.let(
|
|
99
|
-
:admin,
|
|
100
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
|
|
101
|
-
)
|
|
102
|
-
MAINTAIN =
|
|
103
|
-
T.let(
|
|
104
|
-
:maintain,
|
|
105
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
|
|
106
|
-
)
|
|
107
|
-
TRIAGE =
|
|
108
|
-
T.let(
|
|
109
|
-
:triage,
|
|
110
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
sig do
|
|
114
|
-
override.returns(
|
|
115
|
-
T::Array[
|
|
116
|
-
Dodopayments::IntegrationConfigResponse::GitHubConfig::Permission::TaggedSymbol
|
|
117
|
-
]
|
|
118
|
-
)
|
|
119
|
-
end
|
|
120
|
-
def self.values
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
67
|
end
|
|
124
68
|
|
|
125
69
|
class DiscordConfig < Dodopayments::Internal::Type::BaseModel
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Invoices
|
|
6
|
+
class PaymentRetrievePayoutParams < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Dodopayments::Invoices::PaymentRetrievePayoutParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :payout_id
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
payout_id: String,
|
|
24
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(payout_id:, request_options: {})
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
override.returns(
|
|
32
|
+
{ payout_id: String, request_options: Dodopayments::RequestOptions }
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
def to_hash
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|