diff --git a/.fern/metadata.json b/.fern/metadata.json index 4c7c2f4..f99320b 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -13,6 +13,6 @@ "webrick": ">= 1.0" } }, - "originGitCommit": "19cafdf92ab056ef6ba803bf1e352b0422a8ec45", - "sdkVersion": "1.4.9" + "originGitCommit": "75191b40ce7af084ca4fb11f623ab59c57cf97e3", + "sdkVersion": "1.4.10" } \ No newline at end of file diff --git a/.fern/replay.lock b/.fern/replay.lock index 3110136..a0294a7 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -36,5 +36,347 @@ generations: cli_version: unknown generator_versions: fernapi/fern-ruby-sdk: 1.1.13 -current_generation: c93862aca1a52c6c033c908ebab873ca9ef6e401 -patches: [] + - commit_sha: dfe70dc9f1f1787aa5b55f6802739898633c35c7 + tree_hash: 114498346f315168be50ca9bf5c9f463bcfe3303 + timestamp: 2026-07-22T19:30:43.525Z + cli_version: unknown + generator_versions: + fernapi/fern-ruby-sdk: 1.1.13 +current_generation: dfe70dc9f1f1787aa5b55f6802739898633c35c7 +patches: + - id: patch-5da692c2 + content_hash: sha256:e652287219a0a709e16112ced444e6472c6fa8bdfe888edf868caaf9769a9472 + original_commit: 5da692c20aef08577d900f9a860b5f78a549418e + original_message: inject host time into datastream wasm rules engine (SCHY-471) + original_author: Christopher Brady + base_generation: dfe70dc9f1f1787aa5b55f6802739898633c35c7 + files: + - test/rules_engine_clock_test.rb + patch_content: | + diff --git a/test/rules_engine_clock_test.rb b/test/rules_engine_clock_test.rb + new file mode 100644 + index 0000000..8711b5e + --- /dev/null + +++ b/test/rules_engine_clock_test.rb + @@ -0,0 +1,75 @@ + +# frozen_string_literal: true + + + +require_relative "test_helper" + +require "minitest/autorun" + + + +# Regression for SCHY-471. + +# + +# A company-override entitlement rule whose metric condition uses a + +# calendar/billing metric period drives the engine into the metric-period-reset + +# code path, which needs a wall clock. On the raw wasm32-unknown-unknown build + +# that path used to trap (+wasm unreachable+); the flag then wrongly fell back to + +# its default value for a company that is legitimately entitled. The host now + +# injects the current time via +setCurrentTimeMillis+ so this evaluates cleanly. + +class RulesEngineClockTest < Minitest::Test + + def setup + + @engine = Schematic::RulesEngine.new + + @engine.initialize! + + # The wasm binary is fetched via scripts/download-wasm.sh and may be absent + + # (or the wasmtime gem missing) in some environments — skip rather than fail. + + skip "WASM rules engine unavailable (wasm binary or wasmtime gem missing)" unless @engine.initialized? + + end + + + + def flag + + { + + "id" => "flag1", "key" => "mcp-access", "account_id" => "acc_1", + + "environment_id" => "env_1", "default_value" => false, "rules" => [] + + } + + end + + + + # Usage 40 < allocation 100, so the override grants the feature. + + def entitled_company + + { + + "id" => "co_entitled", "account_id" => "acc_1", "environment_id" => "env_1", + + "keys" => { "id" => "co_entitled" }, + + "metrics" => [{ + + "account_id" => "acc_1", "environment_id" => "env_1", "company_id" => "co_entitled", + + "event_subtype" => "api-calls", "period" => "current_month", + + "month_reset" => "billing_cycle", "value" => 40, "created_at" => "2023-01-01T00:00:00Z" + + }], + + "rules" => [{ + + "id" => "rule_override", "flag_id" => "flag1", "account_id" => "acc_1", + + "environment_id" => "env_1", "name" => "Company Override", + + "rule_type" => "company_override", "priority" => 0, "value" => true, + + "condition_groups" => [], + + "conditions" => [ + + { + + "id" => "cond_company", "account_id" => "acc_1", "environment_id" => "env_1", + + "condition_type" => "company", "operator" => "eq", + + "resource_ids" => ["co_entitled"], "trait_value" => "" + + }, + + { + + "id" => "cond_metric", "account_id" => "acc_1", "environment_id" => "env_1", + + "condition_type" => "metric", "operator" => "lt", "event_subtype" => "api-calls", + + "metric_value" => 100, "metric_period" => "current_month", + + "metric_period_month_reset" => "billing_cycle", "trait_value" => "100" + + } + + ] + + }] + + } + + end + + + + def test_billing_metric_override_evaluates_without_trapping + + result = @engine.check_flag(flag, entitled_company) + + + + assert result[:value], "company override should grant the flag, not fall back to default false" + + assert_match(/override/i, result[:reason].to_s) + + end + + + + def test_billing_metric_override_populates_reset_at + + result = @engine.check_flag(flag, entitled_company) + + + + refute_nil result[:feature_usage_reset_at], + + "reset-at should be computed from the injected host time" + + end + +end + theirs_snapshot: + test/rules_engine_clock_test.rb: | + # frozen_string_literal: true + + require_relative "test_helper" + require "minitest/autorun" + + # Regression for SCHY-471. + # + # A company-override entitlement rule whose metric condition uses a + # calendar/billing metric period drives the engine into the metric-period-reset + # code path, which needs a wall clock. On the raw wasm32-unknown-unknown build + # that path used to trap (+wasm unreachable+); the flag then wrongly fell back to + # its default value for a company that is legitimately entitled. The host now + # injects the current time via +setCurrentTimeMillis+ so this evaluates cleanly. + class RulesEngineClockTest < Minitest::Test + def setup + @engine = Schematic::RulesEngine.new + @engine.initialize! + # The wasm binary is fetched via scripts/download-wasm.sh and may be absent + # (or the wasmtime gem missing) in some environments — skip rather than fail. + skip "WASM rules engine unavailable (wasm binary or wasmtime gem missing)" unless @engine.initialized? + end + + def flag + { + "id" => "flag1", "key" => "mcp-access", "account_id" => "acc_1", + "environment_id" => "env_1", "default_value" => false, "rules" => [] + } + end + + # Usage 40 < allocation 100, so the override grants the feature. + def entitled_company + { + "id" => "co_entitled", "account_id" => "acc_1", "environment_id" => "env_1", + "keys" => { "id" => "co_entitled" }, + "metrics" => [{ + "account_id" => "acc_1", "environment_id" => "env_1", "company_id" => "co_entitled", + "event_subtype" => "api-calls", "period" => "current_month", + "month_reset" => "billing_cycle", "value" => 40, "created_at" => "2023-01-01T00:00:00Z" + }], + "rules" => [{ + "id" => "rule_override", "flag_id" => "flag1", "account_id" => "acc_1", + "environment_id" => "env_1", "name" => "Company Override", + "rule_type" => "company_override", "priority" => 0, "value" => true, + "condition_groups" => [], + "conditions" => [ + { + "id" => "cond_company", "account_id" => "acc_1", "environment_id" => "env_1", + "condition_type" => "company", "operator" => "eq", + "resource_ids" => ["co_entitled"], "trait_value" => "" + }, + { + "id" => "cond_metric", "account_id" => "acc_1", "environment_id" => "env_1", + "condition_type" => "metric", "operator" => "lt", "event_subtype" => "api-calls", + "metric_value" => 100, "metric_period" => "current_month", + "metric_period_month_reset" => "billing_cycle", "trait_value" => "100" + } + ] + }] + } + end + + def test_billing_metric_override_evaluates_without_trapping + result = @engine.check_flag(flag, entitled_company) + + assert result[:value], "company override should grant the flag, not fall back to default false" + assert_match(/override/i, result[:reason].to_s) + end + + def test_billing_metric_override_populates_reset_at + result = @engine.check_flag(flag, entitled_company) + + refute_nil result[:feature_usage_reset_at], + "reset-at should be computed from the injected host time" + end + end + user_owned: true + - id: patch-ee61788c + content_hash: sha256:e652287219a0a709e16112ced444e6472c6fa8bdfe888edf868caaf9769a9472 + original_commit: ee61788c5a83fce5dd5768b2536391459550d176 + original_message: fix rubocop offenses in clock regression test (SCHY-471) + original_author: Christopher Brady + base_generation: dfe70dc9f1f1787aa5b55f6802739898633c35c7 + files: + - test/rules_engine_clock_test.rb + patch_content: | + diff --git a/test/rules_engine_clock_test.rb b/test/rules_engine_clock_test.rb + new file mode 100644 + index 0000000..8711b5e + --- /dev/null + +++ b/test/rules_engine_clock_test.rb + @@ -0,0 +1,75 @@ + +# frozen_string_literal: true + + + +require_relative "test_helper" + +require "minitest/autorun" + + + +# Regression for SCHY-471. + +# + +# A company-override entitlement rule whose metric condition uses a + +# calendar/billing metric period drives the engine into the metric-period-reset + +# code path, which needs a wall clock. On the raw wasm32-unknown-unknown build + +# that path used to trap (+wasm unreachable+); the flag then wrongly fell back to + +# its default value for a company that is legitimately entitled. The host now + +# injects the current time via +setCurrentTimeMillis+ so this evaluates cleanly. + +class RulesEngineClockTest < Minitest::Test + + def setup + + @engine = Schematic::RulesEngine.new + + @engine.initialize! + + # The wasm binary is fetched via scripts/download-wasm.sh and may be absent + + # (or the wasmtime gem missing) in some environments — skip rather than fail. + + skip "WASM rules engine unavailable (wasm binary or wasmtime gem missing)" unless @engine.initialized? + + end + + + + def flag + + { + + "id" => "flag1", "key" => "mcp-access", "account_id" => "acc_1", + + "environment_id" => "env_1", "default_value" => false, "rules" => [] + + } + + end + + + + # Usage 40 < allocation 100, so the override grants the feature. + + def entitled_company + + { + + "id" => "co_entitled", "account_id" => "acc_1", "environment_id" => "env_1", + + "keys" => { "id" => "co_entitled" }, + + "metrics" => [{ + + "account_id" => "acc_1", "environment_id" => "env_1", "company_id" => "co_entitled", + + "event_subtype" => "api-calls", "period" => "current_month", + + "month_reset" => "billing_cycle", "value" => 40, "created_at" => "2023-01-01T00:00:00Z" + + }], + + "rules" => [{ + + "id" => "rule_override", "flag_id" => "flag1", "account_id" => "acc_1", + + "environment_id" => "env_1", "name" => "Company Override", + + "rule_type" => "company_override", "priority" => 0, "value" => true, + + "condition_groups" => [], + + "conditions" => [ + + { + + "id" => "cond_company", "account_id" => "acc_1", "environment_id" => "env_1", + + "condition_type" => "company", "operator" => "eq", + + "resource_ids" => ["co_entitled"], "trait_value" => "" + + }, + + { + + "id" => "cond_metric", "account_id" => "acc_1", "environment_id" => "env_1", + + "condition_type" => "metric", "operator" => "lt", "event_subtype" => "api-calls", + + "metric_value" => 100, "metric_period" => "current_month", + + "metric_period_month_reset" => "billing_cycle", "trait_value" => "100" + + } + + ] + + }] + + } + + end + + + + def test_billing_metric_override_evaluates_without_trapping + + result = @engine.check_flag(flag, entitled_company) + + + + assert result[:value], "company override should grant the flag, not fall back to default false" + + assert_match(/override/i, result[:reason].to_s) + + end + + + + def test_billing_metric_override_populates_reset_at + + result = @engine.check_flag(flag, entitled_company) + + + + refute_nil result[:feature_usage_reset_at], + + "reset-at should be computed from the injected host time" + + end + +end + theirs_snapshot: + test/rules_engine_clock_test.rb: | + # frozen_string_literal: true + + require_relative "test_helper" + require "minitest/autorun" + + # Regression for SCHY-471. + # + # A company-override entitlement rule whose metric condition uses a + # calendar/billing metric period drives the engine into the metric-period-reset + # code path, which needs a wall clock. On the raw wasm32-unknown-unknown build + # that path used to trap (+wasm unreachable+); the flag then wrongly fell back to + # its default value for a company that is legitimately entitled. The host now + # injects the current time via +setCurrentTimeMillis+ so this evaluates cleanly. + class RulesEngineClockTest < Minitest::Test + def setup + @engine = Schematic::RulesEngine.new + @engine.initialize! + # The wasm binary is fetched via scripts/download-wasm.sh and may be absent + # (or the wasmtime gem missing) in some environments — skip rather than fail. + skip "WASM rules engine unavailable (wasm binary or wasmtime gem missing)" unless @engine.initialized? + end + + def flag + { + "id" => "flag1", "key" => "mcp-access", "account_id" => "acc_1", + "environment_id" => "env_1", "default_value" => false, "rules" => [] + } + end + + # Usage 40 < allocation 100, so the override grants the feature. + def entitled_company + { + "id" => "co_entitled", "account_id" => "acc_1", "environment_id" => "env_1", + "keys" => { "id" => "co_entitled" }, + "metrics" => [{ + "account_id" => "acc_1", "environment_id" => "env_1", "company_id" => "co_entitled", + "event_subtype" => "api-calls", "period" => "current_month", + "month_reset" => "billing_cycle", "value" => 40, "created_at" => "2023-01-01T00:00:00Z" + }], + "rules" => [{ + "id" => "rule_override", "flag_id" => "flag1", "account_id" => "acc_1", + "environment_id" => "env_1", "name" => "Company Override", + "rule_type" => "company_override", "priority" => 0, "value" => true, + "condition_groups" => [], + "conditions" => [ + { + "id" => "cond_company", "account_id" => "acc_1", "environment_id" => "env_1", + "condition_type" => "company", "operator" => "eq", + "resource_ids" => ["co_entitled"], "trait_value" => "" + }, + { + "id" => "cond_metric", "account_id" => "acc_1", "environment_id" => "env_1", + "condition_type" => "metric", "operator" => "lt", "event_subtype" => "api-calls", + "metric_value" => 100, "metric_period" => "current_month", + "metric_period_month_reset" => "billing_cycle", "trait_value" => "100" + } + ] + }] + } + end + + def test_billing_metric_override_evaluates_without_trapping + result = @engine.check_flag(flag, entitled_company) + + assert result[:value], "company override should grant the flag, not fall back to default false" + assert_match(/override/i, result[:reason].to_s) + end + + def test_billing_metric_override_populates_reset_at + result = @engine.check_flag(flag, entitled_company) + + refute_nil result[:feature_usage_reset_at], + "reset-at should be computed from the injected host time" + end + end + user_owned: true diff --git a/Gemfile.lock b/Gemfile.lock index c8e275a..11a70e0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - schematichq (1.4.9) + schematichq (1.4.10) wasmtime (>= 19.0) websocket (>= 1.2) @@ -26,7 +26,7 @@ GEM minitest-rg (5.4.0) minitest (>= 5.0, < 7) parallel (2.1.0) - parser (3.3.11.1) + parser (3.3.12.0) ast (~> 2.4.1) racc prism (1.9.0) @@ -56,7 +56,7 @@ GEM rubocop-ast (1.50.0) parser (>= 3.3.7.2) prism (~> 1.7) - rubocop-minitest (0.39.1) + rubocop-minitest (0.40.0) lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.38.0, < 2.0) diff --git a/lib/schematic.rb b/lib/schematic.rb index cdfcd3d..b12c4ac 100644 --- a/lib/schematic.rb +++ b/lib/schematic.rb @@ -208,27 +208,76 @@ require_relative "schematic/credits/types/list_credit_event_ledger_response" require_relative "schematic/credits/types/count_credit_event_ledger_params" require_relative "schematic/credits/types/count_credit_event_ledger_response" +require_relative "schematic/catalogs/types/list_catalogs_params" +require_relative "schematic/types/catalog_response_data" +require_relative "schematic/catalogs/types/list_catalogs_response" +require_relative "schematic/catalogs/types/create_catalog_response" +require_relative "schematic/catalogs/types/get_catalog_response" +require_relative "schematic/catalogs/types/update_catalog_response" +require_relative "schematic/catalogs/types/delete_catalog_response" +require_relative "schematic/types/billing_linked_resource_response_data" +require_relative "schematic/types/billing_strategy" +require_relative "schematic/types/catalog_config_ordered_bundle_response_data" +require_relative "schematic/types/catalog_config_ordered_entitlement_response_data" +require_relative "schematic/types/catalog_config_ordered_plan_response_data" +require_relative "schematic/types/charge_type" +require_relative "schematic/types/comparable_operator" +require_relative "schematic/types/condition_type" +require_relative "schematic/types/custom_plan_view_config_response_data" +require_relative "schematic/types/entitlement_currency_prices_response_data" +require_relative "schematic/types/entitlement_price_behavior" +require_relative "schematic/types/entitlement_value_type" +require_relative "schematic/types/entity_type" +require_relative "schematic/types/trait_type" +require_relative "schematic/types/entity_trait_definition_response_data" +require_relative "schematic/types/event_summary_response_data" +require_relative "schematic/types/feature_lifecycle_phase" +require_relative "schematic/types/feature_type" +require_relative "schematic/types/feature_response_data" +require_relative "schematic/types/flag_type" +require_relative "schematic/types/metric_period" +require_relative "schematic/types/metric_period_month_reset" +require_relative "schematic/types/rule_condition_detail_response_data" +require_relative "schematic/types/rule_condition_group_detail_response_data" +require_relative "schematic/types/rule_type" +require_relative "schematic/types/rule_detail_response_data" +require_relative "schematic/types/flag_in_plan_response_data" +require_relative "schematic/types/preview_object" +require_relative "schematic/types/feature_in_plan_response_data" +require_relative "schematic/types/plan_catalog_membership_response_data" +require_relative "schematic/types/plan_currency_prices_response_data" +require_relative "schematic/types/plan_icon" +require_relative "schematic/types/plan_type" +require_relative "schematic/types/plan_response_data" +require_relative "schematic/types/warning_tier_response_data" +require_relative "schematic/types/plan_entitlement_response_data" +require_relative "schematic/types/plan_price_cadence" +require_relative "schematic/types/plan_version_status" +require_relative "schematic/types/plan_version_response_data" +require_relative "schematic/types/plan_group_plan_detail_response_data" +require_relative "schematic/types/catalog_configuration_response_data" +require_relative "schematic/catalogs/types/get_configuration_response" +require_relative "schematic/catalogs/types/update_configuration_response" +require_relative "schematic/types/catalog_credit_bundle_i_ds_response_data" +require_relative "schematic/catalogs/types/get_credit_bundles_in_catalog_response" +require_relative "schematic/types/catalog_derived_feature_response_data" +require_relative "schematic/types/catalog_derived_features_response_data" +require_relative "schematic/catalogs/types/get_derived_features_response" +require_relative "schematic/types/catalog_plan_i_ds_response_data" +require_relative "schematic/catalogs/types/get_plans_in_catalog_response" require_relative "schematic/types/checkout_subscription" require_relative "schematic/checkout/types/checkout_internal_response" require_relative "schematic/types/billing_credit_ledger_authority" require_relative "schematic/types/credit_currency_price" require_relative "schematic/types/billing_credit_view" -require_relative "schematic/types/billing_linked_resource_response_data" require_relative "schematic/types/billing_product_for_subscription_response_data" -require_relative "schematic/types/billing_strategy" require_relative "schematic/types/billing_subscription_discount_view" require_relative "schematic/types/billing_subscription_view" -require_relative "schematic/types/charge_type" require_relative "schematic/types/checkout_field_with_value" -require_relative "schematic/types/metric_period" -require_relative "schematic/types/metric_period_month_reset" require_relative "schematic/types/company_event_period_metrics_response_data" require_relative "schematic/types/generic_preview_object" require_relative "schematic/types/company_plan_credit_grant_view" require_relative "schematic/types/company_plan_with_billing_sub_view" -require_relative "schematic/types/comparable_operator" -require_relative "schematic/types/condition_type" -require_relative "schematic/types/entity_type" require_relative "schematic/types/trait_definition_comparable_type" require_relative "schematic/types/trait_definition" require_relative "schematic/types/condition" @@ -236,55 +285,37 @@ require_relative "schematic/types/custom_plan_activation_strategy" require_relative "schematic/types/custom_plan_billing_status" require_relative "schematic/types/custom_plan_billing_response_data" -require_relative "schematic/types/entitlement_value_type" require_relative "schematic/types/entity_key_definition_response_data" require_relative "schematic/types/entity_key_detail_response_data" -require_relative "schematic/types/trait_type" -require_relative "schematic/types/entity_trait_definition_response_data" require_relative "schematic/types/entity_trait_detail_response_data" +require_relative "schematic/types/warning_tier" require_relative "schematic/types/feature_entitlement" -require_relative "schematic/types/rule_type" require_relative "schematic/types/rule" require_relative "schematic/types/scheduled_downgrade_response_data" require_relative "schematic/types/company_detail_response_data" require_relative "schematic/types/company_override_note_response_data" -require_relative "schematic/types/feature_lifecycle_phase" -require_relative "schematic/types/feature_type" -require_relative "schematic/types/feature_response_data" require_relative "schematic/types/company_override_response_data" require_relative "schematic/types/company_subscription_response_data" require_relative "schematic/types/credit_bundle_purchase_response_data" require_relative "schematic/types/credit_grant_detail" require_relative "schematic/types/credit_usage_aggregation" -require_relative "schematic/types/entitlement_currency_prices_response_data" -require_relative "schematic/types/entitlement_price_behavior" require_relative "schematic/types/entitlement_type" -require_relative "schematic/types/event_summary_response_data" -require_relative "schematic/types/flag_type" -require_relative "schematic/types/rule_condition_detail_response_data" -require_relative "schematic/types/rule_condition_group_detail_response_data" -require_relative "schematic/types/rule_detail_response_data" -require_relative "schematic/types/flag_in_plan_response_data" -require_relative "schematic/types/preview_object" -require_relative "schematic/types/feature_in_plan_response_data" -require_relative "schematic/types/plan_icon" -require_relative "schematic/types/plan_type" -require_relative "schematic/types/plan_response_data" -require_relative "schematic/types/warning_tier_response_data" -require_relative "schematic/types/plan_entitlement_response_data" require_relative "schematic/types/feature_usage_response_data" require_relative "schematic/types/feature_usage_detail_response_data" -require_relative "schematic/types/plan_currency_prices_response_data" -require_relative "schematic/types/plan_version_status" -require_relative "schematic/types/plan_version_response_data" require_relative "schematic/types/plan_detail_response_data" require_relative "schematic/types/usage_based_entitlement_response_data" require_relative "schematic/types/checkout_data_response_data" require_relative "schematic/checkout/types/get_checkout_data_response" +require_relative "schematic/types/preview_subscription_discount_response_data" require_relative "schematic/types/preview_subscription_upcoming_invoice_line_items" require_relative "schematic/types/preview_subscription_finance_response_data" require_relative "schematic/types/preview_subscription_change_response_data" require_relative "schematic/checkout/types/preview_checkout_internal_response" +require_relative "schematic/types/company_billing_address_view" +require_relative "schematic/types/company_billing_checkout_settings" +require_relative "schematic/types/company_billing_details_response_data" +require_relative "schematic/checkout/types/get_company_billing_details_response" +require_relative "schematic/checkout/types/update_company_billing_details_response" require_relative "schematic/types/manage_plan_response_response_data" require_relative "schematic/checkout/types/manage_plan_response" require_relative "schematic/types/manage_plan_preview_response_response_data" @@ -449,6 +480,7 @@ require_relative "schematic/components/types/get_component_response" require_relative "schematic/components/types/update_component_response" require_relative "schematic/components/types/delete_component_response" +require_relative "schematic/components/types/bind_catalog_response" require_relative "schematic/components/types/count_components_params" require_relative "schematic/components/types/count_components_response" require_relative "schematic/components/types/preview_component_data_params" @@ -458,7 +490,6 @@ require_relative "schematic/types/company_plan_invalid_reason" require_relative "schematic/types/custom_plan_config" require_relative "schematic/types/plan_credit_grant_view" -require_relative "schematic/types/plan_price_cadence" require_relative "schematic/types/company_plan_detail_response_data" require_relative "schematic/types/compatible_plans" require_relative "schematic/types/component_capabilities" @@ -473,11 +504,17 @@ require_relative "schematic/planbundle/types/create_custom_plan_bundle_response" require_relative "schematic/planbundle/types/create_plan_bundle_response" require_relative "schematic/planbundle/types/update_plan_bundle_response" -require_relative "schematic/types/data_export_output_file_type" require_relative "schematic/types/data_export_status" require_relative "schematic/types/data_export_type" +require_relative "schematic/dataexports/types/list_data_exports_params" +require_relative "schematic/types/audit_log_export_metadata" +require_relative "schematic/types/company_feature_usage_export_metadata" +require_relative "schematic/types/data_export_metadata" +require_relative "schematic/types/data_export_output_file_type" require_relative "schematic/types/data_export_response_data" +require_relative "schematic/dataexports/types/list_data_exports_response" require_relative "schematic/dataexports/types/create_data_export_response" +require_relative "schematic/dataexports/types/get_data_export_response" require_relative "schematic/types/raw_event_response_data" require_relative "schematic/types/raw_event_batch_response_data" require_relative "schematic/events/types/create_event_batch_response" @@ -571,10 +608,8 @@ require_relative "schematic/types/checkout_field_response_data" require_relative "schematic/types/checkout_settings_response_data" require_relative "schematic/types/component_settings_response_data" -require_relative "schematic/types/custom_plan_view_config_response_data" require_relative "schematic/types/plan_entitlements_order" require_relative "schematic/types/plan_group_bundle_order" -require_relative "schematic/types/plan_group_plan_detail_response_data" require_relative "schematic/types/plan_group_plan_entitlements_order" require_relative "schematic/types/plan_group_detail_response_data" require_relative "schematic/plangroups/types/get_plan_group_response" @@ -642,6 +677,9 @@ require_relative "schematic/types/billing_subscription_discount" require_relative "schematic/types/capture_raw_event" require_relative "schematic/types/capture_raw_event_batch" +require_relative "schematic/types/catalog_config_ordered_bundle" +require_relative "schematic/types/catalog_config_ordered_entitlement" +require_relative "schematic/types/catalog_config_ordered_plan" require_relative "schematic/types/checkout_field_value" require_relative "schematic/types/update_add_on_request_body" require_relative "schematic/types/update_auto_topup_override_request_body" @@ -651,6 +689,7 @@ require_relative "schematic/types/change_subscription_request_body" require_relative "schematic/types/check_flag_request_body" require_relative "schematic/types/checkout_field_input" +require_relative "schematic/types/company_billing_details_view" require_relative "schematic/types/company_membership_response_data" require_relative "schematic/types/component_hydrate_response_data" require_relative "schematic/types/condition_group_response_data" @@ -664,6 +703,7 @@ require_relative "schematic/types/create_custom_plan_bundle_plan_request_body" require_relative "schematic/types/create_price_tier_request_body" require_relative "schematic/types/currency_price_request_body" +require_relative "schematic/types/warning_tier_request_body" require_relative "schematic/types/create_entitlement_in_bundle_request_body" require_relative "schematic/types/create_entitlement_req_common" require_relative "schematic/types/event_body_flag_check" @@ -686,6 +726,11 @@ require_relative "schematic/types/credits_auto_topup_credit_summary" require_relative "schematic/types/credits_auto_topup_hard_failure" require_relative "schematic/types/credits_auto_topup_retry_failure" +require_relative "schematic/types/credits_auto_topup_success" +require_relative "schematic/types/credits_webhook_company_summary" +require_relative "schematic/types/credits_webhook_credit_summary" +require_relative "schematic/types/credits_credit_purchase_success" +require_relative "schematic/types/customer_billing_address" require_relative "schematic/types/data_event_payload" require_relative "schematic/types/delete_billing_plan_credit_grant_request_body" require_relative "schematic/types/entity_key_response_data" @@ -717,6 +762,7 @@ require_relative "schematic/types/rulesengine_entitlement_value_type" require_relative "schematic/types/rulesengine_metric_period" require_relative "schematic/types/rulesengine_metric_period_month_reset" +require_relative "schematic/types/rulesengine_warning_tier" require_relative "schematic/types/rulesengine_feature_entitlement" require_relative "schematic/types/rulesengine_rule_type" require_relative "schematic/types/rulesengine_check_flag_result" @@ -745,7 +791,6 @@ require_relative "schematic/types/upsert_user_request_body" require_relative "schematic/types/upsert_user_sub_request_body" require_relative "schematic/types/usage_based_entitlement_request_body" -require_relative "schematic/types/warning_tier_request_body" require_relative "schematic/types/web_feature_usage_webhook_output" require_relative "schematic/types/web_scheduled_downgrade_webhook_output" require_relative "schematic/types/webhook_event_response_data" @@ -805,8 +850,14 @@ require_relative "schematic/credits/types/count_billing_plan_credit_grants_request" require_relative "schematic/credits/types/list_credit_event_ledger_request" require_relative "schematic/credits/types/count_credit_event_ledger_request" +require_relative "schematic/catalogs/client" +require_relative "schematic/catalogs/types/list_catalogs_request" +require_relative "schematic/catalogs/types/create_catalog_request_body" +require_relative "schematic/catalogs/types/update_catalog_request_body" +require_relative "schematic/catalogs/types/update_catalog_configuration_request_body" require_relative "schematic/checkout/client" require_relative "schematic/checkout/types/checkout_data_request_body" +require_relative "schematic/checkout/types/update_company_billing_details_request_body" require_relative "schematic/checkout/types/cancel_subscription_request" require_relative "schematic/checkout/types/update_trial_end_request_body" require_relative "schematic/companies/client" @@ -870,6 +921,7 @@ require_relative "schematic/components/types/list_components_request" require_relative "schematic/components/types/create_component_request_body" require_relative "schematic/components/types/update_component_request_body" +require_relative "schematic/components/types/bind_catalog_request_body" require_relative "schematic/components/types/count_components_request" require_relative "schematic/components/types/preview_component_data_request" require_relative "schematic/planbundle/client" @@ -877,6 +929,7 @@ require_relative "schematic/planbundle/types/create_plan_bundle_request_body" require_relative "schematic/planbundle/types/update_plan_bundle_request_body" require_relative "schematic/dataexports/client" +require_relative "schematic/dataexports/types/list_data_exports_request" require_relative "schematic/dataexports/types/create_data_export_request_body" require_relative "schematic/events/client" require_relative "schematic/events/types/create_event_batch_request_body" diff --git a/lib/schematic/catalogs/client.rb b/lib/schematic/catalogs/client.rb new file mode 100644 index 0000000..c1fa475 --- /dev/null +++ b/lib/schematic/catalogs/client.rb @@ -0,0 +1,480 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + class Client + # @param client [Schematic::Internal::Http::RawClient] + # + # @return [void] + def initialize(client:) + @client = client + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [Boolean, nil] :is_default + # @option params [String, nil] :q + # @option params [Integer, nil] :limit + # @option params [Integer, nil] :offset + # + # @return [Schematic::Catalogs::Types::ListCatalogsResponse] + def list_catalogs(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + query_param_names = %i[is_default q limit offset] + query_params = {} + query_params["is_default"] = params[:is_default] if params.key?(:is_default) + query_params["q"] = params[:q] if params.key?(:q) + query_params["limit"] = params[:limit] if params.key?(:limit) + query_params["offset"] = params[:offset] if params.key?(:offset) + params.except(*query_param_names) + + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "catalogs", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::ListCatalogsResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Schematic::Catalogs::Types::CreateCatalogRequestBody] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @return [Schematic::Catalogs::Types::CreateCatalogResponse] + def create_catalog(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "catalogs", + body: Schematic::Catalogs::Types::CreateCatalogRequestBody.new(params).to_h, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::CreateCatalogResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # + # @return [Schematic::Catalogs::Types::GetCatalogResponse] + def get_catalog(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::GetCatalogResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Schematic::Catalogs::Types::UpdateCatalogRequestBody] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # + # @return [Schematic::Catalogs::Types::UpdateCatalogResponse] + def update_catalog(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request_data = Schematic::Catalogs::Types::UpdateCatalogRequestBody.new(params).to_h + non_body_param_names = ["catalog_id"] + body = request_data.except(*non_body_param_names) + + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PUT", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::UpdateCatalogResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # + # @return [Schematic::Catalogs::Types::DeleteCatalogResponse] + def delete_catalog(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::DeleteCatalogResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # + # @return [Schematic::Catalogs::Types::GetConfigurationResponse] + def get_configuration(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/configuration", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::GetConfigurationResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Schematic::Catalogs::Types::UpdateCatalogConfigurationRequestBody] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # + # @return [Schematic::Catalogs::Types::UpdateConfigurationResponse] + def update_configuration(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request_data = Schematic::Catalogs::Types::UpdateCatalogConfigurationRequestBody.new(params).to_h + non_body_param_names = ["catalog_id"] + body = request_data.except(*non_body_param_names) + + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PUT", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/configuration", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::UpdateConfigurationResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # + # @return [Schematic::Catalogs::Types::GetCreditBundlesInCatalogResponse] + def get_credit_bundles_in_catalog(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/credit-bundles", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::GetCreditBundlesInCatalogResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # @option params [String] :credit_bundle_id + # + # @return [untyped] + def add_credit_bundle(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/credit-bundles/#{URI.encode_uri_component(params[:credit_bundle_id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + return if code.between?(200, 299) + + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # @option params [String] :credit_bundle_id + # + # @return [untyped] + def remove_credit_bundle(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/credit-bundles/#{URI.encode_uri_component(params[:credit_bundle_id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + return if code.between?(200, 299) + + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # + # @return [Schematic::Catalogs::Types::GetDerivedFeaturesResponse] + def get_derived_features(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/features", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::GetDerivedFeaturesResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # + # @return [Schematic::Catalogs::Types::GetPlansInCatalogResponse] + def get_plans_in_catalog(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/plans", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Catalogs::Types::GetPlansInCatalogResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # @option params [String] :plan_id + # + # @return [untyped] + def add_plan(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/plans/#{URI.encode_uri_component(params[:plan_id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + return if code.between?(200, 299) + + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :catalog_id + # @option params [String] :plan_id + # + # @return [untyped] + def remove_plan(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "catalogs/#{URI.encode_uri_component(params[:catalog_id].to_s)}/plans/#{URI.encode_uri_component(params[:plan_id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + return if code.between?(200, 299) + + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end +end diff --git a/lib/schematic/catalogs/types/create_catalog_request_body.rb b/lib/schematic/catalogs/types/create_catalog_request_body.rb new file mode 100644 index 0000000..da0fed6 --- /dev/null +++ b/lib/schematic/catalogs/types/create_catalog_request_body.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class CreateCatalogRequestBody < Internal::Types::Model + field :description, -> { String }, optional: true, nullable: false + field :is_default, -> { Internal::Types::Boolean }, optional: false, nullable: false + field :name, -> { String }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/create_catalog_response.rb b/lib/schematic/catalogs/types/create_catalog_response.rb new file mode 100644 index 0000000..d8f519e --- /dev/null +++ b/lib/schematic/catalogs/types/create_catalog_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class CreateCatalogResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/delete_catalog_response.rb b/lib/schematic/catalogs/types/delete_catalog_response.rb new file mode 100644 index 0000000..8db8d6e --- /dev/null +++ b/lib/schematic/catalogs/types/delete_catalog_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class DeleteCatalogResponse < Internal::Types::Model + field :data, -> { Schematic::Types::DeleteResponse }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/get_catalog_response.rb b/lib/schematic/catalogs/types/get_catalog_response.rb new file mode 100644 index 0000000..97d881a --- /dev/null +++ b/lib/schematic/catalogs/types/get_catalog_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class GetCatalogResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/get_configuration_response.rb b/lib/schematic/catalogs/types/get_configuration_response.rb new file mode 100644 index 0000000..e87e12e --- /dev/null +++ b/lib/schematic/catalogs/types/get_configuration_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class GetConfigurationResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CatalogConfigurationResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/get_credit_bundles_in_catalog_response.rb b/lib/schematic/catalogs/types/get_credit_bundles_in_catalog_response.rb new file mode 100644 index 0000000..3312e50 --- /dev/null +++ b/lib/schematic/catalogs/types/get_credit_bundles_in_catalog_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class GetCreditBundlesInCatalogResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CatalogCreditBundleIDsResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/get_derived_features_response.rb b/lib/schematic/catalogs/types/get_derived_features_response.rb new file mode 100644 index 0000000..dc3bae8 --- /dev/null +++ b/lib/schematic/catalogs/types/get_derived_features_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class GetDerivedFeaturesResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CatalogDerivedFeaturesResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/get_plans_in_catalog_response.rb b/lib/schematic/catalogs/types/get_plans_in_catalog_response.rb new file mode 100644 index 0000000..85e01f5 --- /dev/null +++ b/lib/schematic/catalogs/types/get_plans_in_catalog_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class GetPlansInCatalogResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CatalogPlanIDsResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/list_catalogs_params.rb b/lib/schematic/catalogs/types/list_catalogs_params.rb new file mode 100644 index 0000000..23305c2 --- /dev/null +++ b/lib/schematic/catalogs/types/list_catalogs_params.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + # Input parameters + class ListCatalogsParams < Internal::Types::Model + field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :limit, -> { Integer }, optional: true, nullable: false + field :offset, -> { Integer }, optional: true, nullable: false + field :q, -> { String }, optional: true, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/list_catalogs_request.rb b/lib/schematic/catalogs/types/list_catalogs_request.rb new file mode 100644 index 0000000..7a3a489 --- /dev/null +++ b/lib/schematic/catalogs/types/list_catalogs_request.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class ListCatalogsRequest < Internal::Types::Model + field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :q, -> { String }, optional: true, nullable: false + field :limit, -> { Integer }, optional: true, nullable: false + field :offset, -> { Integer }, optional: true, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/list_catalogs_response.rb b/lib/schematic/catalogs/types/list_catalogs_response.rb new file mode 100644 index 0000000..6b4e352 --- /dev/null +++ b/lib/schematic/catalogs/types/list_catalogs_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class ListCatalogsResponse < Internal::Types::Model + field :data, -> { Internal::Types::Array[Schematic::Types::CatalogResponseData] }, optional: false, nullable: false + field :params, -> { Schematic::Catalogs::Types::ListCatalogsParams }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/update_catalog_configuration_request_body.rb b/lib/schematic/catalogs/types/update_catalog_configuration_request_body.rb new file mode 100644 index 0000000..010506e --- /dev/null +++ b/lib/schematic/catalogs/types/update_catalog_configuration_request_body.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class UpdateCatalogConfigurationRequestBody < Internal::Types::Model + field :catalog_id, -> { String }, optional: false, nullable: false + field :custom_plan_cta_text, -> { String }, optional: true, nullable: false + field :custom_plan_cta_url, -> { String }, optional: true, nullable: false + field :custom_plan_price_text, -> { String }, optional: true, nullable: false + field :custom_plans_visible, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :ordered_add_ons, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlan] }, optional: true, nullable: false + field :ordered_bundles, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedBundle] }, optional: true, nullable: false + field :ordered_plans, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlan] }, optional: true, nullable: false + field :pricing_model, -> { String }, optional: true, nullable: false + field :pricing_url, -> { String }, optional: true, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/update_catalog_request_body.rb b/lib/schematic/catalogs/types/update_catalog_request_body.rb new file mode 100644 index 0000000..a060055 --- /dev/null +++ b/lib/schematic/catalogs/types/update_catalog_request_body.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class UpdateCatalogRequestBody < Internal::Types::Model + field :catalog_id, -> { String }, optional: false, nullable: false + field :description, -> { String }, optional: true, nullable: false + field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :name, -> { String }, optional: true, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/update_catalog_response.rb b/lib/schematic/catalogs/types/update_catalog_response.rb new file mode 100644 index 0000000..47bb28a --- /dev/null +++ b/lib/schematic/catalogs/types/update_catalog_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class UpdateCatalogResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/catalogs/types/update_configuration_response.rb b/lib/schematic/catalogs/types/update_configuration_response.rb new file mode 100644 index 0000000..66783a5 --- /dev/null +++ b/lib/schematic/catalogs/types/update_configuration_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Catalogs + module Types + class UpdateConfigurationResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/checkout/client.rb b/lib/schematic/checkout/client.rb index 73c6707..99b697e 100644 --- a/lib/schematic/checkout/client.rb +++ b/lib/schematic/checkout/client.rb @@ -106,6 +106,75 @@ def preview_checkout_internal(request_options: {}, **params) end end + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :company_id + # + # @return [Schematic::Checkout::Types::GetCompanyBillingDetailsResponse] + def get_company_billing_details(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}/billing-details", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Checkout::Types::GetCompanyBillingDetailsResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @param request_options [Hash] + # @param params [Schematic::Checkout::Types::UpdateCompanyBillingDetailsRequestBody] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :company_id + # + # @return [Schematic::Checkout::Types::UpdateCompanyBillingDetailsResponse] + def update_company_billing_details(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request_data = Schematic::Checkout::Types::UpdateCompanyBillingDetailsRequestBody.new(params).to_h + non_body_param_names = ["company_id"] + body = request_data.except(*non_body_param_names) + + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PUT", + path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}/billing-details", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Checkout::Types::UpdateCompanyBillingDetailsResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + # @param request_options [Hash] # @param params [Schematic::Types::ManagePlanRequest] # @option request_options [String] :base_url diff --git a/lib/schematic/checkout/types/get_company_billing_details_response.rb b/lib/schematic/checkout/types/get_company_billing_details_response.rb new file mode 100644 index 0000000..3a850ef --- /dev/null +++ b/lib/schematic/checkout/types/get_company_billing_details_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Checkout + module Types + class GetCompanyBillingDetailsResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CompanyBillingDetailsResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/checkout/types/update_company_billing_details_request_body.rb b/lib/schematic/checkout/types/update_company_billing_details_request_body.rb new file mode 100644 index 0000000..7d45960 --- /dev/null +++ b/lib/schematic/checkout/types/update_company_billing_details_request_body.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Schematic + module Checkout + module Types + class UpdateCompanyBillingDetailsRequestBody < Internal::Types::Model + field :company_id, -> { String }, optional: false, nullable: false + field :address, -> { Schematic::Types::CustomerBillingAddress }, optional: true, nullable: false + field :email, -> { String }, optional: true, nullable: false + field :phone, -> { String }, optional: true, nullable: false + field :values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/checkout/types/update_company_billing_details_response.rb b/lib/schematic/checkout/types/update_company_billing_details_response.rb new file mode 100644 index 0000000..b14ec4d --- /dev/null +++ b/lib/schematic/checkout/types/update_company_billing_details_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Checkout + module Types + class UpdateCompanyBillingDetailsResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CompanyBillingDetailsResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/client.rb b/lib/schematic/client.rb index a19d31d..8a9eb57 100644 --- a/lib/schematic/client.rb +++ b/lib/schematic/client.rb @@ -10,7 +10,7 @@ def initialize(api_key:, base_url: nil) @raw_client = Schematic::Internal::Http::RawClient.new( base_url: base_url || Schematic::Environment::DEFAULT, headers: { - "User-Agent" => "schematichq/1.4.9", + "User-Agent" => "schematichq/1.4.10", "X-Fern-Language" => "Ruby", "X-Schematic-Api-Key" => api_key.to_s } @@ -32,6 +32,11 @@ def credits @credits ||= Schematic::Credits::Client.new(client: @raw_client) end + # @return [Schematic::Catalogs::Client] + def catalogs + @catalogs ||= Schematic::Catalogs::Client.new(client: @raw_client) + end + # @return [Schematic::Checkout::Client] def checkout @checkout ||= Schematic::Checkout::Client.new(client: @raw_client) diff --git a/lib/schematic/components/client.rb b/lib/schematic/components/client.rb index d1c596e..6f80c36 100644 --- a/lib/schematic/components/client.rb +++ b/lib/schematic/components/client.rb @@ -185,6 +185,43 @@ def delete_component(request_options: {}, **params) end end + # @param request_options [Hash] + # @param params [Schematic::Components::Types::BindCatalogRequestBody] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :component_id + # + # @return [Schematic::Components::Types::BindCatalogResponse] + def bind_catalog(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request_data = Schematic::Components::Types::BindCatalogRequestBody.new(params).to_h + non_body_param_names = ["component_id"] + body = request_data.except(*non_body_param_names) + + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PUT", + path: "components/#{URI.encode_uri_component(params[:component_id].to_s)}/catalog", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Components::Types::BindCatalogResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + # @param request_options [Hash] # @param params [Hash] # @option request_options [String] :base_url diff --git a/lib/schematic/components/types/bind_catalog_request_body.rb b/lib/schematic/components/types/bind_catalog_request_body.rb new file mode 100644 index 0000000..3becfe5 --- /dev/null +++ b/lib/schematic/components/types/bind_catalog_request_body.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Components + module Types + class BindCatalogRequestBody < Internal::Types::Model + field :component_id, -> { String }, optional: false, nullable: false + field :catalog_id, -> { String }, optional: true, nullable: false + end + end + end +end diff --git a/lib/schematic/components/types/bind_catalog_response.rb b/lib/schematic/components/types/bind_catalog_response.rb new file mode 100644 index 0000000..baf1d10 --- /dev/null +++ b/lib/schematic/components/types/bind_catalog_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Components + module Types + class BindCatalogResponse < Internal::Types::Model + field :data, -> { Schematic::Types::ComponentResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/dataexports/client.rb b/lib/schematic/dataexports/client.rb index 53da36b..950ae1c 100644 --- a/lib/schematic/dataexports/client.rb +++ b/lib/schematic/dataexports/client.rb @@ -10,6 +10,50 @@ def initialize(client:) @client = client end + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [Schematic::Types::DataExportType, nil] :export_type + # @option params [Schematic::Types::DataExportStatus, nil] :status + # @option params [Integer, nil] :limit + # @option params [Integer, nil] :offset + # + # @return [Schematic::Dataexports::Types::ListDataExportsResponse] + def list_data_exports(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + query_param_names = %i[export_type status limit offset] + query_params = {} + query_params["export_type"] = params[:export_type] if params.key?(:export_type) + query_params["status"] = params[:status] if params.key?(:status) + query_params["limit"] = params[:limit] if params.key?(:limit) + query_params["offset"] = params[:offset] if params.key?(:offset) + params.except(*query_param_names) + + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "data-exports", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Dataexports::Types::ListDataExportsResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + # @param request_options [Hash] # @param params [Schematic::Dataexports::Types::CreateDataExportRequestBody] # @option request_options [String] :base_url @@ -42,6 +86,38 @@ def create_data_export(request_options: {}, **params) end end + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :data_export_id + # + # @return [Schematic::Dataexports::Types::GetDataExportResponse] + def get_data_export(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "data-exports/#{URI.encode_uri_component(params[:data_export_id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Schematic::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + Schematic::Dataexports::Types::GetDataExportResponse.load(response.body) + else + error_class = Schematic::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + # @param request_options [Hash] # @param params [Hash] # @option request_options [String] :base_url diff --git a/lib/schematic/dataexports/types/create_data_export_request_body.rb b/lib/schematic/dataexports/types/create_data_export_request_body.rb index 640e835..75d33b2 100644 --- a/lib/schematic/dataexports/types/create_data_export_request_body.rb +++ b/lib/schematic/dataexports/types/create_data_export_request_body.rb @@ -4,9 +4,9 @@ module Schematic module Dataexports module Types class CreateDataExportRequestBody < Internal::Types::Model - field :export_type, -> { String }, optional: false, nullable: false - field :metadata, -> { String }, optional: false, nullable: false - field :output_file_type, -> { String }, optional: false, nullable: false + field :export_type, -> { Schematic::Types::DataExportType }, optional: false, nullable: false + field :metadata, -> { Schematic::Types::DataExportMetadata }, optional: true, nullable: false + field :output_file_type, -> { Schematic::Types::DataExportOutputFileType }, optional: false, nullable: false end end end diff --git a/lib/schematic/dataexports/types/get_data_export_response.rb b/lib/schematic/dataexports/types/get_data_export_response.rb new file mode 100644 index 0000000..7a5abf5 --- /dev/null +++ b/lib/schematic/dataexports/types/get_data_export_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Dataexports + module Types + class GetDataExportResponse < Internal::Types::Model + field :data, -> { Schematic::Types::DataExportResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/dataexports/types/list_data_exports_params.rb b/lib/schematic/dataexports/types/list_data_exports_params.rb new file mode 100644 index 0000000..b9b998a --- /dev/null +++ b/lib/schematic/dataexports/types/list_data_exports_params.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Schematic + module Dataexports + module Types + # Input parameters + class ListDataExportsParams < Internal::Types::Model + field :export_type, -> { Schematic::Types::DataExportType }, optional: true, nullable: false + field :limit, -> { Integer }, optional: true, nullable: false + field :offset, -> { Integer }, optional: true, nullable: false + field :status, -> { Schematic::Types::DataExportStatus }, optional: true, nullable: false + end + end + end +end diff --git a/lib/schematic/dataexports/types/list_data_exports_request.rb b/lib/schematic/dataexports/types/list_data_exports_request.rb new file mode 100644 index 0000000..1348925 --- /dev/null +++ b/lib/schematic/dataexports/types/list_data_exports_request.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Schematic + module Dataexports + module Types + class ListDataExportsRequest < Internal::Types::Model + field :export_type, -> { Schematic::Types::DataExportType }, optional: true, nullable: false + field :status, -> { Schematic::Types::DataExportStatus }, optional: true, nullable: false + field :limit, -> { Integer }, optional: true, nullable: false + field :offset, -> { Integer }, optional: true, nullable: false + end + end + end +end diff --git a/lib/schematic/dataexports/types/list_data_exports_response.rb b/lib/schematic/dataexports/types/list_data_exports_response.rb new file mode 100644 index 0000000..c271b45 --- /dev/null +++ b/lib/schematic/dataexports/types/list_data_exports_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Dataexports + module Types + class ListDataExportsResponse < Internal::Types::Model + field :data, -> { Internal::Types::Array[Schematic::Types::DataExportResponseData] }, optional: false, nullable: false + field :params, -> { Schematic::Dataexports::Types::ListDataExportsParams }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb b/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb index b4963c0..fd3e123 100644 --- a/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb +++ b/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb @@ -5,6 +5,7 @@ module Planbundle module Types class CreateCustomPlanBundleRequestBody < Internal::Types::Model field :billing_product, -> { Schematic::Types::UpsertBillingProductRequestBody }, optional: true, nullable: false + field :credit_grants, -> { Internal::Types::Array[Schematic::Types::PlanBundleCreditGrantRequestBody] }, optional: true, nullable: false field :entitlements, -> { Internal::Types::Array[Schematic::Types::PlanBundleEntitlementRequestBody] }, optional: false, nullable: false field :plan, -> { Schematic::Types::CreateCustomPlanBundlePlanRequestBody }, optional: true, nullable: false end diff --git a/lib/schematic/types/audit_log_export_metadata.rb b/lib/schematic/types/audit_log_export_metadata.rb new file mode 100644 index 0000000..2748264 --- /dev/null +++ b/lib/schematic/types/audit_log_export_metadata.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Schematic + module Types + class AuditLogExportMetadata < Internal::Types::Model + field :actor_type, -> { String }, optional: true, nullable: false + field :end_time, -> { String }, optional: true, nullable: false + field :notification_email_recipient_email_addresses, -> { Internal::Types::Array[String] }, optional: true, nullable: false + field :q, -> { String }, optional: true, nullable: false + field :start_time, -> { String }, optional: true, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_config_ordered_bundle.rb b/lib/schematic/types/catalog_config_ordered_bundle.rb new file mode 100644 index 0000000..71383b0 --- /dev/null +++ b/lib/schematic/types/catalog_config_ordered_bundle.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogConfigOrderedBundle < Internal::Types::Model + field :bundle_id, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_config_ordered_bundle_response_data.rb b/lib/schematic/types/catalog_config_ordered_bundle_response_data.rb new file mode 100644 index 0000000..04e1d17 --- /dev/null +++ b/lib/schematic/types/catalog_config_ordered_bundle_response_data.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogConfigOrderedBundleResponseData < Internal::Types::Model + field :bundle_id, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_config_ordered_entitlement.rb b/lib/schematic/types/catalog_config_ordered_entitlement.rb new file mode 100644 index 0000000..8369110 --- /dev/null +++ b/lib/schematic/types/catalog_config_ordered_entitlement.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogConfigOrderedEntitlement < Internal::Types::Model + field :plan_entitlement_id, -> { String }, optional: false, nullable: false + field :visible, -> { Internal::Types::Boolean }, optional: true, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_config_ordered_entitlement_response_data.rb b/lib/schematic/types/catalog_config_ordered_entitlement_response_data.rb new file mode 100644 index 0000000..8133a55 --- /dev/null +++ b/lib/schematic/types/catalog_config_ordered_entitlement_response_data.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogConfigOrderedEntitlementResponseData < Internal::Types::Model + field :plan_entitlement_id, -> { String }, optional: false, nullable: false + field :visible, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_config_ordered_plan.rb b/lib/schematic/types/catalog_config_ordered_plan.rb new file mode 100644 index 0000000..12900ba --- /dev/null +++ b/lib/schematic/types/catalog_config_ordered_plan.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogConfigOrderedPlan < Internal::Types::Model + field :entitlements, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedEntitlement] }, optional: true, nullable: false + field :plan_id, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_config_ordered_plan_response_data.rb b/lib/schematic/types/catalog_config_ordered_plan_response_data.rb new file mode 100644 index 0000000..038b734 --- /dev/null +++ b/lib/schematic/types/catalog_config_ordered_plan_response_data.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogConfigOrderedPlanResponseData < Internal::Types::Model + field :entitlements, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedEntitlementResponseData] }, optional: false, nullable: false + field :plan_id, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_configuration_response_data.rb b/lib/schematic/types/catalog_configuration_response_data.rb new file mode 100644 index 0000000..5f98998 --- /dev/null +++ b/lib/schematic/types/catalog_configuration_response_data.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogConfigurationResponseData < Internal::Types::Model + field :add_ons, -> { Internal::Types::Array[Schematic::Types::PlanGroupPlanDetailResponseData] }, optional: false, nullable: false + field :custom_plan_cta_text, -> { String }, optional: true, nullable: false + field :custom_plan_cta_url, -> { String }, optional: true, nullable: false + field :custom_plan_price_text, -> { String }, optional: true, nullable: false + field :custom_plans_visible, -> { Internal::Types::Boolean }, optional: false, nullable: false + field :ordered_add_ons, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlanResponseData] }, optional: false, nullable: false + field :ordered_bundles, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedBundleResponseData] }, optional: false, nullable: false + field :ordered_plans, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlanResponseData] }, optional: false, nullable: false + field :plans, -> { Internal::Types::Array[Schematic::Types::PlanGroupPlanDetailResponseData] }, optional: false, nullable: false + field :pricing_model, -> { String }, optional: true, nullable: false + field :pricing_url, -> { String }, optional: true, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_credit_bundle_i_ds_response_data.rb b/lib/schematic/types/catalog_credit_bundle_i_ds_response_data.rb new file mode 100644 index 0000000..736d203 --- /dev/null +++ b/lib/schematic/types/catalog_credit_bundle_i_ds_response_data.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogCreditBundleIDsResponseData < Internal::Types::Model + field :credit_bundle_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_derived_feature_response_data.rb b/lib/schematic/types/catalog_derived_feature_response_data.rb new file mode 100644 index 0000000..3ca905c --- /dev/null +++ b/lib/schematic/types/catalog_derived_feature_response_data.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogDerivedFeatureResponseData < Internal::Types::Model + field :icon, -> { String }, optional: false, nullable: false + field :id, -> { String }, optional: false, nullable: false + field :name, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_derived_features_response_data.rb b/lib/schematic/types/catalog_derived_features_response_data.rb new file mode 100644 index 0000000..aaa8234 --- /dev/null +++ b/lib/schematic/types/catalog_derived_features_response_data.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogDerivedFeaturesResponseData < Internal::Types::Model + field :features, -> { Internal::Types::Array[Schematic::Types::CatalogDerivedFeatureResponseData] }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_plan_i_ds_response_data.rb b/lib/schematic/types/catalog_plan_i_ds_response_data.rb new file mode 100644 index 0000000..4fc2eb1 --- /dev/null +++ b/lib/schematic/types/catalog_plan_i_ds_response_data.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogPlanIDsResponseData < Internal::Types::Model + field :plan_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/catalog_response_data.rb b/lib/schematic/types/catalog_response_data.rb new file mode 100644 index 0000000..b149fc1 --- /dev/null +++ b/lib/schematic/types/catalog_response_data.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CatalogResponseData < Internal::Types::Model + field :account_id, -> { String }, optional: false, nullable: false + field :created_at, -> { String }, optional: false, nullable: false + field :custom_plan_cta_text, -> { String }, optional: true, nullable: false + field :custom_plan_cta_url, -> { String }, optional: true, nullable: false + field :custom_plan_price_text, -> { String }, optional: true, nullable: false + field :custom_plans_visible, -> { Internal::Types::Boolean }, optional: false, nullable: false + field :description, -> { String }, optional: true, nullable: false + field :environment_id, -> { String }, optional: false, nullable: false + field :id, -> { String }, optional: false, nullable: false + field :is_default, -> { Internal::Types::Boolean }, optional: false, nullable: false + field :name, -> { String }, optional: false, nullable: false + field :pricing_model, -> { String }, optional: true, nullable: false + field :pricing_url, -> { String }, optional: true, nullable: false + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/company_billing_address_view.rb b/lib/schematic/types/company_billing_address_view.rb new file mode 100644 index 0000000..b6901d4 --- /dev/null +++ b/lib/schematic/types/company_billing_address_view.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CompanyBillingAddressView < Internal::Types::Model + field :city, -> { String }, optional: false, nullable: false + field :country, -> { String }, optional: false, nullable: false + field :line_1, -> { String }, optional: false, nullable: false, api_name: "line1" + field :line_2, -> { String }, optional: false, nullable: false, api_name: "line2" + field :postal_code, -> { String }, optional: false, nullable: false + field :state, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/company_billing_checkout_settings.rb b/lib/schematic/types/company_billing_checkout_settings.rb new file mode 100644 index 0000000..1e95482 --- /dev/null +++ b/lib/schematic/types/company_billing_checkout_settings.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CompanyBillingCheckoutSettings < Internal::Types::Model + field :collect_address, -> { Internal::Types::Boolean }, optional: false, nullable: false + field :collect_email, -> { Internal::Types::Boolean }, optional: false, nullable: false + field :collect_phone, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/company_billing_details_response_data.rb b/lib/schematic/types/company_billing_details_response_data.rb new file mode 100644 index 0000000..194a046 --- /dev/null +++ b/lib/schematic/types/company_billing_details_response_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CompanyBillingDetailsResponseData < Internal::Types::Model + field :address, -> { Schematic::Types::CompanyBillingAddressView }, optional: true, nullable: false + field :checkout_settings, -> { Schematic::Types::CompanyBillingCheckoutSettings }, optional: false, nullable: false + field :custom_fields, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldWithValue] }, optional: false, nullable: false + field :email, -> { String }, optional: true, nullable: false + field :phone, -> { String }, optional: true, nullable: false + end + end +end diff --git a/lib/schematic/types/company_billing_details_view.rb b/lib/schematic/types/company_billing_details_view.rb new file mode 100644 index 0000000..f745e5a --- /dev/null +++ b/lib/schematic/types/company_billing_details_view.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CompanyBillingDetailsView < Internal::Types::Model + field :address, -> { Schematic::Types::CompanyBillingAddressView }, optional: true, nullable: false + field :checkout_settings, -> { Schematic::Types::CompanyBillingCheckoutSettings }, optional: false, nullable: false + field :custom_fields, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldWithValue] }, optional: false, nullable: false + field :email, -> { String }, optional: true, nullable: false + field :phone, -> { String }, optional: true, nullable: false + end + end +end diff --git a/lib/schematic/types/company_feature_usage_export_metadata.rb b/lib/schematic/types/company_feature_usage_export_metadata.rb new file mode 100644 index 0000000..6a1b78e --- /dev/null +++ b/lib/schematic/types/company_feature_usage_export_metadata.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CompanyFeatureUsageExportMetadata < Internal::Types::Model + field :company_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false + field :credit_type_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false + field :feature_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false + field :has_scheduled_downgrade, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :monetized_subscriptions, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :notification_email_recipient_email_addresses, -> { Internal::Types::Array[String] }, optional: true, nullable: false + field :plan_id, -> { String }, optional: true, nullable: false + field :plan_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false + field :plan_version_id, -> { String }, optional: true, nullable: false + field :q, -> { String }, optional: true, nullable: false + field :subscription_statuses, -> { Internal::Types::Array[String] }, optional: true, nullable: false + field :subscription_types, -> { Internal::Types::Array[String] }, optional: true, nullable: false + field :with_entitlement_for, -> { String }, optional: true, nullable: false + field :with_subscription, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :without_feature_override_for, -> { String }, optional: true, nullable: false + field :without_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :without_subscription, -> { Internal::Types::Boolean }, optional: true, nullable: false + end + end +end diff --git a/lib/schematic/types/company_plan_detail_response_data.rb b/lib/schematic/types/company_plan_detail_response_data.rb index bfa4e2c..f80c3a3 100644 --- a/lib/schematic/types/company_plan_detail_response_data.rb +++ b/lib/schematic/types/company_plan_detail_response_data.rb @@ -9,6 +9,7 @@ class CompanyPlanDetailResponseData < Internal::Types::Model field :billing_linked_resource, -> { Schematic::Types::BillingLinkedResourceResponseData }, optional: true, nullable: false field :billing_product, -> { Schematic::Types::BillingProductDetailResponseData }, optional: true, nullable: false field :billing_strategy, -> { Schematic::Types::BillingStrategy }, optional: false, nullable: false + field :catalogs, -> { Internal::Types::Array[Schematic::Types::PlanCatalogMembershipResponseData] }, optional: true, nullable: false field :charge_type, -> { Schematic::Types::ChargeType }, optional: false, nullable: false field :company_can_trial, -> { Internal::Types::Boolean }, optional: false, nullable: false field :company_count, -> { Integer }, optional: false, nullable: false diff --git a/lib/schematic/types/component_response_data.rb b/lib/schematic/types/component_response_data.rb index dd6e1f4..3a953c3 100644 --- a/lib/schematic/types/component_response_data.rb +++ b/lib/schematic/types/component_response_data.rb @@ -4,6 +4,7 @@ module Schematic module Types class ComponentResponseData < Internal::Types::Model field :ast, -> { Internal::Types::Hash[String, Integer] }, optional: true, nullable: false + field :catalog_id, -> { String }, optional: true, nullable: false field :created_at, -> { String }, optional: false, nullable: false field :id, -> { String }, optional: false, nullable: false field :name, -> { String }, optional: false, nullable: false diff --git a/lib/schematic/types/create_entitlement_in_bundle_request_body.rb b/lib/schematic/types/create_entitlement_in_bundle_request_body.rb index b37f7e3..7fc9d55 100644 --- a/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +++ b/lib/schematic/types/create_entitlement_in_bundle_request_body.rb @@ -32,6 +32,7 @@ class CreateEntitlementInBundleRequestBody < Internal::Types::Model field :value_numeric, -> { Integer }, optional: true, nullable: false field :value_trait_id, -> { String }, optional: true, nullable: false field :value_type, -> { Schematic::Types::EntitlementValueType }, optional: false, nullable: false + field :warning_tiers, -> { Internal::Types::Array[Schematic::Types::WarningTierRequestBody] }, optional: true, nullable: false field :yearly_metered_price_id, -> { String }, optional: true, nullable: false field :yearly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false field :yearly_unit_price, -> { Integer }, optional: true, nullable: false diff --git a/lib/schematic/types/credits_auto_topup_success.rb b/lib/schematic/types/credits_auto_topup_success.rb new file mode 100644 index 0000000..1a2769e --- /dev/null +++ b/lib/schematic/types/credits_auto_topup_success.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CreditsAutoTopupSuccess < Internal::Types::Model + field :company, -> { Schematic::Types::CreditsAutoTopupCompanySummary }, optional: true, nullable: false + field :credit, -> { Schematic::Types::CreditsAutoTopupCreditSummary }, optional: true, nullable: false + field :grant_id, -> { String }, optional: false, nullable: false + field :quantity, -> { Integer }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/credits_credit_purchase_success.rb b/lib/schematic/types/credits_credit_purchase_success.rb new file mode 100644 index 0000000..af5e2af --- /dev/null +++ b/lib/schematic/types/credits_credit_purchase_success.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CreditsCreditPurchaseSuccess < Internal::Types::Model + field :bundle_id, -> { String }, optional: false, nullable: false + field :bundle_name, -> { String }, optional: false, nullable: false + field :company, -> { Schematic::Types::CreditsWebhookCompanySummary }, optional: true, nullable: false + field :credit, -> { Schematic::Types::CreditsWebhookCreditSummary }, optional: true, nullable: false + field :grant_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false + field :quantity, -> { Integer }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/credits_webhook_company_summary.rb b/lib/schematic/types/credits_webhook_company_summary.rb new file mode 100644 index 0000000..6846859 --- /dev/null +++ b/lib/schematic/types/credits_webhook_company_summary.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CreditsWebhookCompanySummary < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + field :name, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/credits_webhook_credit_summary.rb b/lib/schematic/types/credits_webhook_credit_summary.rb new file mode 100644 index 0000000..8501ed8 --- /dev/null +++ b/lib/schematic/types/credits_webhook_credit_summary.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CreditsWebhookCreditSummary < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + field :name, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/customer_billing_address.rb b/lib/schematic/types/customer_billing_address.rb new file mode 100644 index 0000000..dbf093e --- /dev/null +++ b/lib/schematic/types/customer_billing_address.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CustomerBillingAddress < Internal::Types::Model + field :city, -> { String }, optional: false, nullable: false + field :country, -> { String }, optional: false, nullable: false + field :line_1, -> { String }, optional: false, nullable: false, api_name: "line1" + field :line_2, -> { String }, optional: false, nullable: false, api_name: "line2" + field :postal_code, -> { String }, optional: false, nullable: false + field :state, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/data_export_metadata.rb b/lib/schematic/types/data_export_metadata.rb new file mode 100644 index 0000000..4fe6d11 --- /dev/null +++ b/lib/schematic/types/data_export_metadata.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Schematic + module Types + class DataExportMetadata < Internal::Types::Model + extend Schematic::Internal::Types::Union + + discriminant :export_type + + member -> { Schematic::Types::AuditLogExportMetadata }, key: "AUDIT_LOG" + member -> { Schematic::Types::CompanyFeatureUsageExportMetadata }, key: "COMPANY_FEATURE_USAGE" + end + end +end diff --git a/lib/schematic/types/data_export_output_file_type.rb b/lib/schematic/types/data_export_output_file_type.rb index a7354dd..2d48193 100644 --- a/lib/schematic/types/data_export_output_file_type.rb +++ b/lib/schematic/types/data_export_output_file_type.rb @@ -3,21 +3,10 @@ module Schematic module Types module DataExportOutputFileType - # DataExportOutputFileType is an alias for Object + extend Schematic::Internal::Types::Enum - # @option str [String] - # - # @return [untyped] - def self.load(str) - ::JSON.parse(str) - end - - # @option value [untyped] - # - # @return [String] - def self.dump(value) - ::JSON.generate(value) - end + CSV = "csv" + CSV_GZ = "csv.gz" end end end diff --git a/lib/schematic/types/data_export_response_data.rb b/lib/schematic/types/data_export_response_data.rb index ca1aad0..a8eb8bc 100644 --- a/lib/schematic/types/data_export_response_data.rb +++ b/lib/schematic/types/data_export_response_data.rb @@ -6,10 +6,10 @@ class DataExportResponseData < Internal::Types::Model field :account_id, -> { String }, optional: false, nullable: false field :created_at, -> { String }, optional: false, nullable: false field :environment_id, -> { String }, optional: false, nullable: false - field :export_type, -> { String }, optional: false, nullable: false + field :export_type, -> { Schematic::Types::DataExportType }, optional: false, nullable: false field :id, -> { String }, optional: false, nullable: false - field :metadata, -> { String }, optional: false, nullable: false - field :output_file_type, -> { String }, optional: false, nullable: false + field :metadata, -> { Schematic::Types::DataExportMetadata }, optional: true, nullable: false + field :output_file_type, -> { Schematic::Types::DataExportOutputFileType }, optional: false, nullable: false field :status, -> { Schematic::Types::DataExportStatus }, optional: false, nullable: false field :updated_at, -> { String }, optional: false, nullable: false end diff --git a/lib/schematic/types/data_export_type.rb b/lib/schematic/types/data_export_type.rb index 503d2fd..c1c7dd4 100644 --- a/lib/schematic/types/data_export_type.rb +++ b/lib/schematic/types/data_export_type.rb @@ -3,21 +3,10 @@ module Schematic module Types module DataExportType - # DataExportType is an alias for Object + extend Schematic::Internal::Types::Enum - # @option str [String] - # - # @return [untyped] - def self.load(str) - ::JSON.parse(str) - end - - # @option value [untyped] - # - # @return [String] - def self.dump(value) - ::JSON.generate(value) - end + AUDIT_LOG = "audit-log" + COMPANY_FEATURE_USAGE = "company-feature-usage" end end end diff --git a/lib/schematic/types/feature_entitlement.rb b/lib/schematic/types/feature_entitlement.rb index effb983..68408a3 100644 --- a/lib/schematic/types/feature_entitlement.rb +++ b/lib/schematic/types/feature_entitlement.rb @@ -21,6 +21,7 @@ class FeatureEntitlement < Internal::Types::Model field :soft_limit, -> { Integer }, optional: true, nullable: false field :usage, -> { Integer }, optional: true, nullable: false field :value_type, -> { Schematic::Types::EntitlementValueType }, optional: false, nullable: false + field :warning_tiers, -> { Internal::Types::Array[Schematic::Types::WarningTier] }, optional: true, nullable: false end end end diff --git a/lib/schematic/types/plan_catalog_membership_response_data.rb b/lib/schematic/types/plan_catalog_membership_response_data.rb new file mode 100644 index 0000000..e8cc48e --- /dev/null +++ b/lib/schematic/types/plan_catalog_membership_response_data.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Schematic + module Types + class PlanCatalogMembershipResponseData < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + field :name, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/plan_detail_response_data.rb b/lib/schematic/types/plan_detail_response_data.rb index 81b680d..36b1ad0 100644 --- a/lib/schematic/types/plan_detail_response_data.rb +++ b/lib/schematic/types/plan_detail_response_data.rb @@ -8,6 +8,7 @@ class PlanDetailResponseData < Internal::Types::Model field :billing_linked_resource, -> { Schematic::Types::BillingLinkedResourceResponseData }, optional: true, nullable: false field :billing_product, -> { Schematic::Types::BillingProductDetailResponseData }, optional: true, nullable: false field :billing_strategy, -> { Schematic::Types::BillingStrategy }, optional: false, nullable: false + field :catalogs, -> { Internal::Types::Array[Schematic::Types::PlanCatalogMembershipResponseData] }, optional: true, nullable: false field :charge_type, -> { Schematic::Types::ChargeType }, optional: false, nullable: false field :company_count, -> { Integer }, optional: false, nullable: false field :company_id, -> { String }, optional: true, nullable: false diff --git a/lib/schematic/types/plan_group_plan_detail_response_data.rb b/lib/schematic/types/plan_group_plan_detail_response_data.rb index da72382..a46ab23 100644 --- a/lib/schematic/types/plan_group_plan_detail_response_data.rb +++ b/lib/schematic/types/plan_group_plan_detail_response_data.rb @@ -9,6 +9,7 @@ class PlanGroupPlanDetailResponseData < Internal::Types::Model field :billing_linked_resource, -> { Schematic::Types::BillingLinkedResourceResponseData }, optional: true, nullable: false field :billing_product, -> { Schematic::Types::BillingProductDetailResponseData }, optional: true, nullable: false field :billing_strategy, -> { Schematic::Types::BillingStrategy }, optional: false, nullable: false + field :catalogs, -> { Internal::Types::Array[Schematic::Types::PlanCatalogMembershipResponseData] }, optional: true, nullable: false field :charge_type, -> { Schematic::Types::ChargeType }, optional: false, nullable: false field :company_count, -> { Integer }, optional: false, nullable: false field :company_id, -> { String }, optional: true, nullable: false diff --git a/lib/schematic/types/plan_view_public_response_data.rb b/lib/schematic/types/plan_view_public_response_data.rb index ee7162a..1f3a185 100644 --- a/lib/schematic/types/plan_view_public_response_data.rb +++ b/lib/schematic/types/plan_view_public_response_data.rb @@ -9,6 +9,7 @@ class PlanViewPublicResponseData < Internal::Types::Model field :billing_linked_resource, -> { Schematic::Types::BillingLinkedResourceResponseData }, optional: true, nullable: false field :billing_product, -> { Schematic::Types::BillingProductDetailResponseData }, optional: true, nullable: false field :billing_strategy, -> { Schematic::Types::BillingStrategy }, optional: false, nullable: false + field :catalogs, -> { Internal::Types::Array[Schematic::Types::PlanCatalogMembershipResponseData] }, optional: true, nullable: false field :charge_type, -> { Schematic::Types::ChargeType }, optional: false, nullable: false field :company_count, -> { Integer }, optional: false, nullable: false field :company_id, -> { String }, optional: true, nullable: false diff --git a/lib/schematic/types/preview_subscription_discount_response_data.rb b/lib/schematic/types/preview_subscription_discount_response_data.rb new file mode 100644 index 0000000..9a96dd8 --- /dev/null +++ b/lib/schematic/types/preview_subscription_discount_response_data.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Schematic + module Types + class PreviewSubscriptionDiscountResponseData < Internal::Types::Model + field :amount_off, -> { Integer }, optional: true, nullable: false + field :coupon_name, -> { String }, optional: false, nullable: false + field :currency, -> { String }, optional: true, nullable: false + field :customer_facing_code, -> { String }, optional: true, nullable: false + field :duration, -> { String }, optional: false, nullable: false + field :duration_in_months, -> { Integer }, optional: true, nullable: false + field :ended_at, -> { String }, optional: true, nullable: false + field :is_active, -> { Internal::Types::Boolean }, optional: false, nullable: false + field :percent_off, -> { Integer }, optional: true, nullable: false + field :promo_code_external_id, -> { String }, optional: true, nullable: false + field :started_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/preview_subscription_finance_response_data.rb b/lib/schematic/types/preview_subscription_finance_response_data.rb index 9b42349..4e7148b 100644 --- a/lib/schematic/types/preview_subscription_finance_response_data.rb +++ b/lib/schematic/types/preview_subscription_finance_response_data.rb @@ -4,9 +4,11 @@ module Schematic module Types class PreviewSubscriptionFinanceResponseData < Internal::Types::Model field :amount_off, -> { Integer }, optional: false, nullable: false + field :discounts, -> { Internal::Types::Array[Schematic::Types::PreviewSubscriptionDiscountResponseData] }, optional: false, nullable: false field :due_now, -> { Integer }, optional: false, nullable: false field :new_charges, -> { Integer }, optional: false, nullable: false field :percent_off, -> { Integer }, optional: false, nullable: false + field :period_end, -> { String }, optional: false, nullable: false field :period_start, -> { String }, optional: false, nullable: false field :promo_code_applied, -> { Internal::Types::Boolean }, optional: false, nullable: false field :proration, -> { Integer }, optional: false, nullable: false diff --git a/lib/schematic/types/rulesengine_feature_entitlement.rb b/lib/schematic/types/rulesengine_feature_entitlement.rb index 45e57e8..af35866 100644 --- a/lib/schematic/types/rulesengine_feature_entitlement.rb +++ b/lib/schematic/types/rulesengine_feature_entitlement.rb @@ -21,6 +21,7 @@ class RulesengineFeatureEntitlement < Internal::Types::Model field :soft_limit, -> { Integer }, optional: true, nullable: false field :usage, -> { Integer }, optional: true, nullable: false field :value_type, -> { Schematic::Types::RulesengineEntitlementValueType }, optional: false, nullable: false + field :warning_tiers, -> { Internal::Types::Array[Schematic::Types::RulesengineWarningTier] }, optional: true, nullable: false end end end diff --git a/lib/schematic/types/rulesengine_warning_tier.rb b/lib/schematic/types/rulesengine_warning_tier.rb new file mode 100644 index 0000000..29e9059 --- /dev/null +++ b/lib/schematic/types/rulesengine_warning_tier.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Schematic + module Types + class RulesengineWarningTier < Internal::Types::Model + field :key, -> { String }, optional: false, nullable: false + field :value, -> { Integer }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/upsert_company_request_body.rb b/lib/schematic/types/upsert_company_request_body.rb index 739144d..c6a3c80 100644 --- a/lib/schematic/types/upsert_company_request_body.rb +++ b/lib/schematic/types/upsert_company_request_body.rb @@ -3,6 +3,8 @@ module Schematic module Types class UpsertCompanyRequestBody < Internal::Types::Model + field :base_plan_id, -> { String }, optional: true, nullable: false + field :base_plan_price_id, -> { String }, optional: true, nullable: false field :id, -> { String }, optional: true, nullable: false field :keys, -> { Internal::Types::Hash[String, String] }, optional: false, nullable: false field :last_seen_at, -> { String }, optional: true, nullable: false diff --git a/lib/schematic/types/warning_tier.rb b/lib/schematic/types/warning_tier.rb new file mode 100644 index 0000000..807e8e6 --- /dev/null +++ b/lib/schematic/types/warning_tier.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Schematic + module Types + class WarningTier < Internal::Types::Model + field :key, -> { String }, optional: false, nullable: false + field :value, -> { Integer }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/webhook_request_type.rb b/lib/schematic/types/webhook_request_type.rb index e9106ca..d81b0cf 100644 --- a/lib/schematic/types/webhook_request_type.rb +++ b/lib/schematic/types/webhook_request_type.rb @@ -17,6 +17,7 @@ module WebhookRequestType COMPANY_UPDATED = "company.updated" CREDIT_LIMIT_REACHED = "credit.limit.reached" CREDIT_LIMIT_WARNING = "credit.limit.warning" + CREDIT_PURCHASE_SUCCESS = "credit.purchase.success" ENTITLEMENT_LIMIT_REACHED = "entitlement.limit.reached" ENTITLEMENT_LIMIT_WARNING = "entitlement.limit.warning" ENTITLEMENT_SOFT_LIMIT_REACHED = "entitlement.soft_limit.reached" @@ -44,6 +45,7 @@ module WebhookRequestType USER_UPDATED = "user.updated" AUTO_TOPUP_HARD_FAILURE = "auto.topup.hard.failure" AUTO_TOPUP_RETRY_EXCEEDED = "auto.topup.retry.exceeded" + AUTO_TOPUP_SUCCESS = "auto.topup.success" end end end diff --git a/lib/schematic/version.rb b/lib/schematic/version.rb index dc4bf5d..8606ac9 100644 --- a/lib/schematic/version.rb +++ b/lib/schematic/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Schematic - VERSION = "1.4.9" + VERSION = "1.4.10" end diff --git a/reference.md b/reference.md index 60809ce..eeb08eb 100644 --- a/reference.md +++ b/reference.md @@ -6401,6 +6401,867 @@ client.credits.count_credit_event_ledger( + + + + +## catalogs +
client.catalogs.list_catalogs() -> Schematic::Catalogs::Types::ListCatalogsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.list_catalogs( + is_default: true, + q: "q", + limit: 1000000, + offset: 1000000 +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**is_default:** `Internal::Types::Boolean` + +
+
+ +
+
+ +**q:** `String` — Search by catalog name + +
+
+ +
+
+ +**limit:** `Integer` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `Integer` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.create_catalog(request) -> Schematic::Catalogs::Types::CreateCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.create_catalog( + is_default: true, + name: "name" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**description:** `String` + +
+
+ +
+
+ +**is_default:** `Internal::Types::Boolean` + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.get_catalog(catalog_id) -> Schematic::Catalogs::Types::GetCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.get_catalog(catalog_id: "catalog_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.update_catalog(catalog_id, request) -> Schematic::Catalogs::Types::UpdateCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.update_catalog(catalog_id: "catalog_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**description:** `String` + +
+
+ +
+
+ +**is_default:** `Internal::Types::Boolean` + +
+
+ +
+
+ +**name:** `String` + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.delete_catalog(catalog_id) -> Schematic::Catalogs::Types::DeleteCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.delete_catalog(catalog_id: "catalog_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.get_configuration(catalog_id) -> Schematic::Catalogs::Types::GetConfigurationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.get_configuration(catalog_id: "catalog_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.update_configuration(catalog_id, request) -> Schematic::Catalogs::Types::UpdateConfigurationResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.update_configuration(catalog_id: "catalog_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**custom_plan_cta_text:** `String` + +
+
+ +
+
+ +**custom_plan_cta_url:** `String` + +
+
+ +
+
+ +**custom_plan_price_text:** `String` + +
+
+ +
+
+ +**custom_plans_visible:** `Internal::Types::Boolean` + +
+
+ +
+
+ +**ordered_add_ons:** `Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlan]` + +
+
+ +
+
+ +**ordered_bundles:** `Internal::Types::Array[Schematic::Types::CatalogConfigOrderedBundle]` + +
+
+ +
+
+ +**ordered_plans:** `Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlan]` + +
+
+ +
+
+ +**pricing_model:** `String` + +
+
+ +
+
+ +**pricing_url:** `String` + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.get_credit_bundles_in_catalog(catalog_id) -> Schematic::Catalogs::Types::GetCreditBundlesInCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.get_credit_bundles_in_catalog(catalog_id: "catalog_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.add_credit_bundle(catalog_id, credit_bundle_id) -> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.add_credit_bundle( + catalog_id: "catalog_id", + credit_bundle_id: "credit_bundle_id" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**credit_bundle_id:** `String` — credit_bundle_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.remove_credit_bundle(catalog_id, credit_bundle_id) -> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.remove_credit_bundle( + catalog_id: "catalog_id", + credit_bundle_id: "credit_bundle_id" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**credit_bundle_id:** `String` — credit_bundle_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.get_derived_features(catalog_id) -> Schematic::Catalogs::Types::GetDerivedFeaturesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.get_derived_features(catalog_id: "catalog_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.get_plans_in_catalog(catalog_id) -> Schematic::Catalogs::Types::GetPlansInCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.get_plans_in_catalog(catalog_id: "catalog_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.add_plan(catalog_id, plan_id) -> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.add_plan( + catalog_id: "catalog_id", + plan_id: "plan_id" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**plan_id:** `String` — plan_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.catalogs.remove_plan(catalog_id, plan_id) -> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.catalogs.remove_plan( + catalog_id: "catalog_id", + plan_id: "plan_id" +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**catalog_id:** `String` — catalog_id + +
+
+ +
+
+ +**plan_id:** `String` — plan_id + +
+
+ +
+
+ +**request_options:** `Schematic::Catalogs::RequestOptions` + +
+
+
+
+ +
@@ -6419,7 +7280,143 @@ client.credits.count_credit_event_ledger(
```ruby -client.checkout.internal( +client.checkout.internal( + add_on_ids: [{ + add_on_id: "add_on_id", + price_id: "price_id" + }], + auto_topup_overrides: [{ + plan_credit_grant_id: "plan_credit_grant_id" + }], + company_id: "company_id", + credit_bundles: [{ + bundle_id: "bundle_id", + quantity: 1000000 + }], + custom_field_values: [{ + id: "id", + value: "value" + }], + new_plan_id: "new_plan_id", + new_price_id: "new_price_id", + pay_in_advance: [{ + price_id: "price_id", + quantity: 1000000 + }], + skip_trial: true +) +``` +
+ + + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Schematic::Types::ChangeSubscriptionInternalRequestBody` + +
+
+ +
+
+ +**request_options:** `Schematic::Checkout::RequestOptions` + +
+
+
+
+ + + + + + +
client.checkout.get_checkout_data(request) -> Schematic::Checkout::Types::GetCheckoutDataResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.checkout.get_checkout_data(company_id: "company_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `String` + +
+
+ +
+
+ +**currency:** `String` + +
+
+ +
+
+ +**selected_plan_id:** `String` + +
+
+ +
+
+ +**request_options:** `Schematic::Checkout::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.checkout.preview_checkout_internal(request) -> Schematic::Checkout::Types::PreviewCheckoutInternalResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.checkout.preview_checkout_internal( add_on_ids: [{ add_on_id: "add_on_id", price_id: "price_id" @@ -6478,7 +7475,7 @@ client.checkout.internal(
-
client.checkout.get_checkout_data(request) -> Schematic::Checkout::Types::GetCheckoutDataResponse +
client.checkout.get_company_billing_details(company_id) -> Schematic::Checkout::Types::GetCompanyBillingDetailsResponse
@@ -6491,7 +7488,7 @@ client.checkout.internal(
```ruby -client.checkout.get_checkout_data(company_id: "company_id") +client.checkout.get_company_billing_details(company_id: "company_id") ```
@@ -6506,23 +7503,7 @@ client.checkout.get_checkout_data(company_id: "company_id")
-**company_id:** `String` - -
-
- -
-
- -**currency:** `String` - -
-
- -
-
- -**selected_plan_id:** `String` +**company_id:** `String` — company_id
@@ -6542,7 +7523,7 @@ client.checkout.get_checkout_data(company_id: "company_id")
-
client.checkout.preview_checkout_internal(request) -> Schematic::Checkout::Types::PreviewCheckoutInternalResponse +
client.checkout.update_company_billing_details(company_id, request) -> Schematic::Checkout::Types::UpdateCompanyBillingDetailsResponse
@@ -6555,30 +7536,12 @@ client.checkout.get_checkout_data(company_id: "company_id")
```ruby -client.checkout.preview_checkout_internal( - add_on_ids: [{ - add_on_id: "add_on_id", - price_id: "price_id" - }], - auto_topup_overrides: [{ - plan_credit_grant_id: "plan_credit_grant_id" - }], +client.checkout.update_company_billing_details( company_id: "company_id", - credit_bundles: [{ - bundle_id: "bundle_id", - quantity: 1000000 - }], - custom_field_values: [{ + values: [{ id: "id", value: "value" - }], - new_plan_id: "new_plan_id", - new_price_id: "new_price_id", - pay_in_advance: [{ - price_id: "price_id", - quantity: 1000000 - }], - skip_trial: true + }] ) ```
@@ -6594,7 +7557,39 @@ client.checkout.preview_checkout_internal(
-**request:** `Schematic::Types::ChangeSubscriptionInternalRequestBody` +**company_id:** `String` — company_id + +
+
+ +
+
+ +**address:** `Schematic::Types::CustomerBillingAddress` + +
+
+ +
+
+ +**email:** `String` + +
+
+ +
+
+ +**phone:** `String` + +
+
+ +
+
+ +**values:** `Internal::Types::Array[Schematic::Types::CheckoutFieldValue]`
@@ -14210,6 +15205,62 @@ client.components.delete_component(component_id: "component_id")
+ + +
+ +
client.components.bind_catalog(component_id, request) -> Schematic::Components::Types::BindCatalogResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.components.bind_catalog(component_id: "component_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**component_id:** `String` — component_id + +
+
+ +
+
+ +**catalog_id:** `String` + +
+
+ +
+
+ +**request_options:** `Schematic::Components::RequestOptions` + +
+
+
+
+ +
@@ -14380,6 +15431,14 @@ client.planbundle.create_custom_plan_bundle(entitlements: [{
+**credit_grants:** `Internal::Types::Array[Schematic::Types::PlanBundleCreditGrantRequestBody]` + +
+
+ +
+
+ **entitlements:** `Internal::Types::Array[Schematic::Types::PlanBundleEntitlementRequestBody]`
@@ -14576,6 +15635,83 @@ client.planbundle.update_plan_bundle(
## dataexports +
client.dataexports.list_data_exports() -> Schematic::Dataexports::Types::ListDataExportsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.dataexports.list_data_exports( + export_type: "audit-log", + status: "failure", + limit: 1000000, + offset: 1000000 +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**export_type:** `Schematic::Types::DataExportType` + +
+
+ +
+
+ +**status:** `Schematic::Types::DataExportStatus` + +
+
+ +
+
+ +**limit:** `Integer` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `Integer` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `Schematic::Dataexports::RequestOptions` + +
+
+
+
+ + +
+
+
+
client.dataexports.create_data_export(request) -> Schematic::Dataexports::Types::CreateDataExportResponse
@@ -14590,8 +15726,7 @@ client.planbundle.update_plan_bundle( ```ruby client.dataexports.create_data_export( - export_type: "company-feature-usage", - metadata: "metadata", + export_type: "audit-log", output_file_type: "csv" ) ``` @@ -14608,7 +15743,23 @@ client.dataexports.create_data_export(
-**export_type:** `String` +**export_type:** `Schematic::Types::DataExportType` + +
+
+ +
+
+ +**metadata:** `Schematic::Types::DataExportMetadata` + +
+
+ +
+
+ +**output_file_type:** `Schematic::Types::DataExportOutputFileType`
@@ -14616,15 +15767,47 @@ client.dataexports.create_data_export(
-**metadata:** `String` +**request_options:** `Schematic::Dataexports::RequestOptions`
+
+
+ + + + +
+ +
client.dataexports.get_data_export(data_export_id) -> Schematic::Dataexports::Types::GetDataExportResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.dataexports.get_data_export(data_export_id: "data_export_id") +``` +
+
+
+
+ +#### ⚙️ Parameters
-**output_file_type:** `String` +
+
+ +**data_export_id:** `String` — data_export_id