dodopayments 2.9.0 → 2.10.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 +23 -0
- data/README.md +1 -1
- data/lib/dodopayments/internal/transport/base_client.rb +2 -0
- data/lib/dodopayments/internal/type/union.rb +21 -7
- data/lib/dodopayments/models/abandoned_checkout_detected_webhook_event.rb +4 -16
- data/lib/dodopayments/models/abandoned_checkout_recovered_webhook_event.rb +4 -16
- data/lib/dodopayments/models/checkout_session_request.rb +15 -2
- data/lib/dodopayments/models/credit_added_webhook_event.rb +4 -16
- data/lib/dodopayments/models/credit_balance_low_webhook_event.rb +4 -16
- data/lib/dodopayments/models/credit_deducted_webhook_event.rb +4 -16
- data/lib/dodopayments/models/credit_expired_webhook_event.rb +4 -16
- data/lib/dodopayments/models/credit_manual_adjustment_webhook_event.rb +4 -16
- data/lib/dodopayments/models/credit_overage_charged_webhook_event.rb +4 -16
- data/lib/dodopayments/models/credit_overage_reset_webhook_event.rb +4 -16
- data/lib/dodopayments/models/credit_rolled_over_webhook_event.rb +4 -16
- data/lib/dodopayments/models/credit_rollover_forfeited_webhook_event.rb +4 -16
- data/lib/dodopayments/models/digital_product_delivery.rb +14 -7
- data/lib/dodopayments/models/digital_product_delivery_file.rb +12 -5
- data/lib/dodopayments/models/dispute_accepted_webhook_event.rb +4 -16
- data/lib/dodopayments/models/dispute_cancelled_webhook_event.rb +4 -16
- data/lib/dodopayments/models/dispute_challenged_webhook_event.rb +4 -16
- data/lib/dodopayments/models/dispute_expired_webhook_event.rb +4 -16
- data/lib/dodopayments/models/dispute_lost_webhook_event.rb +4 -16
- data/lib/dodopayments/models/dispute_opened_webhook_event.rb +4 -16
- data/lib/dodopayments/models/dispute_won_webhook_event.rb +4 -16
- data/lib/dodopayments/models/dunning_recovered_webhook_event.rb +4 -16
- data/lib/dodopayments/models/dunning_started_webhook_event.rb +4 -16
- data/lib/dodopayments/models/entitlement.rb +31 -20
- data/lib/dodopayments/models/entitlement_create_params.rb +3 -3
- data/lib/dodopayments/models/entitlement_grant_created_webhook_event.rb +10 -17
- data/lib/dodopayments/models/entitlement_grant_delivered_webhook_event.rb +10 -17
- data/lib/dodopayments/models/entitlement_grant_failed_webhook_event.rb +10 -17
- data/lib/dodopayments/models/entitlement_grant_revoked_webhook_event.rb +10 -17
- data/lib/dodopayments/models/entitlement_update_params.rb +3 -3
- data/lib/dodopayments/models/entitlements/entitlement_grant.rb +50 -32
- data/lib/dodopayments/models/entitlements/file_upload_response.rb +3 -3
- data/lib/dodopayments/models/entitlements/license_key_grant.rb +14 -9
- data/lib/dodopayments/models/integration_config.rb +70 -27
- data/lib/dodopayments/models/integration_config_response.rb +88 -48
- data/lib/dodopayments/models/license_key_created_webhook_event.rb +4 -16
- data/lib/dodopayments/models/payment.rb +153 -3
- data/lib/dodopayments/models/payment_cancelled_webhook_event.rb +4 -16
- data/lib/dodopayments/models/payment_create_params.rb +15 -3
- data/lib/dodopayments/models/payment_create_response.rb +14 -3
- data/lib/dodopayments/models/payment_failed_webhook_event.rb +4 -16
- data/lib/dodopayments/models/payment_processing_webhook_event.rb +4 -16
- data/lib/dodopayments/models/payment_succeeded_webhook_event.rb +4 -16
- data/lib/dodopayments/models/payout_list_response.rb +6 -3
- data/lib/dodopayments/models/price.rb +20 -48
- data/lib/dodopayments/models/product.rb +6 -8
- data/lib/dodopayments/models/product_create_params.rb +3 -3
- data/lib/dodopayments/models/product_entitlement_summary.rb +5 -5
- data/lib/dodopayments/models/product_item_req.rb +42 -1
- data/lib/dodopayments/models/product_update_params.rb +3 -3
- data/lib/dodopayments/models/refund_failed_webhook_event.rb +4 -16
- data/lib/dodopayments/models/refund_succeeded_webhook_event.rb +4 -16
- data/lib/dodopayments/models/subscription.rb +153 -5
- data/lib/dodopayments/models/subscription_active_webhook_event.rb +4 -16
- data/lib/dodopayments/models/subscription_cancelled_webhook_event.rb +4 -16
- data/lib/dodopayments/models/subscription_create_params.rb +15 -3
- data/lib/dodopayments/models/subscription_create_response.rb +14 -3
- data/lib/dodopayments/models/subscription_expired_webhook_event.rb +4 -16
- data/lib/dodopayments/models/subscription_failed_webhook_event.rb +4 -16
- data/lib/dodopayments/models/subscription_list_response.rb +36 -5
- data/lib/dodopayments/models/subscription_on_hold_webhook_event.rb +4 -16
- data/lib/dodopayments/models/subscription_plan_changed_webhook_event.rb +4 -16
- data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +21 -49
- data/lib/dodopayments/models/subscription_renewed_webhook_event.rb +4 -16
- data/lib/dodopayments/models/subscription_update_payment_method_params.rb +12 -30
- data/lib/dodopayments/models/subscription_updated_webhook_event.rb +4 -16
- data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +41 -39
- data/lib/dodopayments/models/unwrap_webhook_event.rb +41 -39
- data/lib/dodopayments/models/update_subscription_plan_req.rb +17 -6
- data/lib/dodopayments/models/webhook_event_type.rb +3 -0
- data/lib/dodopayments/models/webhook_payload.rb +57 -143
- data/lib/dodopayments/resources/checkout_sessions.rb +8 -4
- data/lib/dodopayments/resources/entitlements/files.rb +3 -10
- data/lib/dodopayments/resources/entitlements/grants.rb +2 -4
- data/lib/dodopayments/resources/entitlements.rb +2 -2
- data/lib/dodopayments/resources/payments.rb +4 -2
- data/lib/dodopayments/resources/subscriptions.rb +12 -6
- data/lib/dodopayments/version.rb +1 -1
- data/rbi/dodopayments/models/abandoned_checkout_detected_webhook_event.rbi +4 -40
- data/rbi/dodopayments/models/abandoned_checkout_recovered_webhook_event.rbi +4 -40
- data/rbi/dodopayments/models/checkout_session_request.rbi +14 -0
- data/rbi/dodopayments/models/credit_added_webhook_event.rbi +4 -29
- data/rbi/dodopayments/models/credit_balance_low_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/credit_deducted_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/credit_expired_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/credit_manual_adjustment_webhook_event.rbi +4 -39
- data/rbi/dodopayments/models/credit_overage_charged_webhook_event.rbi +4 -36
- data/rbi/dodopayments/models/credit_overage_reset_webhook_event.rbi +4 -36
- data/rbi/dodopayments/models/credit_rolled_over_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/credit_rollover_forfeited_webhook_event.rbi +4 -40
- data/rbi/dodopayments/models/digital_product_delivery.rbi +15 -5
- data/rbi/dodopayments/models/digital_product_delivery_file.rbi +11 -0
- data/rbi/dodopayments/models/dispute_accepted_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/dispute_cancelled_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/dispute_challenged_webhook_event.rbi +4 -34
- data/rbi/dodopayments/models/dispute_expired_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/dispute_lost_webhook_event.rbi +4 -29
- data/rbi/dodopayments/models/dispute_opened_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/dispute_won_webhook_event.rbi +4 -29
- data/rbi/dodopayments/models/dunning_recovered_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/dunning_started_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/entitlement.rbi +35 -20
- data/rbi/dodopayments/models/entitlement_create_params.rbi +8 -5
- data/rbi/dodopayments/models/entitlement_grant_created_webhook_event.rbi +8 -40
- data/rbi/dodopayments/models/entitlement_grant_delivered_webhook_event.rbi +8 -40
- data/rbi/dodopayments/models/entitlement_grant_failed_webhook_event.rbi +8 -39
- data/rbi/dodopayments/models/entitlement_grant_revoked_webhook_event.rbi +8 -40
- data/rbi/dodopayments/models/entitlement_update_params.rbi +4 -4
- data/rbi/dodopayments/models/entitlements/entitlement_grant.rbi +54 -20
- data/rbi/dodopayments/models/entitlements/file_upload_response.rbi +4 -4
- data/rbi/dodopayments/models/entitlements/license_key_grant.rbi +10 -4
- data/rbi/dodopayments/models/integration_config.rbi +141 -26
- data/rbi/dodopayments/models/integration_config_response.rbi +153 -38
- data/rbi/dodopayments/models/license_key_created_webhook_event.rbi +4 -34
- data/rbi/dodopayments/models/payment.rbi +170 -2
- data/rbi/dodopayments/models/payment_cancelled_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/payment_create_params.rbi +14 -2
- data/rbi/dodopayments/models/payment_create_response.rbi +12 -2
- data/rbi/dodopayments/models/payment_failed_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/payment_processing_webhook_event.rbi +4 -34
- data/rbi/dodopayments/models/payment_succeeded_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/price.rbi +18 -90
- data/rbi/dodopayments/models/product.rbi +4 -8
- data/rbi/dodopayments/models/product_entitlement_summary.rbi +8 -8
- data/rbi/dodopayments/models/product_item_req.rbi +74 -3
- data/rbi/dodopayments/models/refund_failed_webhook_event.rbi +4 -31
- data/rbi/dodopayments/models/refund_succeeded_webhook_event.rbi +4 -33
- data/rbi/dodopayments/models/subscription.rbi +173 -4
- data/rbi/dodopayments/models/subscription_active_webhook_event.rbi +4 -36
- data/rbi/dodopayments/models/subscription_cancelled_webhook_event.rbi +4 -36
- data/rbi/dodopayments/models/subscription_create_params.rbi +14 -2
- data/rbi/dodopayments/models/subscription_create_response.rbi +12 -2
- data/rbi/dodopayments/models/subscription_expired_webhook_event.rbi +4 -36
- data/rbi/dodopayments/models/subscription_failed_webhook_event.rbi +4 -36
- data/rbi/dodopayments/models/subscription_list_response.rbi +67 -4
- data/rbi/dodopayments/models/subscription_on_hold_webhook_event.rbi +4 -36
- data/rbi/dodopayments/models/subscription_plan_changed_webhook_event.rbi +4 -40
- data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +18 -123
- data/rbi/dodopayments/models/subscription_renewed_webhook_event.rbi +4 -36
- data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +12 -96
- data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +4 -36
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +18 -8
- data/rbi/dodopayments/models/webhook_event_type.rbi +15 -0
- data/rbi/dodopayments/models/webhook_payload.rbi +48 -466
- data/rbi/dodopayments/resources/checkout_sessions.rbi +12 -0
- data/rbi/dodopayments/resources/entitlements/files.rbi +3 -10
- data/rbi/dodopayments/resources/entitlements/grants.rbi +2 -4
- data/rbi/dodopayments/resources/entitlements.rbi +4 -4
- data/rbi/dodopayments/resources/payments.rbi +6 -1
- data/rbi/dodopayments/resources/subscriptions.rbi +22 -9
- data/sig/dodopayments/models/abandoned_checkout_detected_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/abandoned_checkout_recovered_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
- data/sig/dodopayments/models/credit_added_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/credit_balance_low_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/credit_deducted_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/credit_expired_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/credit_manual_adjustment_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/credit_overage_charged_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/credit_overage_reset_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/credit_rolled_over_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/credit_rollover_forfeited_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/dispute_accepted_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/dispute_cancelled_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/dispute_challenged_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/dispute_expired_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/dispute_lost_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/dispute_opened_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/dispute_won_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/dunning_recovered_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/dunning_started_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/entitlement.rbs +8 -10
- data/sig/dodopayments/models/entitlement_create_params.rbs +6 -4
- data/sig/dodopayments/models/entitlement_grant_created_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/entitlement_grant_delivered_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/entitlement_grant_failed_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/entitlement_grant_revoked_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +4 -11
- data/sig/dodopayments/models/integration_config.rbs +28 -4
- data/sig/dodopayments/models/integration_config_response.rbs +28 -9
- data/sig/dodopayments/models/license_key_created_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/payment.rbs +97 -0
- data/sig/dodopayments/models/payment_cancelled_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/payment_create_params.rbs +5 -0
- data/sig/dodopayments/models/payment_create_response.rbs +5 -0
- data/sig/dodopayments/models/payment_failed_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/payment_processing_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/payment_succeeded_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/price.rbs +15 -45
- data/sig/dodopayments/models/product_item_req.rbs +27 -3
- data/sig/dodopayments/models/refund_failed_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/refund_succeeded_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/subscription.rbs +97 -0
- data/sig/dodopayments/models/subscription_active_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/subscription_cancelled_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/subscription_create_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_create_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_expired_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/subscription_failed_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/subscription_list_response.rbs +24 -0
- data/sig/dodopayments/models/subscription_on_hold_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/subscription_plan_changed_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +15 -45
- data/sig/dodopayments/models/subscription_renewed_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +8 -48
- data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +4 -14
- data/sig/dodopayments/models/update_subscription_plan_req.rbs +5 -0
- data/sig/dodopayments/models/webhook_event_type.rbs +6 -0
- data/sig/dodopayments/models/webhook_payload.rbs +50 -213
- data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
- data/sig/dodopayments/resources/entitlements.rbs +1 -1
- data/sig/dodopayments/resources/payments.rbs +1 -0
- data/sig/dodopayments/resources/subscriptions.rbs +3 -0
- metadata +2 -2
|
@@ -14,24 +14,31 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
# Unique identifier of the grant.
|
|
17
18
|
sig { returns(String) }
|
|
18
19
|
attr_accessor :id
|
|
19
20
|
|
|
21
|
+
# Identifier of the business that owns the grant.
|
|
20
22
|
sig { returns(String) }
|
|
21
23
|
attr_accessor :business_id
|
|
22
24
|
|
|
25
|
+
# Timestamp when the grant was created.
|
|
23
26
|
sig { returns(Time) }
|
|
24
27
|
attr_accessor :created_at
|
|
25
28
|
|
|
29
|
+
# Identifier of the customer the grant was issued to.
|
|
26
30
|
sig { returns(String) }
|
|
27
31
|
attr_accessor :customer_id
|
|
28
32
|
|
|
33
|
+
# Identifier of the entitlement this grant was issued from.
|
|
29
34
|
sig { returns(String) }
|
|
30
35
|
attr_accessor :entitlement_id
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
# Arbitrary key-value metadata recorded on the grant.
|
|
38
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
39
|
+
attr_accessor :metadata
|
|
34
40
|
|
|
41
|
+
# Lifecycle status of the grant.
|
|
35
42
|
sig do
|
|
36
43
|
returns(
|
|
37
44
|
Dodopayments::Entitlements::EntitlementGrant::Status::TaggedSymbol
|
|
@@ -39,14 +46,16 @@ module Dodopayments
|
|
|
39
46
|
end
|
|
40
47
|
attr_accessor :status
|
|
41
48
|
|
|
49
|
+
# Timestamp when the grant was last modified.
|
|
42
50
|
sig { returns(Time) }
|
|
43
51
|
attr_accessor :updated_at
|
|
44
52
|
|
|
53
|
+
# Timestamp when the grant transitioned to `delivered`, when applicable.
|
|
45
54
|
sig { returns(T.nilable(Time)) }
|
|
46
55
|
attr_accessor :delivered_at
|
|
47
56
|
|
|
48
|
-
#
|
|
49
|
-
#
|
|
57
|
+
# Digital-product-delivery payload, present when the entitlement integration is
|
|
58
|
+
# `digital_files`.
|
|
50
59
|
sig { returns(T.nilable(Dodopayments::DigitalProductDelivery)) }
|
|
51
60
|
attr_reader :digital_product_delivery
|
|
52
61
|
|
|
@@ -58,13 +67,16 @@ module Dodopayments
|
|
|
58
67
|
end
|
|
59
68
|
attr_writer :digital_product_delivery
|
|
60
69
|
|
|
70
|
+
# Machine-readable code reported when delivery failed, when applicable.
|
|
61
71
|
sig { returns(T.nilable(String)) }
|
|
62
72
|
attr_accessor :error_code
|
|
63
73
|
|
|
74
|
+
# Human-readable message reported when delivery failed, when applicable.
|
|
64
75
|
sig { returns(T.nilable(String)) }
|
|
65
76
|
attr_accessor :error_message
|
|
66
77
|
|
|
67
|
-
#
|
|
78
|
+
# License-key delivery payload, present when the entitlement integration is
|
|
79
|
+
# `license_key`.
|
|
68
80
|
sig { returns(T.nilable(Dodopayments::Entitlements::LicenseKeyGrant)) }
|
|
69
81
|
attr_reader :license_key
|
|
70
82
|
|
|
@@ -76,30 +88,34 @@ module Dodopayments
|
|
|
76
88
|
end
|
|
77
89
|
attr_writer :license_key
|
|
78
90
|
|
|
79
|
-
|
|
80
|
-
attr_reader :metadata
|
|
81
|
-
|
|
82
|
-
sig { params(metadata: T.anything).void }
|
|
83
|
-
attr_writer :metadata
|
|
84
|
-
|
|
91
|
+
# Timestamp when `oauth_url` stops being valid, when applicable.
|
|
85
92
|
sig { returns(T.nilable(Time)) }
|
|
86
93
|
attr_accessor :oauth_expires_at
|
|
87
94
|
|
|
95
|
+
# Customer-facing OAuth URL for OAuth-style integrations. Populated during the
|
|
96
|
+
# customer-portal accept flow; `null` until the customer completes that step, and
|
|
97
|
+
# on grants for non-OAuth integrations.
|
|
88
98
|
sig { returns(T.nilable(String)) }
|
|
89
99
|
attr_accessor :oauth_url
|
|
90
100
|
|
|
101
|
+
# Identifier of the payment that triggered this grant, when applicable.
|
|
91
102
|
sig { returns(T.nilable(String)) }
|
|
92
103
|
attr_accessor :payment_id
|
|
93
104
|
|
|
105
|
+
# Reason recorded when the grant was revoked, when applicable.
|
|
94
106
|
sig { returns(T.nilable(String)) }
|
|
95
107
|
attr_accessor :revocation_reason
|
|
96
108
|
|
|
109
|
+
# Timestamp when the grant transitioned to `revoked`, when applicable.
|
|
97
110
|
sig { returns(T.nilable(Time)) }
|
|
98
111
|
attr_accessor :revoked_at
|
|
99
112
|
|
|
113
|
+
# Identifier of the subscription that triggered this grant, when applicable.
|
|
100
114
|
sig { returns(T.nilable(String)) }
|
|
101
115
|
attr_accessor :subscription_id
|
|
102
116
|
|
|
117
|
+
# Detailed view of a single entitlement grant: who it's for, its lifecycle state,
|
|
118
|
+
# and any integration-specific delivery payload.
|
|
103
119
|
sig do
|
|
104
120
|
params(
|
|
105
121
|
id: String,
|
|
@@ -107,7 +123,7 @@ module Dodopayments
|
|
|
107
123
|
created_at: Time,
|
|
108
124
|
customer_id: String,
|
|
109
125
|
entitlement_id: String,
|
|
110
|
-
|
|
126
|
+
metadata: T::Hash[Symbol, String],
|
|
111
127
|
status:
|
|
112
128
|
Dodopayments::Entitlements::EntitlementGrant::Status::OrSymbol,
|
|
113
129
|
updated_at: Time,
|
|
@@ -118,7 +134,6 @@ module Dodopayments
|
|
|
118
134
|
error_message: T.nilable(String),
|
|
119
135
|
license_key:
|
|
120
136
|
T.nilable(Dodopayments::Entitlements::LicenseKeyGrant::OrHash),
|
|
121
|
-
metadata: T.anything,
|
|
122
137
|
oauth_expires_at: T.nilable(Time),
|
|
123
138
|
oauth_url: T.nilable(String),
|
|
124
139
|
payment_id: T.nilable(String),
|
|
@@ -128,28 +143,47 @@ module Dodopayments
|
|
|
128
143
|
).returns(T.attached_class)
|
|
129
144
|
end
|
|
130
145
|
def self.new(
|
|
146
|
+
# Unique identifier of the grant.
|
|
131
147
|
id:,
|
|
148
|
+
# Identifier of the business that owns the grant.
|
|
132
149
|
business_id:,
|
|
150
|
+
# Timestamp when the grant was created.
|
|
133
151
|
created_at:,
|
|
152
|
+
# Identifier of the customer the grant was issued to.
|
|
134
153
|
customer_id:,
|
|
154
|
+
# Identifier of the entitlement this grant was issued from.
|
|
135
155
|
entitlement_id:,
|
|
136
|
-
|
|
156
|
+
# Arbitrary key-value metadata recorded on the grant.
|
|
157
|
+
metadata:,
|
|
158
|
+
# Lifecycle status of the grant.
|
|
137
159
|
status:,
|
|
160
|
+
# Timestamp when the grant was last modified.
|
|
138
161
|
updated_at:,
|
|
162
|
+
# Timestamp when the grant transitioned to `delivered`, when applicable.
|
|
139
163
|
delivered_at: nil,
|
|
140
|
-
#
|
|
141
|
-
#
|
|
164
|
+
# Digital-product-delivery payload, present when the entitlement integration is
|
|
165
|
+
# `digital_files`.
|
|
142
166
|
digital_product_delivery: nil,
|
|
167
|
+
# Machine-readable code reported when delivery failed, when applicable.
|
|
143
168
|
error_code: nil,
|
|
169
|
+
# Human-readable message reported when delivery failed, when applicable.
|
|
144
170
|
error_message: nil,
|
|
145
|
-
#
|
|
171
|
+
# License-key delivery payload, present when the entitlement integration is
|
|
172
|
+
# `license_key`.
|
|
146
173
|
license_key: nil,
|
|
147
|
-
|
|
174
|
+
# Timestamp when `oauth_url` stops being valid, when applicable.
|
|
148
175
|
oauth_expires_at: nil,
|
|
176
|
+
# Customer-facing OAuth URL for OAuth-style integrations. Populated during the
|
|
177
|
+
# customer-portal accept flow; `null` until the customer completes that step, and
|
|
178
|
+
# on grants for non-OAuth integrations.
|
|
149
179
|
oauth_url: nil,
|
|
180
|
+
# Identifier of the payment that triggered this grant, when applicable.
|
|
150
181
|
payment_id: nil,
|
|
182
|
+
# Reason recorded when the grant was revoked, when applicable.
|
|
151
183
|
revocation_reason: nil,
|
|
184
|
+
# Timestamp when the grant transitioned to `revoked`, when applicable.
|
|
152
185
|
revoked_at: nil,
|
|
186
|
+
# Identifier of the subscription that triggered this grant, when applicable.
|
|
153
187
|
subscription_id: nil
|
|
154
188
|
)
|
|
155
189
|
end
|
|
@@ -162,7 +196,7 @@ module Dodopayments
|
|
|
162
196
|
created_at: Time,
|
|
163
197
|
customer_id: String,
|
|
164
198
|
entitlement_id: String,
|
|
165
|
-
|
|
199
|
+
metadata: T::Hash[Symbol, String],
|
|
166
200
|
status:
|
|
167
201
|
Dodopayments::Entitlements::EntitlementGrant::Status::TaggedSymbol,
|
|
168
202
|
updated_at: Time,
|
|
@@ -173,7 +207,6 @@ module Dodopayments
|
|
|
173
207
|
error_message: T.nilable(String),
|
|
174
208
|
license_key:
|
|
175
209
|
T.nilable(Dodopayments::Entitlements::LicenseKeyGrant),
|
|
176
|
-
metadata: T.anything,
|
|
177
210
|
oauth_expires_at: T.nilable(Time),
|
|
178
211
|
oauth_url: T.nilable(String),
|
|
179
212
|
payment_id: T.nilable(String),
|
|
@@ -186,6 +219,7 @@ module Dodopayments
|
|
|
186
219
|
def to_hash
|
|
187
220
|
end
|
|
188
221
|
|
|
222
|
+
# Lifecycle status of the grant.
|
|
189
223
|
module Status
|
|
190
224
|
extend Dodopayments::Internal::Type::Enum
|
|
191
225
|
|
|
@@ -12,15 +12,15 @@ module Dodopayments
|
|
|
12
12
|
)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
#
|
|
16
|
-
# `entitlements.
|
|
15
|
+
# Identifier of the attached file. Pass it to
|
|
16
|
+
# `DELETE /entitlements/{id}/files/{file_id}` to detach the file later.
|
|
17
17
|
sig { returns(String) }
|
|
18
18
|
attr_accessor :file_id
|
|
19
19
|
|
|
20
20
|
sig { params(file_id: String).returns(T.attached_class) }
|
|
21
21
|
def self.new(
|
|
22
|
-
#
|
|
23
|
-
# `entitlements.
|
|
22
|
+
# Identifier of the attached file. Pass it to
|
|
23
|
+
# `DELETE /entitlements/{id}/files/{file_id}` to detach the file later.
|
|
24
24
|
file_id:
|
|
25
25
|
)
|
|
26
26
|
end
|
|
@@ -12,22 +12,24 @@ module Dodopayments
|
|
|
12
12
|
)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
# Number of activations consumed so far.
|
|
15
16
|
sig { returns(Integer) }
|
|
16
17
|
attr_accessor :activations_used
|
|
17
18
|
|
|
19
|
+
# Issued license key.
|
|
18
20
|
sig { returns(String) }
|
|
19
21
|
attr_accessor :key
|
|
20
22
|
|
|
23
|
+
# Maximum activations allowed by the entitlement, when set.
|
|
21
24
|
sig { returns(T.nilable(Integer)) }
|
|
22
25
|
attr_accessor :activations_limit
|
|
23
26
|
|
|
27
|
+
# When the license key expires, when applicable.
|
|
24
28
|
sig { returns(T.nilable(Time)) }
|
|
25
29
|
attr_accessor :expires_at
|
|
26
30
|
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
# `license_keys`. The grant's top-level `status` is the source of truth for the
|
|
30
|
-
# grant's lifecycle — no per-license-key status is exposed here.
|
|
31
|
+
# License-key delivery payload, present on grants for `license_key` entitlements.
|
|
32
|
+
# The grant's top-level `status` is the source of truth for the grant's lifecycle.
|
|
31
33
|
sig do
|
|
32
34
|
params(
|
|
33
35
|
activations_used: Integer,
|
|
@@ -37,9 +39,13 @@ module Dodopayments
|
|
|
37
39
|
).returns(T.attached_class)
|
|
38
40
|
end
|
|
39
41
|
def self.new(
|
|
42
|
+
# Number of activations consumed so far.
|
|
40
43
|
activations_used:,
|
|
44
|
+
# Issued license key.
|
|
41
45
|
key:,
|
|
46
|
+
# Maximum activations allowed by the entitlement, when set.
|
|
42
47
|
activations_limit: nil,
|
|
48
|
+
# When the license key expires, when applicable.
|
|
43
49
|
expires_at: nil
|
|
44
50
|
)
|
|
45
51
|
end
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Dodopayments
|
|
4
4
|
module Models
|
|
5
|
-
#
|
|
6
|
-
#
|
|
5
|
+
# Integration-specific configuration supplied when creating or updating an
|
|
6
|
+
# entitlement. The shape required matches the entitlement's `integration_type`.
|
|
7
7
|
module IntegrationConfig
|
|
8
8
|
extend Dodopayments::Internal::Type::Union
|
|
9
9
|
|
|
@@ -30,28 +30,94 @@ module Dodopayments
|
|
|
30
30
|
)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
#
|
|
34
|
-
sig
|
|
33
|
+
# Permission to grant on the repository.
|
|
34
|
+
sig do
|
|
35
|
+
returns(
|
|
36
|
+
Dodopayments::IntegrationConfig::GitHubConfig::Permission::OrSymbol
|
|
37
|
+
)
|
|
38
|
+
end
|
|
35
39
|
attr_accessor :permission
|
|
36
40
|
|
|
41
|
+
# Repository or organisation slug to grant access to.
|
|
37
42
|
sig { returns(String) }
|
|
38
43
|
attr_accessor :target_id
|
|
39
44
|
|
|
40
45
|
sig do
|
|
41
|
-
params(
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
params(
|
|
47
|
+
permission:
|
|
48
|
+
Dodopayments::IntegrationConfig::GitHubConfig::Permission::OrSymbol,
|
|
49
|
+
target_id: String
|
|
50
|
+
).returns(T.attached_class)
|
|
44
51
|
end
|
|
45
52
|
def self.new(
|
|
46
|
-
#
|
|
53
|
+
# Permission to grant on the repository.
|
|
47
54
|
permission:,
|
|
55
|
+
# Repository or organisation slug to grant access to.
|
|
48
56
|
target_id:
|
|
49
57
|
)
|
|
50
58
|
end
|
|
51
59
|
|
|
52
|
-
sig
|
|
60
|
+
sig do
|
|
61
|
+
override.returns(
|
|
62
|
+
{
|
|
63
|
+
permission:
|
|
64
|
+
Dodopayments::IntegrationConfig::GitHubConfig::Permission::OrSymbol,
|
|
65
|
+
target_id: String
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
end
|
|
53
69
|
def to_hash
|
|
54
70
|
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
|
|
55
121
|
end
|
|
56
122
|
|
|
57
123
|
class DiscordConfig < Dodopayments::Internal::Type::BaseModel
|
|
@@ -63,9 +129,11 @@ module Dodopayments
|
|
|
63
129
|
)
|
|
64
130
|
end
|
|
65
131
|
|
|
132
|
+
# Discord guild (server) ID.
|
|
66
133
|
sig { returns(String) }
|
|
67
134
|
attr_accessor :guild_id
|
|
68
135
|
|
|
136
|
+
# Optional Discord role to assign within the guild.
|
|
69
137
|
sig { returns(T.nilable(String)) }
|
|
70
138
|
attr_accessor :role_id
|
|
71
139
|
|
|
@@ -74,7 +142,12 @@ module Dodopayments
|
|
|
74
142
|
T.attached_class
|
|
75
143
|
)
|
|
76
144
|
end
|
|
77
|
-
def self.new(
|
|
145
|
+
def self.new(
|
|
146
|
+
# Discord guild (server) ID.
|
|
147
|
+
guild_id:,
|
|
148
|
+
# Optional Discord role to assign within the guild.
|
|
149
|
+
role_id: nil
|
|
150
|
+
)
|
|
78
151
|
end
|
|
79
152
|
|
|
80
153
|
sig do
|
|
@@ -93,11 +166,15 @@ module Dodopayments
|
|
|
93
166
|
)
|
|
94
167
|
end
|
|
95
168
|
|
|
169
|
+
# Telegram chat ID. For groups this is typically a negative integer.
|
|
96
170
|
sig { returns(String) }
|
|
97
171
|
attr_accessor :chat_id
|
|
98
172
|
|
|
99
173
|
sig { params(chat_id: String).returns(T.attached_class) }
|
|
100
|
-
def self.new(
|
|
174
|
+
def self.new(
|
|
175
|
+
# Telegram chat ID. For groups this is typically a negative integer.
|
|
176
|
+
chat_id:
|
|
177
|
+
)
|
|
101
178
|
end
|
|
102
179
|
|
|
103
180
|
sig { override.returns({ chat_id: String }) }
|
|
@@ -114,11 +191,15 @@ module Dodopayments
|
|
|
114
191
|
)
|
|
115
192
|
end
|
|
116
193
|
|
|
194
|
+
# Figma file identifier to grant access to.
|
|
117
195
|
sig { returns(String) }
|
|
118
196
|
attr_accessor :figma_file_id
|
|
119
197
|
|
|
120
198
|
sig { params(figma_file_id: String).returns(T.attached_class) }
|
|
121
|
-
def self.new(
|
|
199
|
+
def self.new(
|
|
200
|
+
# Figma file identifier to grant access to.
|
|
201
|
+
figma_file_id:
|
|
202
|
+
)
|
|
122
203
|
end
|
|
123
204
|
|
|
124
205
|
sig { override.returns({ figma_file_id: String }) }
|
|
@@ -135,11 +216,15 @@ module Dodopayments
|
|
|
135
216
|
)
|
|
136
217
|
end
|
|
137
218
|
|
|
219
|
+
# Framer template identifier to grant access to.
|
|
138
220
|
sig { returns(String) }
|
|
139
221
|
attr_accessor :framer_template_id
|
|
140
222
|
|
|
141
223
|
sig { params(framer_template_id: String).returns(T.attached_class) }
|
|
142
|
-
def self.new(
|
|
224
|
+
def self.new(
|
|
225
|
+
# Framer template identifier to grant access to.
|
|
226
|
+
framer_template_id:
|
|
227
|
+
)
|
|
143
228
|
end
|
|
144
229
|
|
|
145
230
|
sig { override.returns({ framer_template_id: String }) }
|
|
@@ -156,11 +241,15 @@ module Dodopayments
|
|
|
156
241
|
)
|
|
157
242
|
end
|
|
158
243
|
|
|
244
|
+
# Notion template identifier to grant access to.
|
|
159
245
|
sig { returns(String) }
|
|
160
246
|
attr_accessor :notion_template_id
|
|
161
247
|
|
|
162
248
|
sig { params(notion_template_id: String).returns(T.attached_class) }
|
|
163
|
-
def self.new(
|
|
249
|
+
def self.new(
|
|
250
|
+
# Notion template identifier to grant access to.
|
|
251
|
+
notion_template_id:
|
|
252
|
+
)
|
|
164
253
|
end
|
|
165
254
|
|
|
166
255
|
sig { override.returns({ notion_template_id: String }) }
|
|
@@ -177,23 +266,29 @@ module Dodopayments
|
|
|
177
266
|
)
|
|
178
267
|
end
|
|
179
268
|
|
|
269
|
+
# Files attached to this entitlement. Add files via
|
|
270
|
+
# `POST /entitlements/{id}/files` and remove them via
|
|
271
|
+
# `DELETE /entitlements/{id}/files/{file_id}`.
|
|
180
272
|
sig { returns(T::Array[String]) }
|
|
181
273
|
attr_accessor :digital_file_ids
|
|
182
274
|
|
|
275
|
+
# Optional external URL shown to the customer alongside the files.
|
|
183
276
|
sig { returns(T.nilable(String)) }
|
|
184
277
|
attr_accessor :external_url
|
|
185
278
|
|
|
279
|
+
# Optional human-readable delivery instructions shown to the customer alongside
|
|
280
|
+
# the files.
|
|
186
281
|
sig { returns(T.nilable(String)) }
|
|
187
282
|
attr_accessor :instructions
|
|
188
283
|
|
|
189
|
-
# Three-way patchable
|
|
284
|
+
# Three-way patchable list of legacy file identifiers:
|
|
190
285
|
#
|
|
191
|
-
# - omitted → preserve
|
|
192
|
-
# - `null` → clear
|
|
193
|
-
# - `[...]` → replace
|
|
286
|
+
# - omitted → preserve the current value
|
|
287
|
+
# - `null` → clear
|
|
288
|
+
# - `[...]` → replace
|
|
194
289
|
#
|
|
195
|
-
# On
|
|
196
|
-
#
|
|
290
|
+
# On create, an omitted field, an explicit `null`, or an empty array all result in
|
|
291
|
+
# no legacy files attached.
|
|
197
292
|
sig { returns(T.nilable(T::Array[String])) }
|
|
198
293
|
attr_accessor :legacy_file_ids
|
|
199
294
|
|
|
@@ -206,17 +301,23 @@ module Dodopayments
|
|
|
206
301
|
).returns(T.attached_class)
|
|
207
302
|
end
|
|
208
303
|
def self.new(
|
|
304
|
+
# Files attached to this entitlement. Add files via
|
|
305
|
+
# `POST /entitlements/{id}/files` and remove them via
|
|
306
|
+
# `DELETE /entitlements/{id}/files/{file_id}`.
|
|
209
307
|
digital_file_ids:,
|
|
308
|
+
# Optional external URL shown to the customer alongside the files.
|
|
210
309
|
external_url: nil,
|
|
310
|
+
# Optional human-readable delivery instructions shown to the customer alongside
|
|
311
|
+
# the files.
|
|
211
312
|
instructions: nil,
|
|
212
|
-
# Three-way patchable
|
|
313
|
+
# Three-way patchable list of legacy file identifiers:
|
|
213
314
|
#
|
|
214
|
-
# - omitted → preserve
|
|
215
|
-
# - `null` → clear
|
|
216
|
-
# - `[...]` → replace
|
|
315
|
+
# - omitted → preserve the current value
|
|
316
|
+
# - `null` → clear
|
|
317
|
+
# - `[...]` → replace
|
|
217
318
|
#
|
|
218
|
-
# On
|
|
219
|
-
#
|
|
319
|
+
# On create, an omitted field, an explicit `null`, or an empty array all result in
|
|
320
|
+
# no legacy files attached.
|
|
220
321
|
legacy_file_ids: nil
|
|
221
322
|
)
|
|
222
323
|
end
|
|
@@ -244,15 +345,22 @@ module Dodopayments
|
|
|
244
345
|
)
|
|
245
346
|
end
|
|
246
347
|
|
|
348
|
+
# Optional message displayed when a customer activates the license key (≤ 2500
|
|
349
|
+
# characters).
|
|
247
350
|
sig { returns(T.nilable(String)) }
|
|
248
351
|
attr_accessor :activation_message
|
|
249
352
|
|
|
353
|
+
# Maximum activations allowed per issued license key. Omit for unlimited.
|
|
250
354
|
sig { returns(T.nilable(Integer)) }
|
|
251
355
|
attr_accessor :activations_limit
|
|
252
356
|
|
|
357
|
+
# Validity duration of issued license keys. Provide both `duration_count` and
|
|
358
|
+
# `duration_interval` together for a fixed duration; omit both for non-expiring
|
|
359
|
+
# keys.
|
|
253
360
|
sig { returns(T.nilable(Integer)) }
|
|
254
361
|
attr_accessor :duration_count
|
|
255
362
|
|
|
363
|
+
# Unit of `duration_count`.
|
|
256
364
|
sig { returns(T.nilable(Dodopayments::TimeInterval::OrSymbol)) }
|
|
257
365
|
attr_accessor :duration_interval
|
|
258
366
|
|
|
@@ -265,9 +373,16 @@ module Dodopayments
|
|
|
265
373
|
).returns(T.attached_class)
|
|
266
374
|
end
|
|
267
375
|
def self.new(
|
|
376
|
+
# Optional message displayed when a customer activates the license key (≤ 2500
|
|
377
|
+
# characters).
|
|
268
378
|
activation_message: nil,
|
|
379
|
+
# Maximum activations allowed per issued license key. Omit for unlimited.
|
|
269
380
|
activations_limit: nil,
|
|
381
|
+
# Validity duration of issued license keys. Provide both `duration_count` and
|
|
382
|
+
# `duration_interval` together for a fixed duration; omit both for non-expiring
|
|
383
|
+
# keys.
|
|
270
384
|
duration_count: nil,
|
|
385
|
+
# Unit of `duration_count`.
|
|
271
386
|
duration_interval: nil
|
|
272
387
|
)
|
|
273
388
|
end
|