stigg 0.1.0.pre.alpha.1
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 +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +45 -0
- data/README.md +233 -0
- data/SECURITY.md +23 -0
- data/lib/stigg/client.rb +72 -0
- data/lib/stigg/errors.rb +228 -0
- data/lib/stigg/file_part.rb +58 -0
- data/lib/stigg/internal/my_cursor_id_page.rb +82 -0
- data/lib/stigg/internal/transport/base_client.rb +570 -0
- data/lib/stigg/internal/transport/pooled_net_requester.rb +210 -0
- data/lib/stigg/internal/type/array_of.rb +168 -0
- data/lib/stigg/internal/type/base_model.rb +529 -0
- data/lib/stigg/internal/type/base_page.rb +55 -0
- data/lib/stigg/internal/type/boolean.rb +77 -0
- data/lib/stigg/internal/type/converter.rb +327 -0
- data/lib/stigg/internal/type/enum.rb +131 -0
- data/lib/stigg/internal/type/file_input.rb +110 -0
- data/lib/stigg/internal/type/hash_of.rb +188 -0
- data/lib/stigg/internal/type/request_parameters.rb +42 -0
- data/lib/stigg/internal/type/union.rb +237 -0
- data/lib/stigg/internal/type/unknown.rb +81 -0
- data/lib/stigg/internal/util.rb +920 -0
- data/lib/stigg/internal.rb +20 -0
- data/lib/stigg/models/v1/coupon_create_params.rb +221 -0
- data/lib/stigg/models/v1/coupon_create_response.rb +317 -0
- data/lib/stigg/models/v1/coupon_list_params.rb +40 -0
- data/lib/stigg/models/v1/coupon_list_response.rb +324 -0
- data/lib/stigg/models/v1/coupon_retrieve_params.rb +16 -0
- data/lib/stigg/models/v1/coupon_retrieve_response.rb +317 -0
- data/lib/stigg/models/v1/customer_archive_params.rb +16 -0
- data/lib/stigg/models/v1/customer_create_params.rb +185 -0
- data/lib/stigg/models/v1/customer_list_params.rb +40 -0
- data/lib/stigg/models/v1/customer_list_response.rb +223 -0
- data/lib/stigg/models/v1/customer_response.rb +216 -0
- data/lib/stigg/models/v1/customer_retrieve_params.rb +16 -0
- data/lib/stigg/models/v1/customer_unarchive_params.rb +16 -0
- data/lib/stigg/models/v1/customer_update_params.rb +107 -0
- data/lib/stigg/models/v1/customers/payment_method_attach_params.rb +197 -0
- data/lib/stigg/models/v1/customers/payment_method_detach_params.rb +18 -0
- data/lib/stigg/models/v1/customers/promotional_create_params.rb +294 -0
- data/lib/stigg/models/v1/customers/promotional_create_response.rb +268 -0
- data/lib/stigg/models/v1/customers/promotional_revoke_params.rb +24 -0
- data/lib/stigg/models/v1/customers/promotional_revoke_response.rb +268 -0
- data/lib/stigg/models/v1/customers/usage_retrieve_params.rb +56 -0
- data/lib/stigg/models/v1/customers/usage_retrieve_response.rb +145 -0
- data/lib/stigg/models/v1/subscription_create_params.rb +214 -0
- data/lib/stigg/models/v1/subscription_create_response.rb +338 -0
- data/lib/stigg/models/v1/subscription_delegate_params.rb +24 -0
- data/lib/stigg/models/v1/subscription_delegate_response.rb +274 -0
- data/lib/stigg/models/v1/subscription_list_params.rb +60 -0
- data/lib/stigg/models/v1/subscription_list_response.rb +281 -0
- data/lib/stigg/models/v1/subscription_migrate_params.rb +37 -0
- data/lib/stigg/models/v1/subscription_migrate_response.rb +274 -0
- data/lib/stigg/models/v1/subscription_preview_params.rb +644 -0
- data/lib/stigg/models/v1/subscription_preview_response.rb +431 -0
- data/lib/stigg/models/v1/subscription_retrieve_params.rb +16 -0
- data/lib/stigg/models/v1/subscription_retrieve_response.rb +274 -0
- data/lib/stigg/models/v1/subscription_transfer_params.rb +28 -0
- data/lib/stigg/models/v1/subscription_transfer_response.rb +274 -0
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_params.rb +18 -0
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rb +32 -0
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_params.rb +18 -0
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +32 -0
- data/lib/stigg/models/v1_create_event_params.rb +87 -0
- data/lib/stigg/models/v1_create_event_response.rb +16 -0
- data/lib/stigg/models/v1_create_usage_params.rb +96 -0
- data/lib/stigg/models/v1_create_usage_response.rb +112 -0
- data/lib/stigg/models.rb +47 -0
- data/lib/stigg/request_options.rb +77 -0
- data/lib/stigg/resources/v1/coupons.rb +95 -0
- data/lib/stigg/resources/v1/customers/payment_method.rb +67 -0
- data/lib/stigg/resources/v1/customers/promotional.rb +69 -0
- data/lib/stigg/resources/v1/customers/usage.rb +59 -0
- data/lib/stigg/resources/v1/customers.rb +177 -0
- data/lib/stigg/resources/v1/subscriptions/future_update.rb +56 -0
- data/lib/stigg/resources/v1/subscriptions.rb +241 -0
- data/lib/stigg/resources/v1.rb +70 -0
- data/lib/stigg/version.rb +5 -0
- data/lib/stigg.rb +108 -0
- data/manifest.yaml +17 -0
- data/rbi/stigg/client.rbi +49 -0
- data/rbi/stigg/errors.rbi +205 -0
- data/rbi/stigg/file_part.rbi +37 -0
- data/rbi/stigg/internal/my_cursor_id_page.rbi +19 -0
- data/rbi/stigg/internal/transport/base_client.rbi +297 -0
- data/rbi/stigg/internal/transport/pooled_net_requester.rbi +82 -0
- data/rbi/stigg/internal/type/array_of.rbi +104 -0
- data/rbi/stigg/internal/type/base_model.rbi +299 -0
- data/rbi/stigg/internal/type/base_page.rbi +42 -0
- data/rbi/stigg/internal/type/boolean.rbi +58 -0
- data/rbi/stigg/internal/type/converter.rbi +204 -0
- data/rbi/stigg/internal/type/enum.rbi +82 -0
- data/rbi/stigg/internal/type/file_input.rbi +58 -0
- data/rbi/stigg/internal/type/hash_of.rbi +104 -0
- data/rbi/stigg/internal/type/request_parameters.rbi +29 -0
- data/rbi/stigg/internal/type/union.rbi +126 -0
- data/rbi/stigg/internal/type/unknown.rbi +58 -0
- data/rbi/stigg/internal/util.rbi +478 -0
- data/rbi/stigg/internal.rbi +16 -0
- data/rbi/stigg/models/v1/coupon_create_params.rbi +758 -0
- data/rbi/stigg/models/v1/coupon_create_response.rbi +986 -0
- data/rbi/stigg/models/v1/coupon_list_params.rbi +70 -0
- data/rbi/stigg/models/v1/coupon_list_response.rbi +983 -0
- data/rbi/stigg/models/v1/coupon_retrieve_params.rbi +29 -0
- data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +986 -0
- data/rbi/stigg/models/v1/customer_archive_params.rbi +29 -0
- data/rbi/stigg/models/v1/customer_create_params.rbi +376 -0
- data/rbi/stigg/models/v1/customer_list_params.rbi +70 -0
- data/rbi/stigg/models/v1/customer_list_response.rbi +447 -0
- data/rbi/stigg/models/v1/customer_response.rbi +423 -0
- data/rbi/stigg/models/v1/customer_retrieve_params.rbi +29 -0
- data/rbi/stigg/models/v1/customer_unarchive_params.rbi +29 -0
- data/rbi/stigg/models/v1/customer_update_params.rbi +226 -0
- data/rbi/stigg/models/v1/customers/payment_method_attach_params.rbi +769 -0
- data/rbi/stigg/models/v1/customers/payment_method_detach_params.rbi +34 -0
- data/rbi/stigg/models/v1/customers/promotional_create_params.rbi +639 -0
- data/rbi/stigg/models/v1/customers/promotional_create_response.rbi +495 -0
- data/rbi/stigg/models/v1/customers/promotional_revoke_params.rbi +42 -0
- data/rbi/stigg/models/v1/customers/promotional_revoke_response.rbi +497 -0
- data/rbi/stigg/models/v1/customers/usage_retrieve_params.rbi +84 -0
- data/rbi/stigg/models/v1/customers/usage_retrieve_response.rbi +353 -0
- data/rbi/stigg/models/v1/subscription_create_params.rbi +394 -0
- data/rbi/stigg/models/v1/subscription_create_response.rbi +668 -0
- data/rbi/stigg/models/v1/subscription_delegate_params.rbi +48 -0
- data/rbi/stigg/models/v1/subscription_delegate_response.rbi +535 -0
- data/rbi/stigg/models/v1/subscription_list_params.rbi +94 -0
- data/rbi/stigg/models/v1/subscription_list_response.rbi +543 -0
- data/rbi/stigg/models/v1/subscription_migrate_params.rbi +99 -0
- data/rbi/stigg/models/v1/subscription_migrate_response.rbi +535 -0
- data/rbi/stigg/models/v1/subscription_preview_params.rbi +1786 -0
- data/rbi/stigg/models/v1/subscription_preview_response.rbi +929 -0
- data/rbi/stigg/models/v1/subscription_retrieve_params.rbi +32 -0
- data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +535 -0
- data/rbi/stigg/models/v1/subscription_transfer_params.rbi +50 -0
- data/rbi/stigg/models/v1/subscription_transfer_response.rbi +535 -0
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_params.rbi +34 -0
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +79 -0
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_schedule_params.rbi +34 -0
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbi +79 -0
- data/rbi/stigg/models/v1_create_event_params.rbi +160 -0
- data/rbi/stigg/models/v1_create_event_response.rbi +23 -0
- data/rbi/stigg/models/v1_create_usage_params.rbi +177 -0
- data/rbi/stigg/models/v1_create_usage_response.rbi +150 -0
- data/rbi/stigg/models.rbi +9 -0
- data/rbi/stigg/request_options.rbi +55 -0
- data/rbi/stigg/resources/v1/coupons.rbi +79 -0
- data/rbi/stigg/resources/v1/customers/payment_method.rbi +54 -0
- data/rbi/stigg/resources/v1/customers/promotional.rbi +53 -0
- data/rbi/stigg/resources/v1/customers/usage.rbi +45 -0
- data/rbi/stigg/resources/v1/customers.rbi +138 -0
- data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +40 -0
- data/rbi/stigg/resources/v1/subscriptions.rbi +199 -0
- data/rbi/stigg/resources/v1.rbi +49 -0
- data/rbi/stigg/version.rbi +5 -0
- data/sig/stigg/client.rbs +26 -0
- data/sig/stigg/errors.rbs +117 -0
- data/sig/stigg/file_part.rbs +21 -0
- data/sig/stigg/internal/my_cursor_id_page.rbs +11 -0
- data/sig/stigg/internal/transport/base_client.rbs +133 -0
- data/sig/stigg/internal/transport/pooled_net_requester.rbs +48 -0
- data/sig/stigg/internal/type/array_of.rbs +48 -0
- data/sig/stigg/internal/type/base_model.rbs +102 -0
- data/sig/stigg/internal/type/base_page.rbs +24 -0
- data/sig/stigg/internal/type/boolean.rbs +26 -0
- data/sig/stigg/internal/type/converter.rbs +79 -0
- data/sig/stigg/internal/type/enum.rbs +32 -0
- data/sig/stigg/internal/type/file_input.rbs +25 -0
- data/sig/stigg/internal/type/hash_of.rbs +48 -0
- data/sig/stigg/internal/type/request_parameters.rbs +17 -0
- data/sig/stigg/internal/type/union.rbs +52 -0
- data/sig/stigg/internal/type/unknown.rbs +26 -0
- data/sig/stigg/internal/util.rbs +185 -0
- data/sig/stigg/internal.rbs +9 -0
- data/sig/stigg/models/v1/coupon_create_params.rbs +323 -0
- data/sig/stigg/models/v1/coupon_create_response.rbs +392 -0
- data/sig/stigg/models/v1/coupon_list_params.rbs +40 -0
- data/sig/stigg/models/v1/coupon_list_response.rbs +399 -0
- data/sig/stigg/models/v1/coupon_retrieve_params.rbs +17 -0
- data/sig/stigg/models/v1/coupon_retrieve_response.rbs +394 -0
- data/sig/stigg/models/v1/customer_archive_params.rbs +17 -0
- data/sig/stigg/models/v1/customer_create_params.rbs +169 -0
- data/sig/stigg/models/v1/customer_list_params.rbs +40 -0
- data/sig/stigg/models/v1/customer_list_response.rbs +198 -0
- data/sig/stigg/models/v1/customer_response.rbs +188 -0
- data/sig/stigg/models/v1/customer_retrieve_params.rbs +17 -0
- data/sig/stigg/models/v1/customer_unarchive_params.rbs +17 -0
- data/sig/stigg/models/v1/customer_update_params.rbs +110 -0
- data/sig/stigg/models/v1/customers/payment_method_attach_params.rbs +315 -0
- data/sig/stigg/models/v1/customers/payment_method_detach_params.rbs +19 -0
- data/sig/stigg/models/v1/customers/promotional_create_params.rbs +234 -0
- data/sig/stigg/models/v1/customers/promotional_create_response.rbs +209 -0
- data/sig/stigg/models/v1/customers/promotional_revoke_params.rbs +27 -0
- data/sig/stigg/models/v1/customers/promotional_revoke_response.rbs +209 -0
- data/sig/stigg/models/v1/customers/usage_retrieve_params.rbs +54 -0
- data/sig/stigg/models/v1/customers/usage_retrieve_response.rbs +134 -0
- data/sig/stigg/models/v1/subscription_create_params.rbs +199 -0
- data/sig/stigg/models/v1/subscription_create_response.rbs +283 -0
- data/sig/stigg/models/v1/subscription_delegate_params.rbs +26 -0
- data/sig/stigg/models/v1/subscription_delegate_response.rbs +224 -0
- data/sig/stigg/models/v1/subscription_list_params.rbs +58 -0
- data/sig/stigg/models/v1/subscription_list_response.rbs +229 -0
- data/sig/stigg/models/v1/subscription_migrate_params.rbs +43 -0
- data/sig/stigg/models/v1/subscription_migrate_response.rbs +224 -0
- data/sig/stigg/models/v1/subscription_preview_params.rbs +821 -0
- data/sig/stigg/models/v1/subscription_preview_response.rbs +466 -0
- data/sig/stigg/models/v1/subscription_retrieve_params.rbs +17 -0
- data/sig/stigg/models/v1/subscription_retrieve_response.rbs +224 -0
- data/sig/stigg/models/v1/subscription_transfer_params.rbs +26 -0
- data/sig/stigg/models/v1/subscription_transfer_response.rbs +224 -0
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_params.rbs +19 -0
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbs +34 -0
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_params.rbs +19 -0
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbs +34 -0
- data/sig/stigg/models/v1_create_event_params.rbs +80 -0
- data/sig/stigg/models/v1_create_event_response.rbs +13 -0
- data/sig/stigg/models/v1_create_usage_params.rbs +90 -0
- data/sig/stigg/models/v1_create_usage_response.rbs +85 -0
- data/sig/stigg/models.rbs +7 -0
- data/sig/stigg/request_options.rbs +34 -0
- data/sig/stigg/resources/v1/coupons.rbs +32 -0
- data/sig/stigg/resources/v1/customers/payment_method.rbs +25 -0
- data/sig/stigg/resources/v1/customers/promotional.rbs +23 -0
- data/sig/stigg/resources/v1/customers/usage.rbs +21 -0
- data/sig/stigg/resources/v1/customers.rbs +58 -0
- data/sig/stigg/resources/v1/subscriptions/future_update.rbs +21 -0
- data/sig/stigg/resources/v1/subscriptions.rbs +76 -0
- data/sig/stigg/resources/v1.rbs +23 -0
- data/sig/stigg/version.rbs +3 -0
- metadata +301 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Resources
|
|
5
|
+
class V1
|
|
6
|
+
class Customers
|
|
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
|
+
# @api private
|
|
50
|
+
#
|
|
51
|
+
# @param client [Stigg::Client]
|
|
52
|
+
def initialize(client:)
|
|
53
|
+
@client = client
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Resources
|
|
5
|
+
class V1
|
|
6
|
+
class Customers
|
|
7
|
+
# @return [Stigg::Resources::V1::Customers::PaymentMethod]
|
|
8
|
+
attr_reader :payment_method
|
|
9
|
+
|
|
10
|
+
# @return [Stigg::Resources::V1::Customers::Usage]
|
|
11
|
+
attr_reader :usage
|
|
12
|
+
|
|
13
|
+
# @return [Stigg::Resources::V1::Customers::Promotional]
|
|
14
|
+
attr_reader :promotional
|
|
15
|
+
|
|
16
|
+
# Create a new Customer
|
|
17
|
+
#
|
|
18
|
+
# @overload create(id:, coupon_id: nil, default_payment_method: nil, email: nil, integrations: nil, metadata: nil, name: nil, request_options: {})
|
|
19
|
+
#
|
|
20
|
+
# @param id [String] Customer slug
|
|
21
|
+
#
|
|
22
|
+
# @param coupon_id [String, nil] Customer level coupon
|
|
23
|
+
#
|
|
24
|
+
# @param default_payment_method [Stigg::Models::V1::CustomerCreateParams::DefaultPaymentMethod, nil] The default payment method details
|
|
25
|
+
#
|
|
26
|
+
# @param email [String, nil] The email of the customer
|
|
27
|
+
#
|
|
28
|
+
# @param integrations [Array<Stigg::Models::V1::CustomerCreateParams::Integration>] List of integrations
|
|
29
|
+
#
|
|
30
|
+
# @param metadata [Hash{Symbol=>String}] Additional metadata
|
|
31
|
+
#
|
|
32
|
+
# @param name [String, nil] The name of the customer
|
|
33
|
+
#
|
|
34
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
35
|
+
#
|
|
36
|
+
# @return [Stigg::Models::V1::CustomerResponse]
|
|
37
|
+
#
|
|
38
|
+
# @see Stigg::Models::V1::CustomerCreateParams
|
|
39
|
+
def create(params)
|
|
40
|
+
parsed, options = Stigg::V1::CustomerCreateParams.dump_request(params)
|
|
41
|
+
@client.request(
|
|
42
|
+
method: :post,
|
|
43
|
+
path: "api/v1/customers",
|
|
44
|
+
body: parsed,
|
|
45
|
+
model: Stigg::V1::CustomerResponse,
|
|
46
|
+
options: options
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Get a single Customer by id
|
|
51
|
+
#
|
|
52
|
+
# @overload retrieve(id, request_options: {})
|
|
53
|
+
#
|
|
54
|
+
# @param id [String]
|
|
55
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
56
|
+
#
|
|
57
|
+
# @return [Stigg::Models::V1::CustomerResponse]
|
|
58
|
+
#
|
|
59
|
+
# @see Stigg::Models::V1::CustomerRetrieveParams
|
|
60
|
+
def retrieve(id, params = {})
|
|
61
|
+
@client.request(
|
|
62
|
+
method: :get,
|
|
63
|
+
path: ["api/v1/customers/%1$s", id],
|
|
64
|
+
model: Stigg::V1::CustomerResponse,
|
|
65
|
+
options: params[:request_options]
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Update an existing Customer
|
|
70
|
+
#
|
|
71
|
+
# @overload update(id, coupon_id: nil, email: nil, integrations: nil, metadata: nil, name: nil, request_options: {})
|
|
72
|
+
#
|
|
73
|
+
# @param id [String]
|
|
74
|
+
#
|
|
75
|
+
# @param coupon_id [String, nil] Customer level coupon
|
|
76
|
+
#
|
|
77
|
+
# @param email [String, nil] The email of the customer
|
|
78
|
+
#
|
|
79
|
+
# @param integrations [Array<Stigg::Models::V1::CustomerUpdateParams::Integration>] List of integrations
|
|
80
|
+
#
|
|
81
|
+
# @param metadata [Hash{Symbol=>String}] Additional metadata
|
|
82
|
+
#
|
|
83
|
+
# @param name [String, nil] The name of the customer
|
|
84
|
+
#
|
|
85
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
86
|
+
#
|
|
87
|
+
# @return [Stigg::Models::V1::CustomerResponse]
|
|
88
|
+
#
|
|
89
|
+
# @see Stigg::Models::V1::CustomerUpdateParams
|
|
90
|
+
def update(id, params = {})
|
|
91
|
+
parsed, options = Stigg::V1::CustomerUpdateParams.dump_request(params)
|
|
92
|
+
@client.request(
|
|
93
|
+
method: :patch,
|
|
94
|
+
path: ["api/v1/customers/%1$s", id],
|
|
95
|
+
body: parsed,
|
|
96
|
+
model: Stigg::V1::CustomerResponse,
|
|
97
|
+
options: options
|
|
98
|
+
)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Get a list of Customers
|
|
102
|
+
#
|
|
103
|
+
# @overload list(ending_before: nil, limit: nil, starting_after: nil, request_options: {})
|
|
104
|
+
#
|
|
105
|
+
# @param ending_before [String] Ending before this UUID for pagination
|
|
106
|
+
#
|
|
107
|
+
# @param limit [Integer] Items per page
|
|
108
|
+
#
|
|
109
|
+
# @param starting_after [String] Starting after this UUID for pagination
|
|
110
|
+
#
|
|
111
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
112
|
+
#
|
|
113
|
+
# @return [Stigg::Models::V1::CustomerListResponse]
|
|
114
|
+
#
|
|
115
|
+
# @see Stigg::Models::V1::CustomerListParams
|
|
116
|
+
def list(params = {})
|
|
117
|
+
parsed, options = Stigg::V1::CustomerListParams.dump_request(params)
|
|
118
|
+
@client.request(
|
|
119
|
+
method: :get,
|
|
120
|
+
path: "api/v1/customers",
|
|
121
|
+
query: parsed.transform_keys(ending_before: "endingBefore", starting_after: "startingAfter"),
|
|
122
|
+
model: Stigg::Models::V1::CustomerListResponse,
|
|
123
|
+
options: options
|
|
124
|
+
)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Perform archive on a Customer
|
|
128
|
+
#
|
|
129
|
+
# @overload archive(id, request_options: {})
|
|
130
|
+
#
|
|
131
|
+
# @param id [String]
|
|
132
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
133
|
+
#
|
|
134
|
+
# @return [Stigg::Models::V1::CustomerResponse]
|
|
135
|
+
#
|
|
136
|
+
# @see Stigg::Models::V1::CustomerArchiveParams
|
|
137
|
+
def archive(id, params = {})
|
|
138
|
+
@client.request(
|
|
139
|
+
method: :post,
|
|
140
|
+
path: ["api/v1/customers/%1$s/archive", id],
|
|
141
|
+
model: Stigg::V1::CustomerResponse,
|
|
142
|
+
options: params[:request_options]
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Perform unarchive on a Customer
|
|
147
|
+
#
|
|
148
|
+
# @overload unarchive(id, request_options: {})
|
|
149
|
+
#
|
|
150
|
+
# @param id [String]
|
|
151
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
152
|
+
#
|
|
153
|
+
# @return [Stigg::Models::V1::CustomerResponse]
|
|
154
|
+
#
|
|
155
|
+
# @see Stigg::Models::V1::CustomerUnarchiveParams
|
|
156
|
+
def unarchive(id, params = {})
|
|
157
|
+
@client.request(
|
|
158
|
+
method: :post,
|
|
159
|
+
path: ["api/v1/customers/%1$s/unarchive", id],
|
|
160
|
+
model: Stigg::V1::CustomerResponse,
|
|
161
|
+
options: params[:request_options]
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# @api private
|
|
166
|
+
#
|
|
167
|
+
# @param client [Stigg::Client]
|
|
168
|
+
def initialize(client:)
|
|
169
|
+
@client = client
|
|
170
|
+
@payment_method = Stigg::Resources::V1::Customers::PaymentMethod.new(client: client)
|
|
171
|
+
@usage = Stigg::Resources::V1::Customers::Usage.new(client: client)
|
|
172
|
+
@promotional = Stigg::Resources::V1::Customers::Promotional.new(client: client)
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Resources
|
|
5
|
+
class V1
|
|
6
|
+
class Subscriptions
|
|
7
|
+
class FutureUpdate
|
|
8
|
+
# Perform cancel future update on a Subscription
|
|
9
|
+
#
|
|
10
|
+
# @overload cancel_pending_payment(id, request_options: {})
|
|
11
|
+
#
|
|
12
|
+
# @param id [String]
|
|
13
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
14
|
+
#
|
|
15
|
+
# @return [Stigg::Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentResponse]
|
|
16
|
+
#
|
|
17
|
+
# @see Stigg::Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentParams
|
|
18
|
+
def cancel_pending_payment(id, params = {})
|
|
19
|
+
@client.request(
|
|
20
|
+
method: :delete,
|
|
21
|
+
path: ["api/v1/subscriptions/%1$s/future-update/pending-payment", id],
|
|
22
|
+
model: Stigg::Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentResponse,
|
|
23
|
+
options: params[:request_options]
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Perform cancel future update on a Subscription
|
|
28
|
+
#
|
|
29
|
+
# @overload cancel_schedule(id, request_options: {})
|
|
30
|
+
#
|
|
31
|
+
# @param id [String]
|
|
32
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
33
|
+
#
|
|
34
|
+
# @return [Stigg::Models::V1::Subscriptions::FutureUpdateCancelScheduleResponse]
|
|
35
|
+
#
|
|
36
|
+
# @see Stigg::Models::V1::Subscriptions::FutureUpdateCancelScheduleParams
|
|
37
|
+
def cancel_schedule(id, params = {})
|
|
38
|
+
@client.request(
|
|
39
|
+
method: :delete,
|
|
40
|
+
path: ["api/v1/subscriptions/%1$s/future-update/schedule", id],
|
|
41
|
+
model: Stigg::Models::V1::Subscriptions::FutureUpdateCancelScheduleResponse,
|
|
42
|
+
options: params[:request_options]
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# @api private
|
|
47
|
+
#
|
|
48
|
+
# @param client [Stigg::Client]
|
|
49
|
+
def initialize(client:)
|
|
50
|
+
@client = client
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Resources
|
|
5
|
+
class V1
|
|
6
|
+
class Subscriptions
|
|
7
|
+
# @return [Stigg::Resources::V1::Subscriptions::FutureUpdate]
|
|
8
|
+
attr_reader :future_update
|
|
9
|
+
|
|
10
|
+
# Create a new Subscription
|
|
11
|
+
#
|
|
12
|
+
# @overload create(customer_id:, plan_id:, id: nil, await_payment_confirmation: nil, billing_period: nil, checkout_options: nil, metadata: nil, paying_customer_id: nil, resource_id: nil, trial_override_configuration: nil, request_options: {})
|
|
13
|
+
#
|
|
14
|
+
# @param customer_id [String] Customer ID to provision the subscription for
|
|
15
|
+
#
|
|
16
|
+
# @param plan_id [String] Plan ID to provision
|
|
17
|
+
#
|
|
18
|
+
# @param id [String, nil] Unique identifier for the subscription
|
|
19
|
+
#
|
|
20
|
+
# @param await_payment_confirmation [Boolean] Whether to wait for payment confirmation before returning the subscription
|
|
21
|
+
#
|
|
22
|
+
# @param billing_period [Symbol, Stigg::Models::V1::SubscriptionCreateParams::BillingPeriod]
|
|
23
|
+
#
|
|
24
|
+
# @param checkout_options [Stigg::Models::V1::SubscriptionCreateParams::CheckoutOptions]
|
|
25
|
+
#
|
|
26
|
+
# @param metadata [Hash{Symbol=>String}] Additional metadata for the subscription
|
|
27
|
+
#
|
|
28
|
+
# @param paying_customer_id [String, nil] Optional paying customer ID for split billing scenarios
|
|
29
|
+
#
|
|
30
|
+
# @param resource_id [String, nil] Optional resource ID for multi-instance subscriptions
|
|
31
|
+
#
|
|
32
|
+
# @param trial_override_configuration [Stigg::Models::V1::SubscriptionCreateParams::TrialOverrideConfiguration]
|
|
33
|
+
#
|
|
34
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
35
|
+
#
|
|
36
|
+
# @return [Stigg::Models::V1::SubscriptionCreateResponse]
|
|
37
|
+
#
|
|
38
|
+
# @see Stigg::Models::V1::SubscriptionCreateParams
|
|
39
|
+
def create(params)
|
|
40
|
+
parsed, options = Stigg::V1::SubscriptionCreateParams.dump_request(params)
|
|
41
|
+
@client.request(
|
|
42
|
+
method: :post,
|
|
43
|
+
path: "api/v1/subscriptions",
|
|
44
|
+
body: parsed,
|
|
45
|
+
model: Stigg::Models::V1::SubscriptionCreateResponse,
|
|
46
|
+
options: options
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Get a single Subscription by id
|
|
51
|
+
#
|
|
52
|
+
# @overload retrieve(id, request_options: {})
|
|
53
|
+
#
|
|
54
|
+
# @param id [String]
|
|
55
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
56
|
+
#
|
|
57
|
+
# @return [Stigg::Models::V1::SubscriptionRetrieveResponse]
|
|
58
|
+
#
|
|
59
|
+
# @see Stigg::Models::V1::SubscriptionRetrieveParams
|
|
60
|
+
def retrieve(id, params = {})
|
|
61
|
+
@client.request(
|
|
62
|
+
method: :get,
|
|
63
|
+
path: ["api/v1/subscriptions/%1$s", id],
|
|
64
|
+
model: Stigg::Models::V1::SubscriptionRetrieveResponse,
|
|
65
|
+
options: params[:request_options]
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Some parameter documentations has been truncated, see
|
|
70
|
+
# {Stigg::Models::V1::SubscriptionListParams} for more details.
|
|
71
|
+
#
|
|
72
|
+
# Get a list of Subscriptions
|
|
73
|
+
#
|
|
74
|
+
# @overload list(customer_id: nil, ending_before: nil, limit: nil, starting_after: nil, status: nil, request_options: {})
|
|
75
|
+
#
|
|
76
|
+
# @param customer_id [String] Filter by customer ID
|
|
77
|
+
#
|
|
78
|
+
# @param ending_before [String] Ending before this UUID for pagination
|
|
79
|
+
#
|
|
80
|
+
# @param limit [Integer] Items per page
|
|
81
|
+
#
|
|
82
|
+
# @param starting_after [String] Starting after this UUID for pagination
|
|
83
|
+
#
|
|
84
|
+
# @param status [String] Filter by subscription status (comma-separated for multiple statuses, e.g., ACTI
|
|
85
|
+
#
|
|
86
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
87
|
+
#
|
|
88
|
+
# @return [Stigg::Models::V1::SubscriptionListResponse]
|
|
89
|
+
#
|
|
90
|
+
# @see Stigg::Models::V1::SubscriptionListParams
|
|
91
|
+
def list(params = {})
|
|
92
|
+
parsed, options = Stigg::V1::SubscriptionListParams.dump_request(params)
|
|
93
|
+
@client.request(
|
|
94
|
+
method: :get,
|
|
95
|
+
path: "api/v1/subscriptions",
|
|
96
|
+
query: parsed.transform_keys(
|
|
97
|
+
customer_id: "customerId",
|
|
98
|
+
ending_before: "endingBefore",
|
|
99
|
+
starting_after: "startingAfter"
|
|
100
|
+
),
|
|
101
|
+
model: Stigg::Models::V1::SubscriptionListResponse,
|
|
102
|
+
options: options
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Perform delegate on a Subscription
|
|
107
|
+
#
|
|
108
|
+
# @overload delegate(id, target_customer_id:, request_options: {})
|
|
109
|
+
#
|
|
110
|
+
# @param id [String]
|
|
111
|
+
#
|
|
112
|
+
# @param target_customer_id [String] The customer ID to delegate the subscription to
|
|
113
|
+
#
|
|
114
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
115
|
+
#
|
|
116
|
+
# @return [Stigg::Models::V1::SubscriptionDelegateResponse]
|
|
117
|
+
#
|
|
118
|
+
# @see Stigg::Models::V1::SubscriptionDelegateParams
|
|
119
|
+
def delegate(id, params)
|
|
120
|
+
parsed, options = Stigg::V1::SubscriptionDelegateParams.dump_request(params)
|
|
121
|
+
@client.request(
|
|
122
|
+
method: :post,
|
|
123
|
+
path: ["api/v1/subscriptions/%1$s/delegate", id],
|
|
124
|
+
body: parsed,
|
|
125
|
+
model: Stigg::Models::V1::SubscriptionDelegateResponse,
|
|
126
|
+
options: options
|
|
127
|
+
)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Perform migrate to latest plan version on a Subscription
|
|
131
|
+
#
|
|
132
|
+
# @overload migrate(id, subscription_migration_time: nil, request_options: {})
|
|
133
|
+
#
|
|
134
|
+
# @param id [String]
|
|
135
|
+
#
|
|
136
|
+
# @param subscription_migration_time [Symbol, Stigg::Models::V1::SubscriptionMigrateParams::SubscriptionMigrationTime] When to migrate the subscription: IMMEDIATE or END_OF_BILLING_PERIOD
|
|
137
|
+
#
|
|
138
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
139
|
+
#
|
|
140
|
+
# @return [Stigg::Models::V1::SubscriptionMigrateResponse]
|
|
141
|
+
#
|
|
142
|
+
# @see Stigg::Models::V1::SubscriptionMigrateParams
|
|
143
|
+
def migrate(id, params = {})
|
|
144
|
+
parsed, options = Stigg::V1::SubscriptionMigrateParams.dump_request(params)
|
|
145
|
+
@client.request(
|
|
146
|
+
method: :post,
|
|
147
|
+
path: ["api/v1/subscriptions/%1$s/migrate", id],
|
|
148
|
+
body: parsed,
|
|
149
|
+
model: Stigg::Models::V1::SubscriptionMigrateResponse,
|
|
150
|
+
options: options
|
|
151
|
+
)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Create a new Subscription Preview
|
|
155
|
+
#
|
|
156
|
+
# @overload preview(customer_id:, plan_id:, addons: nil, applied_coupon: nil, billable_features: nil, billing_country_code: nil, billing_information: nil, billing_period: nil, charges: nil, paying_customer_id: nil, resource_id: nil, schedule_strategy: nil, start_date: nil, trial_override_configuration: nil, unit_quantity: nil, request_options: {})
|
|
157
|
+
#
|
|
158
|
+
# @param customer_id [String] Customer ID
|
|
159
|
+
#
|
|
160
|
+
# @param plan_id [String] Plan ID
|
|
161
|
+
#
|
|
162
|
+
# @param addons [Array<Stigg::Models::V1::SubscriptionPreviewParams::Addon>]
|
|
163
|
+
#
|
|
164
|
+
# @param applied_coupon [Stigg::Models::V1::SubscriptionPreviewParams::AppliedCoupon]
|
|
165
|
+
#
|
|
166
|
+
# @param billable_features [Array<Stigg::Models::V1::SubscriptionPreviewParams::BillableFeature>]
|
|
167
|
+
#
|
|
168
|
+
# @param billing_country_code [String]
|
|
169
|
+
#
|
|
170
|
+
# @param billing_information [Stigg::Models::V1::SubscriptionPreviewParams::BillingInformation]
|
|
171
|
+
#
|
|
172
|
+
# @param billing_period [Symbol, Stigg::Models::V1::SubscriptionPreviewParams::BillingPeriod]
|
|
173
|
+
#
|
|
174
|
+
# @param charges [Array<Stigg::Models::V1::SubscriptionPreviewParams::Charge>]
|
|
175
|
+
#
|
|
176
|
+
# @param paying_customer_id [String]
|
|
177
|
+
#
|
|
178
|
+
# @param resource_id [String]
|
|
179
|
+
#
|
|
180
|
+
# @param schedule_strategy [Symbol, Stigg::Models::V1::SubscriptionPreviewParams::ScheduleStrategy]
|
|
181
|
+
#
|
|
182
|
+
# @param start_date [Time] Subscription start date
|
|
183
|
+
#
|
|
184
|
+
# @param trial_override_configuration [Stigg::Models::V1::SubscriptionPreviewParams::TrialOverrideConfiguration]
|
|
185
|
+
#
|
|
186
|
+
# @param unit_quantity [Float]
|
|
187
|
+
#
|
|
188
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
189
|
+
#
|
|
190
|
+
# @return [Stigg::Models::V1::SubscriptionPreviewResponse]
|
|
191
|
+
#
|
|
192
|
+
# @see Stigg::Models::V1::SubscriptionPreviewParams
|
|
193
|
+
def preview(params)
|
|
194
|
+
parsed, options = Stigg::V1::SubscriptionPreviewParams.dump_request(params)
|
|
195
|
+
@client.request(
|
|
196
|
+
method: :post,
|
|
197
|
+
path: "api/v1/subscriptions/preview",
|
|
198
|
+
body: parsed,
|
|
199
|
+
model: Stigg::Models::V1::SubscriptionPreviewResponse,
|
|
200
|
+
options: options
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Some parameter documentations has been truncated, see
|
|
205
|
+
# {Stigg::Models::V1::SubscriptionTransferParams} for more details.
|
|
206
|
+
#
|
|
207
|
+
# Perform transfer to resource on a Subscription
|
|
208
|
+
#
|
|
209
|
+
# @overload transfer(id, destination_resource_id:, request_options: {})
|
|
210
|
+
#
|
|
211
|
+
# @param id [String]
|
|
212
|
+
#
|
|
213
|
+
# @param destination_resource_id [String] The resource ID to transfer the subscription to. The destination resource must b
|
|
214
|
+
#
|
|
215
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
216
|
+
#
|
|
217
|
+
# @return [Stigg::Models::V1::SubscriptionTransferResponse]
|
|
218
|
+
#
|
|
219
|
+
# @see Stigg::Models::V1::SubscriptionTransferParams
|
|
220
|
+
def transfer(id, params)
|
|
221
|
+
parsed, options = Stigg::V1::SubscriptionTransferParams.dump_request(params)
|
|
222
|
+
@client.request(
|
|
223
|
+
method: :post,
|
|
224
|
+
path: ["api/v1/subscriptions/%1$s/transfer", id],
|
|
225
|
+
body: parsed,
|
|
226
|
+
model: Stigg::Models::V1::SubscriptionTransferResponse,
|
|
227
|
+
options: options
|
|
228
|
+
)
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# @api private
|
|
232
|
+
#
|
|
233
|
+
# @param client [Stigg::Client]
|
|
234
|
+
def initialize(client:)
|
|
235
|
+
@client = client
|
|
236
|
+
@future_update = Stigg::Resources::V1::Subscriptions::FutureUpdate.new(client: client)
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Stigg
|
|
4
|
+
module Resources
|
|
5
|
+
class V1
|
|
6
|
+
# @return [Stigg::Resources::V1::Customers]
|
|
7
|
+
attr_reader :customers
|
|
8
|
+
|
|
9
|
+
# @return [Stigg::Resources::V1::Subscriptions]
|
|
10
|
+
attr_reader :subscriptions
|
|
11
|
+
|
|
12
|
+
# @return [Stigg::Resources::V1::Coupons]
|
|
13
|
+
attr_reader :coupons
|
|
14
|
+
|
|
15
|
+
# Create events
|
|
16
|
+
#
|
|
17
|
+
# @overload create_event(events:, request_options: {})
|
|
18
|
+
#
|
|
19
|
+
# @param events [Array<Stigg::Models::V1CreateEventParams::Event>] A list of usage events to report
|
|
20
|
+
#
|
|
21
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
22
|
+
#
|
|
23
|
+
# @return [Stigg::Models::V1CreateEventResponse]
|
|
24
|
+
#
|
|
25
|
+
# @see Stigg::Models::V1CreateEventParams
|
|
26
|
+
def create_event(params)
|
|
27
|
+
parsed, options = Stigg::V1CreateEventParams.dump_request(params)
|
|
28
|
+
@client.request(
|
|
29
|
+
method: :post,
|
|
30
|
+
path: "api/v1/events",
|
|
31
|
+
body: parsed,
|
|
32
|
+
model: Stigg::Models::V1CreateEventResponse,
|
|
33
|
+
options: options
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Create a new Usage
|
|
38
|
+
#
|
|
39
|
+
# @overload create_usage(usages:, request_options: {})
|
|
40
|
+
#
|
|
41
|
+
# @param usages [Array<Stigg::Models::V1CreateUsageParams::Usage>] A list of usage reports to be submitted in bulk
|
|
42
|
+
#
|
|
43
|
+
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
44
|
+
#
|
|
45
|
+
# @return [Stigg::Models::V1CreateUsageResponse]
|
|
46
|
+
#
|
|
47
|
+
# @see Stigg::Models::V1CreateUsageParams
|
|
48
|
+
def create_usage(params)
|
|
49
|
+
parsed, options = Stigg::V1CreateUsageParams.dump_request(params)
|
|
50
|
+
@client.request(
|
|
51
|
+
method: :post,
|
|
52
|
+
path: "api/v1/usage",
|
|
53
|
+
body: parsed,
|
|
54
|
+
model: Stigg::Models::V1CreateUsageResponse,
|
|
55
|
+
options: options
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# @api private
|
|
60
|
+
#
|
|
61
|
+
# @param client [Stigg::Client]
|
|
62
|
+
def initialize(client:)
|
|
63
|
+
@client = client
|
|
64
|
+
@customers = Stigg::Resources::V1::Customers.new(client: client)
|
|
65
|
+
@subscriptions = Stigg::Resources::V1::Subscriptions.new(client: client)
|
|
66
|
+
@coupons = Stigg::Resources::V1::Coupons.new(client: client)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|