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
|
@@ -71,7 +71,15 @@ module Schematic
|
|
|
71
71
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::ListCompanyOverridesResponse.load(response.body))
|
|
72
72
|
else
|
|
73
73
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
74
|
-
|
|
74
|
+
error_types = {
|
|
75
|
+
400 => Schematic::Types::ApiError,
|
|
76
|
+
401 => Schematic::Types::ApiError,
|
|
77
|
+
403 => Schematic::Types::ApiError,
|
|
78
|
+
404 => Schematic::Types::ApiError,
|
|
79
|
+
500 => Schematic::Types::ApiError
|
|
80
|
+
}
|
|
81
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
82
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
75
83
|
end
|
|
76
84
|
end
|
|
77
85
|
|
|
@@ -110,7 +118,15 @@ module Schematic
|
|
|
110
118
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::CreateCompanyOverrideResponse.load(response.body))
|
|
111
119
|
else
|
|
112
120
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
113
|
-
|
|
121
|
+
error_types = {
|
|
122
|
+
400 => Schematic::Types::ApiError,
|
|
123
|
+
401 => Schematic::Types::ApiError,
|
|
124
|
+
403 => Schematic::Types::ApiError,
|
|
125
|
+
404 => Schematic::Types::ApiError,
|
|
126
|
+
500 => Schematic::Types::ApiError
|
|
127
|
+
}
|
|
128
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
129
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
114
130
|
end
|
|
115
131
|
end
|
|
116
132
|
|
|
@@ -145,7 +161,14 @@ module Schematic
|
|
|
145
161
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::GetCompanyOverrideResponse.load(response.body))
|
|
146
162
|
else
|
|
147
163
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
148
|
-
|
|
164
|
+
error_types = {
|
|
165
|
+
401 => Schematic::Types::ApiError,
|
|
166
|
+
403 => Schematic::Types::ApiError,
|
|
167
|
+
404 => Schematic::Types::ApiError,
|
|
168
|
+
500 => Schematic::Types::ApiError
|
|
169
|
+
}
|
|
170
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
171
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
149
172
|
end
|
|
150
173
|
end
|
|
151
174
|
|
|
@@ -188,7 +211,15 @@ module Schematic
|
|
|
188
211
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::UpdateCompanyOverrideResponse.load(response.body))
|
|
189
212
|
else
|
|
190
213
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
191
|
-
|
|
214
|
+
error_types = {
|
|
215
|
+
400 => Schematic::Types::ApiError,
|
|
216
|
+
401 => Schematic::Types::ApiError,
|
|
217
|
+
403 => Schematic::Types::ApiError,
|
|
218
|
+
404 => Schematic::Types::ApiError,
|
|
219
|
+
500 => Schematic::Types::ApiError
|
|
220
|
+
}
|
|
221
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
222
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
192
223
|
end
|
|
193
224
|
end
|
|
194
225
|
|
|
@@ -223,7 +254,15 @@ module Schematic
|
|
|
223
254
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::DeleteCompanyOverrideResponse.load(response.body))
|
|
224
255
|
else
|
|
225
256
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
226
|
-
|
|
257
|
+
error_types = {
|
|
258
|
+
400 => Schematic::Types::ApiError,
|
|
259
|
+
401 => Schematic::Types::ApiError,
|
|
260
|
+
403 => Schematic::Types::ApiError,
|
|
261
|
+
404 => Schematic::Types::ApiError,
|
|
262
|
+
500 => Schematic::Types::ApiError
|
|
263
|
+
}
|
|
264
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
265
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
227
266
|
end
|
|
228
267
|
end
|
|
229
268
|
|
|
@@ -288,7 +327,15 @@ module Schematic
|
|
|
288
327
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::CountCompanyOverridesResponse.load(response.body))
|
|
289
328
|
else
|
|
290
329
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
291
|
-
|
|
330
|
+
error_types = {
|
|
331
|
+
400 => Schematic::Types::ApiError,
|
|
332
|
+
401 => Schematic::Types::ApiError,
|
|
333
|
+
403 => Schematic::Types::ApiError,
|
|
334
|
+
404 => Schematic::Types::ApiError,
|
|
335
|
+
500 => Schematic::Types::ApiError
|
|
336
|
+
}
|
|
337
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
338
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
292
339
|
end
|
|
293
340
|
end
|
|
294
341
|
|
|
@@ -338,7 +385,15 @@ module Schematic
|
|
|
338
385
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::ListFeatureCompaniesResponse.load(response.body))
|
|
339
386
|
else
|
|
340
387
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
341
|
-
|
|
388
|
+
error_types = {
|
|
389
|
+
400 => Schematic::Types::ApiError,
|
|
390
|
+
401 => Schematic::Types::ApiError,
|
|
391
|
+
403 => Schematic::Types::ApiError,
|
|
392
|
+
404 => Schematic::Types::ApiError,
|
|
393
|
+
500 => Schematic::Types::ApiError
|
|
394
|
+
}
|
|
395
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
396
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
342
397
|
end
|
|
343
398
|
end
|
|
344
399
|
|
|
@@ -388,7 +443,15 @@ module Schematic
|
|
|
388
443
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::CountFeatureCompaniesResponse.load(response.body))
|
|
389
444
|
else
|
|
390
445
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
391
|
-
|
|
446
|
+
error_types = {
|
|
447
|
+
400 => Schematic::Types::ApiError,
|
|
448
|
+
401 => Schematic::Types::ApiError,
|
|
449
|
+
403 => Schematic::Types::ApiError,
|
|
450
|
+
404 => Schematic::Types::ApiError,
|
|
451
|
+
500 => Schematic::Types::ApiError
|
|
452
|
+
}
|
|
453
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
454
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
392
455
|
end
|
|
393
456
|
end
|
|
394
457
|
|
|
@@ -452,7 +515,15 @@ module Schematic
|
|
|
452
515
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::ListFeatureUsageResponse.load(response.body))
|
|
453
516
|
else
|
|
454
517
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
455
|
-
|
|
518
|
+
error_types = {
|
|
519
|
+
400 => Schematic::Types::ApiError,
|
|
520
|
+
401 => Schematic::Types::ApiError,
|
|
521
|
+
403 => Schematic::Types::ApiError,
|
|
522
|
+
404 => Schematic::Types::ApiError,
|
|
523
|
+
500 => Schematic::Types::ApiError
|
|
524
|
+
}
|
|
525
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
526
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
456
527
|
end
|
|
457
528
|
end
|
|
458
529
|
|
|
@@ -511,7 +582,15 @@ module Schematic
|
|
|
511
582
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::ListFeatureUsageHistoryResponse.load(response.body))
|
|
512
583
|
else
|
|
513
584
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
514
|
-
|
|
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)
|
|
515
594
|
end
|
|
516
595
|
end
|
|
517
596
|
|
|
@@ -564,7 +643,14 @@ module Schematic
|
|
|
564
643
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::GetFeatureUsageTimeSeriesResponse.load(response.body))
|
|
565
644
|
else
|
|
566
645
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
567
|
-
|
|
646
|
+
error_types = {
|
|
647
|
+
401 => Schematic::Types::ApiError,
|
|
648
|
+
403 => Schematic::Types::ApiError,
|
|
649
|
+
404 => Schematic::Types::ApiError,
|
|
650
|
+
500 => Schematic::Types::ApiError
|
|
651
|
+
}
|
|
652
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
653
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
568
654
|
end
|
|
569
655
|
end
|
|
570
656
|
|
|
@@ -628,7 +714,15 @@ module Schematic
|
|
|
628
714
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::CountFeatureUsageResponse.load(response.body))
|
|
629
715
|
else
|
|
630
716
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
631
|
-
|
|
717
|
+
error_types = {
|
|
718
|
+
400 => Schematic::Types::ApiError,
|
|
719
|
+
401 => Schematic::Types::ApiError,
|
|
720
|
+
403 => Schematic::Types::ApiError,
|
|
721
|
+
404 => Schematic::Types::ApiError,
|
|
722
|
+
500 => Schematic::Types::ApiError
|
|
723
|
+
}
|
|
724
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
725
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
632
726
|
end
|
|
633
727
|
end
|
|
634
728
|
|
|
@@ -678,7 +772,15 @@ module Schematic
|
|
|
678
772
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::ListFeatureUsersResponse.load(response.body))
|
|
679
773
|
else
|
|
680
774
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
681
|
-
|
|
775
|
+
error_types = {
|
|
776
|
+
400 => Schematic::Types::ApiError,
|
|
777
|
+
401 => Schematic::Types::ApiError,
|
|
778
|
+
403 => Schematic::Types::ApiError,
|
|
779
|
+
404 => Schematic::Types::ApiError,
|
|
780
|
+
500 => Schematic::Types::ApiError
|
|
781
|
+
}
|
|
782
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
783
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
682
784
|
end
|
|
683
785
|
end
|
|
684
786
|
|
|
@@ -728,7 +830,15 @@ module Schematic
|
|
|
728
830
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::CountFeatureUsersResponse.load(response.body))
|
|
729
831
|
else
|
|
730
832
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
731
|
-
|
|
833
|
+
error_types = {
|
|
834
|
+
400 => Schematic::Types::ApiError,
|
|
835
|
+
401 => Schematic::Types::ApiError,
|
|
836
|
+
403 => Schematic::Types::ApiError,
|
|
837
|
+
404 => Schematic::Types::ApiError,
|
|
838
|
+
500 => Schematic::Types::ApiError
|
|
839
|
+
}
|
|
840
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
841
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
732
842
|
end
|
|
733
843
|
end
|
|
734
844
|
|
|
@@ -799,7 +909,15 @@ module Schematic
|
|
|
799
909
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::ListPlanEntitlementsResponse.load(response.body))
|
|
800
910
|
else
|
|
801
911
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
802
|
-
|
|
912
|
+
error_types = {
|
|
913
|
+
400 => Schematic::Types::ApiError,
|
|
914
|
+
401 => Schematic::Types::ApiError,
|
|
915
|
+
403 => Schematic::Types::ApiError,
|
|
916
|
+
404 => Schematic::Types::ApiError,
|
|
917
|
+
500 => Schematic::Types::ApiError
|
|
918
|
+
}
|
|
919
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
920
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
803
921
|
end
|
|
804
922
|
end
|
|
805
923
|
|
|
@@ -838,7 +956,15 @@ module Schematic
|
|
|
838
956
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::CreatePlanEntitlementResponse.load(response.body))
|
|
839
957
|
else
|
|
840
958
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
841
|
-
|
|
959
|
+
error_types = {
|
|
960
|
+
400 => Schematic::Types::ApiError,
|
|
961
|
+
401 => Schematic::Types::ApiError,
|
|
962
|
+
403 => Schematic::Types::ApiError,
|
|
963
|
+
404 => Schematic::Types::ApiError,
|
|
964
|
+
500 => Schematic::Types::ApiError
|
|
965
|
+
}
|
|
966
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
967
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
842
968
|
end
|
|
843
969
|
end
|
|
844
970
|
|
|
@@ -873,7 +999,14 @@ module Schematic
|
|
|
873
999
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::GetPlanEntitlementResponse.load(response.body))
|
|
874
1000
|
else
|
|
875
1001
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
876
|
-
|
|
1002
|
+
error_types = {
|
|
1003
|
+
401 => Schematic::Types::ApiError,
|
|
1004
|
+
403 => Schematic::Types::ApiError,
|
|
1005
|
+
404 => Schematic::Types::ApiError,
|
|
1006
|
+
500 => Schematic::Types::ApiError
|
|
1007
|
+
}
|
|
1008
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1009
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
877
1010
|
end
|
|
878
1011
|
end
|
|
879
1012
|
|
|
@@ -916,7 +1049,15 @@ module Schematic
|
|
|
916
1049
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::UpdatePlanEntitlementResponse.load(response.body))
|
|
917
1050
|
else
|
|
918
1051
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
919
|
-
|
|
1052
|
+
error_types = {
|
|
1053
|
+
400 => Schematic::Types::ApiError,
|
|
1054
|
+
401 => Schematic::Types::ApiError,
|
|
1055
|
+
403 => Schematic::Types::ApiError,
|
|
1056
|
+
404 => Schematic::Types::ApiError,
|
|
1057
|
+
500 => Schematic::Types::ApiError
|
|
1058
|
+
}
|
|
1059
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1060
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
920
1061
|
end
|
|
921
1062
|
end
|
|
922
1063
|
|
|
@@ -951,7 +1092,15 @@ module Schematic
|
|
|
951
1092
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::DeletePlanEntitlementResponse.load(response.body))
|
|
952
1093
|
else
|
|
953
1094
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
954
|
-
|
|
1095
|
+
error_types = {
|
|
1096
|
+
400 => Schematic::Types::ApiError,
|
|
1097
|
+
401 => Schematic::Types::ApiError,
|
|
1098
|
+
403 => Schematic::Types::ApiError,
|
|
1099
|
+
404 => Schematic::Types::ApiError,
|
|
1100
|
+
500 => Schematic::Types::ApiError
|
|
1101
|
+
}
|
|
1102
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1103
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
955
1104
|
end
|
|
956
1105
|
end
|
|
957
1106
|
|
|
@@ -992,7 +1141,15 @@ module Schematic
|
|
|
992
1141
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::UpsertPlanEntitlementForBillingProductResponse.load(response.body))
|
|
993
1142
|
else
|
|
994
1143
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
995
|
-
|
|
1144
|
+
error_types = {
|
|
1145
|
+
400 => Schematic::Types::ApiError,
|
|
1146
|
+
401 => Schematic::Types::ApiError,
|
|
1147
|
+
403 => Schematic::Types::ApiError,
|
|
1148
|
+
404 => Schematic::Types::ApiError,
|
|
1149
|
+
500 => Schematic::Types::ApiError
|
|
1150
|
+
}
|
|
1151
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1152
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
996
1153
|
end
|
|
997
1154
|
end
|
|
998
1155
|
|
|
@@ -1063,7 +1220,15 @@ module Schematic
|
|
|
1063
1220
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::CountPlanEntitlementsResponse.load(response.body))
|
|
1064
1221
|
else
|
|
1065
1222
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1066
|
-
|
|
1223
|
+
error_types = {
|
|
1224
|
+
400 => Schematic::Types::ApiError,
|
|
1225
|
+
401 => Schematic::Types::ApiError,
|
|
1226
|
+
403 => Schematic::Types::ApiError,
|
|
1227
|
+
404 => Schematic::Types::ApiError,
|
|
1228
|
+
500 => Schematic::Types::ApiError
|
|
1229
|
+
}
|
|
1230
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1231
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1067
1232
|
end
|
|
1068
1233
|
end
|
|
1069
1234
|
|
|
@@ -1101,7 +1266,15 @@ module Schematic
|
|
|
1101
1266
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::DuplicatePlanEntitlementsResponse.load(response.body))
|
|
1102
1267
|
else
|
|
1103
1268
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1104
|
-
|
|
1269
|
+
error_types = {
|
|
1270
|
+
400 => Schematic::Types::ApiError,
|
|
1271
|
+
401 => Schematic::Types::ApiError,
|
|
1272
|
+
403 => Schematic::Types::ApiError,
|
|
1273
|
+
404 => Schematic::Types::ApiError,
|
|
1274
|
+
500 => Schematic::Types::ApiError
|
|
1275
|
+
}
|
|
1276
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1277
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1105
1278
|
end
|
|
1106
1279
|
end
|
|
1107
1280
|
|
|
@@ -1142,7 +1315,14 @@ module Schematic
|
|
|
1142
1315
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::GetFeatureUsageByCompanyResponse.load(response.body))
|
|
1143
1316
|
else
|
|
1144
1317
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1145
|
-
|
|
1318
|
+
error_types = {
|
|
1319
|
+
401 => Schematic::Types::ApiError,
|
|
1320
|
+
403 => Schematic::Types::ApiError,
|
|
1321
|
+
404 => Schematic::Types::ApiError,
|
|
1322
|
+
500 => Schematic::Types::ApiError
|
|
1323
|
+
}
|
|
1324
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1325
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1146
1326
|
end
|
|
1147
1327
|
end
|
|
1148
1328
|
|
|
@@ -1192,7 +1372,14 @@ module Schematic
|
|
|
1192
1372
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::GetUserUsageByCompanyResponse.load(response.body))
|
|
1193
1373
|
else
|
|
1194
1374
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1195
|
-
|
|
1375
|
+
error_types = {
|
|
1376
|
+
401 => Schematic::Types::ApiError,
|
|
1377
|
+
403 => Schematic::Types::ApiError,
|
|
1378
|
+
404 => Schematic::Types::ApiError,
|
|
1379
|
+
500 => Schematic::Types::ApiError
|
|
1380
|
+
}
|
|
1381
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1382
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1196
1383
|
end
|
|
1197
1384
|
end
|
|
1198
1385
|
|
|
@@ -1239,7 +1426,14 @@ module Schematic
|
|
|
1239
1426
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::GetCompanyUserUsageMetricsResponse.load(response.body))
|
|
1240
1427
|
else
|
|
1241
1428
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1242
|
-
|
|
1429
|
+
error_types = {
|
|
1430
|
+
401 => Schematic::Types::ApiError,
|
|
1431
|
+
403 => Schematic::Types::ApiError,
|
|
1432
|
+
404 => Schematic::Types::ApiError,
|
|
1433
|
+
500 => Schematic::Types::ApiError
|
|
1434
|
+
}
|
|
1435
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1436
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1243
1437
|
end
|
|
1244
1438
|
end
|
|
1245
1439
|
|
|
@@ -1298,7 +1492,14 @@ module Schematic
|
|
|
1298
1492
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::ListCompanyUserUsageResponse.load(response.body))
|
|
1299
1493
|
else
|
|
1300
1494
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1301
|
-
|
|
1495
|
+
error_types = {
|
|
1496
|
+
401 => Schematic::Types::ApiError,
|
|
1497
|
+
403 => Schematic::Types::ApiError,
|
|
1498
|
+
404 => Schematic::Types::ApiError,
|
|
1499
|
+
500 => Schematic::Types::ApiError
|
|
1500
|
+
}
|
|
1501
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1502
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1302
1503
|
end
|
|
1303
1504
|
end
|
|
1304
1505
|
|
|
@@ -1357,7 +1558,15 @@ module Schematic
|
|
|
1357
1558
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::CountCompanyUserUsageResponse.load(response.body))
|
|
1358
1559
|
else
|
|
1359
1560
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1360
|
-
|
|
1561
|
+
error_types = {
|
|
1562
|
+
400 => Schematic::Types::ApiError,
|
|
1563
|
+
401 => Schematic::Types::ApiError,
|
|
1564
|
+
403 => Schematic::Types::ApiError,
|
|
1565
|
+
404 => Schematic::Types::ApiError,
|
|
1566
|
+
500 => Schematic::Types::ApiError
|
|
1567
|
+
}
|
|
1568
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1569
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1361
1570
|
end
|
|
1362
1571
|
end
|
|
1363
1572
|
|
|
@@ -1407,7 +1616,14 @@ module Schematic
|
|
|
1407
1616
|
(response.body.to_s.empty? ? nil : Schematic::Entitlements::Types::GetUserUsageDetailResponse.load(response.body))
|
|
1408
1617
|
else
|
|
1409
1618
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1410
|
-
|
|
1619
|
+
error_types = {
|
|
1620
|
+
401 => Schematic::Types::ApiError,
|
|
1621
|
+
403 => Schematic::Types::ApiError,
|
|
1622
|
+
404 => Schematic::Types::ApiError,
|
|
1623
|
+
500 => Schematic::Types::ApiError
|
|
1624
|
+
}
|
|
1625
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1626
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1411
1627
|
end
|
|
1412
1628
|
end
|
|
1413
1629
|
end
|
data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb
CHANGED
|
@@ -10,9 +10,9 @@ module Schematic
|
|
|
10
10
|
|
|
11
11
|
field :billing_threshold, -> { Integer }, optional: true, nullable: false
|
|
12
12
|
|
|
13
|
-
field :credit_consumption_rate, -> {
|
|
13
|
+
field :credit_consumption_rate, -> { Float }, optional: true, nullable: false
|
|
14
14
|
|
|
15
|
-
field :currency, -> {
|
|
15
|
+
field :currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
|
|
16
16
|
|
|
17
17
|
field :currency_prices, -> { Internal::Types::Array[Schematic::Types::CurrencyPriceRequestBody] }, optional: true, nullable: false
|
|
18
18
|
|
|
@@ -46,6 +46,8 @@ module Schematic
|
|
|
46
46
|
|
|
47
47
|
field :price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
|
|
48
48
|
|
|
49
|
+
field :quantity_rates, -> { Internal::Types::Hash[String, Float] }, optional: true, nullable: false
|
|
50
|
+
|
|
49
51
|
field :quarterly_metered_price_id, -> { String }, optional: true, nullable: false
|
|
50
52
|
|
|
51
53
|
field :quarterly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
|
|
@@ -6,7 +6,7 @@ module Schematic
|
|
|
6
6
|
class CreateCompanyOverrideRequestBody < Internal::Types::Model
|
|
7
7
|
field :company_id, -> { String }, optional: false, nullable: false
|
|
8
8
|
|
|
9
|
-
field :credit_consumption_rate, -> {
|
|
9
|
+
field :credit_consumption_rate, -> { Float }, optional: true, nullable: false
|
|
10
10
|
|
|
11
11
|
field :expiration_date, -> { String }, optional: true, nullable: false
|
|
12
12
|
|
|
@@ -18,6 +18,8 @@ module Schematic
|
|
|
18
18
|
|
|
19
19
|
field :note, -> { String }, optional: true, nullable: false
|
|
20
20
|
|
|
21
|
+
field :quantity_rates, -> { Internal::Types::Hash[String, Float] }, optional: true, nullable: false
|
|
22
|
+
|
|
21
23
|
field :value_bool, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
22
24
|
|
|
23
25
|
field :value_credit_id, -> { String }, optional: true, nullable: false
|
|
@@ -8,9 +8,9 @@ module Schematic
|
|
|
8
8
|
|
|
9
9
|
field :billing_threshold, -> { Integer }, optional: true, nullable: false
|
|
10
10
|
|
|
11
|
-
field :credit_consumption_rate, -> {
|
|
11
|
+
field :credit_consumption_rate, -> { Float }, optional: true, nullable: false
|
|
12
12
|
|
|
13
|
-
field :currency, -> {
|
|
13
|
+
field :currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
|
|
14
14
|
|
|
15
15
|
field :currency_prices, -> { Internal::Types::Array[Schematic::Types::CurrencyPriceRequestBody] }, optional: true, nullable: false
|
|
16
16
|
|
|
@@ -42,6 +42,8 @@ module Schematic
|
|
|
42
42
|
|
|
43
43
|
field :price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
|
|
44
44
|
|
|
45
|
+
field :quantity_rates, -> { Internal::Types::Hash[String, Float] }, optional: true, nullable: false
|
|
46
|
+
|
|
45
47
|
field :quarterly_metered_price_id, -> { String }, optional: true, nullable: false
|
|
46
48
|
|
|
47
49
|
field :quarterly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
|
|
@@ -6,7 +6,7 @@ module Schematic
|
|
|
6
6
|
class UpdateCompanyOverrideRequestBody < Internal::Types::Model
|
|
7
7
|
field :company_override_id, -> { String }, optional: false, nullable: false
|
|
8
8
|
|
|
9
|
-
field :credit_consumption_rate, -> {
|
|
9
|
+
field :credit_consumption_rate, -> { Float }, optional: true, nullable: false
|
|
10
10
|
|
|
11
11
|
field :expiration_date, -> { String }, optional: true, nullable: false
|
|
12
12
|
|
|
@@ -16,6 +16,8 @@ module Schematic
|
|
|
16
16
|
|
|
17
17
|
field :note, -> { String }, optional: true, nullable: false
|
|
18
18
|
|
|
19
|
+
field :quantity_rates, -> { Internal::Types::Hash[String, Float] }, optional: true, nullable: false
|
|
20
|
+
|
|
19
21
|
field :value_bool, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
20
22
|
|
|
21
23
|
field :value_credit_id, -> { String }, optional: true, nullable: false
|
|
@@ -10,9 +10,9 @@ module Schematic
|
|
|
10
10
|
|
|
11
11
|
field :billing_threshold, -> { Integer }, optional: true, nullable: false
|
|
12
12
|
|
|
13
|
-
field :credit_consumption_rate, -> {
|
|
13
|
+
field :credit_consumption_rate, -> { Float }, optional: true, nullable: false
|
|
14
14
|
|
|
15
|
-
field :currency, -> {
|
|
15
|
+
field :currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
|
|
16
16
|
|
|
17
17
|
field :currency_prices, -> { Internal::Types::Array[Schematic::Types::CurrencyPriceRequestBody] }, optional: true, nullable: false
|
|
18
18
|
|
|
@@ -38,6 +38,8 @@ module Schematic
|
|
|
38
38
|
|
|
39
39
|
field :price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
|
|
40
40
|
|
|
41
|
+
field :quantity_rates, -> { Internal::Types::Hash[String, Float] }, optional: true, nullable: false
|
|
42
|
+
|
|
41
43
|
field :quarterly_metered_price_id, -> { String }, optional: true, nullable: false
|
|
42
44
|
|
|
43
45
|
field :quarterly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Errors
|
|
5
|
+
# Raised when the request fails before a response is received: the connection is refused,
|
|
6
|
+
# reset or closed early, the host name cannot be resolved, or the TLS handshake fails.
|
|
7
|
+
# The original exception is available as `cause`.
|
|
8
|
+
class ConnectionError < ApiError
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
module Schematic
|
|
4
4
|
module Errors
|
|
5
5
|
class ResponseError < ApiError
|
|
6
|
-
attr_reader :code
|
|
6
|
+
attr_reader :code, :body
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# @param msg [String] The raw response body.
|
|
9
|
+
# @param code [Integer] The HTTP status code.
|
|
10
|
+
# @param body [Object, nil] The response body parsed into the endpoint's declared error type, if any.
|
|
11
|
+
def initialize(msg, code:, body: nil)
|
|
9
12
|
@code = code
|
|
13
|
+
@body = body
|
|
10
14
|
super(msg)
|
|
11
15
|
end
|
|
12
16
|
|
|
@@ -14,6 +18,23 @@ module Schematic
|
|
|
14
18
|
"#<#{self.class.name} @code=#{code} @body=#{message}>"
|
|
15
19
|
end
|
|
16
20
|
|
|
21
|
+
# Parses a raw error response body into the type declared for its status code.
|
|
22
|
+
#
|
|
23
|
+
# @param code [Integer]
|
|
24
|
+
# @param raw_body [String, nil]
|
|
25
|
+
# @param types [Hash{Integer, Range => Class}] Matchers in priority order.
|
|
26
|
+
# @return [Object, nil] nil when no type matches or the body cannot be parsed.
|
|
27
|
+
def self.load_error_body(code, raw_body, types)
|
|
28
|
+
type = types.find { |matcher, _| matcher.is_a?(::Range) ? matcher.cover?(code) : matcher == code }&.last
|
|
29
|
+
return nil if type.nil? || raw_body.to_s.empty?
|
|
30
|
+
|
|
31
|
+
begin
|
|
32
|
+
type.load(raw_body)
|
|
33
|
+
rescue StandardError
|
|
34
|
+
nil
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
17
38
|
# Returns the most appropriate error class for the given code.
|
|
18
39
|
#
|
|
19
40
|
# @return [Class]
|