stigg 0.1.0.pre.alpha.2 → 0.1.0.pre.alpha.3
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/stigg/internal/type/base_model.rb +2 -2
- data/lib/stigg/models/v1/{coupon_create_response.rb → coupon.rb} +24 -24
- data/lib/stigg/models/v1/customer_import_params.rb +75 -0
- data/lib/stigg/models/v1/customer_import_response.rb +35 -0
- data/lib/stigg/models/v1/{customer_create_params.rb → customer_provision_params.rb} +16 -16
- data/lib/stigg/models/v1/customer_response.rb +1 -1
- data/lib/stigg/models/v1/customers/promotional_entitlement_grant_params.rb +296 -0
- data/lib/stigg/models/v1/customers/promotional_entitlement_grant_response.rb +341 -0
- data/lib/stigg/models/v1/customers/promotional_entitlement_revoke_params.rb +24 -0
- data/lib/stigg/models/v1/customers/promotional_entitlement_revoke_response.rb +342 -0
- data/lib/stigg/models/v1/event_report_params.rb +91 -0
- data/lib/stigg/models/v1/event_report_response.rb +25 -0
- data/lib/stigg/models/v1/{subscription_retrieve_response.rb → subscription.rb} +30 -29
- data/lib/stigg/models/v1/subscription_cancel_params.rb +75 -0
- data/lib/stigg/models/v1/subscription_import_params.rb +92 -0
- data/lib/stigg/models/v1/subscription_import_response.rb +32 -0
- data/lib/stigg/models/v1/{subscription_create_params.rb → subscription_provision_params.rb} +118 -118
- data/lib/stigg/models/v1/{subscription_create_response.rb → subscription_provision_response.rb} +76 -75
- data/lib/stigg/models/v1/subscription_update_params.rb +1114 -0
- data/lib/stigg/models/v1/subscriptions/{future_update_cancel_pending_payment_response.rb → cancel_subscription.rb} +7 -5
- data/lib/stigg/models/v1/usage_history_params.rb +54 -0
- data/lib/stigg/models/v1/usage_history_response.rb +155 -0
- data/lib/stigg/models/v1/usage_report_params.rb +114 -0
- data/lib/stigg/models/v1/usage_report_response.rb +120 -0
- data/lib/stigg/models.rb +0 -4
- data/lib/stigg/resources/v1/coupons.rb +4 -4
- data/lib/stigg/resources/v1/customers/promotional_entitlements.rb +69 -0
- data/lib/stigg/resources/v1/customers.rb +59 -37
- data/lib/stigg/resources/v1/events.rb +38 -0
- data/lib/stigg/resources/v1/subscriptions/future_update.rb +4 -4
- data/lib/stigg/resources/v1/subscriptions.rb +166 -64
- data/lib/stigg/resources/v1/usage.rb +79 -0
- data/lib/stigg/resources/v1.rb +6 -42
- data/lib/stigg/version.rb +1 -1
- data/lib/stigg.rb +25 -16
- data/rbi/stigg/models/v1/{coupon_create_response.rbi → coupon.rbi} +156 -252
- data/rbi/stigg/models/v1/customer_import_params.rbi +130 -0
- data/rbi/stigg/models/v1/customer_import_response.rbi +76 -0
- data/rbi/stigg/models/v1/{customer_create_params.rbi → customer_provision_params.rbi} +35 -35
- data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_params.rbi +640 -0
- data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_response.rbi +690 -0
- data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_params.rbi +42 -0
- data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbi +696 -0
- data/rbi/stigg/models/v1/event_report_params.rbi +168 -0
- data/rbi/stigg/models/v1/event_report_response.rbi +35 -0
- data/rbi/stigg/models/v1/{subscription_migrate_response.rbi → subscription.rbi} +66 -117
- data/rbi/stigg/models/v1/subscription_cancel_params.rbi +182 -0
- data/rbi/stigg/models/v1/subscription_import_params.rbi +148 -0
- data/rbi/stigg/models/v1/subscription_import_response.rbi +69 -0
- data/rbi/stigg/models/v1/{subscription_create_params.rbi → subscription_provision_params.rbi} +794 -773
- data/rbi/stigg/models/v1/{subscription_create_response.rbi → subscription_provision_response.rbi} +481 -481
- data/rbi/stigg/models/v1/subscription_update_params.rbi +3578 -0
- data/rbi/stigg/models/v1/subscriptions/{future_update_cancel_schedule_response.rbi → cancel_subscription.rbi} +9 -16
- data/rbi/stigg/models/v1/usage_history_params.rbi +79 -0
- data/rbi/stigg/models/v1/usage_history_response.rbi +347 -0
- data/rbi/stigg/models/v1/usage_report_params.rbi +227 -0
- data/rbi/stigg/models/v1/usage_report_response.rbi +162 -0
- data/rbi/stigg/models.rbi +0 -4
- data/rbi/stigg/resources/v1/coupons.rbi +2 -2
- data/rbi/stigg/resources/v1/customers/promotional_entitlements.rbi +57 -0
- data/rbi/stigg/resources/v1/customers.rbi +53 -36
- data/rbi/stigg/resources/v1/events.rbi +28 -0
- data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +2 -6
- data/rbi/stigg/resources/v1/subscriptions.rbi +179 -74
- data/rbi/stigg/resources/v1/usage.rbi +57 -0
- data/rbi/stigg/resources/v1.rbi +4 -26
- data/sig/stigg/models/v1/{coupon_create_response.rbs → coupon.rbs} +29 -32
- data/sig/stigg/models/v1/customer_import_params.rbs +74 -0
- data/sig/stigg/models/v1/customer_import_response.rbs +30 -0
- data/sig/stigg/models/v1/{customer_create_params.rbs → customer_provision_params.rbs} +22 -22
- data/sig/stigg/models/v1/customers/promotional_entitlement_grant_params.rbs +234 -0
- data/sig/stigg/models/v1/customers/promotional_entitlement_grant_response.rbs +281 -0
- data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_params.rbs +27 -0
- data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbs +281 -0
- data/sig/stigg/models/v1/event_report_params.rbs +82 -0
- data/sig/stigg/models/v1/event_report_response.rbs +15 -0
- data/sig/stigg/models/v1/{subscription_retrieve_response.rbs → subscription.rbs} +36 -41
- data/sig/stigg/models/v1/subscription_cancel_params.rbs +79 -0
- data/sig/stigg/models/v1/subscription_import_params.rbs +84 -0
- data/sig/stigg/models/v1/subscription_import_response.rbs +30 -0
- data/sig/stigg/models/v1/{subscription_create_params.rbs → subscription_provision_params.rbs} +200 -200
- data/sig/stigg/models/v1/{subscription_create_response.rbs → subscription_provision_response.rbs} +106 -106
- data/sig/stigg/models/v1/subscription_update_params.rbs +1544 -0
- data/sig/stigg/models/v1/subscriptions/cancel_subscription.rbs +34 -0
- data/sig/stigg/models/v1/usage_history_params.rbs +52 -0
- data/sig/stigg/models/v1/usage_history_response.rbs +129 -0
- data/sig/stigg/models/v1/usage_report_params.rbs +102 -0
- data/sig/stigg/models/v1/usage_report_response.rbs +87 -0
- data/sig/stigg/models.rbs +0 -4
- data/sig/stigg/resources/v1/coupons.rbs +2 -2
- data/sig/stigg/resources/v1/customers/promotional_entitlements.rbs +23 -0
- data/sig/stigg/resources/v1/customers.rbs +17 -12
- data/sig/stigg/resources/v1/events.rbs +14 -0
- data/sig/stigg/resources/v1/subscriptions/future_update.rbs +2 -2
- data/sig/stigg/resources/v1/subscriptions.rbs +65 -32
- data/sig/stigg/resources/v1/usage.rbs +24 -0
- data/sig/stigg/resources/v1.rbs +2 -8
- metadata +77 -50
- data/lib/stigg/models/v1/coupon_retrieve_response.rb +0 -322
- data/lib/stigg/models/v1/subscription_delegate_response.rb +0 -314
- data/lib/stigg/models/v1/subscription_migrate_response.rb +0 -314
- data/lib/stigg/models/v1/subscription_transfer_response.rb +0 -314
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +0 -34
- data/lib/stigg/models/v1_create_event_params.rb +0 -89
- data/lib/stigg/models/v1_create_event_response.rb +0 -23
- data/lib/stigg/models/v1_create_usage_params.rb +0 -112
- data/lib/stigg/models/v1_create_usage_response.rb +0 -118
- data/lib/stigg/resources/v1/customers/usage.rb +0 -18
- data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +0 -987
- data/rbi/stigg/models/v1/subscription_delegate_response.rbi +0 -618
- data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +0 -618
- data/rbi/stigg/models/v1/subscription_transfer_response.rbi +0 -618
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +0 -80
- data/rbi/stigg/models/v1_create_event_params.rbi +0 -161
- data/rbi/stigg/models/v1_create_event_response.rbi +0 -30
- data/rbi/stigg/models/v1_create_usage_params.rbi +0 -217
- data/rbi/stigg/models/v1_create_usage_response.rbi +0 -157
- data/rbi/stigg/resources/v1/customers/usage.rbi +0 -16
- data/sig/stigg/models/v1/coupon_retrieve_response.rbs +0 -394
- data/sig/stigg/models/v1/subscription_delegate_response.rbs +0 -255
- data/sig/stigg/models/v1/subscription_migrate_response.rbs +0 -255
- data/sig/stigg/models/v1/subscription_transfer_response.rbs +0 -255
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbs +0 -34
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbs +0 -34
- data/sig/stigg/models/v1_create_event_params.rbs +0 -80
- data/sig/stigg/models/v1_create_event_response.rbs +0 -13
- data/sig/stigg/models/v1_create_usage_params.rbs +0 -100
- data/sig/stigg/models/v1_create_usage_response.rbs +0 -85
- data/sig/stigg/resources/v1/customers/usage.rbs +0 -11
|
@@ -7,113 +7,76 @@ module Stigg
|
|
|
7
7
|
sig { returns(Stigg::Resources::V1::Subscriptions::FutureUpdate) }
|
|
8
8
|
attr_reader :future_update
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# Get a single subscription by ID
|
|
11
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
id: String,
|
|
14
|
+
request_options: Stigg::RequestOptions::OrHash
|
|
15
|
+
).returns(Stigg::V1::Subscription)
|
|
16
|
+
end
|
|
17
|
+
def retrieve(
|
|
18
|
+
# The unique identifier of the entity
|
|
19
|
+
id,
|
|
20
|
+
request_options: {}
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Update a subscription
|
|
11
25
|
sig do
|
|
12
26
|
params(
|
|
13
|
-
customer_id: String,
|
|
14
|
-
plan_id: String,
|
|
15
27
|
id: String,
|
|
16
28
|
addons:
|
|
17
|
-
T::Array[Stigg::V1::
|
|
29
|
+
T::Array[Stigg::V1::SubscriptionUpdateParams::Addon::OrHash],
|
|
18
30
|
applied_coupon:
|
|
19
|
-
Stigg::V1::
|
|
31
|
+
Stigg::V1::SubscriptionUpdateParams::AppliedCoupon::OrHash,
|
|
20
32
|
await_payment_confirmation: T::Boolean,
|
|
21
|
-
billing_country_code: T.nilable(String),
|
|
22
|
-
billing_id: T.nilable(String),
|
|
23
33
|
billing_information:
|
|
24
|
-
Stigg::V1::
|
|
34
|
+
Stigg::V1::SubscriptionUpdateParams::BillingInformation::OrHash,
|
|
25
35
|
billing_period:
|
|
26
|
-
Stigg::V1::
|
|
36
|
+
Stigg::V1::SubscriptionUpdateParams::BillingPeriod::OrSymbol,
|
|
27
37
|
budget:
|
|
28
|
-
T.nilable(Stigg::V1::
|
|
38
|
+
T.nilable(Stigg::V1::SubscriptionUpdateParams::Budget::OrHash),
|
|
29
39
|
charges:
|
|
30
|
-
T::Array[Stigg::V1::
|
|
31
|
-
checkout_options:
|
|
32
|
-
Stigg::V1::SubscriptionCreateParams::CheckoutOptions::OrHash,
|
|
40
|
+
T::Array[Stigg::V1::SubscriptionUpdateParams::Charge::OrHash],
|
|
33
41
|
metadata: T::Hash[Symbol, String],
|
|
34
42
|
minimum_spend:
|
|
35
43
|
T.nilable(
|
|
36
|
-
Stigg::V1::
|
|
44
|
+
Stigg::V1::SubscriptionUpdateParams::MinimumSpend::OrHash
|
|
37
45
|
),
|
|
38
|
-
paying_customer_id: T.nilable(String),
|
|
39
|
-
payment_collection_method:
|
|
40
|
-
Stigg::V1::SubscriptionCreateParams::PaymentCollectionMethod::OrSymbol,
|
|
41
46
|
price_overrides:
|
|
42
47
|
T::Array[
|
|
43
|
-
Stigg::V1::
|
|
48
|
+
Stigg::V1::SubscriptionUpdateParams::PriceOverride::OrHash
|
|
44
49
|
],
|
|
45
|
-
|
|
46
|
-
salesforce_id: T.nilable(String),
|
|
50
|
+
promotion_code: String,
|
|
47
51
|
schedule_strategy:
|
|
48
|
-
Stigg::V1::
|
|
49
|
-
start_date: Time,
|
|
52
|
+
Stigg::V1::SubscriptionUpdateParams::ScheduleStrategy::OrSymbol,
|
|
50
53
|
subscription_entitlements:
|
|
51
54
|
T::Array[
|
|
52
|
-
Stigg::V1::
|
|
55
|
+
Stigg::V1::SubscriptionUpdateParams::SubscriptionEntitlement::OrHash
|
|
53
56
|
],
|
|
54
|
-
|
|
55
|
-
Stigg::V1::SubscriptionCreateParams::TrialOverrideConfiguration::OrHash,
|
|
56
|
-
unit_quantity: Float,
|
|
57
|
+
trial_end_date: Time,
|
|
57
58
|
request_options: Stigg::RequestOptions::OrHash
|
|
58
|
-
).returns(Stigg::
|
|
59
|
+
).returns(Stigg::V1::Subscription)
|
|
59
60
|
end
|
|
60
|
-
def
|
|
61
|
-
#
|
|
62
|
-
|
|
63
|
-
# Plan ID to provision
|
|
64
|
-
plan_id:,
|
|
65
|
-
# Unique identifier for the subscription
|
|
66
|
-
id: nil,
|
|
61
|
+
def update(
|
|
62
|
+
# The unique identifier of the entity
|
|
63
|
+
id,
|
|
67
64
|
addons: nil,
|
|
68
|
-
# Coupon configuration
|
|
69
65
|
applied_coupon: nil,
|
|
70
|
-
# Whether to wait for payment confirmation before returning the subscription
|
|
71
66
|
await_payment_confirmation: nil,
|
|
72
|
-
# The ISO 3166-1 alpha-2 country code for billing
|
|
73
|
-
billing_country_code: nil,
|
|
74
|
-
# External billing system identifier
|
|
75
|
-
billing_id: nil,
|
|
76
67
|
billing_information: nil,
|
|
77
|
-
# Billing period (MONTHLY or ANNUALLY)
|
|
78
68
|
billing_period: nil,
|
|
79
69
|
budget: nil,
|
|
80
70
|
charges: nil,
|
|
81
|
-
# Checkout page configuration for payment collection
|
|
82
|
-
checkout_options: nil,
|
|
83
71
|
# Additional metadata for the subscription
|
|
84
72
|
metadata: nil,
|
|
85
73
|
minimum_spend: nil,
|
|
86
|
-
# Optional paying customer ID for split billing scenarios
|
|
87
|
-
paying_customer_id: nil,
|
|
88
|
-
# How payments should be collected for this subscription
|
|
89
|
-
payment_collection_method: nil,
|
|
90
74
|
price_overrides: nil,
|
|
91
|
-
|
|
92
|
-
resource_id: nil,
|
|
93
|
-
# Salesforce ID
|
|
94
|
-
salesforce_id: nil,
|
|
95
|
-
# Strategy for scheduling subscription changes
|
|
75
|
+
promotion_code: nil,
|
|
96
76
|
schedule_strategy: nil,
|
|
97
|
-
# Subscription start date
|
|
98
|
-
start_date: nil,
|
|
99
77
|
subscription_entitlements: nil,
|
|
100
|
-
#
|
|
101
|
-
|
|
102
|
-
unit_quantity: nil,
|
|
103
|
-
request_options: {}
|
|
104
|
-
)
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
# Get a single subscription by ID
|
|
108
|
-
sig do
|
|
109
|
-
params(
|
|
110
|
-
id: String,
|
|
111
|
-
request_options: Stigg::RequestOptions::OrHash
|
|
112
|
-
).returns(Stigg::Models::V1::SubscriptionRetrieveResponse)
|
|
113
|
-
end
|
|
114
|
-
def retrieve(
|
|
115
|
-
# The unique identifier of the entity
|
|
116
|
-
id,
|
|
78
|
+
# Subscription trial end date
|
|
79
|
+
trial_end_date: nil,
|
|
117
80
|
request_options: {}
|
|
118
81
|
)
|
|
119
82
|
end
|
|
@@ -148,13 +111,41 @@ module Stigg
|
|
|
148
111
|
)
|
|
149
112
|
end
|
|
150
113
|
|
|
114
|
+
# Cancel subscription
|
|
115
|
+
sig do
|
|
116
|
+
params(
|
|
117
|
+
id: String,
|
|
118
|
+
cancellation_action:
|
|
119
|
+
Stigg::V1::SubscriptionCancelParams::CancellationAction::OrSymbol,
|
|
120
|
+
cancellation_time:
|
|
121
|
+
Stigg::V1::SubscriptionCancelParams::CancellationTime::OrSymbol,
|
|
122
|
+
end_date: Time,
|
|
123
|
+
prorate: T::Boolean,
|
|
124
|
+
request_options: Stigg::RequestOptions::OrHash
|
|
125
|
+
).returns(Stigg::V1::Subscription)
|
|
126
|
+
end
|
|
127
|
+
def cancel(
|
|
128
|
+
# The unique identifier of the entity
|
|
129
|
+
id,
|
|
130
|
+
# Action on cancellation (downgrade or revoke)
|
|
131
|
+
cancellation_action: nil,
|
|
132
|
+
# When to cancel (immediate, period end, or date)
|
|
133
|
+
cancellation_time: nil,
|
|
134
|
+
# Subscription end date
|
|
135
|
+
end_date: nil,
|
|
136
|
+
# If set, enables or disables prorating of credits on subscription cancellation.
|
|
137
|
+
prorate: nil,
|
|
138
|
+
request_options: {}
|
|
139
|
+
)
|
|
140
|
+
end
|
|
141
|
+
|
|
151
142
|
# Delegate subscription payment to customer
|
|
152
143
|
sig do
|
|
153
144
|
params(
|
|
154
145
|
id: String,
|
|
155
146
|
target_customer_id: String,
|
|
156
147
|
request_options: Stigg::RequestOptions::OrHash
|
|
157
|
-
).returns(Stigg::
|
|
148
|
+
).returns(Stigg::V1::Subscription)
|
|
158
149
|
end
|
|
159
150
|
def delegate(
|
|
160
151
|
# The unique identifier of the entity
|
|
@@ -167,6 +158,23 @@ module Stigg
|
|
|
167
158
|
)
|
|
168
159
|
end
|
|
169
160
|
|
|
161
|
+
# Bulk import subscriptions
|
|
162
|
+
sig do
|
|
163
|
+
params(
|
|
164
|
+
subscriptions:
|
|
165
|
+
T::Array[
|
|
166
|
+
Stigg::V1::SubscriptionImportParams::Subscription::OrHash
|
|
167
|
+
],
|
|
168
|
+
request_options: Stigg::RequestOptions::OrHash
|
|
169
|
+
).returns(Stigg::Models::V1::SubscriptionImportResponse)
|
|
170
|
+
end
|
|
171
|
+
def import(
|
|
172
|
+
# List of subscription objects to import
|
|
173
|
+
subscriptions:,
|
|
174
|
+
request_options: {}
|
|
175
|
+
)
|
|
176
|
+
end
|
|
177
|
+
|
|
170
178
|
# Migrate subscription to latest plan version
|
|
171
179
|
sig do
|
|
172
180
|
params(
|
|
@@ -174,7 +182,7 @@ module Stigg
|
|
|
174
182
|
subscription_migration_time:
|
|
175
183
|
Stigg::V1::SubscriptionMigrateParams::SubscriptionMigrationTime::OrSymbol,
|
|
176
184
|
request_options: Stigg::RequestOptions::OrHash
|
|
177
|
-
).returns(Stigg::
|
|
185
|
+
).returns(Stigg::V1::Subscription)
|
|
178
186
|
end
|
|
179
187
|
def migrate(
|
|
180
188
|
# The unique identifier of the entity
|
|
@@ -251,13 +259,110 @@ module Stigg
|
|
|
251
259
|
)
|
|
252
260
|
end
|
|
253
261
|
|
|
262
|
+
# Provision subscription
|
|
263
|
+
sig do
|
|
264
|
+
params(
|
|
265
|
+
customer_id: String,
|
|
266
|
+
plan_id: String,
|
|
267
|
+
id: String,
|
|
268
|
+
addons:
|
|
269
|
+
T::Array[Stigg::V1::SubscriptionProvisionParams::Addon::OrHash],
|
|
270
|
+
applied_coupon:
|
|
271
|
+
Stigg::V1::SubscriptionProvisionParams::AppliedCoupon::OrHash,
|
|
272
|
+
await_payment_confirmation: T::Boolean,
|
|
273
|
+
billing_country_code: T.nilable(String),
|
|
274
|
+
billing_id: T.nilable(String),
|
|
275
|
+
billing_information:
|
|
276
|
+
Stigg::V1::SubscriptionProvisionParams::BillingInformation::OrHash,
|
|
277
|
+
billing_period:
|
|
278
|
+
Stigg::V1::SubscriptionProvisionParams::BillingPeriod::OrSymbol,
|
|
279
|
+
budget:
|
|
280
|
+
T.nilable(Stigg::V1::SubscriptionProvisionParams::Budget::OrHash),
|
|
281
|
+
charges:
|
|
282
|
+
T::Array[Stigg::V1::SubscriptionProvisionParams::Charge::OrHash],
|
|
283
|
+
checkout_options:
|
|
284
|
+
Stigg::V1::SubscriptionProvisionParams::CheckoutOptions::OrHash,
|
|
285
|
+
metadata: T::Hash[Symbol, String],
|
|
286
|
+
minimum_spend:
|
|
287
|
+
T.nilable(
|
|
288
|
+
Stigg::V1::SubscriptionProvisionParams::MinimumSpend::OrHash
|
|
289
|
+
),
|
|
290
|
+
paying_customer_id: T.nilable(String),
|
|
291
|
+
payment_collection_method:
|
|
292
|
+
Stigg::V1::SubscriptionProvisionParams::PaymentCollectionMethod::OrSymbol,
|
|
293
|
+
price_overrides:
|
|
294
|
+
T::Array[
|
|
295
|
+
Stigg::V1::SubscriptionProvisionParams::PriceOverride::OrHash
|
|
296
|
+
],
|
|
297
|
+
resource_id: T.nilable(String),
|
|
298
|
+
salesforce_id: T.nilable(String),
|
|
299
|
+
schedule_strategy:
|
|
300
|
+
Stigg::V1::SubscriptionProvisionParams::ScheduleStrategy::OrSymbol,
|
|
301
|
+
start_date: Time,
|
|
302
|
+
subscription_entitlements:
|
|
303
|
+
T::Array[
|
|
304
|
+
Stigg::V1::SubscriptionProvisionParams::SubscriptionEntitlement::OrHash
|
|
305
|
+
],
|
|
306
|
+
trial_override_configuration:
|
|
307
|
+
Stigg::V1::SubscriptionProvisionParams::TrialOverrideConfiguration::OrHash,
|
|
308
|
+
unit_quantity: Float,
|
|
309
|
+
request_options: Stigg::RequestOptions::OrHash
|
|
310
|
+
).returns(Stigg::Models::V1::SubscriptionProvisionResponse)
|
|
311
|
+
end
|
|
312
|
+
def provision(
|
|
313
|
+
# Customer ID to provision the subscription for
|
|
314
|
+
customer_id:,
|
|
315
|
+
# Plan ID to provision
|
|
316
|
+
plan_id:,
|
|
317
|
+
# Unique identifier for the subscription
|
|
318
|
+
id: nil,
|
|
319
|
+
addons: nil,
|
|
320
|
+
# Coupon configuration
|
|
321
|
+
applied_coupon: nil,
|
|
322
|
+
# Whether to wait for payment confirmation before returning the subscription
|
|
323
|
+
await_payment_confirmation: nil,
|
|
324
|
+
# The ISO 3166-1 alpha-2 country code for billing
|
|
325
|
+
billing_country_code: nil,
|
|
326
|
+
# External billing system identifier
|
|
327
|
+
billing_id: nil,
|
|
328
|
+
billing_information: nil,
|
|
329
|
+
# Billing period (MONTHLY or ANNUALLY)
|
|
330
|
+
billing_period: nil,
|
|
331
|
+
budget: nil,
|
|
332
|
+
charges: nil,
|
|
333
|
+
# Checkout page configuration for payment collection
|
|
334
|
+
checkout_options: nil,
|
|
335
|
+
# Additional metadata for the subscription
|
|
336
|
+
metadata: nil,
|
|
337
|
+
minimum_spend: nil,
|
|
338
|
+
# Optional paying customer ID for split billing scenarios
|
|
339
|
+
paying_customer_id: nil,
|
|
340
|
+
# How payments should be collected for this subscription
|
|
341
|
+
payment_collection_method: nil,
|
|
342
|
+
price_overrides: nil,
|
|
343
|
+
# Optional resource ID for multi-instance subscriptions
|
|
344
|
+
resource_id: nil,
|
|
345
|
+
# Salesforce ID
|
|
346
|
+
salesforce_id: nil,
|
|
347
|
+
# Strategy for scheduling subscription changes
|
|
348
|
+
schedule_strategy: nil,
|
|
349
|
+
# Subscription start date
|
|
350
|
+
start_date: nil,
|
|
351
|
+
subscription_entitlements: nil,
|
|
352
|
+
# Trial period override settings
|
|
353
|
+
trial_override_configuration: nil,
|
|
354
|
+
unit_quantity: nil,
|
|
355
|
+
request_options: {}
|
|
356
|
+
)
|
|
357
|
+
end
|
|
358
|
+
|
|
254
359
|
# Transfer subscription to resource
|
|
255
360
|
sig do
|
|
256
361
|
params(
|
|
257
362
|
id: String,
|
|
258
363
|
destination_resource_id: String,
|
|
259
364
|
request_options: Stigg::RequestOptions::OrHash
|
|
260
|
-
).returns(Stigg::
|
|
365
|
+
).returns(Stigg::V1::Subscription)
|
|
261
366
|
end
|
|
262
367
|
def transfer(
|
|
263
368
|
# The unique identifier of the entity
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Resources
|
|
5
|
+
class V1
|
|
6
|
+
class Usage
|
|
7
|
+
# Get usage history
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
feature_id: String,
|
|
11
|
+
customer_id: String,
|
|
12
|
+
start_date: Time,
|
|
13
|
+
end_date: Time,
|
|
14
|
+
group_by: String,
|
|
15
|
+
resource_id: T.nilable(String),
|
|
16
|
+
request_options: Stigg::RequestOptions::OrHash
|
|
17
|
+
).returns(Stigg::Models::V1::UsageHistoryResponse)
|
|
18
|
+
end
|
|
19
|
+
def history(
|
|
20
|
+
# Path param: Feature id
|
|
21
|
+
feature_id,
|
|
22
|
+
# Path param: Customer id
|
|
23
|
+
customer_id:,
|
|
24
|
+
# Query param: The start date of the range
|
|
25
|
+
start_date:,
|
|
26
|
+
# Query param: The end date of the range
|
|
27
|
+
end_date: nil,
|
|
28
|
+
# Query param
|
|
29
|
+
group_by: nil,
|
|
30
|
+
# Query param: Resource id
|
|
31
|
+
resource_id: nil,
|
|
32
|
+
request_options: {}
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Report usage measurements
|
|
37
|
+
sig do
|
|
38
|
+
params(
|
|
39
|
+
usages: T::Array[Stigg::V1::UsageReportParams::Usage::OrHash],
|
|
40
|
+
request_options: Stigg::RequestOptions::OrHash
|
|
41
|
+
).returns(Stigg::Models::V1::UsageReportResponse)
|
|
42
|
+
end
|
|
43
|
+
def report(
|
|
44
|
+
# A list of usage reports to be submitted in bulk
|
|
45
|
+
usages:,
|
|
46
|
+
request_options: {}
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# @api private
|
|
51
|
+
sig { params(client: Stigg::Client).returns(T.attached_class) }
|
|
52
|
+
def self.new(client:)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
data/rbi/stigg/resources/v1.rbi
CHANGED
|
@@ -12,33 +12,11 @@ module Stigg
|
|
|
12
12
|
sig { returns(Stigg::Resources::V1::Coupons) }
|
|
13
13
|
attr_reader :coupons
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
params(
|
|
18
|
-
events: T::Array[Stigg::V1CreateEventParams::Event::OrHash],
|
|
19
|
-
request_options: Stigg::RequestOptions::OrHash
|
|
20
|
-
).returns(Stigg::Models::V1CreateEventResponse)
|
|
21
|
-
end
|
|
22
|
-
def create_event(
|
|
23
|
-
# A list of usage events to report
|
|
24
|
-
events:,
|
|
25
|
-
request_options: {}
|
|
26
|
-
)
|
|
27
|
-
end
|
|
15
|
+
sig { returns(Stigg::Resources::V1::Events) }
|
|
16
|
+
attr_reader :events
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
params(
|
|
32
|
-
usages: T::Array[Stigg::V1CreateUsageParams::Usage::OrHash],
|
|
33
|
-
request_options: Stigg::RequestOptions::OrHash
|
|
34
|
-
).returns(Stigg::Models::V1CreateUsageResponse)
|
|
35
|
-
end
|
|
36
|
-
def create_usage(
|
|
37
|
-
# A list of usage reports to be submitted in bulk
|
|
38
|
-
usages:,
|
|
39
|
-
request_options: {}
|
|
40
|
-
)
|
|
41
|
-
end
|
|
18
|
+
sig { returns(Stigg::Resources::V1::Usage) }
|
|
19
|
+
attr_reader :usage
|
|
42
20
|
|
|
43
21
|
# @api private
|
|
44
22
|
sig { params(client: Stigg::Client).returns(T.attached_class) }
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
module Stigg
|
|
2
2
|
module Models
|
|
3
3
|
module V1
|
|
4
|
-
type
|
|
5
|
-
{ data: Stigg::Models::V1::CouponCreateResponse::Data }
|
|
4
|
+
type coupon = { data: Stigg::V1::Coupon::Data }
|
|
6
5
|
|
|
7
|
-
class
|
|
8
|
-
attr_accessor data: Stigg::
|
|
6
|
+
class Coupon < Stigg::Internal::Type::BaseModel
|
|
7
|
+
attr_accessor data: Stigg::V1::Coupon::Data
|
|
9
8
|
|
|
10
|
-
def initialize: (
|
|
11
|
-
data: Stigg::Models::V1::CouponCreateResponse::Data
|
|
12
|
-
) -> void
|
|
9
|
+
def initialize: (data: Stigg::V1::Coupon::Data) -> void
|
|
13
10
|
|
|
14
|
-
def to_hash: -> { data: Stigg::
|
|
11
|
+
def to_hash: -> { data: Stigg::V1::Coupon::Data }
|
|
15
12
|
|
|
16
13
|
type data =
|
|
17
14
|
{
|
|
18
15
|
id: String,
|
|
19
|
-
amounts_off: ::Array[Stigg::
|
|
16
|
+
amounts_off: ::Array[Stigg::V1::Coupon::Data::AmountsOff]?,
|
|
20
17
|
billing_id: String?,
|
|
21
18
|
billing_link_url: String?,
|
|
22
19
|
created_at: Time,
|
|
@@ -24,16 +21,16 @@ module Stigg
|
|
|
24
21
|
duration_in_months: Float?,
|
|
25
22
|
name: String,
|
|
26
23
|
percent_off: Float?,
|
|
27
|
-
source: Stigg::Models::V1::
|
|
28
|
-
status: Stigg::Models::V1::
|
|
29
|
-
type: Stigg::Models::V1::
|
|
24
|
+
source: Stigg::Models::V1::Coupon::Data::source?,
|
|
25
|
+
status: Stigg::Models::V1::Coupon::Data::status,
|
|
26
|
+
type: Stigg::Models::V1::Coupon::Data::type_,
|
|
30
27
|
updated_at: Time
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
class Data < Stigg::Internal::Type::BaseModel
|
|
34
31
|
attr_accessor id: String
|
|
35
32
|
|
|
36
|
-
attr_accessor amounts_off: ::Array[Stigg::
|
|
33
|
+
attr_accessor amounts_off: ::Array[Stigg::V1::Coupon::Data::AmountsOff]?
|
|
37
34
|
|
|
38
35
|
attr_accessor billing_id: String?
|
|
39
36
|
|
|
@@ -49,17 +46,17 @@ module Stigg
|
|
|
49
46
|
|
|
50
47
|
attr_accessor percent_off: Float?
|
|
51
48
|
|
|
52
|
-
attr_accessor source: Stigg::Models::V1::
|
|
49
|
+
attr_accessor source: Stigg::Models::V1::Coupon::Data::source?
|
|
53
50
|
|
|
54
|
-
attr_accessor status: Stigg::Models::V1::
|
|
51
|
+
attr_accessor status: Stigg::Models::V1::Coupon::Data::status
|
|
55
52
|
|
|
56
|
-
attr_accessor type: Stigg::Models::V1::
|
|
53
|
+
attr_accessor type: Stigg::Models::V1::Coupon::Data::type_
|
|
57
54
|
|
|
58
55
|
attr_accessor updated_at: Time
|
|
59
56
|
|
|
60
57
|
def initialize: (
|
|
61
58
|
id: String,
|
|
62
|
-
amounts_off: ::Array[Stigg::
|
|
59
|
+
amounts_off: ::Array[Stigg::V1::Coupon::Data::AmountsOff]?,
|
|
63
60
|
billing_id: String?,
|
|
64
61
|
billing_link_url: String?,
|
|
65
62
|
created_at: Time,
|
|
@@ -67,15 +64,15 @@ module Stigg
|
|
|
67
64
|
duration_in_months: Float?,
|
|
68
65
|
name: String,
|
|
69
66
|
percent_off: Float?,
|
|
70
|
-
source: Stigg::Models::V1::
|
|
71
|
-
status: Stigg::Models::V1::
|
|
72
|
-
type: Stigg::Models::V1::
|
|
67
|
+
source: Stigg::Models::V1::Coupon::Data::source?,
|
|
68
|
+
status: Stigg::Models::V1::Coupon::Data::status,
|
|
69
|
+
type: Stigg::Models::V1::Coupon::Data::type_,
|
|
73
70
|
updated_at: Time
|
|
74
71
|
) -> void
|
|
75
72
|
|
|
76
73
|
def to_hash: -> {
|
|
77
74
|
id: String,
|
|
78
|
-
amounts_off: ::Array[Stigg::
|
|
75
|
+
amounts_off: ::Array[Stigg::V1::Coupon::Data::AmountsOff]?,
|
|
79
76
|
billing_id: String?,
|
|
80
77
|
billing_link_url: String?,
|
|
81
78
|
created_at: Time,
|
|
@@ -83,31 +80,31 @@ module Stigg
|
|
|
83
80
|
duration_in_months: Float?,
|
|
84
81
|
name: String,
|
|
85
82
|
percent_off: Float?,
|
|
86
|
-
source: Stigg::Models::V1::
|
|
87
|
-
status: Stigg::Models::V1::
|
|
88
|
-
type: Stigg::Models::V1::
|
|
83
|
+
source: Stigg::Models::V1::Coupon::Data::source?,
|
|
84
|
+
status: Stigg::Models::V1::Coupon::Data::status,
|
|
85
|
+
type: Stigg::Models::V1::Coupon::Data::type_,
|
|
89
86
|
updated_at: Time
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
type amounts_off =
|
|
93
90
|
{
|
|
94
91
|
amount: Float,
|
|
95
|
-
currency: Stigg::Models::V1::
|
|
92
|
+
currency: Stigg::Models::V1::Coupon::Data::AmountsOff::currency
|
|
96
93
|
}
|
|
97
94
|
|
|
98
95
|
class AmountsOff < Stigg::Internal::Type::BaseModel
|
|
99
96
|
attr_accessor amount: Float
|
|
100
97
|
|
|
101
|
-
attr_accessor currency: Stigg::Models::V1::
|
|
98
|
+
attr_accessor currency: Stigg::Models::V1::Coupon::Data::AmountsOff::currency
|
|
102
99
|
|
|
103
100
|
def initialize: (
|
|
104
101
|
amount: Float,
|
|
105
|
-
currency: Stigg::Models::V1::
|
|
102
|
+
currency: Stigg::Models::V1::Coupon::Data::AmountsOff::currency
|
|
106
103
|
) -> void
|
|
107
104
|
|
|
108
105
|
def to_hash: -> {
|
|
109
106
|
amount: Float,
|
|
110
|
-
currency: Stigg::Models::V1::
|
|
107
|
+
currency: Stigg::Models::V1::Coupon::Data::AmountsOff::currency
|
|
111
108
|
}
|
|
112
109
|
|
|
113
110
|
type currency =
|
|
@@ -348,7 +345,7 @@ module Stigg
|
|
|
348
345
|
XOF: :xof
|
|
349
346
|
XPF: :xpf
|
|
350
347
|
|
|
351
|
-
def self?.values: -> ::Array[Stigg::Models::V1::
|
|
348
|
+
def self?.values: -> ::Array[Stigg::Models::V1::Coupon::Data::AmountsOff::currency]
|
|
352
349
|
end
|
|
353
350
|
end
|
|
354
351
|
|
|
@@ -361,7 +358,7 @@ module Stigg
|
|
|
361
358
|
STIGG_ADHOC: :STIGG_ADHOC
|
|
362
359
|
STRIPE: :STRIPE
|
|
363
360
|
|
|
364
|
-
def self?.values: -> ::Array[Stigg::Models::V1::
|
|
361
|
+
def self?.values: -> ::Array[Stigg::Models::V1::Coupon::Data::source]
|
|
365
362
|
end
|
|
366
363
|
|
|
367
364
|
type status = :ACTIVE | :ARCHIVED
|
|
@@ -372,7 +369,7 @@ module Stigg
|
|
|
372
369
|
ACTIVE: :ACTIVE
|
|
373
370
|
ARCHIVED: :ARCHIVED
|
|
374
371
|
|
|
375
|
-
def self?.values: -> ::Array[Stigg::Models::V1::
|
|
372
|
+
def self?.values: -> ::Array[Stigg::Models::V1::Coupon::Data::status]
|
|
376
373
|
end
|
|
377
374
|
|
|
378
375
|
type type_ = :FIXED | :PERCENTAGE
|
|
@@ -383,7 +380,7 @@ module Stigg
|
|
|
383
380
|
FIXED: :FIXED
|
|
384
381
|
PERCENTAGE: :PERCENTAGE
|
|
385
382
|
|
|
386
|
-
def self?.values: -> ::Array[Stigg::Models::V1::
|
|
383
|
+
def self?.values: -> ::Array[Stigg::Models::V1::Coupon::Data::type_]
|
|
387
384
|
end
|
|
388
385
|
end
|
|
389
386
|
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
module Stigg
|
|
2
|
+
module Models
|
|
3
|
+
module V1
|
|
4
|
+
type customer_import_params =
|
|
5
|
+
{ customers: ::Array[Stigg::V1::CustomerImportParams::Customer] }
|
|
6
|
+
& Stigg::Internal::Type::request_parameters
|
|
7
|
+
|
|
8
|
+
class CustomerImportParams < Stigg::Internal::Type::BaseModel
|
|
9
|
+
extend Stigg::Internal::Type::RequestParameters::Converter
|
|
10
|
+
include Stigg::Internal::Type::RequestParameters
|
|
11
|
+
|
|
12
|
+
attr_accessor customers: ::Array[Stigg::V1::CustomerImportParams::Customer]
|
|
13
|
+
|
|
14
|
+
def initialize: (
|
|
15
|
+
customers: ::Array[Stigg::V1::CustomerImportParams::Customer],
|
|
16
|
+
?request_options: Stigg::request_opts
|
|
17
|
+
) -> void
|
|
18
|
+
|
|
19
|
+
def to_hash: -> {
|
|
20
|
+
customers: ::Array[Stigg::V1::CustomerImportParams::Customer],
|
|
21
|
+
request_options: Stigg::RequestOptions
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type customer =
|
|
25
|
+
{
|
|
26
|
+
id: String,
|
|
27
|
+
email: String?,
|
|
28
|
+
name: String?,
|
|
29
|
+
metadata: ::Hash[Symbol, String],
|
|
30
|
+
payment_method_id: String,
|
|
31
|
+
updated_at: Time
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
class Customer < Stigg::Internal::Type::BaseModel
|
|
35
|
+
attr_accessor id: String
|
|
36
|
+
|
|
37
|
+
attr_accessor email: String?
|
|
38
|
+
|
|
39
|
+
attr_accessor name: String?
|
|
40
|
+
|
|
41
|
+
attr_reader metadata: ::Hash[Symbol, String]?
|
|
42
|
+
|
|
43
|
+
def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String]
|
|
44
|
+
|
|
45
|
+
attr_reader payment_method_id: String?
|
|
46
|
+
|
|
47
|
+
def payment_method_id=: (String) -> String
|
|
48
|
+
|
|
49
|
+
attr_reader updated_at: Time?
|
|
50
|
+
|
|
51
|
+
def updated_at=: (Time) -> Time
|
|
52
|
+
|
|
53
|
+
def initialize: (
|
|
54
|
+
id: String,
|
|
55
|
+
email: String?,
|
|
56
|
+
name: String?,
|
|
57
|
+
?metadata: ::Hash[Symbol, String],
|
|
58
|
+
?payment_method_id: String,
|
|
59
|
+
?updated_at: Time
|
|
60
|
+
) -> void
|
|
61
|
+
|
|
62
|
+
def to_hash: -> {
|
|
63
|
+
id: String,
|
|
64
|
+
email: String?,
|
|
65
|
+
name: String?,
|
|
66
|
+
metadata: ::Hash[Symbol, String],
|
|
67
|
+
payment_method_id: String,
|
|
68
|
+
updated_at: Time
|
|
69
|
+
}
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|