schematichq 1.5.2 → 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 +14 -338
- data/.fernignore +8 -0
- data/.rubocop.yml +4 -0
- data/README.md +141 -0
- data/WASM_VERSION +1 -1
- data/custom.gemspec.rb +6 -0
- data/lib/schematic/accesstokens/client.rb +9 -1
- data/lib/schematic/accounts/client.rb +183 -21
- data/lib/schematic/accounts/types/update_environment_request_body.rb +2 -0
- 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 +458 -46
- data/lib/schematic/credits/leases/check.rb +477 -0
- data/lib/schematic/credits/leases/lease_manager.rb +565 -0
- data/lib/schematic/credits/leases/lease_store.rb +240 -0
- data/lib/schematic/credits/leases/redis_lease_store.rb +358 -0
- data/lib/schematic/credits/leases/redis_reservation_store.rb +326 -0
- data/lib/schematic/credits/leases/reservation_store.rb +161 -0
- data/lib/schematic/credits/leases/server_check.rb +237 -0
- data/lib/schematic/credits/leases/track.rb +66 -0
- data/lib/schematic/credits/leases/types.rb +329 -0
- data/lib/schematic/credits/leases/wire_client.rb +83 -0
- data/lib/schematic/credits/types/acquire_credit_lease_request_body.rb +3 -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 +5 -1
- data/lib/schematic/credits/types/extend_credit_lease_request_body.rb +3 -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/get_credit_spend_policy_usage_params.rb +16 -0
- data/lib/schematic/credits/types/get_credit_spend_policy_usage_request.rb +15 -0
- data/lib/schematic/credits/types/get_credit_spend_policy_usage_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 +5 -1
- data/lib/schematic/dataexports/client.rb +36 -6
- data/lib/schematic/datastream/client.rb +32 -2
- data/lib/schematic/entitlements/client.rb +406 -25
- data/lib/schematic/entitlements/types/count_company_user_usage_params.rb +24 -0
- data/lib/schematic/entitlements/types/count_company_user_usage_request.rb +23 -0
- data/lib/schematic/entitlements/types/count_company_user_usage_response.rb +13 -0
- 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/get_company_user_usage_metrics_params.rb +16 -0
- data/lib/schematic/entitlements/types/get_company_user_usage_metrics_request.rb +15 -0
- data/lib/schematic/entitlements/types/get_company_user_usage_metrics_response.rb +13 -0
- data/lib/schematic/entitlements/types/list_company_user_usage_params.rb +24 -0
- data/lib/schematic/entitlements/types/list_company_user_usage_request.rb +23 -0
- data/lib/schematic/entitlements/types/list_company_user_usage_response.rb +13 -0
- 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 +28 -3
- data/lib/schematic/plangroups/types/create_plan_group_request_body.rb +2 -0
- data/lib/schematic/plangroups/types/update_plan_group_request_body.rb +2 -0
- data/lib/schematic/planmigrations/client.rb +104 -11
- data/lib/schematic/planmigrations/types/count_migrations_params.rb +2 -0
- data/lib/schematic/planmigrations/types/count_migrations_request.rb +2 -0
- data/lib/schematic/planmigrations/types/create_migration_input.rb +2 -0
- data/lib/schematic/planmigrations/types/list_migrations_params.rb +2 -0
- data/lib/schematic/planmigrations/types/list_migrations_request.rb +2 -0
- 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 +6 -0
- data/lib/schematic/plans/types/retry_custom_plan_billing_request_body.rb +2 -0
- data/lib/schematic/rules_engine.rb +49 -0
- data/lib/schematic/scheduledcheckout/client.rb +35 -4
- data/lib/schematic/schematic_client.rb +841 -33
- 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/capture_raw_event.rb +4 -0
- 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/check_flags_response_data.rb +2 -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/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 +3 -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 +4 -0
- data/lib/schematic/types/company_subscription_response_data.rb +1 -1
- data/lib/schematic/types/company_user_usage_metrics_response_data.rb +15 -0
- data/lib/schematic/types/company_user_usage_response_data.rb +19 -0
- data/lib/schematic/types/company_user_usage_row_response_data.rb +17 -0
- data/lib/schematic/types/component_display_settings.rb +2 -0
- data/lib/schematic/types/component_response_data.rb +1 -1
- data/lib/schematic/types/component_settings_response_data.rb +2 -0
- 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 +14 -6
- data/lib/schematic/types/credit_event_type.rb +3 -0
- 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_ledger_entry_kind.rb +17 -0
- data/lib/schematic/types/credit_reservation_response_data.rb +2 -2
- data/lib/schematic/types/credit_spend_policy.rb +25 -0
- data/lib/schematic/types/credit_spend_policy_response_data.rb +13 -1
- data/lib/schematic/types/credit_spend_window.rb +11 -0
- data/lib/schematic/types/credit_spend_window_unit.rb +13 -0
- 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 +8 -0
- data/lib/schematic/types/entitlement_currency_prices_response_data.rb +1 -1
- data/lib/schematic/types/environment_detail_response_data.rb +2 -0
- data/lib/schematic/types/environment_response_data.rb +2 -0
- data/lib/schematic/types/estimated_plan_total.rb +13 -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/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/pending_migration_response_data.rb +6 -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_migration_response_data.rb +2 -0
- data/lib/schematic/types/plan_version_migration_strategy.rb +1 -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/rules_engine_schema_version.rb +1 -1
- data/lib/schematic/types/rulesengine_company.rb +3 -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 +25 -0
- data/lib/schematic/types/rulesengine_credit_spend_policy_scope.rb +13 -0
- data/lib/schematic/types/rulesengine_credit_spend_window.rb +11 -0
- data/lib/schematic/types/rulesengine_feature_entitlement.rb +8 -6
- data/lib/schematic/types/rulesengine_user.rb +2 -0
- 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/types/user_usage_metric.rb +12 -0
- 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 +64 -5
- data/lib/schematichq.rb +10 -0
- data/reference.md +888 -127
- metadata +71 -2
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
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Entitlements
|
|
5
|
+
module Types
|
|
6
|
+
# Input parameters
|
|
7
|
+
class GetCompanyUserUsageMetricsParams < Internal::Types::Model
|
|
8
|
+
field :company_id, -> { String }, optional: true, nullable: false
|
|
9
|
+
|
|
10
|
+
field :end_time, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :start_time, -> { String }, optional: true, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Entitlements
|
|
5
|
+
module Types
|
|
6
|
+
class GetCompanyUserUsageMetricsRequest < Internal::Types::Model
|
|
7
|
+
field :company_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :end_time, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :start_time, -> { String }, optional: true, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Entitlements
|
|
5
|
+
module Types
|
|
6
|
+
class GetCompanyUserUsageMetricsResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::CompanyUserUsageMetricsResponseData }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :params, -> { Schematic::Entitlements::Types::GetCompanyUserUsageMetricsParams }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Entitlements
|
|
5
|
+
module Types
|
|
6
|
+
# Input parameters
|
|
7
|
+
class ListCompanyUserUsageParams < Internal::Types::Model
|
|
8
|
+
field :company_id, -> { String }, optional: true, nullable: false
|
|
9
|
+
|
|
10
|
+
field :end_time, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :feature_id, -> { String }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
15
|
+
|
|
16
|
+
field :metric, -> { Schematic::Types::UserUsageMetric }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
19
|
+
|
|
20
|
+
field :start_time, -> { String }, optional: true, nullable: false
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Entitlements
|
|
5
|
+
module Types
|
|
6
|
+
class ListCompanyUserUsageRequest < Internal::Types::Model
|
|
7
|
+
field :company_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :end_time, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :feature_id, -> { String }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :metric, -> { Schematic::Types::UserUsageMetric }, optional: false, nullable: false
|
|
14
|
+
|
|
15
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
16
|
+
|
|
17
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
18
|
+
|
|
19
|
+
field :start_time, -> { String }, optional: true, nullable: false
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Entitlements
|
|
5
|
+
module Types
|
|
6
|
+
class ListCompanyUserUsageResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::CompanyUserUsageResponseData }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :params, -> { Schematic::Entitlements::Types::ListCompanyUserUsageParams }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -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]
|
|
@@ -43,7 +43,15 @@ module Schematic
|
|
|
43
43
|
(response.body.to_s.empty? ? nil : Schematic::Events::Types::CreateEventBatchResponse.load(response.body))
|
|
44
44
|
else
|
|
45
45
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
46
|
-
|
|
46
|
+
error_types = {
|
|
47
|
+
400 => Schematic::Types::ApiError,
|
|
48
|
+
401 => Schematic::Types::ApiError,
|
|
49
|
+
403 => Schematic::Types::ApiError,
|
|
50
|
+
404 => Schematic::Types::ApiError,
|
|
51
|
+
500 => Schematic::Types::ApiError
|
|
52
|
+
}
|
|
53
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
54
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
47
55
|
end
|
|
48
56
|
end
|
|
49
57
|
|
|
@@ -93,7 +101,15 @@ module Schematic
|
|
|
93
101
|
(response.body.to_s.empty? ? nil : Schematic::Events::Types::GetEventSummariesResponse.load(response.body))
|
|
94
102
|
else
|
|
95
103
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
96
|
-
|
|
104
|
+
error_types = {
|
|
105
|
+
400 => Schematic::Types::ApiError,
|
|
106
|
+
401 => Schematic::Types::ApiError,
|
|
107
|
+
403 => Schematic::Types::ApiError,
|
|
108
|
+
404 => Schematic::Types::ApiError,
|
|
109
|
+
500 => Schematic::Types::ApiError
|
|
110
|
+
}
|
|
111
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
112
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
97
113
|
end
|
|
98
114
|
end
|
|
99
115
|
|
|
@@ -155,7 +171,15 @@ module Schematic
|
|
|
155
171
|
(response.body.to_s.empty? ? nil : Schematic::Events::Types::ListEventsResponse.load(response.body))
|
|
156
172
|
else
|
|
157
173
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
158
|
-
|
|
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)
|
|
159
183
|
end
|
|
160
184
|
end
|
|
161
185
|
|
|
@@ -190,7 +214,15 @@ module Schematic
|
|
|
190
214
|
(response.body.to_s.empty? ? nil : Schematic::Events::Types::CreateEventResponse.load(response.body))
|
|
191
215
|
else
|
|
192
216
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
193
|
-
|
|
217
|
+
error_types = {
|
|
218
|
+
400 => Schematic::Types::ApiError,
|
|
219
|
+
401 => Schematic::Types::ApiError,
|
|
220
|
+
403 => Schematic::Types::ApiError,
|
|
221
|
+
404 => Schematic::Types::ApiError,
|
|
222
|
+
500 => Schematic::Types::ApiError
|
|
223
|
+
}
|
|
224
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
225
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
194
226
|
end
|
|
195
227
|
end
|
|
196
228
|
|
|
@@ -225,7 +257,14 @@ module Schematic
|
|
|
225
257
|
(response.body.to_s.empty? ? nil : Schematic::Events::Types::GetEventResponse.load(response.body))
|
|
226
258
|
else
|
|
227
259
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
228
|
-
|
|
260
|
+
error_types = {
|
|
261
|
+
401 => Schematic::Types::ApiError,
|
|
262
|
+
403 => Schematic::Types::ApiError,
|
|
263
|
+
404 => Schematic::Types::ApiError,
|
|
264
|
+
500 => Schematic::Types::ApiError
|
|
265
|
+
}
|
|
266
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
267
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
229
268
|
end
|
|
230
269
|
end
|
|
231
270
|
|
|
@@ -258,7 +297,14 @@ module Schematic
|
|
|
258
297
|
(response.body.to_s.empty? ? nil : Schematic::Events::Types::GetOtlpEnvironmentSettingsResponse.load(response.body))
|
|
259
298
|
else
|
|
260
299
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
261
|
-
|
|
300
|
+
error_types = {
|
|
301
|
+
401 => Schematic::Types::ApiError,
|
|
302
|
+
403 => Schematic::Types::ApiError,
|
|
303
|
+
404 => Schematic::Types::ApiError,
|
|
304
|
+
500 => Schematic::Types::ApiError
|
|
305
|
+
}
|
|
306
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
307
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
262
308
|
end
|
|
263
309
|
end
|
|
264
310
|
|
|
@@ -293,7 +339,15 @@ module Schematic
|
|
|
293
339
|
(response.body.to_s.empty? ? nil : Schematic::Events::Types::UpsertOtlpEnvironmentSettingsResponse.load(response.body))
|
|
294
340
|
else
|
|
295
341
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
296
|
-
|
|
342
|
+
error_types = {
|
|
343
|
+
400 => Schematic::Types::ApiError,
|
|
344
|
+
401 => Schematic::Types::ApiError,
|
|
345
|
+
403 => Schematic::Types::ApiError,
|
|
346
|
+
404 => Schematic::Types::ApiError,
|
|
347
|
+
500 => Schematic::Types::ApiError
|
|
348
|
+
}
|
|
349
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
350
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
297
351
|
end
|
|
298
352
|
end
|
|
299
353
|
|
|
@@ -326,7 +380,15 @@ module Schematic
|
|
|
326
380
|
(response.body.to_s.empty? ? nil : Schematic::Events::Types::DeleteOtlpEnvironmentSettingsResponse.load(response.body))
|
|
327
381
|
else
|
|
328
382
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
329
|
-
|
|
383
|
+
error_types = {
|
|
384
|
+
400 => Schematic::Types::ApiError,
|
|
385
|
+
401 => Schematic::Types::ApiError,
|
|
386
|
+
403 => Schematic::Types::ApiError,
|
|
387
|
+
404 => Schematic::Types::ApiError,
|
|
388
|
+
500 => Schematic::Types::ApiError
|
|
389
|
+
}
|
|
390
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
391
|
+
raise error_class.new(response.body, code: code, body: error_body)
|
|
330
392
|
end
|
|
331
393
|
end
|
|
332
394
|
|
|
@@ -359,7 +421,14 @@ module Schematic
|
|
|
359
421
|
(response.body.to_s.empty? ? nil : Schematic::Events::Types::GetSegmentIntegrationStatusResponse.load(response.body))
|
|
360
422
|
else
|
|
361
423
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
362
|
-
|
|
424
|
+
error_types = {
|
|
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)
|
|
363
432
|
end
|
|
364
433
|
end
|
|
365
434
|
end
|