schematichq 1.5.3 → 1.5.4
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/.fern/metadata.json +4 -4
- data/.fern/replay.lock +7 -1
- data/.fernignore +2 -0
- data/.rubocop.yml +4 -0
- data/README.md +1 -1
- data/WASM_VERSION +1 -1
- data/lib/schematic/accesstokens/client.rb +9 -1
- data/lib/schematic/accounts/client.rb +183 -21
- data/lib/schematic/billing/client.rb +325 -34
- data/lib/schematic/billing/types/create_billing_price_request_body.rb +1 -1
- data/lib/schematic/billing/types/create_billing_product_request_body.rb +1 -1
- data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +1 -1
- data/lib/schematic/billing/types/create_coupon_request_body.rb +2 -2
- data/lib/schematic/billing/types/create_invoice_request_body.rb +1 -1
- data/lib/schematic/billing/types/get_billing_settings_response.rb +13 -0
- data/lib/schematic/billing/types/list_billing_prices_params.rb +1 -1
- data/lib/schematic/billing/types/list_billing_prices_request.rb +1 -1
- data/lib/schematic/billing/types/list_billing_product_prices_params.rb +1 -1
- data/lib/schematic/billing/types/list_billing_product_prices_request.rb +1 -1
- data/lib/schematic/billing/types/update_billing_settings_request_body.rb +11 -0
- data/lib/schematic/billing/types/update_billing_settings_response.rb +13 -0
- data/lib/schematic/catalogs/client.rb +121 -14
- data/lib/schematic/checkout/client.rb +80 -9
- data/lib/schematic/checkout/types/checkout_data_request_body.rb +1 -1
- data/lib/schematic/client.rb +5 -3
- data/lib/schematic/companies/client.rb +380 -44
- data/lib/schematic/components/client.rb +70 -8
- data/lib/schematic/components/types/create_component_request_body.rb +1 -1
- data/lib/schematic/components/types/update_component_request_body.rb +1 -1
- data/lib/schematic/componentspublic/client.rb +8 -1
- data/lib/schematic/credits/client.rb +409 -41
- data/lib/schematic/credits/types/acquire_credit_lease_request_body.rb +1 -1
- data/lib/schematic/credits/types/create_billing_credit_request_body.rb +1 -1
- data/lib/schematic/credits/types/create_company_credit_grant.rb +1 -1
- data/lib/schematic/credits/types/create_credit_bundle_request_body.rb +1 -1
- data/lib/schematic/credits/types/create_credit_spend_policy_request_body.rb +2 -2
- data/lib/schematic/credits/types/extend_credit_lease_request_body.rb +1 -1
- data/lib/schematic/credits/types/get_credit_balance_time_series_params.rb +18 -0
- data/lib/schematic/credits/types/get_credit_balance_time_series_request.rb +17 -0
- data/lib/schematic/credits/types/get_credit_balance_time_series_response.rb +13 -0
- data/lib/schematic/credits/types/reserve_credits_request_body.rb +1 -1
- data/lib/schematic/credits/types/update_credit_spend_policy_request_body.rb +2 -2
- data/lib/schematic/dataexports/client.rb +36 -6
- data/lib/schematic/entitlements/client.rb +244 -28
- data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb +4 -2
- data/lib/schematic/entitlements/types/create_company_override_request_body.rb +3 -1
- data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +4 -2
- data/lib/schematic/entitlements/types/update_company_override_request_body.rb +3 -1
- data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +4 -2
- data/lib/schematic/errors/connection_error.rb +11 -0
- data/lib/schematic/errors/response_error.rb +23 -2
- data/lib/schematic/events/client.rb +78 -9
- data/lib/schematic/features/client.rb +160 -18
- data/lib/schematic/features/types/check_and_reserve_flag_request_body.rb +1 -1
- data/lib/schematic/features/types/create_billing_linked_feature_request_body.rb +2 -0
- data/lib/schematic/features/types/create_feature_request_body.rb +2 -0
- data/lib/schematic/features/types/update_feature_request_body.rb +2 -0
- data/lib/schematic/insights/client.rb +48 -6
- data/lib/schematic/integrationsapi/client.rb +120 -14
- data/lib/schematic/internal/http/base_request.rb +30 -0
- data/lib/schematic/internal/http/raw_client.rb +35 -5
- data/lib/schematic/internal/iterators/cursor_item_iterator.rb +7 -2
- data/lib/schematic/internal/iterators/cursor_page_iterator.rb +68 -14
- data/lib/schematic/internal/iterators/item_iterator.rb +61 -15
- data/lib/schematic/internal/iterators/offset_item_iterator.rb +7 -2
- data/lib/schematic/internal/iterators/offset_page_iterator.rb +57 -9
- data/lib/schematic/internal/json/request.rb +11 -2
- data/lib/schematic/internal/multipart/multipart_request.rb +1 -0
- data/lib/schematic/internal/types/model.rb +7 -3
- data/lib/schematic/internal/types/utils.rb +7 -0
- data/lib/schematic/licenses/client.rb +26 -3
- data/lib/schematic/planbundle/client.rb +27 -3
- data/lib/schematic/plangroups/client.rb +26 -3
- data/lib/schematic/planmigrations/client.rb +98 -11
- data/lib/schematic/plans/client.rb +213 -23
- data/lib/schematic/plans/types/get_plan_version_diff_params.rb +12 -0
- data/lib/schematic/plans/types/get_plan_version_diff_request.rb +13 -0
- data/lib/schematic/plans/types/get_plan_version_diff_response.rb +13 -0
- data/lib/schematic/plans/types/publish_plan_version_request_body.rb +2 -0
- data/lib/schematic/rules_engine.rb +14 -2
- data/lib/schematic/scheduledcheckout/client.rb +35 -4
- data/lib/schematic/schematic_client.rb +22 -11
- data/lib/schematic/types/billing_coupon_response_data.rb +2 -2
- data/lib/schematic/types/billing_credit_grant_response_data.rb +8 -8
- data/lib/schematic/types/billing_customer_subscription.rb +1 -1
- data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +1 -1
- data/lib/schematic/types/billing_price_response_data.rb +1 -1
- data/lib/schematic/types/billing_price_view.rb +1 -1
- data/lib/schematic/types/billing_product_detail_response_data.rb +2 -2
- data/lib/schematic/types/billing_product_for_subscription_response_data.rb +2 -2
- data/lib/schematic/types/billing_product_price_response_data.rb +1 -1
- data/lib/schematic/types/billing_product_pricing.rb +1 -1
- data/lib/schematic/types/billing_product_response_data.rb +2 -2
- data/lib/schematic/types/billing_settings_response_data.rb +9 -0
- data/lib/schematic/types/billing_subscription_discount_view.rb +2 -2
- data/lib/schematic/types/billing_subscription_response_data.rb +1 -1
- data/lib/schematic/types/billing_subscription_view.rb +1 -1
- data/lib/schematic/types/catalog_config_ordered_plan.rb +2 -0
- data/lib/schematic/types/catalog_config_ordered_plan_response_data.rb +2 -0
- data/lib/schematic/types/catalog_config_plan_credit.rb +11 -0
- data/lib/schematic/types/catalog_config_plan_credit_response_data.rb +11 -0
- data/lib/schematic/types/change_subscription_internal_request_body.rb +1 -1
- data/lib/schematic/types/change_subscription_request_body.rb +1 -1
- data/lib/schematic/types/checkout_problem_code.rb +54 -0
- data/lib/schematic/types/checkout_problem_response_data.rb +31 -0
- data/lib/schematic/types/checkout_problem_source.rb +13 -0
- data/lib/schematic/types/checkout_subscription.rb +1 -1
- data/lib/schematic/types/company_billing_entity_subscription_response_data.rb +1 -1
- data/lib/schematic/types/company_credit_balance.rb +3 -3
- data/lib/schematic/types/company_credit_balance_response_data.rb +4 -4
- data/lib/schematic/types/company_detail_response_data.rb +1 -1
- data/lib/schematic/types/company_override_response_data.rb +3 -1
- data/lib/schematic/types/company_plan_credit_grant_view.rb +1 -1
- data/lib/schematic/types/company_plan_detail_response_data.rb +2 -0
- data/lib/schematic/types/company_subscription_response_data.rb +1 -1
- data/lib/schematic/types/company_user_usage_response_data.rb +2 -2
- data/lib/schematic/types/company_user_usage_row_response_data.rb +2 -2
- data/lib/schematic/types/component_response_data.rb +1 -1
- data/lib/schematic/types/condition.rb +3 -1
- data/lib/schematic/types/condition_response_data.rb +3 -1
- data/lib/schematic/types/condition_view.rb +3 -1
- data/lib/schematic/types/coupon_request_body.rb +2 -2
- data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +1 -1
- data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +4 -2
- data/lib/schematic/types/create_entitlement_req_common.rb +3 -1
- data/lib/schematic/types/create_or_update_condition_request_body.rb +1 -1
- data/lib/schematic/types/credit_balance_event_response_data.rb +21 -0
- data/lib/schematic/types/credit_balance_feature_consumption_response_data.rb +13 -0
- data/lib/schematic/types/credit_balance_point_response_data.rb +15 -0
- data/lib/schematic/types/credit_balance_time_series_response_data.rb +15 -0
- data/lib/schematic/types/credit_bundle_currency_price.rb +1 -1
- data/lib/schematic/types/credit_bundle_currency_price_request_body.rb +1 -1
- data/lib/schematic/types/credit_bundle_currency_price_response_data.rb +1 -1
- data/lib/schematic/types/credit_burn_breakdown_line.rb +15 -0
- data/lib/schematic/types/credit_company_grant_view.rb +8 -8
- data/lib/schematic/types/credit_currency_price.rb +1 -1
- data/lib/schematic/types/credit_currency_price_request_body.rb +1 -1
- data/lib/schematic/types/credit_currency_price_response_data.rb +1 -1
- data/lib/schematic/types/credit_event_ledger_response_data.rb +10 -6
- data/lib/schematic/types/credit_grant_detail.rb +1 -1
- data/lib/schematic/types/credit_lease_response_data.rb +2 -2
- data/lib/schematic/types/credit_reservation_response_data.rb +2 -2
- data/lib/schematic/types/credit_spend_policy.rb +2 -2
- data/lib/schematic/types/credit_spend_policy_response_data.rb +4 -4
- data/lib/schematic/types/credit_transfer_response_data.rb +1 -1
- data/lib/schematic/types/credit_transfer_view.rb +1 -1
- data/lib/schematic/types/credit_usage.rb +5 -5
- data/lib/schematic/types/credit_usage_aggregation.rb +4 -4
- data/lib/schematic/types/credit_usage_reason.rb +1 -0
- data/lib/schematic/types/credits_in_plan.rb +11 -0
- data/lib/schematic/types/currency.rb +144 -0
- data/lib/schematic/types/currency_price_request_body.rb +1 -1
- data/lib/schematic/types/custom_plan_billing_response_data.rb +6 -0
- data/lib/schematic/types/entitlement_currency_prices_response_data.rb +1 -1
- data/lib/schematic/types/estimated_plan_total.rb +1 -1
- data/lib/schematic/types/feature_company_response_data.rb +7 -7
- data/lib/schematic/types/feature_detail_response_data.rb +2 -0
- data/lib/schematic/types/feature_entitlement.rb +8 -6
- data/lib/schematic/types/feature_event_source.rb +12 -0
- data/lib/schematic/types/feature_in_plan_response_data.rb +2 -0
- data/lib/schematic/types/feature_response_data.rb +2 -0
- data/lib/schematic/types/feature_usage_response_data.rb +7 -7
- data/lib/schematic/types/feature_view.rb +2 -0
- data/lib/schematic/types/flag_check_reservation_response_data.rb +3 -3
- data/lib/schematic/types/insights_summary_response_data.rb +1 -1
- data/lib/schematic/types/invoice_request_body.rb +1 -1
- data/lib/schematic/types/invoice_response_data.rb +1 -1
- data/lib/schematic/types/manage_plan_preview_response_response_data.rb +2 -0
- data/lib/schematic/types/manage_plan_request.rb +3 -1
- data/lib/schematic/types/manage_plan_response_response_data.rb +4 -0
- data/lib/schematic/types/mrr_response_data.rb +1 -1
- data/lib/schematic/types/onboarding_milestone_view.rb +1 -1
- data/lib/schematic/types/ordered_plans_in_group.rb +2 -0
- data/lib/schematic/types/plan_billing_source.rb +1 -0
- data/lib/schematic/types/plan_change_action.rb +1 -0
- data/lib/schematic/types/plan_change_amendment_status.rb +15 -0
- data/lib/schematic/types/plan_change_response_data.rb +4 -0
- data/lib/schematic/types/plan_credit_grant_view.rb +1 -1
- data/lib/schematic/types/plan_credit_order.rb +11 -0
- data/lib/schematic/types/plan_credit_visibility.rb +11 -0
- data/lib/schematic/types/plan_currency_price_request_body.rb +1 -1
- data/lib/schematic/types/plan_currency_prices_response_data.rb +1 -1
- data/lib/schematic/types/plan_entitlement_response_data.rb +3 -1
- data/lib/schematic/types/plan_group_plan_entitlements_order.rb +2 -0
- data/lib/schematic/types/plan_version_billing_product_change_response_data.rb +11 -0
- data/lib/schematic/types/plan_version_credit_grant_change_response_data.rb +17 -0
- data/lib/schematic/types/plan_version_diff_change_type.rb +13 -0
- data/lib/schematic/types/plan_version_diff_price_cadence.rb +14 -0
- data/lib/schematic/types/plan_version_diff_response_data.rb +23 -0
- data/lib/schematic/types/plan_version_entitlement_change_response_data.rb +17 -0
- data/lib/schematic/types/plan_version_field_change_response_data.rb +13 -0
- data/lib/schematic/types/plan_version_price_change_response_data.rb +15 -0
- data/lib/schematic/types/plan_view_public_response_data.rb +2 -0
- data/lib/schematic/types/preflight_request_body.rb +1 -1
- data/lib/schematic/types/preview_subscription_change_response_data.rb +3 -1
- data/lib/schematic/types/preview_subscription_discount_response_data.rb +2 -2
- data/lib/schematic/types/preview_subscription_finance_response_data.rb +2 -2
- data/lib/schematic/types/rulesengine_company.rb +1 -1
- data/lib/schematic/types/rulesengine_condition.rb +3 -1
- data/lib/schematic/types/rulesengine_credit_postpaid_config.rb +1 -1
- data/lib/schematic/types/rulesengine_credit_spend_policy.rb +2 -2
- data/lib/schematic/types/rulesengine_feature_entitlement.rb +8 -6
- data/lib/schematic/types/scheduled_downgrade_response_data.rb +1 -1
- data/lib/schematic/types/top_feature_by_usage_response_data.rb +1 -1
- data/lib/schematic/types/upcoming_invoice_response_data.rb +1 -1
- data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +1 -1
- data/lib/schematic/types/update_entitlement_req_common.rb +3 -1
- data/lib/schematic/types/upsert_billing_product_request_body.rb +1 -1
- data/lib/schematic/types/usage_based_entitlement_request_body.rb +1 -1
- data/lib/schematic/types/usage_based_entitlement_response_data.rb +1 -1
- data/lib/schematic/types/user_credit_usage_response_data.rb +2 -2
- data/lib/schematic/types/user_daily_credit_point_response_data.rb +1 -1
- data/lib/schematic/types/user_feature_usage_response_data.rb +1 -1
- data/lib/schematic/version.rb +1 -1
- data/lib/schematic/wasm/rulesengine.wasm +0 -0
- data/lib/schematic/webhooks/client.rb +88 -10
- data/lib/schematic.rb +38 -3
- data/reference.md +340 -44
- metadata +37 -2
|
@@ -56,7 +56,15 @@ module Schematic
|
|
|
56
56
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::ListCouponsResponse.load(response.body))
|
|
57
57
|
else
|
|
58
58
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
59
|
-
|
|
59
|
+
error_types = {
|
|
60
|
+
400 => Schematic::Types::ApiError,
|
|
61
|
+
401 => Schematic::Types::ApiError,
|
|
62
|
+
403 => Schematic::Types::ApiError,
|
|
63
|
+
404 => Schematic::Types::ApiError,
|
|
64
|
+
500 => Schematic::Types::ApiError
|
|
65
|
+
}
|
|
66
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
67
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
60
68
|
end
|
|
61
69
|
end
|
|
62
70
|
|
|
@@ -100,7 +108,15 @@ module Schematic
|
|
|
100
108
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpsertBillingCouponResponse.load(response.body))
|
|
101
109
|
else
|
|
102
110
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
103
|
-
|
|
111
|
+
error_types = {
|
|
112
|
+
400 => Schematic::Types::ApiError,
|
|
113
|
+
401 => Schematic::Types::ApiError,
|
|
114
|
+
403 => Schematic::Types::ApiError,
|
|
115
|
+
404 => Schematic::Types::ApiError,
|
|
116
|
+
500 => Schematic::Types::ApiError
|
|
117
|
+
}
|
|
118
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
119
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
104
120
|
end
|
|
105
121
|
end
|
|
106
122
|
|
|
@@ -135,7 +151,15 @@ module Schematic
|
|
|
135
151
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::DeleteBillingCouponResponse.load(response.body))
|
|
136
152
|
else
|
|
137
153
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
138
|
-
|
|
154
|
+
error_types = {
|
|
155
|
+
400 => Schematic::Types::ApiError,
|
|
156
|
+
401 => Schematic::Types::ApiError,
|
|
157
|
+
403 => Schematic::Types::ApiError,
|
|
158
|
+
404 => Schematic::Types::ApiError,
|
|
159
|
+
500 => Schematic::Types::ApiError
|
|
160
|
+
}
|
|
161
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
162
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
139
163
|
end
|
|
140
164
|
end
|
|
141
165
|
|
|
@@ -170,7 +194,15 @@ module Schematic
|
|
|
170
194
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::DeleteBillingCustomerResponse.load(response.body))
|
|
171
195
|
else
|
|
172
196
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
173
|
-
|
|
197
|
+
error_types = {
|
|
198
|
+
400 => Schematic::Types::ApiError,
|
|
199
|
+
401 => Schematic::Types::ApiError,
|
|
200
|
+
403 => Schematic::Types::ApiError,
|
|
201
|
+
404 => Schematic::Types::ApiError,
|
|
202
|
+
500 => Schematic::Types::ApiError
|
|
203
|
+
}
|
|
204
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
205
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
174
206
|
end
|
|
175
207
|
end
|
|
176
208
|
|
|
@@ -212,7 +244,15 @@ module Schematic
|
|
|
212
244
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpsertBillingCustomerResponse.load(response.body))
|
|
213
245
|
else
|
|
214
246
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
215
|
-
|
|
247
|
+
error_types = {
|
|
248
|
+
400 => Schematic::Types::ApiError,
|
|
249
|
+
401 => Schematic::Types::ApiError,
|
|
250
|
+
403 => Schematic::Types::ApiError,
|
|
251
|
+
404 => Schematic::Types::ApiError,
|
|
252
|
+
500 => Schematic::Types::ApiError
|
|
253
|
+
}
|
|
254
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
255
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
216
256
|
end
|
|
217
257
|
end
|
|
218
258
|
|
|
@@ -268,7 +308,15 @@ module Schematic
|
|
|
268
308
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::ListCustomersWithSubscriptionsResponse.load(response.body))
|
|
269
309
|
else
|
|
270
310
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
271
|
-
|
|
311
|
+
error_types = {
|
|
312
|
+
400 => Schematic::Types::ApiError,
|
|
313
|
+
401 => Schematic::Types::ApiError,
|
|
314
|
+
403 => Schematic::Types::ApiError,
|
|
315
|
+
404 => Schematic::Types::ApiError,
|
|
316
|
+
500 => Schematic::Types::ApiError
|
|
317
|
+
}
|
|
318
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
319
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
272
320
|
end
|
|
273
321
|
end
|
|
274
322
|
|
|
@@ -324,7 +372,15 @@ module Schematic
|
|
|
324
372
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::CountCustomersResponse.load(response.body))
|
|
325
373
|
else
|
|
326
374
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
327
|
-
|
|
375
|
+
error_types = {
|
|
376
|
+
400 => Schematic::Types::ApiError,
|
|
377
|
+
401 => Schematic::Types::ApiError,
|
|
378
|
+
403 => Schematic::Types::ApiError,
|
|
379
|
+
404 => Schematic::Types::ApiError,
|
|
380
|
+
500 => Schematic::Types::ApiError
|
|
381
|
+
}
|
|
382
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
383
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
328
384
|
end
|
|
329
385
|
end
|
|
330
386
|
|
|
@@ -377,7 +433,15 @@ module Schematic
|
|
|
377
433
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::ListInvoicesResponse.load(response.body))
|
|
378
434
|
else
|
|
379
435
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
380
|
-
|
|
436
|
+
error_types = {
|
|
437
|
+
400 => Schematic::Types::ApiError,
|
|
438
|
+
401 => Schematic::Types::ApiError,
|
|
439
|
+
403 => Schematic::Types::ApiError,
|
|
440
|
+
404 => Schematic::Types::ApiError,
|
|
441
|
+
500 => Schematic::Types::ApiError
|
|
442
|
+
}
|
|
443
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
444
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
381
445
|
end
|
|
382
446
|
end
|
|
383
447
|
|
|
@@ -395,7 +459,7 @@ module Schematic
|
|
|
395
459
|
# amount_paid: 1000000,
|
|
396
460
|
# amount_remaining: 1000000,
|
|
397
461
|
# collection_method: "collection_method",
|
|
398
|
-
# currency: "
|
|
462
|
+
# currency: "aed",
|
|
399
463
|
# customer_external_id: "customer_external_id",
|
|
400
464
|
# subtotal: 1000000
|
|
401
465
|
# )
|
|
@@ -420,7 +484,15 @@ module Schematic
|
|
|
420
484
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpsertInvoiceResponse.load(response.body))
|
|
421
485
|
else
|
|
422
486
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
423
|
-
|
|
487
|
+
error_types = {
|
|
488
|
+
400 => Schematic::Types::ApiError,
|
|
489
|
+
401 => Schematic::Types::ApiError,
|
|
490
|
+
403 => Schematic::Types::ApiError,
|
|
491
|
+
404 => Schematic::Types::ApiError,
|
|
492
|
+
500 => Schematic::Types::ApiError
|
|
493
|
+
}
|
|
494
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
495
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
424
496
|
end
|
|
425
497
|
end
|
|
426
498
|
|
|
@@ -455,7 +527,15 @@ module Schematic
|
|
|
455
527
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::DeleteBillingInvoiceResponse.load(response.body))
|
|
456
528
|
else
|
|
457
529
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
458
|
-
|
|
530
|
+
error_types = {
|
|
531
|
+
400 => Schematic::Types::ApiError,
|
|
532
|
+
401 => Schematic::Types::ApiError,
|
|
533
|
+
403 => Schematic::Types::ApiError,
|
|
534
|
+
404 => Schematic::Types::ApiError,
|
|
535
|
+
500 => Schematic::Types::ApiError
|
|
536
|
+
}
|
|
537
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
538
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
459
539
|
end
|
|
460
540
|
end
|
|
461
541
|
|
|
@@ -502,7 +582,15 @@ module Schematic
|
|
|
502
582
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::ListMetersResponse.load(response.body))
|
|
503
583
|
else
|
|
504
584
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
505
|
-
|
|
585
|
+
error_types = {
|
|
586
|
+
400 => Schematic::Types::ApiError,
|
|
587
|
+
401 => Schematic::Types::ApiError,
|
|
588
|
+
403 => Schematic::Types::ApiError,
|
|
589
|
+
404 => Schematic::Types::ApiError,
|
|
590
|
+
500 => Schematic::Types::ApiError
|
|
591
|
+
}
|
|
592
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
593
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
506
594
|
end
|
|
507
595
|
end
|
|
508
596
|
|
|
@@ -542,7 +630,15 @@ module Schematic
|
|
|
542
630
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpsertBillingMeterResponse.load(response.body))
|
|
543
631
|
else
|
|
544
632
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
545
|
-
|
|
633
|
+
error_types = {
|
|
634
|
+
400 => Schematic::Types::ApiError,
|
|
635
|
+
401 => Schematic::Types::ApiError,
|
|
636
|
+
403 => Schematic::Types::ApiError,
|
|
637
|
+
404 => Schematic::Types::ApiError,
|
|
638
|
+
500 => Schematic::Types::ApiError
|
|
639
|
+
}
|
|
640
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
641
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
546
642
|
end
|
|
547
643
|
end
|
|
548
644
|
|
|
@@ -592,7 +688,15 @@ module Schematic
|
|
|
592
688
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::ListPaymentMethodsResponse.load(response.body))
|
|
593
689
|
else
|
|
594
690
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
595
|
-
|
|
691
|
+
error_types = {
|
|
692
|
+
400 => Schematic::Types::ApiError,
|
|
693
|
+
401 => Schematic::Types::ApiError,
|
|
694
|
+
403 => Schematic::Types::ApiError,
|
|
695
|
+
404 => Schematic::Types::ApiError,
|
|
696
|
+
500 => Schematic::Types::ApiError
|
|
697
|
+
}
|
|
698
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
699
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
596
700
|
end
|
|
597
701
|
end
|
|
598
702
|
|
|
@@ -631,7 +735,15 @@ module Schematic
|
|
|
631
735
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpsertPaymentMethodResponse.load(response.body))
|
|
632
736
|
else
|
|
633
737
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
634
|
-
|
|
738
|
+
error_types = {
|
|
739
|
+
400 => Schematic::Types::ApiError,
|
|
740
|
+
401 => Schematic::Types::ApiError,
|
|
741
|
+
403 => Schematic::Types::ApiError,
|
|
742
|
+
404 => Schematic::Types::ApiError,
|
|
743
|
+
500 => Schematic::Types::ApiError
|
|
744
|
+
}
|
|
745
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
746
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
635
747
|
end
|
|
636
748
|
end
|
|
637
749
|
|
|
@@ -666,7 +778,15 @@ module Schematic
|
|
|
666
778
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::DeletePaymentMethodByExternalIdResponse.load(response.body))
|
|
667
779
|
else
|
|
668
780
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
669
|
-
|
|
781
|
+
error_types = {
|
|
782
|
+
400 => Schematic::Types::ApiError,
|
|
783
|
+
401 => Schematic::Types::ApiError,
|
|
784
|
+
403 => Schematic::Types::ApiError,
|
|
785
|
+
404 => Schematic::Types::ApiError,
|
|
786
|
+
500 => Schematic::Types::ApiError
|
|
787
|
+
}
|
|
788
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
789
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
670
790
|
end
|
|
671
791
|
end
|
|
672
792
|
|
|
@@ -677,7 +797,7 @@ module Schematic
|
|
|
677
797
|
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
678
798
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
679
799
|
# @option request_options [Integer] :timeout_in_seconds
|
|
680
|
-
# @option params [
|
|
800
|
+
# @option params [Schematic::Types::Currency, nil] :currency
|
|
681
801
|
# @option params [Boolean, nil] :for_initial_plan
|
|
682
802
|
# @option params [Boolean, nil] :for_trial_expiry_plan
|
|
683
803
|
# @option params [String, nil] :ids
|
|
@@ -698,7 +818,7 @@ module Schematic
|
|
|
698
818
|
#
|
|
699
819
|
# @example
|
|
700
820
|
# client.billing.list_billing_prices(
|
|
701
|
-
# currency: "
|
|
821
|
+
# currency: "aed",
|
|
702
822
|
# for_initial_plan: true,
|
|
703
823
|
# for_trial_expiry_plan: true,
|
|
704
824
|
# ids: ["ids"],
|
|
@@ -758,7 +878,15 @@ module Schematic
|
|
|
758
878
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::ListBillingPricesResponse.load(response.body))
|
|
759
879
|
else
|
|
760
880
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
761
|
-
|
|
881
|
+
error_types = {
|
|
882
|
+
400 => Schematic::Types::ApiError,
|
|
883
|
+
401 => Schematic::Types::ApiError,
|
|
884
|
+
403 => Schematic::Types::ApiError,
|
|
885
|
+
404 => Schematic::Types::ApiError,
|
|
886
|
+
500 => Schematic::Types::ApiError
|
|
887
|
+
}
|
|
888
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
889
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
762
890
|
end
|
|
763
891
|
end
|
|
764
892
|
|
|
@@ -773,7 +901,7 @@ module Schematic
|
|
|
773
901
|
# @example
|
|
774
902
|
# client.billing.upsert_billing_price(
|
|
775
903
|
# billing_scheme: "per_unit",
|
|
776
|
-
# currency: "
|
|
904
|
+
# currency: "aed",
|
|
777
905
|
# external_account_id: "external_account_id",
|
|
778
906
|
# interval: "interval",
|
|
779
907
|
# is_active: true,
|
|
@@ -806,7 +934,15 @@ module Schematic
|
|
|
806
934
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpsertBillingPriceResponse.load(response.body))
|
|
807
935
|
else
|
|
808
936
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
809
|
-
|
|
937
|
+
error_types = {
|
|
938
|
+
400 => Schematic::Types::ApiError,
|
|
939
|
+
401 => Schematic::Types::ApiError,
|
|
940
|
+
403 => Schematic::Types::ApiError,
|
|
941
|
+
404 => Schematic::Types::ApiError,
|
|
942
|
+
500 => Schematic::Types::ApiError
|
|
943
|
+
}
|
|
944
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
945
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
810
946
|
end
|
|
811
947
|
end
|
|
812
948
|
|
|
@@ -841,7 +977,15 @@ module Schematic
|
|
|
841
977
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::DeleteBillingProductResponse.load(response.body))
|
|
842
978
|
else
|
|
843
979
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
844
|
-
|
|
980
|
+
error_types = {
|
|
981
|
+
400 => Schematic::Types::ApiError,
|
|
982
|
+
401 => Schematic::Types::ApiError,
|
|
983
|
+
403 => Schematic::Types::ApiError,
|
|
984
|
+
404 => Schematic::Types::ApiError,
|
|
985
|
+
500 => Schematic::Types::ApiError
|
|
986
|
+
}
|
|
987
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
988
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
845
989
|
end
|
|
846
990
|
end
|
|
847
991
|
|
|
@@ -852,7 +996,7 @@ module Schematic
|
|
|
852
996
|
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
853
997
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
854
998
|
# @option request_options [Integer] :timeout_in_seconds
|
|
855
|
-
# @option params [
|
|
999
|
+
# @option params [Schematic::Types::Currency, nil] :currency
|
|
856
1000
|
# @option params [Boolean, nil] :for_initial_plan
|
|
857
1001
|
# @option params [Boolean, nil] :for_trial_expiry_plan
|
|
858
1002
|
# @option params [String, nil] :ids
|
|
@@ -873,7 +1017,7 @@ module Schematic
|
|
|
873
1017
|
#
|
|
874
1018
|
# @example
|
|
875
1019
|
# client.billing.list_billing_product_prices(
|
|
876
|
-
# currency: "
|
|
1020
|
+
# currency: "aed",
|
|
877
1021
|
# for_initial_plan: true,
|
|
878
1022
|
# for_trial_expiry_plan: true,
|
|
879
1023
|
# ids: ["ids"],
|
|
@@ -933,7 +1077,15 @@ module Schematic
|
|
|
933
1077
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::ListBillingProductPricesResponse.load(response.body))
|
|
934
1078
|
else
|
|
935
1079
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
936
|
-
|
|
1080
|
+
error_types = {
|
|
1081
|
+
400 => Schematic::Types::ApiError,
|
|
1082
|
+
401 => Schematic::Types::ApiError,
|
|
1083
|
+
403 => Schematic::Types::ApiError,
|
|
1084
|
+
404 => Schematic::Types::ApiError,
|
|
1085
|
+
500 => Schematic::Types::ApiError
|
|
1086
|
+
}
|
|
1087
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1088
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
937
1089
|
end
|
|
938
1090
|
end
|
|
939
1091
|
|
|
@@ -968,7 +1120,15 @@ module Schematic
|
|
|
968
1120
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::DeleteProductPriceResponse.load(response.body))
|
|
969
1121
|
else
|
|
970
1122
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
971
|
-
|
|
1123
|
+
error_types = {
|
|
1124
|
+
400 => Schematic::Types::ApiError,
|
|
1125
|
+
401 => Schematic::Types::ApiError,
|
|
1126
|
+
403 => Schematic::Types::ApiError,
|
|
1127
|
+
404 => Schematic::Types::ApiError,
|
|
1128
|
+
500 => Schematic::Types::ApiError
|
|
1129
|
+
}
|
|
1130
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1131
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
972
1132
|
end
|
|
973
1133
|
end
|
|
974
1134
|
|
|
@@ -1006,7 +1166,15 @@ module Schematic
|
|
|
1006
1166
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpsertBillingProductResponse.load(response.body))
|
|
1007
1167
|
else
|
|
1008
1168
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1009
|
-
|
|
1169
|
+
error_types = {
|
|
1170
|
+
400 => Schematic::Types::ApiError,
|
|
1171
|
+
401 => Schematic::Types::ApiError,
|
|
1172
|
+
403 => Schematic::Types::ApiError,
|
|
1173
|
+
404 => Schematic::Types::ApiError,
|
|
1174
|
+
500 => Schematic::Types::ApiError
|
|
1175
|
+
}
|
|
1176
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1177
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1010
1178
|
end
|
|
1011
1179
|
end
|
|
1012
1180
|
|
|
@@ -1083,7 +1251,15 @@ module Schematic
|
|
|
1083
1251
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::ListBillingProductsResponse.load(response.body))
|
|
1084
1252
|
else
|
|
1085
1253
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1086
|
-
|
|
1254
|
+
error_types = {
|
|
1255
|
+
400 => Schematic::Types::ApiError,
|
|
1256
|
+
401 => Schematic::Types::ApiError,
|
|
1257
|
+
403 => Schematic::Types::ApiError,
|
|
1258
|
+
404 => Schematic::Types::ApiError,
|
|
1259
|
+
500 => Schematic::Types::ApiError
|
|
1260
|
+
}
|
|
1261
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1262
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1087
1263
|
end
|
|
1088
1264
|
end
|
|
1089
1265
|
|
|
@@ -1160,7 +1336,15 @@ module Schematic
|
|
|
1160
1336
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::CountBillingProductsResponse.load(response.body))
|
|
1161
1337
|
else
|
|
1162
1338
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1163
|
-
|
|
1339
|
+
error_types = {
|
|
1340
|
+
400 => Schematic::Types::ApiError,
|
|
1341
|
+
401 => Schematic::Types::ApiError,
|
|
1342
|
+
403 => Schematic::Types::ApiError,
|
|
1343
|
+
404 => Schematic::Types::ApiError,
|
|
1344
|
+
500 => Schematic::Types::ApiError
|
|
1345
|
+
}
|
|
1346
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1347
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1164
1348
|
end
|
|
1165
1349
|
end
|
|
1166
1350
|
|
|
@@ -1213,7 +1397,15 @@ module Schematic
|
|
|
1213
1397
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::ListCompanyBillingProfilesResponse.load(response.body))
|
|
1214
1398
|
else
|
|
1215
1399
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1216
|
-
|
|
1400
|
+
error_types = {
|
|
1401
|
+
400 => Schematic::Types::ApiError,
|
|
1402
|
+
401 => Schematic::Types::ApiError,
|
|
1403
|
+
403 => Schematic::Types::ApiError,
|
|
1404
|
+
404 => Schematic::Types::ApiError,
|
|
1405
|
+
500 => Schematic::Types::ApiError
|
|
1406
|
+
}
|
|
1407
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1408
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1217
1409
|
end
|
|
1218
1410
|
end
|
|
1219
1411
|
|
|
@@ -1256,7 +1448,98 @@ module Schematic
|
|
|
1256
1448
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpdateCompanyBillingProfileResponse.load(response.body))
|
|
1257
1449
|
else
|
|
1258
1450
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1259
|
-
|
|
1451
|
+
error_types = {
|
|
1452
|
+
400 => Schematic::Types::ApiError,
|
|
1453
|
+
401 => Schematic::Types::ApiError,
|
|
1454
|
+
403 => Schematic::Types::ApiError,
|
|
1455
|
+
404 => Schematic::Types::ApiError,
|
|
1456
|
+
500 => Schematic::Types::ApiError
|
|
1457
|
+
}
|
|
1458
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1459
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1460
|
+
end
|
|
1461
|
+
end
|
|
1462
|
+
|
|
1463
|
+
# @param request_options [Hash]
|
|
1464
|
+
# @param _params [Hash]
|
|
1465
|
+
# @option request_options [String] :base_url
|
|
1466
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1467
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1468
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1469
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1470
|
+
#
|
|
1471
|
+
# @example
|
|
1472
|
+
# client.billing.get_billing_settings
|
|
1473
|
+
#
|
|
1474
|
+
# @return [Schematic::Billing::Types::GetBillingSettingsResponse]
|
|
1475
|
+
def get_billing_settings(request_options: {}, **_params)
|
|
1476
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1477
|
+
base_url: request_options[:base_url],
|
|
1478
|
+
method: "GET",
|
|
1479
|
+
path: "billing/settings",
|
|
1480
|
+
request_options: request_options
|
|
1481
|
+
)
|
|
1482
|
+
begin
|
|
1483
|
+
response = @client.send(request)
|
|
1484
|
+
rescue Net::HTTPRequestTimeout
|
|
1485
|
+
raise Schematic::Errors::TimeoutError
|
|
1486
|
+
end
|
|
1487
|
+
code = response.code.to_i
|
|
1488
|
+
if code.between?(200, 299)
|
|
1489
|
+
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::GetBillingSettingsResponse.load(response.body))
|
|
1490
|
+
else
|
|
1491
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1492
|
+
error_types = {
|
|
1493
|
+
401 => Schematic::Types::ApiError,
|
|
1494
|
+
403 => Schematic::Types::ApiError,
|
|
1495
|
+
404 => Schematic::Types::ApiError,
|
|
1496
|
+
500 => Schematic::Types::ApiError
|
|
1497
|
+
}
|
|
1498
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1499
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1500
|
+
end
|
|
1501
|
+
end
|
|
1502
|
+
|
|
1503
|
+
# @param request_options [Hash]
|
|
1504
|
+
# @param params [Schematic::Billing::Types::UpdateBillingSettingsRequestBody]
|
|
1505
|
+
# @option request_options [String] :base_url
|
|
1506
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1507
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1508
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1509
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1510
|
+
#
|
|
1511
|
+
# @example
|
|
1512
|
+
# client.billing.update_billing_settings
|
|
1513
|
+
#
|
|
1514
|
+
# @return [Schematic::Billing::Types::UpdateBillingSettingsResponse]
|
|
1515
|
+
def update_billing_settings(request_options: {}, **params)
|
|
1516
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1517
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1518
|
+
base_url: request_options[:base_url],
|
|
1519
|
+
method: "POST",
|
|
1520
|
+
path: "billing/settings",
|
|
1521
|
+
body: Schematic::Billing::Types::UpdateBillingSettingsRequestBody.new(params).to_h,
|
|
1522
|
+
request_options: request_options
|
|
1523
|
+
)
|
|
1524
|
+
begin
|
|
1525
|
+
response = @client.send(request)
|
|
1526
|
+
rescue Net::HTTPRequestTimeout
|
|
1527
|
+
raise Schematic::Errors::TimeoutError
|
|
1528
|
+
end
|
|
1529
|
+
code = response.code.to_i
|
|
1530
|
+
if code.between?(200, 299)
|
|
1531
|
+
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpdateBillingSettingsResponse.load(response.body))
|
|
1532
|
+
else
|
|
1533
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1534
|
+
error_types = {
|
|
1535
|
+
400 => Schematic::Types::ApiError,
|
|
1536
|
+
401 => Schematic::Types::ApiError,
|
|
1537
|
+
403 => Schematic::Types::ApiError,
|
|
1538
|
+
404 => Schematic::Types::ApiError,
|
|
1539
|
+
500 => Schematic::Types::ApiError
|
|
1540
|
+
}
|
|
1541
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1542
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1260
1543
|
end
|
|
1261
1544
|
end
|
|
1262
1545
|
|
|
@@ -1271,7 +1554,7 @@ module Schematic
|
|
|
1271
1554
|
# @example
|
|
1272
1555
|
# client.billing.upsert_billing_subscription(
|
|
1273
1556
|
# cancel_at_period_end: true,
|
|
1274
|
-
# currency: "
|
|
1557
|
+
# currency: "aed",
|
|
1275
1558
|
# customer_external_id: "customer_external_id",
|
|
1276
1559
|
# discounts: [{
|
|
1277
1560
|
# coupon_external_id: "coupon_external_id",
|
|
@@ -1281,7 +1564,7 @@ module Schematic
|
|
|
1281
1564
|
# }],
|
|
1282
1565
|
# expired_at: "2024-01-15T09:30:00Z",
|
|
1283
1566
|
# product_external_ids: [{
|
|
1284
|
-
# currency: "
|
|
1567
|
+
# currency: "aed",
|
|
1285
1568
|
# interval: "interval",
|
|
1286
1569
|
# price: 1000000,
|
|
1287
1570
|
# price_external_id: "price_external_id",
|
|
@@ -1313,7 +1596,15 @@ module Schematic
|
|
|
1313
1596
|
(response.body.to_s.empty? ? nil : Schematic::Billing::Types::UpsertBillingSubscriptionResponse.load(response.body))
|
|
1314
1597
|
else
|
|
1315
1598
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1316
|
-
|
|
1599
|
+
error_types = {
|
|
1600
|
+
400 => Schematic::Types::ApiError,
|
|
1601
|
+
401 => Schematic::Types::ApiError,
|
|
1602
|
+
403 => Schematic::Types::ApiError,
|
|
1603
|
+
404 => Schematic::Types::ApiError,
|
|
1604
|
+
500 => Schematic::Types::ApiError
|
|
1605
|
+
}
|
|
1606
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1607
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1317
1608
|
end
|
|
1318
1609
|
end
|
|
1319
1610
|
end
|
|
@@ -6,7 +6,7 @@ module Schematic
|
|
|
6
6
|
class CreateBillingPriceRequestBody < Internal::Types::Model
|
|
7
7
|
field :billing_scheme, -> { Schematic::Types::BillingPriceScheme }, optional: false, nullable: false
|
|
8
8
|
|
|
9
|
-
field :currency, -> {
|
|
9
|
+
field :currency, -> { Schematic::Types::Currency }, optional: false, nullable: false
|
|
10
10
|
|
|
11
11
|
field :external_account_id, -> { String }, optional: false, nullable: false
|
|
12
12
|
|
|
@@ -10,7 +10,7 @@ module Schematic
|
|
|
10
10
|
|
|
11
11
|
field :name, -> { String }, optional: true, nullable: false
|
|
12
12
|
|
|
13
|
-
field :price, -> {
|
|
13
|
+
field :price, -> { Float }, optional: false, nullable: false
|
|
14
14
|
|
|
15
15
|
field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
|
|
16
16
|
end
|
|
@@ -12,7 +12,7 @@ module Schematic
|
|
|
12
12
|
|
|
13
13
|
field :company_id, -> { String }, optional: true, nullable: false
|
|
14
14
|
|
|
15
|
-
field :currency, -> {
|
|
15
|
+
field :currency, -> { Schematic::Types::Currency }, optional: false, nullable: false
|
|
16
16
|
|
|
17
17
|
field :customer_external_id, -> { String }, optional: false, nullable: false
|
|
18
18
|
|
|
@@ -6,7 +6,7 @@ module Schematic
|
|
|
6
6
|
class CreateCouponRequestBody < Internal::Types::Model
|
|
7
7
|
field :amount_off, -> { Integer }, optional: false, nullable: false
|
|
8
8
|
|
|
9
|
-
field :currency, -> {
|
|
9
|
+
field :currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
|
|
10
10
|
|
|
11
11
|
field :duration, -> { String }, optional: false, nullable: false
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ module Schematic
|
|
|
18
18
|
|
|
19
19
|
field :name, -> { String }, optional: false, nullable: false
|
|
20
20
|
|
|
21
|
-
field :percent_off, -> {
|
|
21
|
+
field :percent_off, -> { Float }, optional: false, nullable: false
|
|
22
22
|
|
|
23
23
|
field :times_redeemed, -> { Integer }, optional: false, nullable: false
|
|
24
24
|
end
|
|
@@ -12,7 +12,7 @@ module Schematic
|
|
|
12
12
|
|
|
13
13
|
field :collection_method, -> { String }, optional: false, nullable: false
|
|
14
14
|
|
|
15
|
-
field :currency, -> {
|
|
15
|
+
field :currency, -> { Schematic::Types::Currency }, optional: false, nullable: false
|
|
16
16
|
|
|
17
17
|
field :customer_external_id, -> { String }, optional: false, nullable: false
|
|
18
18
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Billing
|
|
5
|
+
module Types
|
|
6
|
+
class GetBillingSettingsResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::BillingSettingsResponseData }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -5,7 +5,7 @@ module Schematic
|
|
|
5
5
|
module Types
|
|
6
6
|
# Input parameters
|
|
7
7
|
class ListBillingPricesParams < Internal::Types::Model
|
|
8
|
-
field :currency, -> {
|
|
8
|
+
field :currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
|
|
9
9
|
|
|
10
10
|
field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
11
11
|
|