stigg 0.1.0.pre.alpha.1 → 0.1.0.pre.alpha.2
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 +14 -0
- data/README.md +29 -1
- data/lib/stigg/internal/my_cursor_id_page.rb +32 -4
- data/lib/stigg/models/v1/coupon_create_params.rb +2 -0
- data/lib/stigg/models/v1/coupon_create_response.rb +11 -6
- data/lib/stigg/models/v1/coupon_list_params.rb +14 -14
- data/lib/stigg/models/v1/coupon_list_response.rb +262 -278
- data/lib/stigg/models/v1/coupon_retrieve_response.rb +11 -6
- data/lib/stigg/models/v1/customer_create_params.rb +2 -0
- data/lib/stigg/models/v1/customer_list_params.rb +14 -14
- data/lib/stigg/models/v1/customer_list_response.rb +160 -174
- data/lib/stigg/models/v1/customer_response.rb +8 -1
- data/lib/stigg/models/v1/customer_update_params.rb +2 -0
- data/lib/stigg/models/v1/customers/payment_method_attach_params.rb +3 -1
- data/lib/stigg/models/v1/subscription_create_params.rb +1485 -6
- data/lib/stigg/models/v1/subscription_create_response.rb +703 -4
- data/lib/stigg/models/v1/subscription_delegate_params.rb +7 -2
- data/lib/stigg/models/v1/subscription_delegate_response.rb +42 -2
- data/lib/stigg/models/v1/subscription_list_params.rb +20 -24
- data/lib/stigg/models/v1/subscription_list_response.rb +255 -236
- data/lib/stigg/models/v1/subscription_migrate_params.rb +3 -3
- data/lib/stigg/models/v1/subscription_migrate_response.rb +42 -2
- data/lib/stigg/models/v1/subscription_preview_params.rb +139 -46
- data/lib/stigg/models/v1/subscription_preview_response.rb +164 -49
- data/lib/stigg/models/v1/subscription_retrieve_response.rb +42 -2
- data/lib/stigg/models/v1/subscription_transfer_params.rb +2 -6
- data/lib/stigg/models/v1/subscription_transfer_response.rb +42 -2
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rb +2 -0
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +2 -0
- data/lib/stigg/models/v1_create_event_params.rb +2 -0
- data/lib/stigg/models/v1_create_event_response.rb +8 -1
- data/lib/stigg/models/v1_create_usage_params.rb +19 -3
- data/lib/stigg/models/v1_create_usage_response.rb +7 -1
- data/lib/stigg/resources/v1/coupons.rb +12 -10
- data/lib/stigg/resources/v1/customers/payment_method.rb +6 -5
- data/lib/stigg/resources/v1/customers/usage.rb +0 -41
- data/lib/stigg/resources/v1/customers.rb +20 -20
- data/lib/stigg/resources/v1/subscriptions/future_update.rb +6 -4
- data/lib/stigg/resources/v1/subscriptions.rb +74 -49
- data/lib/stigg/resources/v1.rb +2 -2
- data/lib/stigg/version.rb +1 -1
- data/lib/stigg.rb +0 -7
- data/rbi/stigg/internal/my_cursor_id_page.rbi +27 -0
- data/rbi/stigg/models/v1/coupon_create_params.rbi +1 -0
- data/rbi/stigg/models/v1/coupon_create_response.rbi +11 -10
- data/rbi/stigg/models/v1/coupon_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/coupon_list_response.rbi +812 -869
- data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +11 -10
- data/rbi/stigg/models/v1/customer_create_params.rbi +1 -0
- data/rbi/stigg/models/v1/customer_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/customer_list_response.rbi +307 -347
- data/rbi/stigg/models/v1/customer_response.rbi +8 -1
- data/rbi/stigg/models/v1/customer_update_params.rbi +1 -0
- data/rbi/stigg/models/v1/customers/payment_method_attach_params.rbi +3 -0
- data/rbi/stigg/models/v1/subscription_create_params.rbi +4975 -84
- data/rbi/stigg/models/v1/subscription_create_response.rbi +2508 -1
- data/rbi/stigg/models/v1/subscription_delegate_params.rbi +6 -2
- data/rbi/stigg/models/v1/subscription_delegate_response.rbi +84 -1
- data/rbi/stigg/models/v1/subscription_list_params.rbi +26 -28
- data/rbi/stigg/models/v1/subscription_list_response.rbi +460 -435
- data/rbi/stigg/models/v1/subscription_migrate_params.rbi +3 -3
- data/rbi/stigg/models/v1/subscription_migrate_response.rbi +84 -1
- data/rbi/stigg/models/v1/subscription_preview_params.rbi +112 -14
- data/rbi/stigg/models/v1/subscription_preview_response.rbi +139 -6
- data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +84 -1
- data/rbi/stigg/models/v1/subscription_transfer_params.rbi +2 -4
- data/rbi/stigg/models/v1/subscription_transfer_response.rbi +84 -1
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +1 -0
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbi +1 -0
- data/rbi/stigg/models/v1_create_event_params.rbi +1 -0
- data/rbi/stigg/models/v1_create_event_response.rbi +8 -1
- data/rbi/stigg/models/v1_create_usage_params.rbi +44 -4
- data/rbi/stigg/models/v1_create_usage_response.rbi +8 -1
- data/rbi/stigg/resources/v1/coupons.rbi +20 -12
- data/rbi/stigg/resources/v1/customers/payment_method.rbi +9 -3
- data/rbi/stigg/resources/v1/customers/usage.rbi +0 -29
- data/rbi/stigg/resources/v1/customers.rbi +34 -20
- data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +12 -4
- data/rbi/stigg/resources/v1/subscriptions.rbi +102 -23
- data/rbi/stigg/resources/v1.rbi +2 -2
- data/sig/stigg/internal/my_cursor_id_page.rbs +17 -0
- data/sig/stigg/models/v1/coupon_create_response.rbs +4 -4
- data/sig/stigg/models/v1/coupon_list_params.rbs +11 -11
- data/sig/stigg/models/v1/coupon_list_response.rbs +331 -351
- data/sig/stigg/models/v1/coupon_retrieve_response.rbs +4 -4
- data/sig/stigg/models/v1/customer_list_params.rbs +11 -11
- data/sig/stigg/models/v1/customer_list_response.rbs +133 -153
- data/sig/stigg/models/v1/subscription_create_params.rbs +2029 -5
- data/sig/stigg/models/v1/subscription_create_response.rbs +1022 -0
- data/sig/stigg/models/v1/subscription_delegate_response.rbs +31 -0
- data/sig/stigg/models/v1/subscription_list_params.rbs +14 -14
- data/sig/stigg/models/v1/subscription_list_response.rbs +196 -189
- data/sig/stigg/models/v1/subscription_migrate_response.rbs +31 -0
- data/sig/stigg/models/v1/subscription_preview_params.rbs +2 -6
- data/sig/stigg/models/v1/subscription_retrieve_response.rbs +31 -0
- data/sig/stigg/models/v1/subscription_transfer_response.rbs +31 -0
- data/sig/stigg/models/v1_create_usage_params.rbs +15 -5
- data/sig/stigg/resources/v1/coupons.rbs +3 -3
- data/sig/stigg/resources/v1/customers/usage.rbs +0 -10
- data/sig/stigg/resources/v1/customers.rbs +3 -5
- data/sig/stigg/resources/v1/subscriptions.rbs +19 -4
- metadata +2 -23
- data/lib/stigg/models/v1/customers/promotional_create_params.rb +0 -294
- data/lib/stigg/models/v1/customers/promotional_create_response.rb +0 -268
- data/lib/stigg/models/v1/customers/promotional_revoke_params.rb +0 -24
- data/lib/stigg/models/v1/customers/promotional_revoke_response.rb +0 -268
- data/lib/stigg/models/v1/customers/usage_retrieve_params.rb +0 -56
- data/lib/stigg/models/v1/customers/usage_retrieve_response.rb +0 -145
- data/lib/stigg/resources/v1/customers/promotional.rb +0 -69
- data/rbi/stigg/models/v1/customers/promotional_create_params.rbi +0 -639
- data/rbi/stigg/models/v1/customers/promotional_create_response.rbi +0 -495
- data/rbi/stigg/models/v1/customers/promotional_revoke_params.rbi +0 -42
- data/rbi/stigg/models/v1/customers/promotional_revoke_response.rbi +0 -497
- data/rbi/stigg/models/v1/customers/usage_retrieve_params.rbi +0 -84
- data/rbi/stigg/models/v1/customers/usage_retrieve_response.rbi +0 -353
- data/rbi/stigg/resources/v1/customers/promotional.rbi +0 -53
- data/sig/stigg/models/v1/customers/promotional_create_params.rbs +0 -234
- data/sig/stigg/models/v1/customers/promotional_create_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/promotional_revoke_params.rbs +0 -27
- data/sig/stigg/models/v1/customers/promotional_revoke_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/usage_retrieve_params.rbs +0 -54
- data/sig/stigg/models/v1/customers/usage_retrieve_response.rbs +0 -134
- data/sig/stigg/resources/v1/customers/promotional.rbs +0 -23
|
@@ -15,8 +15,7 @@ module Stigg
|
|
|
15
15
|
)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
#
|
|
19
|
-
# belong to the same customer.
|
|
18
|
+
# Resource ID to transfer the subscription to
|
|
20
19
|
sig { returns(String) }
|
|
21
20
|
attr_accessor :destination_resource_id
|
|
22
21
|
|
|
@@ -27,8 +26,7 @@ module Stigg
|
|
|
27
26
|
).returns(T.attached_class)
|
|
28
27
|
end
|
|
29
28
|
def self.new(
|
|
30
|
-
#
|
|
31
|
-
# belong to the same customer.
|
|
29
|
+
# Resource ID to transfer the subscription to
|
|
32
30
|
destination_resource_id:,
|
|
33
31
|
request_options: {}
|
|
34
32
|
)
|
|
@@ -12,6 +12,7 @@ module Stigg
|
|
|
12
12
|
)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
# Customer subscription to a plan
|
|
15
16
|
sig { returns(Stigg::Models::V1::SubscriptionTransferResponse::Data) }
|
|
16
17
|
attr_reader :data
|
|
17
18
|
|
|
@@ -22,12 +23,16 @@ module Stigg
|
|
|
22
23
|
end
|
|
23
24
|
attr_writer :data
|
|
24
25
|
|
|
26
|
+
# Response object
|
|
25
27
|
sig do
|
|
26
28
|
params(
|
|
27
29
|
data: Stigg::Models::V1::SubscriptionTransferResponse::Data::OrHash
|
|
28
30
|
).returns(T.attached_class)
|
|
29
31
|
end
|
|
30
|
-
def self.new(
|
|
32
|
+
def self.new(
|
|
33
|
+
# Customer subscription to a plan
|
|
34
|
+
data:
|
|
35
|
+
)
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
sig do
|
|
@@ -146,6 +151,27 @@ module Stigg
|
|
|
146
151
|
end
|
|
147
152
|
attr_accessor :payment_collection_method
|
|
148
153
|
|
|
154
|
+
sig do
|
|
155
|
+
returns(
|
|
156
|
+
T.nilable(
|
|
157
|
+
T::Array[
|
|
158
|
+
Stigg::Models::V1::SubscriptionTransferResponse::Data::Price
|
|
159
|
+
]
|
|
160
|
+
)
|
|
161
|
+
)
|
|
162
|
+
end
|
|
163
|
+
attr_reader :prices
|
|
164
|
+
|
|
165
|
+
sig do
|
|
166
|
+
params(
|
|
167
|
+
prices:
|
|
168
|
+
T::Array[
|
|
169
|
+
Stigg::Models::V1::SubscriptionTransferResponse::Data::Price::OrHash
|
|
170
|
+
]
|
|
171
|
+
).void
|
|
172
|
+
end
|
|
173
|
+
attr_writer :prices
|
|
174
|
+
|
|
149
175
|
# Resource ID
|
|
150
176
|
sig { returns(T.nilable(String)) }
|
|
151
177
|
attr_accessor :resource_id
|
|
@@ -154,6 +180,7 @@ module Stigg
|
|
|
154
180
|
sig { returns(T.nilable(Time)) }
|
|
155
181
|
attr_accessor :trial_end_date
|
|
156
182
|
|
|
183
|
+
# Customer subscription to a plan
|
|
157
184
|
sig do
|
|
158
185
|
params(
|
|
159
186
|
id: String,
|
|
@@ -183,6 +210,10 @@ module Stigg
|
|
|
183
210
|
T.nilable(
|
|
184
211
|
Stigg::Models::V1::SubscriptionTransferResponse::Data::PaymentCollectionMethod::OrSymbol
|
|
185
212
|
),
|
|
213
|
+
prices:
|
|
214
|
+
T::Array[
|
|
215
|
+
Stigg::Models::V1::SubscriptionTransferResponse::Data::Price::OrHash
|
|
216
|
+
],
|
|
186
217
|
resource_id: T.nilable(String),
|
|
187
218
|
trial_end_date: T.nilable(Time)
|
|
188
219
|
).returns(T.attached_class)
|
|
@@ -224,6 +255,7 @@ module Stigg
|
|
|
224
255
|
paying_customer_id: nil,
|
|
225
256
|
# The method used to collect payments for a subscription
|
|
226
257
|
payment_collection_method: nil,
|
|
258
|
+
prices: nil,
|
|
227
259
|
# Resource ID
|
|
228
260
|
resource_id: nil,
|
|
229
261
|
# Subscription trial end date
|
|
@@ -261,6 +293,10 @@ module Stigg
|
|
|
261
293
|
T.nilable(
|
|
262
294
|
Stigg::Models::V1::SubscriptionTransferResponse::Data::PaymentCollectionMethod::TaggedSymbol
|
|
263
295
|
),
|
|
296
|
+
prices:
|
|
297
|
+
T::Array[
|
|
298
|
+
Stigg::Models::V1::SubscriptionTransferResponse::Data::Price
|
|
299
|
+
],
|
|
264
300
|
resource_id: T.nilable(String),
|
|
265
301
|
trial_end_date: T.nilable(Time)
|
|
266
302
|
}
|
|
@@ -528,6 +564,53 @@ module Stigg
|
|
|
528
564
|
def self.values
|
|
529
565
|
end
|
|
530
566
|
end
|
|
567
|
+
|
|
568
|
+
class Price < Stigg::Internal::Type::BaseModel
|
|
569
|
+
OrHash =
|
|
570
|
+
T.type_alias do
|
|
571
|
+
T.any(
|
|
572
|
+
Stigg::Models::V1::SubscriptionTransferResponse::Data::Price,
|
|
573
|
+
Stigg::Internal::AnyHash
|
|
574
|
+
)
|
|
575
|
+
end
|
|
576
|
+
|
|
577
|
+
# Price ID
|
|
578
|
+
sig { returns(String) }
|
|
579
|
+
attr_accessor :id
|
|
580
|
+
|
|
581
|
+
# Creation timestamp
|
|
582
|
+
sig { returns(String) }
|
|
583
|
+
attr_accessor :created_at
|
|
584
|
+
|
|
585
|
+
# Last update timestamp
|
|
586
|
+
sig { returns(String) }
|
|
587
|
+
attr_accessor :updated_at
|
|
588
|
+
|
|
589
|
+
sig do
|
|
590
|
+
params(
|
|
591
|
+
id: String,
|
|
592
|
+
created_at: String,
|
|
593
|
+
updated_at: String
|
|
594
|
+
).returns(T.attached_class)
|
|
595
|
+
end
|
|
596
|
+
def self.new(
|
|
597
|
+
# Price ID
|
|
598
|
+
id:,
|
|
599
|
+
# Creation timestamp
|
|
600
|
+
created_at:,
|
|
601
|
+
# Last update timestamp
|
|
602
|
+
updated_at:
|
|
603
|
+
)
|
|
604
|
+
end
|
|
605
|
+
|
|
606
|
+
sig do
|
|
607
|
+
override.returns(
|
|
608
|
+
{ id: String, created_at: String, updated_at: String }
|
|
609
|
+
)
|
|
610
|
+
end
|
|
611
|
+
def to_hash
|
|
612
|
+
end
|
|
613
|
+
end
|
|
531
614
|
end
|
|
532
615
|
end
|
|
533
616
|
end
|
|
@@ -8,11 +8,18 @@ module Stigg
|
|
|
8
8
|
T.any(Stigg::Models::V1CreateEventResponse, Stigg::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# Empty success response confirming that events were successfully ingested and
|
|
12
|
+
# queued for processing by Stigg's metering system.
|
|
11
13
|
sig { returns(T.anything) }
|
|
12
14
|
attr_accessor :data
|
|
13
15
|
|
|
16
|
+
# Response object
|
|
14
17
|
sig { params(data: T.anything).returns(T.attached_class) }
|
|
15
|
-
def self.new(
|
|
18
|
+
def self.new(
|
|
19
|
+
# Empty success response confirming that events were successfully ingested and
|
|
20
|
+
# queued for processing by Stigg's metering system.
|
|
21
|
+
data:
|
|
22
|
+
)
|
|
16
23
|
end
|
|
17
24
|
|
|
18
25
|
sig { override.returns({ data: T.anything }) }
|
|
@@ -65,10 +65,27 @@ module Stigg
|
|
|
65
65
|
attr_writer :created_at
|
|
66
66
|
|
|
67
67
|
# Additional dimensions for the usage report
|
|
68
|
-
sig
|
|
68
|
+
sig do
|
|
69
|
+
returns(
|
|
70
|
+
T.nilable(
|
|
71
|
+
T::Hash[
|
|
72
|
+
Symbol,
|
|
73
|
+
Stigg::V1CreateUsageParams::Usage::Dimension::Variants
|
|
74
|
+
]
|
|
75
|
+
)
|
|
76
|
+
)
|
|
77
|
+
end
|
|
69
78
|
attr_reader :dimensions
|
|
70
79
|
|
|
71
|
-
sig
|
|
80
|
+
sig do
|
|
81
|
+
params(
|
|
82
|
+
dimensions:
|
|
83
|
+
T::Hash[
|
|
84
|
+
Symbol,
|
|
85
|
+
Stigg::V1CreateUsageParams::Usage::Dimension::Variants
|
|
86
|
+
]
|
|
87
|
+
).void
|
|
88
|
+
end
|
|
72
89
|
attr_writer :dimensions
|
|
73
90
|
|
|
74
91
|
# Resource id
|
|
@@ -93,13 +110,18 @@ module Stigg
|
|
|
93
110
|
end
|
|
94
111
|
attr_writer :update_behavior
|
|
95
112
|
|
|
113
|
+
# Single usage measurement
|
|
96
114
|
sig do
|
|
97
115
|
params(
|
|
98
116
|
customer_id: String,
|
|
99
117
|
feature_id: String,
|
|
100
118
|
value: Integer,
|
|
101
119
|
created_at: Time,
|
|
102
|
-
dimensions:
|
|
120
|
+
dimensions:
|
|
121
|
+
T::Hash[
|
|
122
|
+
Symbol,
|
|
123
|
+
Stigg::V1CreateUsageParams::Usage::Dimension::Variants
|
|
124
|
+
],
|
|
103
125
|
resource_id: T.nilable(String),
|
|
104
126
|
update_behavior:
|
|
105
127
|
Stigg::V1CreateUsageParams::Usage::UpdateBehavior::OrSymbol
|
|
@@ -130,7 +152,11 @@ module Stigg
|
|
|
130
152
|
feature_id: String,
|
|
131
153
|
value: Integer,
|
|
132
154
|
created_at: Time,
|
|
133
|
-
dimensions:
|
|
155
|
+
dimensions:
|
|
156
|
+
T::Hash[
|
|
157
|
+
Symbol,
|
|
158
|
+
Stigg::V1CreateUsageParams::Usage::Dimension::Variants
|
|
159
|
+
],
|
|
134
160
|
resource_id: T.nilable(String),
|
|
135
161
|
update_behavior:
|
|
136
162
|
Stigg::V1CreateUsageParams::Usage::UpdateBehavior::OrSymbol
|
|
@@ -140,6 +166,20 @@ module Stigg
|
|
|
140
166
|
def to_hash
|
|
141
167
|
end
|
|
142
168
|
|
|
169
|
+
module Dimension
|
|
170
|
+
extend Stigg::Internal::Type::Union
|
|
171
|
+
|
|
172
|
+
Variants = T.type_alias { T.any(String, Float, T::Boolean) }
|
|
173
|
+
|
|
174
|
+
sig do
|
|
175
|
+
override.returns(
|
|
176
|
+
T::Array[Stigg::V1CreateUsageParams::Usage::Dimension::Variants]
|
|
177
|
+
)
|
|
178
|
+
end
|
|
179
|
+
def self.variants
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
143
183
|
# The method by which the usage value should be updated
|
|
144
184
|
module UpdateBehavior
|
|
145
185
|
extend Stigg::Internal::Type::Enum
|
|
@@ -8,15 +8,21 @@ module Stigg
|
|
|
8
8
|
T.any(Stigg::Models::V1CreateUsageResponse, Stigg::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# Array of usage measurements with current values and period info
|
|
11
12
|
sig { returns(T::Array[Stigg::Models::V1CreateUsageResponse::Data]) }
|
|
12
13
|
attr_accessor :data
|
|
13
14
|
|
|
15
|
+
# Response containing reported usage measurements with current usage values,
|
|
16
|
+
# period information, and reset dates for each measurement.
|
|
14
17
|
sig do
|
|
15
18
|
params(
|
|
16
19
|
data: T::Array[Stigg::Models::V1CreateUsageResponse::Data::OrHash]
|
|
17
20
|
).returns(T.attached_class)
|
|
18
21
|
end
|
|
19
|
-
def self.new(
|
|
22
|
+
def self.new(
|
|
23
|
+
# Array of usage measurements with current values and period info
|
|
24
|
+
data:
|
|
25
|
+
)
|
|
20
26
|
end
|
|
21
27
|
|
|
22
28
|
sig do
|
|
@@ -82,6 +88,7 @@ module Stigg
|
|
|
82
88
|
sig { returns(T.nilable(Time)) }
|
|
83
89
|
attr_accessor :usage_period_start
|
|
84
90
|
|
|
91
|
+
# Recorded usage with period info
|
|
85
92
|
sig do
|
|
86
93
|
params(
|
|
87
94
|
id: String,
|
|
@@ -4,7 +4,7 @@ module Stigg
|
|
|
4
4
|
module Resources
|
|
5
5
|
class V1
|
|
6
6
|
class Coupons
|
|
7
|
-
# Create
|
|
7
|
+
# Create coupon
|
|
8
8
|
sig do
|
|
9
9
|
params(
|
|
10
10
|
id: String,
|
|
@@ -39,32 +39,40 @@ module Stigg
|
|
|
39
39
|
)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
# Get a single
|
|
42
|
+
# Get a single coupon by ID
|
|
43
43
|
sig do
|
|
44
44
|
params(
|
|
45
45
|
id: String,
|
|
46
46
|
request_options: Stigg::RequestOptions::OrHash
|
|
47
47
|
).returns(Stigg::Models::V1::CouponRetrieveResponse)
|
|
48
48
|
end
|
|
49
|
-
def retrieve(
|
|
49
|
+
def retrieve(
|
|
50
|
+
# The unique identifier of the entity
|
|
51
|
+
id,
|
|
52
|
+
request_options: {}
|
|
53
|
+
)
|
|
50
54
|
end
|
|
51
55
|
|
|
52
|
-
# Get a list of
|
|
56
|
+
# Get a list of coupons
|
|
53
57
|
sig do
|
|
54
58
|
params(
|
|
55
|
-
|
|
59
|
+
after: String,
|
|
60
|
+
before: String,
|
|
56
61
|
limit: Integer,
|
|
57
|
-
starting_after: String,
|
|
58
62
|
request_options: Stigg::RequestOptions::OrHash
|
|
59
|
-
).returns(
|
|
63
|
+
).returns(
|
|
64
|
+
Stigg::Internal::MyCursorIDPage[
|
|
65
|
+
Stigg::Models::V1::CouponListResponse
|
|
66
|
+
]
|
|
67
|
+
)
|
|
60
68
|
end
|
|
61
69
|
def list(
|
|
62
|
-
#
|
|
63
|
-
|
|
64
|
-
#
|
|
70
|
+
# Return items that come after this cursor
|
|
71
|
+
after: nil,
|
|
72
|
+
# Return items that come before this cursor
|
|
73
|
+
before: nil,
|
|
74
|
+
# Maximum number of items to return
|
|
65
75
|
limit: nil,
|
|
66
|
-
# Starting after this UUID for pagination
|
|
67
|
-
starting_after: nil,
|
|
68
76
|
request_options: {}
|
|
69
77
|
)
|
|
70
78
|
end
|
|
@@ -5,7 +5,7 @@ module Stigg
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class PaymentMethod
|
|
8
|
-
#
|
|
8
|
+
# Attach payment method
|
|
9
9
|
sig do
|
|
10
10
|
params(
|
|
11
11
|
id: String,
|
|
@@ -21,6 +21,7 @@ module Stigg
|
|
|
21
21
|
).returns(Stigg::V1::CustomerResponse)
|
|
22
22
|
end
|
|
23
23
|
def attach(
|
|
24
|
+
# The unique identifier of the entity
|
|
24
25
|
id,
|
|
25
26
|
# Integration details
|
|
26
27
|
integration_id:,
|
|
@@ -28,19 +29,24 @@ module Stigg
|
|
|
28
29
|
payment_method_id:,
|
|
29
30
|
# The vendor identifier of integration
|
|
30
31
|
vendor_identifier:,
|
|
32
|
+
# Customers selected currency
|
|
31
33
|
billing_currency: nil,
|
|
32
34
|
request_options: {}
|
|
33
35
|
)
|
|
34
36
|
end
|
|
35
37
|
|
|
36
|
-
#
|
|
38
|
+
# Detach payment method
|
|
37
39
|
sig do
|
|
38
40
|
params(
|
|
39
41
|
id: String,
|
|
40
42
|
request_options: Stigg::RequestOptions::OrHash
|
|
41
43
|
).returns(Stigg::V1::CustomerResponse)
|
|
42
44
|
end
|
|
43
|
-
def detach(
|
|
45
|
+
def detach(
|
|
46
|
+
# The unique identifier of the entity
|
|
47
|
+
id,
|
|
48
|
+
request_options: {}
|
|
49
|
+
)
|
|
44
50
|
end
|
|
45
51
|
|
|
46
52
|
# @api private
|
|
@@ -5,35 +5,6 @@ module Stigg
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class Usage
|
|
8
|
-
# Perform retrieval on a Usage history
|
|
9
|
-
sig do
|
|
10
|
-
params(
|
|
11
|
-
feature_id: String,
|
|
12
|
-
customer_id: String,
|
|
13
|
-
start_date: Time,
|
|
14
|
-
end_date: Time,
|
|
15
|
-
group_by: String,
|
|
16
|
-
resource_id: T.nilable(String),
|
|
17
|
-
request_options: Stigg::RequestOptions::OrHash
|
|
18
|
-
).returns(Stigg::Models::V1::Customers::UsageRetrieveResponse)
|
|
19
|
-
end
|
|
20
|
-
def retrieve(
|
|
21
|
-
# Path param: Feature id
|
|
22
|
-
feature_id,
|
|
23
|
-
# Path param: Customer id
|
|
24
|
-
customer_id:,
|
|
25
|
-
# Query param: The start date of the range
|
|
26
|
-
start_date:,
|
|
27
|
-
# Query param: The end date of the range
|
|
28
|
-
end_date: nil,
|
|
29
|
-
# Query param
|
|
30
|
-
group_by: nil,
|
|
31
|
-
# Query param: Resource id
|
|
32
|
-
resource_id: nil,
|
|
33
|
-
request_options: {}
|
|
34
|
-
)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
8
|
# @api private
|
|
38
9
|
sig { params(client: Stigg::Client).returns(T.attached_class) }
|
|
39
10
|
def self.new(client:)
|
|
@@ -10,10 +10,7 @@ module Stigg
|
|
|
10
10
|
sig { returns(Stigg::Resources::V1::Customers::Usage) }
|
|
11
11
|
attr_reader :usage
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
attr_reader :promotional
|
|
15
|
-
|
|
16
|
-
# Create a new Customer
|
|
13
|
+
# Provision customer
|
|
17
14
|
sig do
|
|
18
15
|
params(
|
|
19
16
|
id: String,
|
|
@@ -49,17 +46,21 @@ module Stigg
|
|
|
49
46
|
)
|
|
50
47
|
end
|
|
51
48
|
|
|
52
|
-
# Get a single
|
|
49
|
+
# Get a single customer by ID
|
|
53
50
|
sig do
|
|
54
51
|
params(
|
|
55
52
|
id: String,
|
|
56
53
|
request_options: Stigg::RequestOptions::OrHash
|
|
57
54
|
).returns(Stigg::V1::CustomerResponse)
|
|
58
55
|
end
|
|
59
|
-
def retrieve(
|
|
56
|
+
def retrieve(
|
|
57
|
+
# The unique identifier of the entity
|
|
58
|
+
id,
|
|
59
|
+
request_options: {}
|
|
60
|
+
)
|
|
60
61
|
end
|
|
61
62
|
|
|
62
|
-
# Update
|
|
63
|
+
# Update a customer
|
|
63
64
|
sig do
|
|
64
65
|
params(
|
|
65
66
|
id: String,
|
|
@@ -73,6 +74,7 @@ module Stigg
|
|
|
73
74
|
).returns(Stigg::V1::CustomerResponse)
|
|
74
75
|
end
|
|
75
76
|
def update(
|
|
77
|
+
# The unique identifier of the entity
|
|
76
78
|
id,
|
|
77
79
|
# Customer level coupon
|
|
78
80
|
coupon_id: nil,
|
|
@@ -88,44 +90,56 @@ module Stigg
|
|
|
88
90
|
)
|
|
89
91
|
end
|
|
90
92
|
|
|
91
|
-
# Get a list of
|
|
93
|
+
# Get a list of customers
|
|
92
94
|
sig do
|
|
93
95
|
params(
|
|
94
|
-
|
|
96
|
+
after: String,
|
|
97
|
+
before: String,
|
|
95
98
|
limit: Integer,
|
|
96
|
-
starting_after: String,
|
|
97
99
|
request_options: Stigg::RequestOptions::OrHash
|
|
98
|
-
).returns(
|
|
100
|
+
).returns(
|
|
101
|
+
Stigg::Internal::MyCursorIDPage[
|
|
102
|
+
Stigg::Models::V1::CustomerListResponse
|
|
103
|
+
]
|
|
104
|
+
)
|
|
99
105
|
end
|
|
100
106
|
def list(
|
|
101
|
-
#
|
|
102
|
-
|
|
103
|
-
#
|
|
107
|
+
# Return items that come after this cursor
|
|
108
|
+
after: nil,
|
|
109
|
+
# Return items that come before this cursor
|
|
110
|
+
before: nil,
|
|
111
|
+
# Maximum number of items to return
|
|
104
112
|
limit: nil,
|
|
105
|
-
# Starting after this UUID for pagination
|
|
106
|
-
starting_after: nil,
|
|
107
113
|
request_options: {}
|
|
108
114
|
)
|
|
109
115
|
end
|
|
110
116
|
|
|
111
|
-
#
|
|
117
|
+
# Archive customer
|
|
112
118
|
sig do
|
|
113
119
|
params(
|
|
114
120
|
id: String,
|
|
115
121
|
request_options: Stigg::RequestOptions::OrHash
|
|
116
122
|
).returns(Stigg::V1::CustomerResponse)
|
|
117
123
|
end
|
|
118
|
-
def archive(
|
|
124
|
+
def archive(
|
|
125
|
+
# The unique identifier of the entity
|
|
126
|
+
id,
|
|
127
|
+
request_options: {}
|
|
128
|
+
)
|
|
119
129
|
end
|
|
120
130
|
|
|
121
|
-
#
|
|
131
|
+
# Unarchive customer
|
|
122
132
|
sig do
|
|
123
133
|
params(
|
|
124
134
|
id: String,
|
|
125
135
|
request_options: Stigg::RequestOptions::OrHash
|
|
126
136
|
).returns(Stigg::V1::CustomerResponse)
|
|
127
137
|
end
|
|
128
|
-
def unarchive(
|
|
138
|
+
def unarchive(
|
|
139
|
+
# The unique identifier of the entity
|
|
140
|
+
id,
|
|
141
|
+
request_options: {}
|
|
142
|
+
)
|
|
129
143
|
end
|
|
130
144
|
|
|
131
145
|
# @api private
|
|
@@ -5,7 +5,7 @@ module Stigg
|
|
|
5
5
|
class V1
|
|
6
6
|
class Subscriptions
|
|
7
7
|
class FutureUpdate
|
|
8
|
-
#
|
|
8
|
+
# Cancel pending payment update
|
|
9
9
|
sig do
|
|
10
10
|
params(
|
|
11
11
|
id: String,
|
|
@@ -14,10 +14,14 @@ module Stigg
|
|
|
14
14
|
Stigg::Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentResponse
|
|
15
15
|
)
|
|
16
16
|
end
|
|
17
|
-
def cancel_pending_payment(
|
|
17
|
+
def cancel_pending_payment(
|
|
18
|
+
# The unique identifier of the entity
|
|
19
|
+
id,
|
|
20
|
+
request_options: {}
|
|
21
|
+
)
|
|
18
22
|
end
|
|
19
23
|
|
|
20
|
-
#
|
|
24
|
+
# Cancel scheduled update
|
|
21
25
|
sig do
|
|
22
26
|
params(
|
|
23
27
|
id: String,
|
|
@@ -26,7 +30,11 @@ module Stigg
|
|
|
26
30
|
Stigg::Models::V1::Subscriptions::FutureUpdateCancelScheduleResponse
|
|
27
31
|
)
|
|
28
32
|
end
|
|
29
|
-
def cancel_schedule(
|
|
33
|
+
def cancel_schedule(
|
|
34
|
+
# The unique identifier of the entity
|
|
35
|
+
id,
|
|
36
|
+
request_options: {}
|
|
37
|
+
)
|
|
30
38
|
end
|
|
31
39
|
|
|
32
40
|
# @api private
|