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
|
@@ -6,12 +6,15 @@ module Stigg
|
|
|
6
6
|
# @see Stigg::Resources::V1::Subscriptions#transfer
|
|
7
7
|
class SubscriptionTransferResponse < Stigg::Internal::Type::BaseModel
|
|
8
8
|
# @!attribute data
|
|
9
|
+
# Customer subscription to a plan
|
|
9
10
|
#
|
|
10
11
|
# @return [Stigg::Models::V1::SubscriptionTransferResponse::Data]
|
|
11
12
|
required :data, -> { Stigg::Models::V1::SubscriptionTransferResponse::Data }
|
|
12
13
|
|
|
13
14
|
# @!method initialize(data:)
|
|
14
|
-
#
|
|
15
|
+
# Response object
|
|
16
|
+
#
|
|
17
|
+
# @param data [Stigg::Models::V1::SubscriptionTransferResponse::Data] Customer subscription to a plan
|
|
15
18
|
|
|
16
19
|
# @see Stigg::Models::V1::SubscriptionTransferResponse#data
|
|
17
20
|
class Data < Stigg::Internal::Type::BaseModel
|
|
@@ -133,6 +136,12 @@ module Stigg
|
|
|
133
136
|
api_name: :paymentCollectionMethod,
|
|
134
137
|
nil?: true
|
|
135
138
|
|
|
139
|
+
# @!attribute prices
|
|
140
|
+
#
|
|
141
|
+
# @return [Array<Stigg::Models::V1::SubscriptionTransferResponse::Data::Price>, nil]
|
|
142
|
+
optional :prices,
|
|
143
|
+
-> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::SubscriptionTransferResponse::Data::Price] }
|
|
144
|
+
|
|
136
145
|
# @!attribute resource_id
|
|
137
146
|
# Resource ID
|
|
138
147
|
#
|
|
@@ -145,7 +154,9 @@ module Stigg
|
|
|
145
154
|
# @return [Time, nil]
|
|
146
155
|
optional :trial_end_date, Time, api_name: :trialEndDate, nil?: true
|
|
147
156
|
|
|
148
|
-
# @!method initialize(id:, billing_id:, created_at:, customer_id:, payment_collection:, plan_id:, pricing_type:, start_date:, status:, cancellation_date: nil, cancel_reason: nil, current_billing_period_end: nil, current_billing_period_start: nil, effective_end_date: nil, end_date: nil, metadata: nil, paying_customer_id: nil, payment_collection_method: nil, resource_id: nil, trial_end_date: nil)
|
|
157
|
+
# @!method initialize(id:, billing_id:, created_at:, customer_id:, payment_collection:, plan_id:, pricing_type:, start_date:, status:, cancellation_date: nil, cancel_reason: nil, current_billing_period_end: nil, current_billing_period_start: nil, effective_end_date: nil, end_date: nil, metadata: nil, paying_customer_id: nil, payment_collection_method: nil, prices: nil, resource_id: nil, trial_end_date: nil)
|
|
158
|
+
# Customer subscription to a plan
|
|
159
|
+
#
|
|
149
160
|
# @param id [String] Subscription ID
|
|
150
161
|
#
|
|
151
162
|
# @param billing_id [String, nil] Billing ID
|
|
@@ -182,6 +193,8 @@ module Stigg
|
|
|
182
193
|
#
|
|
183
194
|
# @param payment_collection_method [Symbol, Stigg::Models::V1::SubscriptionTransferResponse::Data::PaymentCollectionMethod, nil] The method used to collect payments for a subscription
|
|
184
195
|
#
|
|
196
|
+
# @param prices [Array<Stigg::Models::V1::SubscriptionTransferResponse::Data::Price>]
|
|
197
|
+
#
|
|
185
198
|
# @param resource_id [String, nil] Resource ID
|
|
186
199
|
#
|
|
187
200
|
# @param trial_end_date [Time, nil] Subscription trial end date
|
|
@@ -267,6 +280,33 @@ module Stigg
|
|
|
267
280
|
# @!method self.values
|
|
268
281
|
# @return [Array<Symbol>]
|
|
269
282
|
end
|
|
283
|
+
|
|
284
|
+
class Price < Stigg::Internal::Type::BaseModel
|
|
285
|
+
# @!attribute id
|
|
286
|
+
# Price ID
|
|
287
|
+
#
|
|
288
|
+
# @return [String]
|
|
289
|
+
required :id, String
|
|
290
|
+
|
|
291
|
+
# @!attribute created_at
|
|
292
|
+
# Creation timestamp
|
|
293
|
+
#
|
|
294
|
+
# @return [String]
|
|
295
|
+
required :created_at, String, api_name: :createdAt
|
|
296
|
+
|
|
297
|
+
# @!attribute updated_at
|
|
298
|
+
# Last update timestamp
|
|
299
|
+
#
|
|
300
|
+
# @return [String]
|
|
301
|
+
required :updated_at, String, api_name: :updatedAt
|
|
302
|
+
|
|
303
|
+
# @!method initialize(id:, created_at:, updated_at:)
|
|
304
|
+
# @param id [String] Price ID
|
|
305
|
+
#
|
|
306
|
+
# @param created_at [String] Creation timestamp
|
|
307
|
+
#
|
|
308
|
+
# @param updated_at [String] Last update timestamp
|
|
309
|
+
end
|
|
270
310
|
end
|
|
271
311
|
end
|
|
272
312
|
end
|
|
@@ -12,6 +12,8 @@ module Stigg
|
|
|
12
12
|
required :data, -> { Stigg::Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentResponse::Data }
|
|
13
13
|
|
|
14
14
|
# @!method initialize(data:)
|
|
15
|
+
# Response object
|
|
16
|
+
#
|
|
15
17
|
# @param data [Stigg::Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentResponse::Data]
|
|
16
18
|
|
|
17
19
|
# @see Stigg::Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentResponse#data
|
|
@@ -12,6 +12,8 @@ module Stigg
|
|
|
12
12
|
required :data, -> { Stigg::Models::V1::Subscriptions::FutureUpdateCancelScheduleResponse::Data }
|
|
13
13
|
|
|
14
14
|
# @!method initialize(data:)
|
|
15
|
+
# Response object
|
|
16
|
+
#
|
|
15
17
|
# @param data [Stigg::Models::V1::Subscriptions::FutureUpdateCancelScheduleResponse::Data]
|
|
16
18
|
|
|
17
19
|
# @see Stigg::Models::V1::Subscriptions::FutureUpdateCancelScheduleResponse#data
|
|
@@ -57,6 +57,8 @@ module Stigg
|
|
|
57
57
|
optional :timestamp, Time
|
|
58
58
|
|
|
59
59
|
# @!method initialize(customer_id:, event_name:, idempotency_key:, dimensions: nil, resource_id: nil, timestamp: nil)
|
|
60
|
+
# Raw usage event
|
|
61
|
+
#
|
|
60
62
|
# @param customer_id [String] Customer id
|
|
61
63
|
#
|
|
62
64
|
# @param event_name [String] The name of the usage event
|
|
@@ -5,12 +5,19 @@ module Stigg
|
|
|
5
5
|
# @see Stigg::Resources::V1#create_event
|
|
6
6
|
class V1CreateEventResponse < Stigg::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute data
|
|
8
|
+
# Empty success response confirming that events were successfully ingested and
|
|
9
|
+
# queued for processing by Stigg's metering system.
|
|
8
10
|
#
|
|
9
11
|
# @return [Object]
|
|
10
12
|
required :data, Stigg::Internal::Type::Unknown
|
|
11
13
|
|
|
12
14
|
# @!method initialize(data:)
|
|
13
|
-
#
|
|
15
|
+
# Some parameter documentations has been truncated, see
|
|
16
|
+
# {Stigg::Models::V1CreateEventResponse} for more details.
|
|
17
|
+
#
|
|
18
|
+
# Response object
|
|
19
|
+
#
|
|
20
|
+
# @param data [Object] Empty success response confirming that events were successfully ingested and que
|
|
14
21
|
end
|
|
15
22
|
end
|
|
16
23
|
end
|
|
@@ -46,8 +46,9 @@ module Stigg
|
|
|
46
46
|
# @!attribute dimensions
|
|
47
47
|
# Additional dimensions for the usage report
|
|
48
48
|
#
|
|
49
|
-
# @return [Hash{Symbol=>String}, nil]
|
|
50
|
-
optional :dimensions,
|
|
49
|
+
# @return [Hash{Symbol=>String, Float, Boolean}, nil]
|
|
50
|
+
optional :dimensions,
|
|
51
|
+
-> { Stigg::Internal::Type::HashOf[union: Stigg::V1CreateUsageParams::Usage::Dimension] }
|
|
51
52
|
|
|
52
53
|
# @!attribute resource_id
|
|
53
54
|
# Resource id
|
|
@@ -64,6 +65,8 @@ module Stigg
|
|
|
64
65
|
api_name: :updateBehavior
|
|
65
66
|
|
|
66
67
|
# @!method initialize(customer_id:, feature_id:, value:, created_at: nil, dimensions: nil, resource_id: nil, update_behavior: nil)
|
|
68
|
+
# Single usage measurement
|
|
69
|
+
#
|
|
67
70
|
# @param customer_id [String] Customer id
|
|
68
71
|
#
|
|
69
72
|
# @param feature_id [String] Feature id
|
|
@@ -72,12 +75,25 @@ module Stigg
|
|
|
72
75
|
#
|
|
73
76
|
# @param created_at [Time] Timestamp of when the record was created
|
|
74
77
|
#
|
|
75
|
-
# @param dimensions [Hash{Symbol=>String}] Additional dimensions for the usage report
|
|
78
|
+
# @param dimensions [Hash{Symbol=>String, Float, Boolean}] Additional dimensions for the usage report
|
|
76
79
|
#
|
|
77
80
|
# @param resource_id [String, nil] Resource id
|
|
78
81
|
#
|
|
79
82
|
# @param update_behavior [Symbol, Stigg::Models::V1CreateUsageParams::Usage::UpdateBehavior] The method by which the usage value should be updated
|
|
80
83
|
|
|
84
|
+
module Dimension
|
|
85
|
+
extend Stigg::Internal::Type::Union
|
|
86
|
+
|
|
87
|
+
variant String
|
|
88
|
+
|
|
89
|
+
variant Float
|
|
90
|
+
|
|
91
|
+
variant Stigg::Internal::Type::Boolean
|
|
92
|
+
|
|
93
|
+
# @!method self.variants
|
|
94
|
+
# @return [Array(String, Float, Boolean)]
|
|
95
|
+
end
|
|
96
|
+
|
|
81
97
|
# The method by which the usage value should be updated
|
|
82
98
|
#
|
|
83
99
|
# @see Stigg::Models::V1CreateUsageParams::Usage#update_behavior
|
|
@@ -5,12 +5,16 @@ module Stigg
|
|
|
5
5
|
# @see Stigg::Resources::V1#create_usage
|
|
6
6
|
class V1CreateUsageResponse < Stigg::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute data
|
|
8
|
+
# Array of usage measurements with current values and period info
|
|
8
9
|
#
|
|
9
10
|
# @return [Array<Stigg::Models::V1CreateUsageResponse::Data>]
|
|
10
11
|
required :data, -> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1CreateUsageResponse::Data] }
|
|
11
12
|
|
|
12
13
|
# @!method initialize(data:)
|
|
13
|
-
#
|
|
14
|
+
# Response containing reported usage measurements with current usage values,
|
|
15
|
+
# period information, and reset dates for each measurement.
|
|
16
|
+
#
|
|
17
|
+
# @param data [Array<Stigg::Models::V1CreateUsageResponse::Data>] Array of usage measurements with current values and period info
|
|
14
18
|
|
|
15
19
|
class Data < Stigg::Internal::Type::BaseModel
|
|
16
20
|
# @!attribute id
|
|
@@ -85,6 +89,8 @@ module Stigg
|
|
|
85
89
|
# Some parameter documentations has been truncated, see
|
|
86
90
|
# {Stigg::Models::V1CreateUsageResponse::Data} for more details.
|
|
87
91
|
#
|
|
92
|
+
# Recorded usage with period info
|
|
93
|
+
#
|
|
88
94
|
# @param id [String] Unique identifier for the entity
|
|
89
95
|
#
|
|
90
96
|
# @param created_at [Time] Timestamp of when the record was created
|
|
@@ -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
|
#
|
|
9
9
|
# @overload create(id:, amounts_off:, description:, duration_in_months:, name:, percent_off:, additional_meta_data: nil, request_options: {})
|
|
10
10
|
#
|
|
@@ -38,11 +38,12 @@ module Stigg
|
|
|
38
38
|
)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
# Get a single
|
|
41
|
+
# Get a single coupon by ID
|
|
42
42
|
#
|
|
43
43
|
# @overload retrieve(id, request_options: {})
|
|
44
44
|
#
|
|
45
|
-
# @param id [String]
|
|
45
|
+
# @param id [String] The unique identifier of the entity
|
|
46
|
+
#
|
|
46
47
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
47
48
|
#
|
|
48
49
|
# @return [Stigg::Models::V1::CouponRetrieveResponse]
|
|
@@ -57,19 +58,19 @@ module Stigg
|
|
|
57
58
|
)
|
|
58
59
|
end
|
|
59
60
|
|
|
60
|
-
# Get a list of
|
|
61
|
+
# Get a list of coupons
|
|
61
62
|
#
|
|
62
|
-
# @overload list(
|
|
63
|
+
# @overload list(after: nil, before: nil, limit: nil, request_options: {})
|
|
63
64
|
#
|
|
64
|
-
# @param
|
|
65
|
+
# @param after [String] Return items that come after this cursor
|
|
65
66
|
#
|
|
66
|
-
# @param
|
|
67
|
+
# @param before [String] Return items that come before this cursor
|
|
67
68
|
#
|
|
68
|
-
# @param
|
|
69
|
+
# @param limit [Integer] Maximum number of items to return
|
|
69
70
|
#
|
|
70
71
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
71
72
|
#
|
|
72
|
-
# @return [Stigg::Models::V1::CouponListResponse]
|
|
73
|
+
# @return [Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::CouponListResponse>]
|
|
73
74
|
#
|
|
74
75
|
# @see Stigg::Models::V1::CouponListParams
|
|
75
76
|
def list(params = {})
|
|
@@ -77,7 +78,8 @@ module Stigg
|
|
|
77
78
|
@client.request(
|
|
78
79
|
method: :get,
|
|
79
80
|
path: "api/v1/coupons",
|
|
80
|
-
query: parsed
|
|
81
|
+
query: parsed,
|
|
82
|
+
page: Stigg::Internal::MyCursorIDPage,
|
|
81
83
|
model: Stigg::Models::V1::CouponListResponse,
|
|
82
84
|
options: options
|
|
83
85
|
)
|
|
@@ -5,11 +5,11 @@ module Stigg
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class PaymentMethod
|
|
8
|
-
#
|
|
8
|
+
# Attach payment method
|
|
9
9
|
#
|
|
10
10
|
# @overload attach(id, integration_id:, payment_method_id:, vendor_identifier:, billing_currency: nil, request_options: {})
|
|
11
11
|
#
|
|
12
|
-
# @param id [String]
|
|
12
|
+
# @param id [String] The unique identifier of the entity
|
|
13
13
|
#
|
|
14
14
|
# @param integration_id [String] Integration details
|
|
15
15
|
#
|
|
@@ -17,7 +17,7 @@ module Stigg
|
|
|
17
17
|
#
|
|
18
18
|
# @param vendor_identifier [Symbol, Stigg::Models::V1::Customers::PaymentMethodAttachParams::VendorIdentifier] The vendor identifier of integration
|
|
19
19
|
#
|
|
20
|
-
# @param billing_currency [Symbol, Stigg::Models::V1::Customers::PaymentMethodAttachParams::BillingCurrency, nil]
|
|
20
|
+
# @param billing_currency [Symbol, Stigg::Models::V1::Customers::PaymentMethodAttachParams::BillingCurrency, nil] Customers selected currency
|
|
21
21
|
#
|
|
22
22
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
23
23
|
#
|
|
@@ -35,11 +35,12 @@ module Stigg
|
|
|
35
35
|
)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
#
|
|
38
|
+
# Detach payment method
|
|
39
39
|
#
|
|
40
40
|
# @overload detach(id, request_options: {})
|
|
41
41
|
#
|
|
42
|
-
# @param id [String]
|
|
42
|
+
# @param id [String] The unique identifier of the entity
|
|
43
|
+
#
|
|
43
44
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
44
45
|
#
|
|
45
46
|
# @return [Stigg::Models::V1::CustomerResponse]
|
|
@@ -5,47 +5,6 @@ module Stigg
|
|
|
5
5
|
class V1
|
|
6
6
|
class Customers
|
|
7
7
|
class Usage
|
|
8
|
-
# Perform retrieval on a Usage history
|
|
9
|
-
#
|
|
10
|
-
# @overload retrieve(feature_id, customer_id:, start_date:, end_date: nil, group_by: nil, resource_id: nil, request_options: {})
|
|
11
|
-
#
|
|
12
|
-
# @param feature_id [String] Path param: Feature id
|
|
13
|
-
#
|
|
14
|
-
# @param customer_id [String] Path param: Customer id
|
|
15
|
-
#
|
|
16
|
-
# @param start_date [Time] Query param: The start date of the range
|
|
17
|
-
#
|
|
18
|
-
# @param end_date [Time] Query param: The end date of the range
|
|
19
|
-
#
|
|
20
|
-
# @param group_by [String] Query param
|
|
21
|
-
#
|
|
22
|
-
# @param resource_id [String, nil] Query param: Resource id
|
|
23
|
-
#
|
|
24
|
-
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
25
|
-
#
|
|
26
|
-
# @return [Stigg::Models::V1::Customers::UsageRetrieveResponse]
|
|
27
|
-
#
|
|
28
|
-
# @see Stigg::Models::V1::Customers::UsageRetrieveParams
|
|
29
|
-
def retrieve(feature_id, params)
|
|
30
|
-
parsed, options = Stigg::V1::Customers::UsageRetrieveParams.dump_request(params)
|
|
31
|
-
customer_id =
|
|
32
|
-
parsed.delete(:customer_id) do
|
|
33
|
-
raise ArgumentError.new("missing required path argument #{_1}")
|
|
34
|
-
end
|
|
35
|
-
@client.request(
|
|
36
|
-
method: :get,
|
|
37
|
-
path: ["api/v1/customers/%1$s/usage/features/%2$s", customer_id, feature_id],
|
|
38
|
-
query: parsed.transform_keys(
|
|
39
|
-
start_date: "startDate",
|
|
40
|
-
end_date: "endDate",
|
|
41
|
-
group_by: "groupBy",
|
|
42
|
-
resource_id: "resourceId"
|
|
43
|
-
),
|
|
44
|
-
model: Stigg::Models::V1::Customers::UsageRetrieveResponse,
|
|
45
|
-
options: options
|
|
46
|
-
)
|
|
47
|
-
end
|
|
48
|
-
|
|
49
8
|
# @api private
|
|
50
9
|
#
|
|
51
10
|
# @param client [Stigg::Client]
|
|
@@ -10,10 +10,7 @@ module Stigg
|
|
|
10
10
|
# @return [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
|
#
|
|
18
15
|
# @overload create(id:, coupon_id: nil, default_payment_method: nil, email: nil, integrations: nil, metadata: nil, name: nil, request_options: {})
|
|
19
16
|
#
|
|
@@ -47,11 +44,12 @@ module Stigg
|
|
|
47
44
|
)
|
|
48
45
|
end
|
|
49
46
|
|
|
50
|
-
# Get a single
|
|
47
|
+
# Get a single customer by ID
|
|
51
48
|
#
|
|
52
49
|
# @overload retrieve(id, request_options: {})
|
|
53
50
|
#
|
|
54
|
-
# @param id [String]
|
|
51
|
+
# @param id [String] The unique identifier of the entity
|
|
52
|
+
#
|
|
55
53
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
56
54
|
#
|
|
57
55
|
# @return [Stigg::Models::V1::CustomerResponse]
|
|
@@ -66,11 +64,11 @@ module Stigg
|
|
|
66
64
|
)
|
|
67
65
|
end
|
|
68
66
|
|
|
69
|
-
# Update
|
|
67
|
+
# Update a customer
|
|
70
68
|
#
|
|
71
69
|
# @overload update(id, coupon_id: nil, email: nil, integrations: nil, metadata: nil, name: nil, request_options: {})
|
|
72
70
|
#
|
|
73
|
-
# @param id [String]
|
|
71
|
+
# @param id [String] The unique identifier of the entity
|
|
74
72
|
#
|
|
75
73
|
# @param coupon_id [String, nil] Customer level coupon
|
|
76
74
|
#
|
|
@@ -98,19 +96,19 @@ module Stigg
|
|
|
98
96
|
)
|
|
99
97
|
end
|
|
100
98
|
|
|
101
|
-
# Get a list of
|
|
99
|
+
# Get a list of customers
|
|
102
100
|
#
|
|
103
|
-
# @overload list(
|
|
101
|
+
# @overload list(after: nil, before: nil, limit: nil, request_options: {})
|
|
104
102
|
#
|
|
105
|
-
# @param
|
|
103
|
+
# @param after [String] Return items that come after this cursor
|
|
106
104
|
#
|
|
107
|
-
# @param
|
|
105
|
+
# @param before [String] Return items that come before this cursor
|
|
108
106
|
#
|
|
109
|
-
# @param
|
|
107
|
+
# @param limit [Integer] Maximum number of items to return
|
|
110
108
|
#
|
|
111
109
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
112
110
|
#
|
|
113
|
-
# @return [Stigg::Models::V1::CustomerListResponse]
|
|
111
|
+
# @return [Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::CustomerListResponse>]
|
|
114
112
|
#
|
|
115
113
|
# @see Stigg::Models::V1::CustomerListParams
|
|
116
114
|
def list(params = {})
|
|
@@ -118,17 +116,19 @@ module Stigg
|
|
|
118
116
|
@client.request(
|
|
119
117
|
method: :get,
|
|
120
118
|
path: "api/v1/customers",
|
|
121
|
-
query: parsed
|
|
119
|
+
query: parsed,
|
|
120
|
+
page: Stigg::Internal::MyCursorIDPage,
|
|
122
121
|
model: Stigg::Models::V1::CustomerListResponse,
|
|
123
122
|
options: options
|
|
124
123
|
)
|
|
125
124
|
end
|
|
126
125
|
|
|
127
|
-
#
|
|
126
|
+
# Archive customer
|
|
128
127
|
#
|
|
129
128
|
# @overload archive(id, request_options: {})
|
|
130
129
|
#
|
|
131
|
-
# @param id [String]
|
|
130
|
+
# @param id [String] The unique identifier of the entity
|
|
131
|
+
#
|
|
132
132
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
133
133
|
#
|
|
134
134
|
# @return [Stigg::Models::V1::CustomerResponse]
|
|
@@ -143,11 +143,12 @@ module Stigg
|
|
|
143
143
|
)
|
|
144
144
|
end
|
|
145
145
|
|
|
146
|
-
#
|
|
146
|
+
# Unarchive customer
|
|
147
147
|
#
|
|
148
148
|
# @overload unarchive(id, request_options: {})
|
|
149
149
|
#
|
|
150
|
-
# @param id [String]
|
|
150
|
+
# @param id [String] The unique identifier of the entity
|
|
151
|
+
#
|
|
151
152
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
152
153
|
#
|
|
153
154
|
# @return [Stigg::Models::V1::CustomerResponse]
|
|
@@ -169,7 +170,6 @@ module Stigg
|
|
|
169
170
|
@client = client
|
|
170
171
|
@payment_method = Stigg::Resources::V1::Customers::PaymentMethod.new(client: client)
|
|
171
172
|
@usage = Stigg::Resources::V1::Customers::Usage.new(client: client)
|
|
172
|
-
@promotional = Stigg::Resources::V1::Customers::Promotional.new(client: client)
|
|
173
173
|
end
|
|
174
174
|
end
|
|
175
175
|
end
|
|
@@ -5,11 +5,12 @@ module Stigg
|
|
|
5
5
|
class V1
|
|
6
6
|
class Subscriptions
|
|
7
7
|
class FutureUpdate
|
|
8
|
-
#
|
|
8
|
+
# Cancel pending payment update
|
|
9
9
|
#
|
|
10
10
|
# @overload cancel_pending_payment(id, request_options: {})
|
|
11
11
|
#
|
|
12
|
-
# @param id [String]
|
|
12
|
+
# @param id [String] The unique identifier of the entity
|
|
13
|
+
#
|
|
13
14
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
14
15
|
#
|
|
15
16
|
# @return [Stigg::Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentResponse]
|
|
@@ -24,11 +25,12 @@ module Stigg
|
|
|
24
25
|
)
|
|
25
26
|
end
|
|
26
27
|
|
|
27
|
-
#
|
|
28
|
+
# Cancel scheduled update
|
|
28
29
|
#
|
|
29
30
|
# @overload cancel_schedule(id, request_options: {})
|
|
30
31
|
#
|
|
31
|
-
# @param id [String]
|
|
32
|
+
# @param id [String] The unique identifier of the entity
|
|
33
|
+
#
|
|
32
34
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
33
35
|
#
|
|
34
36
|
# @return [Stigg::Models::V1::Subscriptions::FutureUpdateCancelScheduleResponse]
|