schematichq 1.5.3 → 1.5.5
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 +13 -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 +748 -34
- data/lib/schematic/billing/types/count_native_invoices_params.rb +20 -0
- data/lib/schematic/billing/types/count_native_invoices_request.rb +19 -0
- data/lib/schematic/billing/types/count_native_invoices_response.rb +13 -0
- 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/finalize_native_invoice_response.rb +13 -0
- data/lib/schematic/billing/types/get_billing_settings_response.rb +13 -0
- data/lib/schematic/billing/types/get_company_native_subscription_response.rb +13 -0
- data/lib/schematic/billing/types/get_native_invoice_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/list_native_invoices_params.rb +20 -0
- data/lib/schematic/billing/types/list_native_invoices_request.rb +19 -0
- data/lib/schematic/billing/types/list_native_invoices_response.rb +13 -0
- data/lib/schematic/billing/types/mark_invoice_paid_request_body.rb +19 -0
- data/lib/schematic/billing/types/mark_native_invoice_paid_response.rb +13 -0
- 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/billing/types/void_native_invoice_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 -20
- 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 +9 -4
- data/lib/schematic/internal/iterators/cursor_page_iterator.rb +78 -15
- data/lib/schematic/internal/iterators/item_iterator.rb +70 -15
- data/lib/schematic/internal/iterators/offset_item_iterator.rb +9 -4
- data/lib/schematic/internal/iterators/offset_page_iterator.rb +71 -14
- 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 +24 -4
- 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 +274 -28
- 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/list_custom_plan_billings_params.rb +4 -0
- data/lib/schematic/plans/types/list_custom_plan_billings_request.rb +4 -0
- data/lib/schematic/plans/types/preview_publish_plan_version_response.rb +13 -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/amendment_proration_lands_on.rb +13 -0
- 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_invoice_detail_response_data.rb +49 -0
- data/lib/schematic/types/billing_invoice_line_response_data.rb +27 -0
- data/lib/schematic/types/billing_invoice_response_data.rb +43 -0
- data/lib/schematic/types/billing_invoice_settlement_response_data.rb +17 -0
- data/lib/schematic/types/billing_invoice_terms_response_data.rb +19 -0
- data/lib/schematic/types/billing_native_subscription_change_response_data.rb +15 -0
- data/lib/schematic/types/billing_native_subscription_line_response_data.rb +47 -0
- data/lib/schematic/types/billing_native_subscription_response_data.rb +31 -0
- 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_statement_line_response_data.rb +21 -0
- data/lib/schematic/types/billing_statement_response_data.rb +19 -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/charge_timing.rb +12 -0
- 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/collector.rb +13 -0
- data/lib/schematic/types/company_billing_entity_subscription_response_data.rb +1 -1
- data/lib/schematic/types/company_billing_profile_response_data.rb +12 -0
- data/lib/schematic/types/company_credit_balance.rb +7 -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_flag_request_body.rb +1 -1
- data/lib/schematic/types/create_or_update_condition_request_body.rb +1 -1
- data/lib/schematic/types/create_or_update_flag_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 +4 -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/event_body_inference.rb +4 -0
- 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/flag_detail_response_data.rb +1 -1
- data/lib/schematic/types/flag_in_plan_response_data.rb +1 -1
- data/lib/schematic/types/flag_response_data.rb +1 -1
- data/lib/schematic/types/insights_summary_response_data.rb +1 -1
- data/lib/schematic/types/invoice_collection_state.rb +17 -0
- data/lib/schematic/types/invoice_document_state.rb +14 -0
- data/lib/schematic/types/invoice_line_kind.rb +15 -0
- data/lib/schematic/types/invoice_request_body.rb +1 -1
- data/lib/schematic/types/invoice_response_data.rb +1 -1
- data/lib/schematic/types/line_kind.rb +13 -0
- 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/payment_gating.rb +12 -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_event_quantities_request_body.rb +13 -0
- data/lib/schematic/types/preflight_request_body.rb +3 -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/publish_plan_version_request_body.rb +43 -0
- data/lib/schematic/types/publish_preview_pay_in_advance_response_data.rb +15 -0
- data/lib/schematic/types/publish_preview_payment_method_response_data.rb +15 -0
- data/lib/schematic/types/publish_preview_proration_line_response_data.rb +19 -0
- data/lib/schematic/types/publish_preview_response_data.rb +53 -0
- 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 +4 -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/subscription_change_action.rb +14 -0
- 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 +80 -8
- data/reference.md +892 -113
- metadata +75 -3
- data/lib/schematic/plans/types/publish_plan_version_request_body.rb +0 -45
|
@@ -49,7 +49,15 @@ module Schematic
|
|
|
49
49
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpdateCompanyPlansResponse.load(response.body))
|
|
50
50
|
else
|
|
51
51
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
52
|
-
|
|
52
|
+
error_types = {
|
|
53
|
+
400 => Schematic::Types::ApiError,
|
|
54
|
+
401 => Schematic::Types::ApiError,
|
|
55
|
+
403 => Schematic::Types::ApiError,
|
|
56
|
+
404 => Schematic::Types::ApiError,
|
|
57
|
+
500 => Schematic::Types::ApiError
|
|
58
|
+
}
|
|
59
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
60
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
53
61
|
end
|
|
54
62
|
end
|
|
55
63
|
|
|
@@ -62,7 +70,9 @@ module Schematic
|
|
|
62
70
|
# @option request_options [Integer] :timeout_in_seconds
|
|
63
71
|
# @option params [String, nil] :company_id
|
|
64
72
|
# @option params [String, nil] :plan_id
|
|
73
|
+
# @option params [String, nil] :plan_version_id
|
|
65
74
|
# @option params [Schematic::Types::PlanBillingSource, nil] :plan_billing_source
|
|
75
|
+
# @option params [Schematic::Types::PlanBillingSource, nil] :plan_billing_sources
|
|
66
76
|
# @option params [Schematic::Types::CustomPlanBillingStatus, nil] :status
|
|
67
77
|
# @option params [Schematic::Types::CustomPlanBillingStatus, nil] :statuses
|
|
68
78
|
# @option params [Integer, nil] :limit
|
|
@@ -72,7 +82,9 @@ module Schematic
|
|
|
72
82
|
# client.plans.list_custom_plan_billings(
|
|
73
83
|
# company_id: "company_id",
|
|
74
84
|
# plan_id: "plan_id",
|
|
75
|
-
#
|
|
85
|
+
# plan_version_id: "plan_version_id",
|
|
86
|
+
# plan_billing_source: "amendment",
|
|
87
|
+
# plan_billing_sources: ["amendment"],
|
|
76
88
|
# status: "active",
|
|
77
89
|
# statuses: ["active"],
|
|
78
90
|
# limit: 1000000,
|
|
@@ -85,7 +97,9 @@ module Schematic
|
|
|
85
97
|
query_params = {}
|
|
86
98
|
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
87
99
|
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
100
|
+
query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
|
|
88
101
|
query_params["plan_billing_source"] = params[:plan_billing_source] if params.key?(:plan_billing_source)
|
|
102
|
+
query_params["plan_billing_sources"] = params[:plan_billing_sources] if params.key?(:plan_billing_sources)
|
|
89
103
|
query_params["status"] = params[:status] if params.key?(:status)
|
|
90
104
|
query_params["statuses"] = params[:statuses] if params.key?(:statuses)
|
|
91
105
|
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
@@ -108,7 +122,15 @@ module Schematic
|
|
|
108
122
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListCustomPlanBillingsResponse.load(response.body))
|
|
109
123
|
else
|
|
110
124
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
111
|
-
|
|
125
|
+
error_types = {
|
|
126
|
+
400 => Schematic::Types::ApiError,
|
|
127
|
+
401 => Schematic::Types::ApiError,
|
|
128
|
+
403 => Schematic::Types::ApiError,
|
|
129
|
+
404 => Schematic::Types::ApiError,
|
|
130
|
+
500 => Schematic::Types::ApiError
|
|
131
|
+
}
|
|
132
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
133
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
112
134
|
end
|
|
113
135
|
end
|
|
114
136
|
|
|
@@ -132,14 +154,11 @@ module Schematic
|
|
|
132
154
|
# @return [Schematic::Plans::Types::MarkCustomPlanBillingPaidResponse]
|
|
133
155
|
def mark_custom_plan_billing_paid(request_options: {}, **params)
|
|
134
156
|
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
135
|
-
path_param_names = %i[custom_plan_billing_id]
|
|
136
|
-
body_params = params.except(*path_param_names)
|
|
137
|
-
|
|
138
157
|
request = Schematic::Internal::JSON::Request.new(
|
|
139
158
|
base_url: request_options[:base_url],
|
|
140
159
|
method: "PUT",
|
|
141
160
|
path: "custom-plan-billings/#{URI.encode_uri_component(params[:custom_plan_billing_id].to_s)}/mark-paid",
|
|
142
|
-
body:
|
|
161
|
+
body: params[:request],
|
|
143
162
|
request_options: request_options
|
|
144
163
|
)
|
|
145
164
|
begin
|
|
@@ -152,7 +171,15 @@ module Schematic
|
|
|
152
171
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::MarkCustomPlanBillingPaidResponse.load(response.body))
|
|
153
172
|
else
|
|
154
173
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
155
|
-
|
|
174
|
+
error_types = {
|
|
175
|
+
400 => Schematic::Types::ApiError,
|
|
176
|
+
401 => Schematic::Types::ApiError,
|
|
177
|
+
403 => Schematic::Types::ApiError,
|
|
178
|
+
404 => Schematic::Types::ApiError,
|
|
179
|
+
500 => Schematic::Types::ApiError
|
|
180
|
+
}
|
|
181
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
182
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
156
183
|
end
|
|
157
184
|
end
|
|
158
185
|
|
|
@@ -195,7 +222,15 @@ module Schematic
|
|
|
195
222
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::RetryCustomPlanBillingResponse.load(response.body))
|
|
196
223
|
else
|
|
197
224
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
198
|
-
|
|
225
|
+
error_types = {
|
|
226
|
+
400 => Schematic::Types::ApiError,
|
|
227
|
+
401 => Schematic::Types::ApiError,
|
|
228
|
+
403 => Schematic::Types::ApiError,
|
|
229
|
+
404 => Schematic::Types::ApiError,
|
|
230
|
+
500 => Schematic::Types::ApiError
|
|
231
|
+
}
|
|
232
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
233
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
199
234
|
end
|
|
200
235
|
end
|
|
201
236
|
|
|
@@ -233,7 +268,15 @@ module Schematic
|
|
|
233
268
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::CreateCustomPlanResponse.load(response.body))
|
|
234
269
|
else
|
|
235
270
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
236
|
-
|
|
271
|
+
error_types = {
|
|
272
|
+
400 => Schematic::Types::ApiError,
|
|
273
|
+
401 => Schematic::Types::ApiError,
|
|
274
|
+
403 => Schematic::Types::ApiError,
|
|
275
|
+
404 => Schematic::Types::ApiError,
|
|
276
|
+
500 => Schematic::Types::ApiError
|
|
277
|
+
}
|
|
278
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
279
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
237
280
|
end
|
|
238
281
|
end
|
|
239
282
|
|
|
@@ -331,7 +374,15 @@ module Schematic
|
|
|
331
374
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListPlansResponse.load(response.body))
|
|
332
375
|
else
|
|
333
376
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
334
|
-
|
|
377
|
+
error_types = {
|
|
378
|
+
400 => Schematic::Types::ApiError,
|
|
379
|
+
401 => Schematic::Types::ApiError,
|
|
380
|
+
403 => Schematic::Types::ApiError,
|
|
381
|
+
404 => Schematic::Types::ApiError,
|
|
382
|
+
500 => Schematic::Types::ApiError
|
|
383
|
+
}
|
|
384
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
385
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
335
386
|
end
|
|
336
387
|
end
|
|
337
388
|
|
|
@@ -369,7 +420,15 @@ module Schematic
|
|
|
369
420
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::CreatePlanResponse.load(response.body))
|
|
370
421
|
else
|
|
371
422
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
372
|
-
|
|
423
|
+
error_types = {
|
|
424
|
+
400 => Schematic::Types::ApiError,
|
|
425
|
+
401 => Schematic::Types::ApiError,
|
|
426
|
+
403 => Schematic::Types::ApiError,
|
|
427
|
+
404 => Schematic::Types::ApiError,
|
|
428
|
+
500 => Schematic::Types::ApiError
|
|
429
|
+
}
|
|
430
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
431
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
373
432
|
end
|
|
374
433
|
end
|
|
375
434
|
|
|
@@ -412,7 +471,14 @@ module Schematic
|
|
|
412
471
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::GetPlanResponse.load(response.body))
|
|
413
472
|
else
|
|
414
473
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
415
|
-
|
|
474
|
+
error_types = {
|
|
475
|
+
401 => Schematic::Types::ApiError,
|
|
476
|
+
403 => Schematic::Types::ApiError,
|
|
477
|
+
404 => Schematic::Types::ApiError,
|
|
478
|
+
500 => Schematic::Types::ApiError
|
|
479
|
+
}
|
|
480
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
481
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
416
482
|
end
|
|
417
483
|
end
|
|
418
484
|
|
|
@@ -454,7 +520,15 @@ module Schematic
|
|
|
454
520
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpdatePlanResponse.load(response.body))
|
|
455
521
|
else
|
|
456
522
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
457
|
-
|
|
523
|
+
error_types = {
|
|
524
|
+
400 => Schematic::Types::ApiError,
|
|
525
|
+
401 => Schematic::Types::ApiError,
|
|
526
|
+
403 => Schematic::Types::ApiError,
|
|
527
|
+
404 => Schematic::Types::ApiError,
|
|
528
|
+
500 => Schematic::Types::ApiError
|
|
529
|
+
}
|
|
530
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
531
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
458
532
|
end
|
|
459
533
|
end
|
|
460
534
|
|
|
@@ -489,7 +563,15 @@ module Schematic
|
|
|
489
563
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::DeletePlanResponse.load(response.body))
|
|
490
564
|
else
|
|
491
565
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
492
|
-
|
|
566
|
+
error_types = {
|
|
567
|
+
400 => Schematic::Types::ApiError,
|
|
568
|
+
401 => Schematic::Types::ApiError,
|
|
569
|
+
403 => Schematic::Types::ApiError,
|
|
570
|
+
404 => Schematic::Types::ApiError,
|
|
571
|
+
500 => Schematic::Types::ApiError
|
|
572
|
+
}
|
|
573
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
574
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
493
575
|
end
|
|
494
576
|
end
|
|
495
577
|
|
|
@@ -532,7 +614,15 @@ module Schematic
|
|
|
532
614
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpsertBillingProductPlanResponse.load(response.body))
|
|
533
615
|
else
|
|
534
616
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
535
|
-
|
|
617
|
+
error_types = {
|
|
618
|
+
400 => Schematic::Types::ApiError,
|
|
619
|
+
401 => Schematic::Types::ApiError,
|
|
620
|
+
403 => Schematic::Types::ApiError,
|
|
621
|
+
404 => Schematic::Types::ApiError,
|
|
622
|
+
500 => Schematic::Types::ApiError
|
|
623
|
+
}
|
|
624
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
625
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
536
626
|
end
|
|
537
627
|
end
|
|
538
628
|
|
|
@@ -572,7 +662,15 @@ module Schematic
|
|
|
572
662
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpsertPlanForBillingProductResponse.load(response.body))
|
|
573
663
|
else
|
|
574
664
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
575
|
-
|
|
665
|
+
error_types = {
|
|
666
|
+
400 => Schematic::Types::ApiError,
|
|
667
|
+
401 => Schematic::Types::ApiError,
|
|
668
|
+
403 => Schematic::Types::ApiError,
|
|
669
|
+
404 => Schematic::Types::ApiError,
|
|
670
|
+
500 => Schematic::Types::ApiError
|
|
671
|
+
}
|
|
672
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
673
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
576
674
|
end
|
|
577
675
|
end
|
|
578
676
|
|
|
@@ -622,7 +720,15 @@ module Schematic
|
|
|
622
720
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListBillingProductMatchCompaniesResponse.load(response.body))
|
|
623
721
|
else
|
|
624
722
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
625
|
-
|
|
723
|
+
error_types = {
|
|
724
|
+
400 => Schematic::Types::ApiError,
|
|
725
|
+
401 => Schematic::Types::ApiError,
|
|
726
|
+
403 => Schematic::Types::ApiError,
|
|
727
|
+
404 => Schematic::Types::ApiError,
|
|
728
|
+
500 => Schematic::Types::ApiError
|
|
729
|
+
}
|
|
730
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
731
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
626
732
|
end
|
|
627
733
|
end
|
|
628
734
|
|
|
@@ -672,7 +778,15 @@ module Schematic
|
|
|
672
778
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::CountBillingProductMatchCompaniesResponse.load(response.body))
|
|
673
779
|
else
|
|
674
780
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
675
|
-
|
|
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)
|
|
676
790
|
end
|
|
677
791
|
end
|
|
678
792
|
|
|
@@ -770,7 +884,15 @@ module Schematic
|
|
|
770
884
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::CountPlansResponse.load(response.body))
|
|
771
885
|
else
|
|
772
886
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
773
|
-
|
|
887
|
+
error_types = {
|
|
888
|
+
400 => Schematic::Types::ApiError,
|
|
889
|
+
401 => Schematic::Types::ApiError,
|
|
890
|
+
403 => Schematic::Types::ApiError,
|
|
891
|
+
404 => Schematic::Types::ApiError,
|
|
892
|
+
500 => Schematic::Types::ApiError
|
|
893
|
+
}
|
|
894
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
895
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
774
896
|
end
|
|
775
897
|
end
|
|
776
898
|
|
|
@@ -814,7 +936,15 @@ module Schematic
|
|
|
814
936
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListPlanIssuesResponse.load(response.body))
|
|
815
937
|
else
|
|
816
938
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
817
|
-
|
|
939
|
+
error_types = {
|
|
940
|
+
400 => Schematic::Types::ApiError,
|
|
941
|
+
401 => Schematic::Types::ApiError,
|
|
942
|
+
403 => Schematic::Types::ApiError,
|
|
943
|
+
404 => Schematic::Types::ApiError,
|
|
944
|
+
500 => Schematic::Types::ApiError
|
|
945
|
+
}
|
|
946
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
947
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
818
948
|
end
|
|
819
949
|
end
|
|
820
950
|
|
|
@@ -857,12 +987,70 @@ module Schematic
|
|
|
857
987
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::DeletePlanVersionResponse.load(response.body))
|
|
858
988
|
else
|
|
859
989
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
860
|
-
|
|
990
|
+
error_types = {
|
|
991
|
+
400 => Schematic::Types::ApiError,
|
|
992
|
+
401 => Schematic::Types::ApiError,
|
|
993
|
+
403 => Schematic::Types::ApiError,
|
|
994
|
+
404 => Schematic::Types::ApiError,
|
|
995
|
+
500 => Schematic::Types::ApiError
|
|
996
|
+
}
|
|
997
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
998
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
999
|
+
end
|
|
1000
|
+
end
|
|
1001
|
+
|
|
1002
|
+
# @param request_options [Hash]
|
|
1003
|
+
# @param params [Hash]
|
|
1004
|
+
# @option request_options [String] :base_url
|
|
1005
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1006
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1007
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1008
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1009
|
+
# @option params [String] :plan_version_id
|
|
1010
|
+
# @option params [String, nil] :against
|
|
1011
|
+
#
|
|
1012
|
+
# @example
|
|
1013
|
+
# client.plans.get_plan_version_diff(
|
|
1014
|
+
# plan_version_id: "plan_version_id",
|
|
1015
|
+
# against: "against"
|
|
1016
|
+
# )
|
|
1017
|
+
#
|
|
1018
|
+
# @return [Schematic::Plans::Types::GetPlanVersionDiffResponse]
|
|
1019
|
+
def get_plan_version_diff(request_options: {}, **params)
|
|
1020
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1021
|
+
query_params = {}
|
|
1022
|
+
query_params["against"] = params[:against] if params.key?(:against)
|
|
1023
|
+
|
|
1024
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1025
|
+
base_url: request_options[:base_url],
|
|
1026
|
+
method: "GET",
|
|
1027
|
+
path: "plans/version/#{URI.encode_uri_component(params[:plan_version_id].to_s)}/diff",
|
|
1028
|
+
query: query_params,
|
|
1029
|
+
request_options: request_options
|
|
1030
|
+
)
|
|
1031
|
+
begin
|
|
1032
|
+
response = @client.send(request)
|
|
1033
|
+
rescue Net::HTTPRequestTimeout
|
|
1034
|
+
raise Schematic::Errors::TimeoutError
|
|
1035
|
+
end
|
|
1036
|
+
code = response.code.to_i
|
|
1037
|
+
if code.between?(200, 299)
|
|
1038
|
+
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::GetPlanVersionDiffResponse.load(response.body))
|
|
1039
|
+
else
|
|
1040
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1041
|
+
error_types = {
|
|
1042
|
+
401 => Schematic::Types::ApiError,
|
|
1043
|
+
403 => Schematic::Types::ApiError,
|
|
1044
|
+
404 => Schematic::Types::ApiError,
|
|
1045
|
+
500 => Schematic::Types::ApiError
|
|
1046
|
+
}
|
|
1047
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1048
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
861
1049
|
end
|
|
862
1050
|
end
|
|
863
1051
|
|
|
864
1052
|
# @param request_options [Hash]
|
|
865
|
-
# @param params [Schematic::
|
|
1053
|
+
# @param params [Schematic::Types::PublishPlanVersionRequestBody]
|
|
866
1054
|
# @option request_options [String] :base_url
|
|
867
1055
|
# @option request_options [Hash{String => Object}] :additional_headers
|
|
868
1056
|
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
@@ -880,15 +1068,14 @@ module Schematic
|
|
|
880
1068
|
# @return [Schematic::Plans::Types::PublishPlanVersionResponse]
|
|
881
1069
|
def publish_plan_version(request_options: {}, **params)
|
|
882
1070
|
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
body = request_data.except(*non_body_param_names)
|
|
1071
|
+
path_param_names = %i[plan_version_id]
|
|
1072
|
+
body_params = params.except(*path_param_names)
|
|
886
1073
|
|
|
887
1074
|
request = Schematic::Internal::JSON::Request.new(
|
|
888
1075
|
base_url: request_options[:base_url],
|
|
889
1076
|
method: "PUT",
|
|
890
1077
|
path: "plans/version/#{URI.encode_uri_component(params[:plan_version_id].to_s)}/publish",
|
|
891
|
-
body:
|
|
1078
|
+
body: Schematic::Types::PublishPlanVersionRequestBody.new(body_params).to_h,
|
|
892
1079
|
request_options: request_options
|
|
893
1080
|
)
|
|
894
1081
|
begin
|
|
@@ -901,7 +1088,66 @@ module Schematic
|
|
|
901
1088
|
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::PublishPlanVersionResponse.load(response.body))
|
|
902
1089
|
else
|
|
903
1090
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
904
|
-
|
|
1091
|
+
error_types = {
|
|
1092
|
+
400 => Schematic::Types::ApiError,
|
|
1093
|
+
401 => Schematic::Types::ApiError,
|
|
1094
|
+
403 => Schematic::Types::ApiError,
|
|
1095
|
+
404 => Schematic::Types::ApiError,
|
|
1096
|
+
500 => Schematic::Types::ApiError
|
|
1097
|
+
}
|
|
1098
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1099
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
1100
|
+
end
|
|
1101
|
+
end
|
|
1102
|
+
|
|
1103
|
+
# @param request_options [Hash]
|
|
1104
|
+
# @param params [Schematic::Types::PublishPlanVersionRequestBody]
|
|
1105
|
+
# @option request_options [String] :base_url
|
|
1106
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1107
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1108
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1109
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1110
|
+
# @option params [String] :plan_version_id
|
|
1111
|
+
#
|
|
1112
|
+
# @example
|
|
1113
|
+
# client.plans.preview_publish_plan_version(
|
|
1114
|
+
# plan_version_id: "plan_version_id",
|
|
1115
|
+
# excluded_company_ids: ["excluded_company_ids"],
|
|
1116
|
+
# migration_strategy: "end_of_billing_period"
|
|
1117
|
+
# )
|
|
1118
|
+
#
|
|
1119
|
+
# @return [Schematic::Plans::Types::PreviewPublishPlanVersionResponse]
|
|
1120
|
+
def preview_publish_plan_version(request_options: {}, **params)
|
|
1121
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1122
|
+
path_param_names = %i[plan_version_id]
|
|
1123
|
+
body_params = params.except(*path_param_names)
|
|
1124
|
+
|
|
1125
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1126
|
+
base_url: request_options[:base_url],
|
|
1127
|
+
method: "POST",
|
|
1128
|
+
path: "plans/version/#{URI.encode_uri_component(params[:plan_version_id].to_s)}/publish-preview",
|
|
1129
|
+
body: Schematic::Types::PublishPlanVersionRequestBody.new(body_params).to_h,
|
|
1130
|
+
request_options: request_options
|
|
1131
|
+
)
|
|
1132
|
+
begin
|
|
1133
|
+
response = @client.send(request)
|
|
1134
|
+
rescue Net::HTTPRequestTimeout
|
|
1135
|
+
raise Schematic::Errors::TimeoutError
|
|
1136
|
+
end
|
|
1137
|
+
code = response.code.to_i
|
|
1138
|
+
if code.between?(200, 299)
|
|
1139
|
+
(response.body.to_s.empty? ? nil : Schematic::Plans::Types::PreviewPublishPlanVersionResponse.load(response.body))
|
|
1140
|
+
else
|
|
1141
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1142
|
+
error_types = {
|
|
1143
|
+
400 => Schematic::Types::ApiError,
|
|
1144
|
+
401 => Schematic::Types::ApiError,
|
|
1145
|
+
403 => Schematic::Types::ApiError,
|
|
1146
|
+
404 => Schematic::Types::ApiError,
|
|
1147
|
+
500 => Schematic::Types::ApiError
|
|
1148
|
+
}
|
|
1149
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
1150
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
905
1151
|
end
|
|
906
1152
|
end
|
|
907
1153
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class GetPlanVersionDiffRequest < Internal::Types::Model
|
|
7
|
+
field :plan_version_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :against, -> { String }, optional: true, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class GetPlanVersionDiffResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::PlanVersionDiffResponseData }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :params, -> { Schematic::Plans::Types::GetPlanVersionDiffParams }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -13,8 +13,12 @@ module Schematic
|
|
|
13
13
|
|
|
14
14
|
field :plan_billing_source, -> { Schematic::Types::PlanBillingSource }, optional: true, nullable: false
|
|
15
15
|
|
|
16
|
+
field :plan_billing_sources, -> { Internal::Types::Array[Schematic::Types::PlanBillingSource] }, optional: true, nullable: false
|
|
17
|
+
|
|
16
18
|
field :plan_id, -> { String }, optional: true, nullable: false
|
|
17
19
|
|
|
20
|
+
field :plan_version_id, -> { String }, optional: true, nullable: false
|
|
21
|
+
|
|
18
22
|
field :status, -> { Schematic::Types::CustomPlanBillingStatus }, optional: true, nullable: false
|
|
19
23
|
|
|
20
24
|
field :statuses, -> { Internal::Types::Array[Schematic::Types::CustomPlanBillingStatus] }, optional: true, nullable: false
|
|
@@ -8,8 +8,12 @@ module Schematic
|
|
|
8
8
|
|
|
9
9
|
field :plan_id, -> { String }, optional: true, nullable: false
|
|
10
10
|
|
|
11
|
+
field :plan_version_id, -> { String }, optional: true, nullable: false
|
|
12
|
+
|
|
11
13
|
field :plan_billing_source, -> { Schematic::Types::PlanBillingSource }, optional: true, nullable: false
|
|
12
14
|
|
|
15
|
+
field :plan_billing_sources, -> { Schematic::Types::PlanBillingSource }, optional: true, nullable: false
|
|
16
|
+
|
|
13
17
|
field :status, -> { Schematic::Types::CustomPlanBillingStatus }, optional: true, nullable: false
|
|
14
18
|
|
|
15
19
|
field :statuses, -> { Schematic::Types::CustomPlanBillingStatus }, optional: true, nullable: false
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class PreviewPublishPlanVersionResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::PublishPreviewResponseData }, 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
|
|
@@ -82,8 +82,20 @@ module Schematic
|
|
|
82
82
|
# "would this call still be allowed after it lands".
|
|
83
83
|
#
|
|
84
84
|
# options is a hash with any of :credit_cost (credit id to cost),
|
|
85
|
-
# :usage,
|
|
86
|
-
#
|
|
85
|
+
# :usage, :event_usage ({ event_subtype:, quantity: }), and
|
|
86
|
+
# :event_quantities ({ event_subtype:, quantity:, quantities: }). The engine
|
|
87
|
+
# reads them snake_case in both directions, so they go on the envelope as
|
|
88
|
+
# given.
|
|
89
|
+
#
|
|
90
|
+
# event_quantities prices an event against credit-balance conditions whose
|
|
91
|
+
# event_subtype matches, the way the API burns it: quantity times the
|
|
92
|
+
# condition's consumption_rate, plus each named quantity times its rate in
|
|
93
|
+
# the condition's quantity_rates. For an inference call, quantity is the
|
|
94
|
+
# request count and quantities the token counts as the event reports them
|
|
95
|
+
# (input tokens including the cached and cache-creation subsets). Keys
|
|
96
|
+
# without a rate cost nothing; an absent or zero quantity means one. It
|
|
97
|
+
# ranks below credit_cost and above event_usage and usage, and the engine
|
|
98
|
+
# reads its values as floats, so unlike event_usage they are not rounded.
|
|
87
99
|
def check_flag_with_options(flag, company = nil, user = nil, options = nil)
|
|
88
100
|
raise "WASM rules engine not initialized" unless @initialized
|
|
89
101
|
|
|
@@ -56,7 +56,15 @@ module Schematic
|
|
|
56
56
|
(response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::ListScheduledCheckoutsResponse.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
|
|
|
@@ -96,7 +104,15 @@ module Schematic
|
|
|
96
104
|
(response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::CreateScheduledCheckoutResponse.load(response.body))
|
|
97
105
|
else
|
|
98
106
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
99
|
-
|
|
107
|
+
error_types = {
|
|
108
|
+
400 => Schematic::Types::ApiError,
|
|
109
|
+
401 => Schematic::Types::ApiError,
|
|
110
|
+
403 => Schematic::Types::ApiError,
|
|
111
|
+
404 => Schematic::Types::ApiError,
|
|
112
|
+
500 => Schematic::Types::ApiError
|
|
113
|
+
}
|
|
114
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
115
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
100
116
|
end
|
|
101
117
|
end
|
|
102
118
|
|
|
@@ -131,7 +147,14 @@ module Schematic
|
|
|
131
147
|
(response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::GetScheduledCheckoutResponse.load(response.body))
|
|
132
148
|
else
|
|
133
149
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
134
|
-
|
|
150
|
+
error_types = {
|
|
151
|
+
401 => Schematic::Types::ApiError,
|
|
152
|
+
403 => Schematic::Types::ApiError,
|
|
153
|
+
404 => Schematic::Types::ApiError,
|
|
154
|
+
500 => Schematic::Types::ApiError
|
|
155
|
+
}
|
|
156
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
157
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
135
158
|
end
|
|
136
159
|
end
|
|
137
160
|
|
|
@@ -171,7 +194,15 @@ module Schematic
|
|
|
171
194
|
(response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::UpdateScheduledCheckoutResponse.load(response.body))
|
|
172
195
|
else
|
|
173
196
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
174
|
-
|
|
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)
|
|
175
206
|
end
|
|
176
207
|
end
|
|
177
208
|
end
|