dodopayments 2.18.1 → 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 +8 -0
- data/README.md +1 -1
- data/lib/dodopayments/models/checkout_session_request.rb +5 -3
- 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/metadata.rb +15 -1
- data/lib/dodopayments/models/payment.rb +3 -3
- 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 +6 -3
- 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/checkout_session_request.rbi +9 -3
- 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/metadata.rbi +12 -1
- data/rbi/dodopayments/models/payment.rbi +3 -3
- 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 +11 -3
- 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/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
|
@@ -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
|
}
|
|
@@ -43,7 +43,7 @@ module Dodopayments
|
|
|
43
43
|
attr_accessor :integration_type
|
|
44
44
|
|
|
45
45
|
# Arbitrary key-value metadata recorded on the grant.
|
|
46
|
-
sig { returns(T::Hash[Symbol,
|
|
46
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
47
47
|
attr_accessor :metadata
|
|
48
48
|
|
|
49
49
|
# Lifecycle status of the grant.
|
|
@@ -83,6 +83,14 @@ module Dodopayments
|
|
|
83
83
|
sig { returns(T.nilable(String)) }
|
|
84
84
|
attr_accessor :error_message
|
|
85
85
|
|
|
86
|
+
# Typed feature payload, present only when the entitlement integration is
|
|
87
|
+
# `feature_flag`; `null` for every other integration type.
|
|
88
|
+
sig { returns(T.nilable(Dodopayments::Feature)) }
|
|
89
|
+
attr_reader :feature
|
|
90
|
+
|
|
91
|
+
sig { params(feature: T.nilable(Dodopayments::Feature::OrHash)).void }
|
|
92
|
+
attr_writer :feature
|
|
93
|
+
|
|
86
94
|
# License-key delivery payload, present when the entitlement integration is
|
|
87
95
|
# `license_key`.
|
|
88
96
|
sig { returns(T.nilable(Dodopayments::Entitlements::LicenseKeyGrant)) }
|
|
@@ -134,7 +142,7 @@ module Dodopayments
|
|
|
134
142
|
entitlement_id: String,
|
|
135
143
|
integration_type:
|
|
136
144
|
Dodopayments::EntitlementIntegrationType::OrSymbol,
|
|
137
|
-
metadata: T::Hash[Symbol,
|
|
145
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
138
146
|
status:
|
|
139
147
|
Dodopayments::Entitlements::EntitlementGrant::Status::OrSymbol,
|
|
140
148
|
updated_at: Time,
|
|
@@ -143,6 +151,7 @@ module Dodopayments
|
|
|
143
151
|
T.nilable(Dodopayments::DigitalProductDelivery::OrHash),
|
|
144
152
|
error_code: T.nilable(String),
|
|
145
153
|
error_message: T.nilable(String),
|
|
154
|
+
feature: T.nilable(Dodopayments::Feature::OrHash),
|
|
146
155
|
license_key:
|
|
147
156
|
T.nilable(Dodopayments::Entitlements::LicenseKeyGrant::OrHash),
|
|
148
157
|
oauth_expires_at: T.nilable(Time),
|
|
@@ -183,6 +192,9 @@ module Dodopayments
|
|
|
183
192
|
error_code: nil,
|
|
184
193
|
# Human-readable message reported when delivery failed, when applicable.
|
|
185
194
|
error_message: nil,
|
|
195
|
+
# Typed feature payload, present only when the entitlement integration is
|
|
196
|
+
# `feature_flag`; `null` for every other integration type.
|
|
197
|
+
feature: nil,
|
|
186
198
|
# License-key delivery payload, present when the entitlement integration is
|
|
187
199
|
# `license_key`.
|
|
188
200
|
license_key: nil,
|
|
@@ -214,7 +226,7 @@ module Dodopayments
|
|
|
214
226
|
entitlement_id: String,
|
|
215
227
|
integration_type:
|
|
216
228
|
Dodopayments::EntitlementIntegrationType::TaggedSymbol,
|
|
217
|
-
metadata: T::Hash[Symbol,
|
|
229
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
218
230
|
status:
|
|
219
231
|
Dodopayments::Entitlements::EntitlementGrant::Status::TaggedSymbol,
|
|
220
232
|
updated_at: Time,
|
|
@@ -223,6 +235,7 @@ module Dodopayments
|
|
|
223
235
|
T.nilable(Dodopayments::DigitalProductDelivery),
|
|
224
236
|
error_code: T.nilable(String),
|
|
225
237
|
error_message: T.nilable(String),
|
|
238
|
+
feature: T.nilable(Dodopayments::Feature),
|
|
226
239
|
license_key:
|
|
227
240
|
T.nilable(Dodopayments::Entitlements::LicenseKeyGrant),
|
|
228
241
|
oauth_expires_at: T.nilable(Time),
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class Feature < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Dodopayments::Feature, Dodopayments::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Identifier of the capability this grant confers.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :feature_id
|
|
14
|
+
|
|
15
|
+
# Type of capability conferred.
|
|
16
|
+
sig { returns(Dodopayments::FeatureType::TaggedSymbol) }
|
|
17
|
+
attr_accessor :feature_type
|
|
18
|
+
|
|
19
|
+
# Capability conferred by a `feature_flag` grant.
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
feature_id: String,
|
|
23
|
+
feature_type: Dodopayments::FeatureType::OrSymbol
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(
|
|
27
|
+
# Identifier of the capability this grant confers.
|
|
28
|
+
feature_id:,
|
|
29
|
+
# Type of capability conferred.
|
|
30
|
+
feature_type:
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
feature_id: String,
|
|
38
|
+
feature_type: Dodopayments::FeatureType::TaggedSymbol
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# Type of capability a `feature_flag` entitlement confers.
|
|
6
|
+
module FeatureType
|
|
7
|
+
extend Dodopayments::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, Dodopayments::FeatureType) }
|
|
10
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
11
|
+
|
|
12
|
+
BOOLEAN = T.let(:boolean, Dodopayments::FeatureType::TaggedSymbol)
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
override.returns(T::Array[Dodopayments::FeatureType::TaggedSymbol])
|
|
16
|
+
end
|
|
17
|
+
def self.values
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -4,12 +4,17 @@ module Dodopayments
|
|
|
4
4
|
module Models
|
|
5
5
|
# Integration-specific configuration supplied when creating or updating an
|
|
6
6
|
# entitlement. The shape required matches the entitlement's `integration_type`.
|
|
7
|
+
#
|
|
8
|
+
# Untagged enum: variants are matched in order. `FeatureFlag` must precede
|
|
9
|
+
# `LicenseKey`, whose fields are all optional and would otherwise match a
|
|
10
|
+
# `feature_flag` config.
|
|
7
11
|
module IntegrationConfig
|
|
8
12
|
extend Dodopayments::Internal::Type::Union
|
|
9
13
|
|
|
10
14
|
Variants =
|
|
11
15
|
T.type_alias do
|
|
12
16
|
T.any(
|
|
17
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig,
|
|
13
18
|
Dodopayments::IntegrationConfig::GitHubConfig,
|
|
14
19
|
Dodopayments::IntegrationConfig::DiscordConfig,
|
|
15
20
|
Dodopayments::IntegrationConfig::TelegramConfig,
|
|
@@ -21,6 +26,51 @@ module Dodopayments
|
|
|
21
26
|
)
|
|
22
27
|
end
|
|
23
28
|
|
|
29
|
+
class FeatureFlagConfig < Dodopayments::Internal::Type::BaseModel
|
|
30
|
+
OrHash =
|
|
31
|
+
T.type_alias do
|
|
32
|
+
T.any(
|
|
33
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig,
|
|
34
|
+
Dodopayments::Internal::AnyHash
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Merchant-chosen identifier for the capability this entitlement unlocks. Not
|
|
39
|
+
# unique across entitlements.
|
|
40
|
+
sig { returns(String) }
|
|
41
|
+
attr_accessor :feature_id
|
|
42
|
+
|
|
43
|
+
# Type of capability conferred.
|
|
44
|
+
sig { returns(Dodopayments::FeatureType::OrSymbol) }
|
|
45
|
+
attr_accessor :feature_type
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
feature_id: String,
|
|
50
|
+
feature_type: Dodopayments::FeatureType::OrSymbol
|
|
51
|
+
).returns(T.attached_class)
|
|
52
|
+
end
|
|
53
|
+
def self.new(
|
|
54
|
+
# Merchant-chosen identifier for the capability this entitlement unlocks. Not
|
|
55
|
+
# unique across entitlements.
|
|
56
|
+
feature_id:,
|
|
57
|
+
# Type of capability conferred.
|
|
58
|
+
feature_type:
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
override.returns(
|
|
64
|
+
{
|
|
65
|
+
feature_id: String,
|
|
66
|
+
feature_type: Dodopayments::FeatureType::OrSymbol
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
def to_hash
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
24
74
|
class GitHubConfig < Dodopayments::Internal::Type::BaseModel
|
|
25
75
|
OrHash =
|
|
26
76
|
T.type_alias do
|
|
@@ -12,6 +12,7 @@ module Dodopayments
|
|
|
12
12
|
Variants =
|
|
13
13
|
T.type_alias do
|
|
14
14
|
T.any(
|
|
15
|
+
Dodopayments::IntegrationConfigResponse::FeatureFlagConfig,
|
|
15
16
|
Dodopayments::IntegrationConfigResponse::GitHubConfig,
|
|
16
17
|
Dodopayments::IntegrationConfigResponse::DiscordConfig,
|
|
17
18
|
Dodopayments::IntegrationConfigResponse::TelegramConfig,
|
|
@@ -23,6 +24,49 @@ module Dodopayments
|
|
|
23
24
|
)
|
|
24
25
|
end
|
|
25
26
|
|
|
27
|
+
class FeatureFlagConfig < Dodopayments::Internal::Type::BaseModel
|
|
28
|
+
OrHash =
|
|
29
|
+
T.type_alias do
|
|
30
|
+
T.any(
|
|
31
|
+
Dodopayments::IntegrationConfigResponse::FeatureFlagConfig,
|
|
32
|
+
Dodopayments::Internal::AnyHash
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Merchant-chosen identifier for the capability this entitlement unlocks.
|
|
37
|
+
sig { returns(String) }
|
|
38
|
+
attr_accessor :feature_id
|
|
39
|
+
|
|
40
|
+
# Type of capability conferred. Only `boolean` is supported today.
|
|
41
|
+
sig { returns(Dodopayments::FeatureType::TaggedSymbol) }
|
|
42
|
+
attr_accessor :feature_type
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
feature_id: String,
|
|
47
|
+
feature_type: Dodopayments::FeatureType::OrSymbol
|
|
48
|
+
).returns(T.attached_class)
|
|
49
|
+
end
|
|
50
|
+
def self.new(
|
|
51
|
+
# Merchant-chosen identifier for the capability this entitlement unlocks.
|
|
52
|
+
feature_id:,
|
|
53
|
+
# Type of capability conferred. Only `boolean` is supported today.
|
|
54
|
+
feature_type:
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
sig do
|
|
59
|
+
override.returns(
|
|
60
|
+
{
|
|
61
|
+
feature_id: String,
|
|
62
|
+
feature_type: Dodopayments::FeatureType::TaggedSymbol
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
def to_hash
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
26
70
|
class GitHubConfig < Dodopayments::Internal::Type::BaseModel
|
|
27
71
|
OrHash =
|
|
28
72
|
T.type_alias do
|
|
@@ -2,9 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
module Dodopayments
|
|
4
4
|
module Models
|
|
5
|
+
# Metadata value can be a string, integer, number, or boolean
|
|
6
|
+
module MetadataItem
|
|
7
|
+
extend Dodopayments::Internal::Type::Union
|
|
8
|
+
|
|
9
|
+
Variants = T.type_alias { T.any(String, Float, T::Boolean) }
|
|
10
|
+
|
|
11
|
+
sig { override.returns(T::Array[Dodopayments::MetadataItem::Variants]) }
|
|
12
|
+
def self.variants
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
5
16
|
Metadata =
|
|
6
17
|
T.let(
|
|
7
|
-
Dodopayments::Internal::Type::HashOf[
|
|
18
|
+
Dodopayments::Internal::Type::HashOf[union: Dodopayments::MetadataItem],
|
|
8
19
|
Dodopayments::Internal::Type::Converter
|
|
9
20
|
)
|
|
10
21
|
end
|
|
@@ -49,7 +49,7 @@ module Dodopayments
|
|
|
49
49
|
attr_accessor :disputes
|
|
50
50
|
|
|
51
51
|
# Additional custom data associated with the payment
|
|
52
|
-
sig { returns(T::Hash[Symbol,
|
|
52
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
53
53
|
attr_accessor :metadata
|
|
54
54
|
|
|
55
55
|
# Unique identifier for the payment
|
|
@@ -198,7 +198,7 @@ module Dodopayments
|
|
|
198
198
|
customer: Dodopayments::CustomerLimitedDetails::OrHash,
|
|
199
199
|
digital_products_delivered: T::Boolean,
|
|
200
200
|
disputes: T::Array[Dodopayments::Dispute::OrHash],
|
|
201
|
-
metadata: T::Hash[Symbol,
|
|
201
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
202
202
|
payment_id: String,
|
|
203
203
|
payment_provider: Dodopayments::Payment::PaymentProvider::OrSymbol,
|
|
204
204
|
refunds: T::Array[Dodopayments::RefundListItem::OrHash],
|
|
@@ -340,7 +340,7 @@ module Dodopayments
|
|
|
340
340
|
customer: Dodopayments::CustomerLimitedDetails,
|
|
341
341
|
digital_products_delivered: T::Boolean,
|
|
342
342
|
disputes: T::Array[Dodopayments::Dispute],
|
|
343
|
-
metadata: T::Hash[Symbol,
|
|
343
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
344
344
|
payment_id: String,
|
|
345
345
|
payment_provider:
|
|
346
346
|
Dodopayments::Payment::PaymentProvider::TaggedSymbol,
|