schematichq 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.claude/settings.json +16 -0
- data/.claude/skills/pr-review/SKILL.md +129 -0
- data/.fern/metadata.json +18 -0
- data/.fernignore +21 -0
- data/.rubocop.yml +69 -0
- data/CLAUDE.md +45 -0
- data/LICENSE +21 -0
- data/README.md +639 -0
- data/Rakefile +20 -0
- data/WASM_VERSION +1 -0
- data/custom.gemspec.rb +10 -0
- data/lib/schematic/accesstokens/client.rb +46 -0
- data/lib/schematic/accesstokens/types/issue_temporary_access_token_request_body.rb +12 -0
- data/lib/schematic/accesstokens/types/issue_temporary_access_token_response.rb +12 -0
- data/lib/schematic/accounts/client.rb +604 -0
- data/lib/schematic/accounts/types/count_api_keys_params.rb +15 -0
- data/lib/schematic/accounts/types/count_api_keys_request.rb +14 -0
- data/lib/schematic/accounts/types/count_api_keys_response.rb +12 -0
- data/lib/schematic/accounts/types/count_audit_logs_params.rb +18 -0
- data/lib/schematic/accounts/types/count_audit_logs_request.rb +17 -0
- data/lib/schematic/accounts/types/count_audit_logs_response.rb +12 -0
- data/lib/schematic/accounts/types/create_api_key_request_body.rb +14 -0
- data/lib/schematic/accounts/types/create_api_key_response.rb +12 -0
- data/lib/schematic/accounts/types/create_environment_request_body.rb +12 -0
- data/lib/schematic/accounts/types/create_environment_response.rb +12 -0
- data/lib/schematic/accounts/types/delete_api_key_response.rb +12 -0
- data/lib/schematic/accounts/types/delete_environment_response.rb +12 -0
- data/lib/schematic/accounts/types/get_api_key_response.rb +12 -0
- data/lib/schematic/accounts/types/get_audit_log_response.rb +12 -0
- data/lib/schematic/accounts/types/get_environment_response.rb +12 -0
- data/lib/schematic/accounts/types/get_who_am_i_response.rb +12 -0
- data/lib/schematic/accounts/types/list_api_keys_params.rb +15 -0
- data/lib/schematic/accounts/types/list_api_keys_request.rb +14 -0
- data/lib/schematic/accounts/types/list_api_keys_response.rb +12 -0
- data/lib/schematic/accounts/types/list_audit_logs_params.rb +18 -0
- data/lib/schematic/accounts/types/list_audit_logs_request.rb +17 -0
- data/lib/schematic/accounts/types/list_audit_logs_response.rb +12 -0
- data/lib/schematic/accounts/types/list_environments_params.rb +14 -0
- data/lib/schematic/accounts/types/list_environments_request.rb +13 -0
- data/lib/schematic/accounts/types/list_environments_response.rb +12 -0
- data/lib/schematic/accounts/types/quickstart_response.rb +12 -0
- data/lib/schematic/accounts/types/update_api_key_request_body.rb +13 -0
- data/lib/schematic/accounts/types/update_api_key_response.rb +12 -0
- data/lib/schematic/accounts/types/update_environment_request_body.rb +13 -0
- data/lib/schematic/accounts/types/update_environment_response.rb +12 -0
- data/lib/schematic/billing/client.rb +862 -0
- data/lib/schematic/billing/types/count_billing_products_params.rb +23 -0
- data/lib/schematic/billing/types/count_billing_products_request.rb +22 -0
- data/lib/schematic/billing/types/count_billing_products_response.rb +12 -0
- data/lib/schematic/billing/types/count_customers_params.rb +17 -0
- data/lib/schematic/billing/types/count_customers_request.rb +16 -0
- data/lib/schematic/billing/types/count_customers_response.rb +12 -0
- data/lib/schematic/billing/types/create_billing_customer_request_body.rb +17 -0
- data/lib/schematic/billing/types/create_billing_price_request_body.rb +25 -0
- data/lib/schematic/billing/types/create_billing_product_request_body.rb +15 -0
- data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +29 -0
- data/lib/schematic/billing/types/create_coupon_request_body.rb +19 -0
- data/lib/schematic/billing/types/create_invoice_request_body.rb +23 -0
- data/lib/schematic/billing/types/create_meter_request_body.rb +14 -0
- data/lib/schematic/billing/types/create_payment_method_request_body.rb +22 -0
- data/lib/schematic/billing/types/delete_billing_product_response.rb +12 -0
- data/lib/schematic/billing/types/delete_product_price_response.rb +12 -0
- data/lib/schematic/billing/types/list_billing_prices_params.rb +27 -0
- data/lib/schematic/billing/types/list_billing_prices_request.rb +26 -0
- data/lib/schematic/billing/types/list_billing_prices_response.rb +12 -0
- data/lib/schematic/billing/types/list_billing_product_prices_params.rb +27 -0
- data/lib/schematic/billing/types/list_billing_product_prices_request.rb +26 -0
- data/lib/schematic/billing/types/list_billing_product_prices_response.rb +12 -0
- data/lib/schematic/billing/types/list_billing_products_params.rb +23 -0
- data/lib/schematic/billing/types/list_billing_products_request.rb +22 -0
- data/lib/schematic/billing/types/list_billing_products_response.rb +12 -0
- data/lib/schematic/billing/types/list_coupons_params.rb +15 -0
- data/lib/schematic/billing/types/list_coupons_request.rb +14 -0
- data/lib/schematic/billing/types/list_coupons_response.rb +12 -0
- data/lib/schematic/billing/types/list_customers_with_subscriptions_params.rb +17 -0
- data/lib/schematic/billing/types/list_customers_with_subscriptions_request.rb +16 -0
- data/lib/schematic/billing/types/list_customers_with_subscriptions_response.rb +12 -0
- data/lib/schematic/billing/types/list_invoices_params.rb +16 -0
- data/lib/schematic/billing/types/list_invoices_request.rb +15 -0
- data/lib/schematic/billing/types/list_invoices_response.rb +12 -0
- data/lib/schematic/billing/types/list_meters_params.rb +14 -0
- data/lib/schematic/billing/types/list_meters_request.rb +13 -0
- data/lib/schematic/billing/types/list_meters_response.rb +12 -0
- data/lib/schematic/billing/types/list_payment_methods_params.rb +15 -0
- data/lib/schematic/billing/types/list_payment_methods_request.rb +14 -0
- data/lib/schematic/billing/types/list_payment_methods_response.rb +12 -0
- data/lib/schematic/billing/types/upsert_billing_coupon_response.rb +12 -0
- data/lib/schematic/billing/types/upsert_billing_customer_response.rb +12 -0
- data/lib/schematic/billing/types/upsert_billing_meter_response.rb +12 -0
- data/lib/schematic/billing/types/upsert_billing_price_response.rb +12 -0
- data/lib/schematic/billing/types/upsert_billing_product_response.rb +12 -0
- data/lib/schematic/billing/types/upsert_billing_subscription_response.rb +12 -0
- data/lib/schematic/billing/types/upsert_invoice_response.rb +12 -0
- data/lib/schematic/billing/types/upsert_payment_method_response.rb +12 -0
- data/lib/schematic/cache.rb +133 -0
- data/lib/schematic/checkout/client.rb +243 -0
- data/lib/schematic/checkout/types/cancel_subscription_request.rb +13 -0
- data/lib/schematic/checkout/types/cancel_subscription_response.rb +12 -0
- data/lib/schematic/checkout/types/checkout_data_request_body.rb +12 -0
- data/lib/schematic/checkout/types/checkout_internal_response.rb +12 -0
- data/lib/schematic/checkout/types/get_checkout_data_response.rb +12 -0
- data/lib/schematic/checkout/types/manage_plan_response.rb +12 -0
- data/lib/schematic/checkout/types/preview_checkout_internal_response.rb +12 -0
- data/lib/schematic/checkout/types/preview_manage_plan_response.rb +12 -0
- data/lib/schematic/checkout/types/update_customer_subscription_trial_end_response.rb +12 -0
- data/lib/schematic/checkout/types/update_trial_end_request_body.rb +12 -0
- data/lib/schematic/client.rb +110 -0
- data/lib/schematic/companies/client.rb +1561 -0
- data/lib/schematic/companies/types/count_companies_params.rb +29 -0
- data/lib/schematic/companies/types/count_companies_request.rb +28 -0
- data/lib/schematic/companies/types/count_companies_response.rb +12 -0
- data/lib/schematic/companies/types/count_entity_key_definitions_params.rb +16 -0
- data/lib/schematic/companies/types/count_entity_key_definitions_request.rb +15 -0
- data/lib/schematic/companies/types/count_entity_key_definitions_response.rb +12 -0
- data/lib/schematic/companies/types/count_entity_trait_definitions_params.rb +18 -0
- data/lib/schematic/companies/types/count_entity_trait_definitions_request.rb +17 -0
- data/lib/schematic/companies/types/count_entity_trait_definitions_response.rb +12 -0
- data/lib/schematic/companies/types/count_plan_traits_params.rb +17 -0
- data/lib/schematic/companies/types/count_plan_traits_request.rb +16 -0
- data/lib/schematic/companies/types/count_plan_traits_response.rb +12 -0
- data/lib/schematic/companies/types/count_users_params.rb +17 -0
- data/lib/schematic/companies/types/count_users_request.rb +16 -0
- data/lib/schematic/companies/types/count_users_response.rb +12 -0
- data/lib/schematic/companies/types/create_company_response.rb +12 -0
- data/lib/schematic/companies/types/create_entity_trait_definition_request_body.rb +14 -0
- data/lib/schematic/companies/types/create_plan_trait_request_body.rb +13 -0
- data/lib/schematic/companies/types/create_plan_trait_response.rb +12 -0
- data/lib/schematic/companies/types/create_user_response.rb +12 -0
- data/lib/schematic/companies/types/delete_company_by_keys_response.rb +12 -0
- data/lib/schematic/companies/types/delete_company_membership_response.rb +12 -0
- data/lib/schematic/companies/types/delete_company_params.rb +13 -0
- data/lib/schematic/companies/types/delete_company_request.rb +13 -0
- data/lib/schematic/companies/types/delete_company_response.rb +12 -0
- data/lib/schematic/companies/types/delete_plan_trait_response.rb +12 -0
- data/lib/schematic/companies/types/delete_user_by_keys_response.rb +12 -0
- data/lib/schematic/companies/types/delete_user_response.rb +12 -0
- data/lib/schematic/companies/types/get_active_company_subscription_params.rb +15 -0
- data/lib/schematic/companies/types/get_active_company_subscription_request.rb +14 -0
- data/lib/schematic/companies/types/get_active_company_subscription_response.rb +12 -0
- data/lib/schematic/companies/types/get_company_response.rb +12 -0
- data/lib/schematic/companies/types/get_entity_trait_definition_response.rb +12 -0
- data/lib/schematic/companies/types/get_entity_trait_values_params.rb +15 -0
- data/lib/schematic/companies/types/get_entity_trait_values_request.rb +14 -0
- data/lib/schematic/companies/types/get_entity_trait_values_response.rb +12 -0
- data/lib/schematic/companies/types/get_or_create_company_membership_request_body.rb +12 -0
- data/lib/schematic/companies/types/get_or_create_company_membership_response.rb +12 -0
- data/lib/schematic/companies/types/get_or_create_entity_trait_definition_response.rb +12 -0
- data/lib/schematic/companies/types/get_plan_change_response.rb +12 -0
- data/lib/schematic/companies/types/get_plan_trait_response.rb +12 -0
- data/lib/schematic/companies/types/get_user_response.rb +12 -0
- data/lib/schematic/companies/types/list_companies_params.rb +29 -0
- data/lib/schematic/companies/types/list_companies_request.rb +28 -0
- data/lib/schematic/companies/types/list_companies_response.rb +12 -0
- data/lib/schematic/companies/types/list_company_memberships_params.rb +15 -0
- data/lib/schematic/companies/types/list_company_memberships_request.rb +14 -0
- data/lib/schematic/companies/types/list_company_memberships_response.rb +12 -0
- data/lib/schematic/companies/types/list_entity_key_definitions_params.rb +16 -0
- data/lib/schematic/companies/types/list_entity_key_definitions_request.rb +15 -0
- data/lib/schematic/companies/types/list_entity_key_definitions_response.rb +12 -0
- data/lib/schematic/companies/types/list_entity_trait_definitions_params.rb +18 -0
- data/lib/schematic/companies/types/list_entity_trait_definitions_request.rb +17 -0
- data/lib/schematic/companies/types/list_entity_trait_definitions_response.rb +12 -0
- data/lib/schematic/companies/types/list_plan_changes_params.rb +18 -0
- data/lib/schematic/companies/types/list_plan_changes_request.rb +17 -0
- data/lib/schematic/companies/types/list_plan_changes_response.rb +12 -0
- data/lib/schematic/companies/types/list_plan_traits_params.rb +17 -0
- data/lib/schematic/companies/types/list_plan_traits_request.rb +16 -0
- data/lib/schematic/companies/types/list_plan_traits_response.rb +12 -0
- data/lib/schematic/companies/types/list_users_params.rb +17 -0
- data/lib/schematic/companies/types/list_users_request.rb +16 -0
- data/lib/schematic/companies/types/list_users_response.rb +12 -0
- data/lib/schematic/companies/types/lookup_company_params.rb +12 -0
- data/lib/schematic/companies/types/lookup_company_request.rb +11 -0
- data/lib/schematic/companies/types/lookup_company_response.rb +12 -0
- data/lib/schematic/companies/types/lookup_user_params.rb +12 -0
- data/lib/schematic/companies/types/lookup_user_request.rb +11 -0
- data/lib/schematic/companies/types/lookup_user_response.rb +12 -0
- data/lib/schematic/companies/types/update_entity_trait_definition_request_body.rb +13 -0
- data/lib/schematic/companies/types/update_entity_trait_definition_response.rb +12 -0
- data/lib/schematic/companies/types/update_plan_trait_bulk_request_body.rb +13 -0
- data/lib/schematic/companies/types/update_plan_trait_request_body.rb +13 -0
- data/lib/schematic/companies/types/update_plan_trait_response.rb +12 -0
- data/lib/schematic/companies/types/update_plan_traits_bulk_response.rb +12 -0
- data/lib/schematic/companies/types/upsert_company_response.rb +12 -0
- data/lib/schematic/companies/types/upsert_company_trait_response.rb +12 -0
- data/lib/schematic/companies/types/upsert_user_response.rb +12 -0
- data/lib/schematic/companies/types/upsert_user_trait_response.rb +12 -0
- data/lib/schematic/components/client.rb +271 -0
- data/lib/schematic/components/types/count_components_params.rb +14 -0
- data/lib/schematic/components/types/count_components_request.rb +13 -0
- data/lib/schematic/components/types/count_components_response.rb +12 -0
- data/lib/schematic/components/types/create_component_request_body.rb +13 -0
- data/lib/schematic/components/types/create_component_response.rb +12 -0
- data/lib/schematic/components/types/delete_component_response.rb +12 -0
- data/lib/schematic/components/types/get_component_response.rb +12 -0
- data/lib/schematic/components/types/list_components_params.rb +14 -0
- data/lib/schematic/components/types/list_components_request.rb +13 -0
- data/lib/schematic/components/types/list_components_response.rb +12 -0
- data/lib/schematic/components/types/preview_component_data_params.rb +13 -0
- data/lib/schematic/components/types/preview_component_data_request.rb +12 -0
- data/lib/schematic/components/types/preview_component_data_response.rb +12 -0
- data/lib/schematic/components/types/update_component_request_body.rb +15 -0
- data/lib/schematic/components/types/update_component_response.rb +12 -0
- data/lib/schematic/componentspublic/client.rb +45 -0
- data/lib/schematic/componentspublic/types/get_public_plans_response.rb +12 -0
- data/lib/schematic/credits/client.rb +1157 -0
- data/lib/schematic/credits/types/count_billing_credits_grants_params.rb +15 -0
- data/lib/schematic/credits/types/count_billing_credits_grants_request.rb +14 -0
- data/lib/schematic/credits/types/count_billing_credits_grants_response.rb +12 -0
- data/lib/schematic/credits/types/count_billing_credits_params.rb +15 -0
- data/lib/schematic/credits/types/count_billing_credits_request.rb +14 -0
- data/lib/schematic/credits/types/count_billing_credits_response.rb +12 -0
- data/lib/schematic/credits/types/count_billing_plan_credit_grants_params.rb +18 -0
- data/lib/schematic/credits/types/count_billing_plan_credit_grants_request.rb +17 -0
- data/lib/schematic/credits/types/count_billing_plan_credit_grants_response.rb +12 -0
- data/lib/schematic/credits/types/count_company_grants_params.rb +16 -0
- data/lib/schematic/credits/types/count_company_grants_request.rb +15 -0
- data/lib/schematic/credits/types/count_company_grants_response.rb +12 -0
- data/lib/schematic/credits/types/count_credit_bundles_params.rb +17 -0
- data/lib/schematic/credits/types/count_credit_bundles_request.rb +16 -0
- data/lib/schematic/credits/types/count_credit_bundles_response.rb +12 -0
- data/lib/schematic/credits/types/count_credit_event_ledger_params.rb +19 -0
- data/lib/schematic/credits/types/count_credit_event_ledger_request.rb +18 -0
- data/lib/schematic/credits/types/count_credit_event_ledger_response.rb +12 -0
- data/lib/schematic/credits/types/count_credit_ledger_params.rb +19 -0
- data/lib/schematic/credits/types/count_credit_ledger_request.rb +18 -0
- data/lib/schematic/credits/types/count_credit_ledger_response.rb +12 -0
- data/lib/schematic/credits/types/create_billing_credit_request_body.rb +23 -0
- data/lib/schematic/credits/types/create_billing_credit_response.rb +12 -0
- data/lib/schematic/credits/types/create_billing_plan_credit_grant_response.rb +12 -0
- data/lib/schematic/credits/types/create_company_credit_grant.rb +22 -0
- data/lib/schematic/credits/types/create_credit_bundle_request_body.rb +22 -0
- data/lib/schematic/credits/types/create_credit_bundle_response.rb +12 -0
- data/lib/schematic/credits/types/delete_billing_plan_credit_grant_params.rb +12 -0
- data/lib/schematic/credits/types/delete_billing_plan_credit_grant_request.rb +12 -0
- data/lib/schematic/credits/types/delete_billing_plan_credit_grant_response.rb +12 -0
- data/lib/schematic/credits/types/delete_credit_bundle_response.rb +12 -0
- data/lib/schematic/credits/types/get_credit_bundle_response.rb +12 -0
- data/lib/schematic/credits/types/get_enriched_credit_ledger_params.rb +19 -0
- data/lib/schematic/credits/types/get_enriched_credit_ledger_request.rb +18 -0
- data/lib/schematic/credits/types/get_enriched_credit_ledger_response.rb +12 -0
- data/lib/schematic/credits/types/get_single_billing_credit_response.rb +12 -0
- data/lib/schematic/credits/types/get_single_billing_plan_credit_grant_response.rb +12 -0
- data/lib/schematic/credits/types/grant_billing_credits_to_company_response.rb +12 -0
- data/lib/schematic/credits/types/list_billing_credits_params.rb +15 -0
- data/lib/schematic/credits/types/list_billing_credits_request.rb +14 -0
- data/lib/schematic/credits/types/list_billing_credits_response.rb +12 -0
- data/lib/schematic/credits/types/list_billing_plan_credit_grants_params.rb +18 -0
- data/lib/schematic/credits/types/list_billing_plan_credit_grants_request.rb +17 -0
- data/lib/schematic/credits/types/list_billing_plan_credit_grants_response.rb +12 -0
- data/lib/schematic/credits/types/list_company_grants_params.rb +16 -0
- data/lib/schematic/credits/types/list_company_grants_request.rb +15 -0
- data/lib/schematic/credits/types/list_company_grants_response.rb +12 -0
- data/lib/schematic/credits/types/list_credit_bundles_params.rb +17 -0
- data/lib/schematic/credits/types/list_credit_bundles_request.rb +16 -0
- data/lib/schematic/credits/types/list_credit_bundles_response.rb +12 -0
- data/lib/schematic/credits/types/list_credit_event_ledger_params.rb +19 -0
- data/lib/schematic/credits/types/list_credit_event_ledger_request.rb +18 -0
- data/lib/schematic/credits/types/list_credit_event_ledger_response.rb +12 -0
- data/lib/schematic/credits/types/list_grants_for_credit_params.rb +15 -0
- data/lib/schematic/credits/types/list_grants_for_credit_request.rb +14 -0
- data/lib/schematic/credits/types/list_grants_for_credit_response.rb +12 -0
- data/lib/schematic/credits/types/soft_delete_billing_credit_response.rb +12 -0
- data/lib/schematic/credits/types/update_billing_credit_request_body.rb +23 -0
- data/lib/schematic/credits/types/update_billing_credit_response.rb +12 -0
- data/lib/schematic/credits/types/update_billing_plan_credit_grant_response.rb +12 -0
- data/lib/schematic/credits/types/update_credit_bundle_details_request_body.rb +20 -0
- data/lib/schematic/credits/types/update_credit_bundle_details_response.rb +12 -0
- data/lib/schematic/credits/types/zero_out_grant_request_body.rb +12 -0
- data/lib/schematic/credits/types/zero_out_grant_response.rb +12 -0
- data/lib/schematic/dataexports/client.rb +76 -0
- data/lib/schematic/dataexports/types/create_data_export_request_body.rb +13 -0
- data/lib/schematic/dataexports/types/create_data_export_response.rb +12 -0
- data/lib/schematic/datastream/client.rb +508 -0
- data/lib/schematic/datastream/merge.rb +95 -0
- data/lib/schematic/datastream/resource_cache.rb +76 -0
- data/lib/schematic/datastream/websocket_client.rb +315 -0
- data/lib/schematic/entitlements/client.rb +900 -0
- data/lib/schematic/entitlements/types/count_company_overrides_params.rb +20 -0
- data/lib/schematic/entitlements/types/count_company_overrides_request.rb +19 -0
- data/lib/schematic/entitlements/types/count_company_overrides_response.rb +12 -0
- data/lib/schematic/entitlements/types/count_feature_companies_params.rb +15 -0
- data/lib/schematic/entitlements/types/count_feature_companies_request.rb +14 -0
- data/lib/schematic/entitlements/types/count_feature_companies_response.rb +12 -0
- data/lib/schematic/entitlements/types/count_feature_usage_params.rb +19 -0
- data/lib/schematic/entitlements/types/count_feature_usage_request.rb +18 -0
- data/lib/schematic/entitlements/types/count_feature_usage_response.rb +12 -0
- data/lib/schematic/entitlements/types/count_feature_users_params.rb +15 -0
- data/lib/schematic/entitlements/types/count_feature_users_request.rb +14 -0
- data/lib/schematic/entitlements/types/count_feature_users_response.rb +12 -0
- data/lib/schematic/entitlements/types/count_plan_entitlements_params.rb +22 -0
- data/lib/schematic/entitlements/types/count_plan_entitlements_request.rb +21 -0
- data/lib/schematic/entitlements/types/count_plan_entitlements_response.rb +12 -0
- data/lib/schematic/entitlements/types/create_company_override_request_body.rb +22 -0
- data/lib/schematic/entitlements/types/create_company_override_request_body_metric_period.rb +16 -0
- data/lib/schematic/entitlements/types/create_company_override_request_body_metric_period_month_reset.rb +14 -0
- data/lib/schematic/entitlements/types/create_company_override_response.rb +12 -0
- data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +38 -0
- data/lib/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period.rb +16 -0
- data/lib/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period_month_reset.rb +14 -0
- data/lib/schematic/entitlements/types/create_plan_entitlement_response.rb +12 -0
- data/lib/schematic/entitlements/types/delete_company_override_response.rb +12 -0
- data/lib/schematic/entitlements/types/delete_plan_entitlement_response.rb +12 -0
- data/lib/schematic/entitlements/types/duplicate_plan_entitlements_request_body.rb +12 -0
- data/lib/schematic/entitlements/types/duplicate_plan_entitlements_response.rb +12 -0
- data/lib/schematic/entitlements/types/get_company_override_response.rb +12 -0
- data/lib/schematic/entitlements/types/get_feature_usage_by_company_params.rb +12 -0
- data/lib/schematic/entitlements/types/get_feature_usage_by_company_request.rb +11 -0
- data/lib/schematic/entitlements/types/get_feature_usage_by_company_response.rb +12 -0
- data/lib/schematic/entitlements/types/get_feature_usage_time_series_params.rb +16 -0
- data/lib/schematic/entitlements/types/get_feature_usage_time_series_request.rb +15 -0
- data/lib/schematic/entitlements/types/get_feature_usage_time_series_response.rb +12 -0
- data/lib/schematic/entitlements/types/get_plan_entitlement_response.rb +12 -0
- data/lib/schematic/entitlements/types/list_company_overrides_params.rb +20 -0
- data/lib/schematic/entitlements/types/list_company_overrides_request.rb +19 -0
- data/lib/schematic/entitlements/types/list_company_overrides_response.rb +12 -0
- data/lib/schematic/entitlements/types/list_feature_companies_params.rb +15 -0
- data/lib/schematic/entitlements/types/list_feature_companies_request.rb +14 -0
- data/lib/schematic/entitlements/types/list_feature_companies_response.rb +12 -0
- data/lib/schematic/entitlements/types/list_feature_usage_params.rb +19 -0
- data/lib/schematic/entitlements/types/list_feature_usage_request.rb +18 -0
- data/lib/schematic/entitlements/types/list_feature_usage_response.rb +12 -0
- data/lib/schematic/entitlements/types/list_feature_users_params.rb +15 -0
- data/lib/schematic/entitlements/types/list_feature_users_request.rb +14 -0
- data/lib/schematic/entitlements/types/list_feature_users_response.rb +12 -0
- data/lib/schematic/entitlements/types/list_plan_entitlements_params.rb +22 -0
- data/lib/schematic/entitlements/types/list_plan_entitlements_request.rb +21 -0
- data/lib/schematic/entitlements/types/list_plan_entitlements_response.rb +12 -0
- data/lib/schematic/entitlements/types/update_company_override_request_body.rb +21 -0
- data/lib/schematic/entitlements/types/update_company_override_request_body_metric_period.rb +16 -0
- data/lib/schematic/entitlements/types/update_company_override_request_body_metric_period_month_reset.rb +14 -0
- data/lib/schematic/entitlements/types/update_company_override_response.rb +12 -0
- data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +36 -0
- data/lib/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period.rb +16 -0
- data/lib/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period_month_reset.rb +14 -0
- data/lib/schematic/entitlements/types/update_plan_entitlement_response.rb +12 -0
- data/lib/schematic/environment.rb +7 -0
- data/lib/schematic/errors/api_error.rb +8 -0
- data/lib/schematic/errors/client_error.rb +17 -0
- data/lib/schematic/errors/redirect_error.rb +8 -0
- data/lib/schematic/errors/response_error.rb +42 -0
- data/lib/schematic/errors/server_error.rb +11 -0
- data/lib/schematic/errors/timeout_error.rb +8 -0
- data/lib/schematic/event_buffer.rb +180 -0
- data/lib/schematic/events/client.rb +235 -0
- data/lib/schematic/events/types/create_event_batch_request_body.rb +11 -0
- data/lib/schematic/events/types/create_event_batch_response.rb +12 -0
- data/lib/schematic/events/types/create_event_response.rb +12 -0
- data/lib/schematic/events/types/get_event_response.rb +12 -0
- data/lib/schematic/events/types/get_event_summaries_params.rb +15 -0
- data/lib/schematic/events/types/get_event_summaries_request.rb +14 -0
- data/lib/schematic/events/types/get_event_summaries_response.rb +12 -0
- data/lib/schematic/events/types/get_segment_integration_status_response.rb +12 -0
- data/lib/schematic/events/types/list_events_params.rb +18 -0
- data/lib/schematic/events/types/list_events_request.rb +17 -0
- data/lib/schematic/events/types/list_events_response.rb +12 -0
- data/lib/schematic/features/client.rb +610 -0
- data/lib/schematic/features/types/check_flag_response.rb +12 -0
- data/lib/schematic/features/types/check_flags_bulk_request_body.rb +11 -0
- data/lib/schematic/features/types/check_flags_bulk_response.rb +12 -0
- data/lib/schematic/features/types/check_flags_response.rb +12 -0
- data/lib/schematic/features/types/count_features_params.rb +20 -0
- data/lib/schematic/features/types/count_features_request.rb +19 -0
- data/lib/schematic/features/types/count_features_response.rb +12 -0
- data/lib/schematic/features/types/count_flags_params.rb +16 -0
- data/lib/schematic/features/types/count_flags_request.rb +15 -0
- data/lib/schematic/features/types/count_flags_response.rb +12 -0
- data/lib/schematic/features/types/create_feature_request_body.rb +21 -0
- data/lib/schematic/features/types/create_feature_response.rb +12 -0
- data/lib/schematic/features/types/create_flag_response.rb +12 -0
- data/lib/schematic/features/types/delete_feature_response.rb +12 -0
- data/lib/schematic/features/types/delete_flag_response.rb +12 -0
- data/lib/schematic/features/types/get_feature_response.rb +12 -0
- data/lib/schematic/features/types/get_flag_response.rb +12 -0
- data/lib/schematic/features/types/list_features_params.rb +20 -0
- data/lib/schematic/features/types/list_features_request.rb +19 -0
- data/lib/schematic/features/types/list_features_response.rb +12 -0
- data/lib/schematic/features/types/list_flags_params.rb +16 -0
- data/lib/schematic/features/types/list_flags_request.rb +15 -0
- data/lib/schematic/features/types/list_flags_response.rb +12 -0
- data/lib/schematic/features/types/update_feature_request_body.rb +22 -0
- data/lib/schematic/features/types/update_feature_response.rb +12 -0
- data/lib/schematic/features/types/update_flag_response.rb +12 -0
- data/lib/schematic/features/types/update_flag_rules_request_body.rb +12 -0
- data/lib/schematic/features/types/update_flag_rules_response.rb +12 -0
- data/lib/schematic/internal/errors/constraint_error.rb +10 -0
- data/lib/schematic/internal/errors/type_error.rb +10 -0
- data/lib/schematic/internal/http/base_request.rb +51 -0
- data/lib/schematic/internal/http/raw_client.rb +214 -0
- data/lib/schematic/internal/iterators/cursor_item_iterator.rb +28 -0
- data/lib/schematic/internal/iterators/cursor_page_iterator.rb +51 -0
- data/lib/schematic/internal/iterators/item_iterator.rb +59 -0
- data/lib/schematic/internal/iterators/offset_item_iterator.rb +30 -0
- data/lib/schematic/internal/iterators/offset_page_iterator.rb +83 -0
- data/lib/schematic/internal/json/request.rb +41 -0
- data/lib/schematic/internal/json/serializable.rb +25 -0
- data/lib/schematic/internal/multipart/multipart_encoder.rb +141 -0
- data/lib/schematic/internal/multipart/multipart_form_data.rb +78 -0
- data/lib/schematic/internal/multipart/multipart_form_data_part.rb +51 -0
- data/lib/schematic/internal/multipart/multipart_request.rb +40 -0
- data/lib/schematic/internal/types/array.rb +47 -0
- data/lib/schematic/internal/types/boolean.rb +34 -0
- data/lib/schematic/internal/types/enum.rb +56 -0
- data/lib/schematic/internal/types/hash.rb +36 -0
- data/lib/schematic/internal/types/model/field.rb +38 -0
- data/lib/schematic/internal/types/model.rb +208 -0
- data/lib/schematic/internal/types/type.rb +35 -0
- data/lib/schematic/internal/types/union.rb +161 -0
- data/lib/schematic/internal/types/unknown.rb +15 -0
- data/lib/schematic/internal/types/utils.rb +116 -0
- data/lib/schematic/logger.rb +62 -0
- data/lib/schematic/planbundle/client.rb +83 -0
- data/lib/schematic/planbundle/types/create_plan_bundle_request_body.rb +15 -0
- data/lib/schematic/planbundle/types/create_plan_bundle_response.rb +12 -0
- data/lib/schematic/planbundle/types/update_plan_bundle_request_body.rb +17 -0
- data/lib/schematic/planbundle/types/update_plan_bundle_response.rb +12 -0
- data/lib/schematic/plangroups/client.rb +121 -0
- data/lib/schematic/plangroups/types/create_plan_group_request_body.rb +42 -0
- data/lib/schematic/plangroups/types/create_plan_group_response.rb +12 -0
- data/lib/schematic/plangroups/types/get_plan_group_params.rb +12 -0
- data/lib/schematic/plangroups/types/get_plan_group_request.rb +11 -0
- data/lib/schematic/plangroups/types/get_plan_group_response.rb +12 -0
- data/lib/schematic/plangroups/types/update_plan_group_request_body.rb +43 -0
- data/lib/schematic/plangroups/types/update_plan_group_response.rb +12 -0
- data/lib/schematic/planmigrations/client.rb +226 -0
- data/lib/schematic/planmigrations/types/count_company_migrations_params.rb +16 -0
- data/lib/schematic/planmigrations/types/count_company_migrations_request.rb +15 -0
- data/lib/schematic/planmigrations/types/count_company_migrations_response.rb +12 -0
- data/lib/schematic/planmigrations/types/count_migrations_params.rb +15 -0
- data/lib/schematic/planmigrations/types/count_migrations_request.rb +14 -0
- data/lib/schematic/planmigrations/types/count_migrations_response.rb +12 -0
- data/lib/schematic/planmigrations/types/get_migration_response.rb +12 -0
- data/lib/schematic/planmigrations/types/list_company_migrations_params.rb +16 -0
- data/lib/schematic/planmigrations/types/list_company_migrations_request.rb +15 -0
- data/lib/schematic/planmigrations/types/list_company_migrations_response.rb +12 -0
- data/lib/schematic/planmigrations/types/list_migrations_params.rb +15 -0
- data/lib/schematic/planmigrations/types/list_migrations_request.rb +14 -0
- data/lib/schematic/planmigrations/types/list_migrations_response.rb +12 -0
- data/lib/schematic/plans/client.rb +460 -0
- data/lib/schematic/plans/types/count_plans_params.rb +24 -0
- data/lib/schematic/plans/types/count_plans_request.rb +23 -0
- data/lib/schematic/plans/types/count_plans_response.rb +12 -0
- data/lib/schematic/plans/types/create_plan_response.rb +12 -0
- data/lib/schematic/plans/types/delete_plan_response.rb +12 -0
- data/lib/schematic/plans/types/delete_plan_version_params.rb +12 -0
- data/lib/schematic/plans/types/delete_plan_version_request.rb +12 -0
- data/lib/schematic/plans/types/delete_plan_version_response.rb +12 -0
- data/lib/schematic/plans/types/get_plan_params.rb +12 -0
- data/lib/schematic/plans/types/get_plan_request.rb +12 -0
- data/lib/schematic/plans/types/get_plan_response.rb +12 -0
- data/lib/schematic/plans/types/list_plan_issues_params.rb +13 -0
- data/lib/schematic/plans/types/list_plan_issues_request.rb +12 -0
- data/lib/schematic/plans/types/list_plan_issues_response.rb +12 -0
- data/lib/schematic/plans/types/list_plans_params.rb +24 -0
- data/lib/schematic/plans/types/list_plans_request.rb +23 -0
- data/lib/schematic/plans/types/list_plans_response.rb +12 -0
- data/lib/schematic/plans/types/publish_plan_version_request_body.rb +13 -0
- data/lib/schematic/plans/types/publish_plan_version_response.rb +12 -0
- data/lib/schematic/plans/types/update_company_plans_request_body.rb +13 -0
- data/lib/schematic/plans/types/update_company_plans_response.rb +12 -0
- data/lib/schematic/plans/types/update_plan_response.rb +12 -0
- data/lib/schematic/plans/types/upsert_billing_product_plan_response.rb +12 -0
- data/lib/schematic/redis_cache.rb +94 -0
- data/lib/schematic/rules_engine.rb +145 -0
- data/lib/schematic/scheduledcheckout/client.rb +159 -0
- data/lib/schematic/scheduledcheckout/types/create_scheduled_checkout_request.rb +14 -0
- data/lib/schematic/scheduledcheckout/types/create_scheduled_checkout_response.rb +12 -0
- data/lib/schematic/scheduledcheckout/types/get_scheduled_checkout_response.rb +12 -0
- data/lib/schematic/scheduledcheckout/types/list_scheduled_checkouts_params.rb +15 -0
- data/lib/schematic/scheduledcheckout/types/list_scheduled_checkouts_request.rb +14 -0
- data/lib/schematic/scheduledcheckout/types/list_scheduled_checkouts_response.rb +12 -0
- data/lib/schematic/scheduledcheckout/types/update_scheduled_checkout_request.rb +13 -0
- data/lib/schematic/scheduledcheckout/types/update_scheduled_checkout_response.rb +12 -0
- data/lib/schematic/schematic_client.rb +552 -0
- data/lib/schematic/types/actor_type.rb +15 -0
- data/lib/schematic/types/api_error.rb +9 -0
- data/lib/schematic/types/api_key_create_response_data.rb +18 -0
- data/lib/schematic/types/api_key_response_data.rb +17 -0
- data/lib/schematic/types/api_key_scope.rb +14 -0
- data/lib/schematic/types/audit_log_list_response_data.rb +23 -0
- data/lib/schematic/types/audit_log_response_data.rb +26 -0
- data/lib/schematic/types/billing_coupon_response_data.rb +25 -0
- data/lib/schematic/types/billing_credit_bundle_response_data.rb +29 -0
- data/lib/schematic/types/billing_credit_bundle_status.rb +12 -0
- data/lib/schematic/types/billing_credit_bundle_type.rb +23 -0
- data/lib/schematic/types/billing_credit_bundle_view.rb +28 -0
- data/lib/schematic/types/billing_credit_burn_strategy.rb +14 -0
- data/lib/schematic/types/billing_credit_expiry_type.rb +15 -0
- data/lib/schematic/types/billing_credit_expiry_unit.rb +12 -0
- data/lib/schematic/types/billing_credit_grant_reason.rb +15 -0
- data/lib/schematic/types/billing_credit_grant_response_data.rb +32 -0
- data/lib/schematic/types/billing_credit_grant_zeroed_out_reason.rb +14 -0
- data/lib/schematic/types/billing_credit_ledger_response_data.rb +14 -0
- data/lib/schematic/types/billing_credit_response_data.rb +24 -0
- data/lib/schematic/types/billing_credit_rollover_policy.rb +13 -0
- data/lib/schematic/types/billing_credit_view.rb +27 -0
- data/lib/schematic/types/billing_customer_response_data.rb +16 -0
- data/lib/schematic/types/billing_customer_subscription.rb +14 -0
- data/lib/schematic/types/billing_customer_with_subscriptions_response_data.rb +17 -0
- data/lib/schematic/types/billing_meter_response_data.rb +14 -0
- data/lib/schematic/types/billing_plan_credit_grant_reset_cadence.rb +14 -0
- data/lib/schematic/types/billing_plan_credit_grant_reset_start.rb +12 -0
- data/lib/schematic/types/billing_plan_credit_grant_reset_type.rb +12 -0
- data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +34 -0
- data/lib/schematic/types/billing_price_response_data.rb +16 -0
- data/lib/schematic/types/billing_price_scheme.rb +12 -0
- data/lib/schematic/types/billing_price_usage_type.rb +12 -0
- data/lib/schematic/types/billing_price_view.rb +30 -0
- data/lib/schematic/types/billing_product_detail_response_data.rb +23 -0
- data/lib/schematic/types/billing_product_for_subscription_response_data.rb +30 -0
- data/lib/schematic/types/billing_product_plan_response_data.rb +19 -0
- data/lib/schematic/types/billing_product_price_interval.rb +14 -0
- data/lib/schematic/types/billing_product_price_response_data.rb +24 -0
- data/lib/schematic/types/billing_product_price_tier_response_data.rb +12 -0
- data/lib/schematic/types/billing_product_pricing.rb +20 -0
- data/lib/schematic/types/billing_product_response_data.rb +21 -0
- data/lib/schematic/types/billing_provider_type.rb +12 -0
- data/lib/schematic/types/billing_subscription_discount.rb +15 -0
- data/lib/schematic/types/billing_subscription_discount_view.rb +22 -0
- data/lib/schematic/types/billing_subscription_response_data.rb +28 -0
- data/lib/schematic/types/billing_subscription_trial_end_setting.rb +12 -0
- data/lib/schematic/types/billing_subscription_view.rb +32 -0
- data/lib/schematic/types/billing_tiers_mode.rb +12 -0
- data/lib/schematic/types/capture_raw_event.rb +13 -0
- data/lib/schematic/types/capture_raw_event_batch.rb +9 -0
- data/lib/schematic/types/change_subscription_internal_request_body.rb +18 -0
- data/lib/schematic/types/change_subscription_request_body.rb +17 -0
- data/lib/schematic/types/charge_type.rb +13 -0
- data/lib/schematic/types/check_flag_request_body.rb +10 -0
- data/lib/schematic/types/check_flag_response_data.rb +23 -0
- data/lib/schematic/types/check_flags_bulk_response_data.rb +9 -0
- data/lib/schematic/types/check_flags_response_data.rb +10 -0
- data/lib/schematic/types/checkout_data_response_data.rb +18 -0
- data/lib/schematic/types/checkout_settings_response_data.rb +11 -0
- data/lib/schematic/types/checkout_subscription.rb +30 -0
- data/lib/schematic/types/company_detail_response_data.rb +31 -0
- data/lib/schematic/types/company_event_period_metrics_response_data.rb +19 -0
- data/lib/schematic/types/company_ledger_response_data.rb +11 -0
- data/lib/schematic/types/company_membership_detail_response_data.rb +14 -0
- data/lib/schematic/types/company_membership_response_data.rb +13 -0
- data/lib/schematic/types/company_override_note_response_data.rb +14 -0
- data/lib/schematic/types/company_override_response_data.rb +28 -0
- data/lib/schematic/types/company_plan_detail_response_data.rb +43 -0
- data/lib/schematic/types/company_plan_invalid_reason.rb +12 -0
- data/lib/schematic/types/company_plan_with_billing_sub_view.rb +19 -0
- data/lib/schematic/types/company_response_data.rb +15 -0
- data/lib/schematic/types/company_subscription_response_data.rb +22 -0
- data/lib/schematic/types/compatible_plans.rb +10 -0
- data/lib/schematic/types/compatible_plans_response_data.rb +10 -0
- data/lib/schematic/types/component_capabilities.rb +10 -0
- data/lib/schematic/types/component_checkout_settings.rb +12 -0
- data/lib/schematic/types/component_display_settings.rb +14 -0
- data/lib/schematic/types/component_entity_type.rb +12 -0
- data/lib/schematic/types/component_hydrate_response_data.rb +34 -0
- data/lib/schematic/types/component_preview_response_data.rb +35 -0
- data/lib/schematic/types/component_response_data.rb +15 -0
- data/lib/schematic/types/component_settings_response_data.rb +14 -0
- data/lib/schematic/types/component_state.rb +12 -0
- data/lib/schematic/types/condition.rb +23 -0
- data/lib/schematic/types/condition_condition_type.rb +19 -0
- data/lib/schematic/types/condition_group.rb +9 -0
- data/lib/schematic/types/condition_group_response_data.rb +15 -0
- data/lib/schematic/types/condition_group_view.rb +16 -0
- data/lib/schematic/types/condition_metric_period.rb +14 -0
- data/lib/schematic/types/condition_metric_period_month_reset.rb +12 -0
- data/lib/schematic/types/condition_operator.rb +18 -0
- data/lib/schematic/types/condition_response_data.rb +32 -0
- data/lib/schematic/types/condition_view.rb +39 -0
- data/lib/schematic/types/count_response.rb +9 -0
- data/lib/schematic/types/coupon_request_body.rb +16 -0
- data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +26 -0
- data/lib/schematic/types/create_billing_price_tier_request_body.rb +14 -0
- data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +36 -0
- data/lib/schematic/types/create_entitlement_in_bundle_request_body_metric_period.rb +14 -0
- data/lib/schematic/types/create_entitlement_in_bundle_request_body_metric_period_month_reset.rb +12 -0
- data/lib/schematic/types/create_entitlement_req_common.rb +17 -0
- data/lib/schematic/types/create_entitlement_req_common_metric_period.rb +14 -0
- data/lib/schematic/types/create_entitlement_req_common_metric_period_month_reset.rb +12 -0
- data/lib/schematic/types/create_event_request_body.rb +11 -0
- data/lib/schematic/types/create_flag_request_body.rb +15 -0
- data/lib/schematic/types/create_or_update_condition_group_request_body.rb +11 -0
- data/lib/schematic/types/create_or_update_condition_request_body.rb +21 -0
- data/lib/schematic/types/create_or_update_condition_request_body_condition_type.rb +17 -0
- data/lib/schematic/types/create_or_update_condition_request_body_metric_period.rb +14 -0
- data/lib/schematic/types/create_or_update_condition_request_body_metric_period_month_reset.rb +12 -0
- data/lib/schematic/types/create_or_update_condition_request_body_operator.rb +18 -0
- data/lib/schematic/types/create_or_update_flag_request_body.rb +16 -0
- data/lib/schematic/types/create_or_update_rule_request_body.rb +15 -0
- data/lib/schematic/types/create_or_update_rule_request_body_rule_type.rb +15 -0
- data/lib/schematic/types/create_plan_request_body.rb +12 -0
- data/lib/schematic/types/create_price_tier_request_body.rb +12 -0
- data/lib/schematic/types/credit_auto_topup_amount_type.rb +23 -0
- data/lib/schematic/types/credit_bundle_currency_price.rb +10 -0
- data/lib/schematic/types/credit_bundle_currency_price_request_body.rb +11 -0
- data/lib/schematic/types/credit_bundle_currency_price_response_data.rb +10 -0
- data/lib/schematic/types/credit_bundle_purchase_response_data.rb +11 -0
- data/lib/schematic/types/credit_company_grant_view.rb +40 -0
- data/lib/schematic/types/credit_currency_price_request_body.rb +11 -0
- data/lib/schematic/types/credit_currency_price_response_data.rb +10 -0
- data/lib/schematic/types/credit_event_ledger_response_data.rb +39 -0
- data/lib/schematic/types/credit_event_type.rb +14 -0
- data/lib/schematic/types/credit_grant_detail.rb +12 -0
- data/lib/schematic/types/credit_grant_expiry_request_body.rb +14 -0
- data/lib/schematic/types/credit_grant_sort_order.rb +14 -0
- data/lib/schematic/types/credit_ledger_enriched_entry_response_data.rb +30 -0
- data/lib/schematic/types/credit_ledger_period.rb +14 -0
- data/lib/schematic/types/credit_transfer_response_data.rb +14 -0
- data/lib/schematic/types/credit_transfer_view.rb +14 -0
- data/lib/schematic/types/credit_trigger_config.rb +9 -0
- data/lib/schematic/types/credit_usage.rb +17 -0
- data/lib/schematic/types/credit_usage_aggregation.rb +12 -0
- data/lib/schematic/types/credits_auto_topup_company_summary.rb +10 -0
- data/lib/schematic/types/credits_auto_topup_credit_summary.rb +10 -0
- data/lib/schematic/types/credits_auto_topup_hard_failure.rb +12 -0
- data/lib/schematic/types/credits_auto_topup_retry_failure.rb +13 -0
- data/lib/schematic/types/currency_price_request_body.rb +15 -0
- data/lib/schematic/types/custom_plan_config.rb +11 -0
- data/lib/schematic/types/custom_plan_view_config_response_data.rb +11 -0
- data/lib/schematic/types/data_event_payload.rb +12 -0
- data/lib/schematic/types/data_export_output_file_type.rb +23 -0
- data/lib/schematic/types/data_export_response_data.rb +17 -0
- data/lib/schematic/types/data_export_status.rb +13 -0
- data/lib/schematic/types/data_export_type.rb +23 -0
- data/lib/schematic/types/datastream_company_plan.rb +11 -0
- data/lib/schematic/types/delete_billing_plan_credit_grant_request_body.rb +9 -0
- data/lib/schematic/types/delete_response.rb +9 -0
- data/lib/schematic/types/duplicate_plan_entitlements_response_response_data.rb +10 -0
- data/lib/schematic/types/entitlement_currency_prices_response_data.rb +11 -0
- data/lib/schematic/types/entitlement_price_behavior.rb +15 -0
- data/lib/schematic/types/entitlement_trigger_config.rb +9 -0
- data/lib/schematic/types/entitlement_type.rb +13 -0
- data/lib/schematic/types/entitlement_value_type.rb +16 -0
- data/lib/schematic/types/entitlements_in_plan.rb +10 -0
- data/lib/schematic/types/entity_key_definition_response_data.rb +13 -0
- data/lib/schematic/types/entity_key_detail_response_data.rb +18 -0
- data/lib/schematic/types/entity_key_response_data.rb +17 -0
- data/lib/schematic/types/entity_trait_definition_response_data.rb +15 -0
- data/lib/schematic/types/entity_trait_detail_response_data.rb +15 -0
- data/lib/schematic/types/entity_trait_response_data.rb +14 -0
- data/lib/schematic/types/entity_trait_value.rb +10 -0
- data/lib/schematic/types/entity_type.rb +12 -0
- data/lib/schematic/types/environment_detail_response_data.rb +14 -0
- data/lib/schematic/types/environment_response_data.rb +13 -0
- data/lib/schematic/types/environment_type.rb +13 -0
- data/lib/schematic/types/event_body.rb +13 -0
- data/lib/schematic/types/event_body_flag_check.rb +18 -0
- data/lib/schematic/types/event_body_identify.rb +12 -0
- data/lib/schematic/types/event_body_identify_company.rb +12 -0
- data/lib/schematic/types/event_body_track.rb +13 -0
- data/lib/schematic/types/event_detail_response_data.rb +30 -0
- data/lib/schematic/types/event_response_data.rb +27 -0
- data/lib/schematic/types/event_status.rb +15 -0
- data/lib/schematic/types/event_summary_response_data.rb +14 -0
- data/lib/schematic/types/event_type.rb +13 -0
- data/lib/schematic/types/feature_company_response_data.rb +44 -0
- data/lib/schematic/types/feature_company_user_response_data.rb +21 -0
- data/lib/schematic/types/feature_detail_response_data.rb +25 -0
- data/lib/schematic/types/feature_entitlement.rb +22 -0
- data/lib/schematic/types/feature_entitlement_metric_period.rb +14 -0
- data/lib/schematic/types/feature_entitlement_month_reset.rb +12 -0
- data/lib/schematic/types/feature_ledger_response_data.rb +12 -0
- data/lib/schematic/types/feature_lifecycle_phase.rb +19 -0
- data/lib/schematic/types/feature_response_data.rb +21 -0
- data/lib/schematic/types/feature_type.rb +13 -0
- data/lib/schematic/types/feature_usage_detail_response_data.rb +9 -0
- data/lib/schematic/types/feature_usage_legacy_response_data.rb +14 -0
- data/lib/schematic/types/feature_usage_response_data.rb +42 -0
- data/lib/schematic/types/feature_usage_time_series_response_data.rb +13 -0
- data/lib/schematic/types/feature_view.rb +26 -0
- data/lib/schematic/types/flag_detail_response_data.rb +21 -0
- data/lib/schematic/types/flag_response_data.rb +18 -0
- data/lib/schematic/types/flag_type.rb +23 -0
- data/lib/schematic/types/flag_view.rb +22 -0
- data/lib/schematic/types/generic_preview_object.rb +12 -0
- data/lib/schematic/types/invoice_request_body.rb +20 -0
- data/lib/schematic/types/invoice_response_data.rb +27 -0
- data/lib/schematic/types/invoice_status.rb +15 -0
- data/lib/schematic/types/issue_temporary_access_token_response_data.rb +16 -0
- data/lib/schematic/types/keys_request_body.rb +9 -0
- data/lib/schematic/types/limit_time_series_point_response_data.rb +14 -0
- data/lib/schematic/types/manage_plan_preview_response_response_data.rb +9 -0
- data/lib/schematic/types/manage_plan_request.rb +21 -0
- data/lib/schematic/types/manage_plan_response_response_data.rb +10 -0
- data/lib/schematic/types/meter_request_body.rb +11 -0
- data/lib/schematic/types/ordered_plans_in_group.rb +10 -0
- data/lib/schematic/types/payment_method_request_body.rb +19 -0
- data/lib/schematic/types/payment_method_response_data.rb +26 -0
- data/lib/schematic/types/plan_bundle_action.rb +13 -0
- data/lib/schematic/types/plan_bundle_credit_grant_request_body.rb +13 -0
- data/lib/schematic/types/plan_bundle_entitlement_request_body.rb +11 -0
- data/lib/schematic/types/plan_bundle_response_data.rb +13 -0
- data/lib/schematic/types/plan_change_action.rb +21 -0
- data/lib/schematic/types/plan_change_base_plan_action.rb +14 -0
- data/lib/schematic/types/plan_change_response_data.rb +30 -0
- data/lib/schematic/types/plan_change_subscription_action.rb +17 -0
- data/lib/schematic/types/plan_controlled_by_type.rb +12 -0
- data/lib/schematic/types/plan_credit_grant_view.rb +35 -0
- data/lib/schematic/types/plan_currency_price_request_body.rb +12 -0
- data/lib/schematic/types/plan_currency_prices_response_data.rb +12 -0
- data/lib/schematic/types/plan_detail_response_data.rb +33 -0
- data/lib/schematic/types/plan_entitlement_response_data.rb +34 -0
- data/lib/schematic/types/plan_entitlements_order.rb +10 -0
- data/lib/schematic/types/plan_group_bundle_order.rb +9 -0
- data/lib/schematic/types/plan_group_detail_response_data.rb +45 -0
- data/lib/schematic/types/plan_group_plan_detail_response_data.rb +37 -0
- data/lib/schematic/types/plan_group_plan_entitlements_order.rb +10 -0
- data/lib/schematic/types/plan_group_response_data.rb +36 -0
- data/lib/schematic/types/plan_issue_response_data.rb +12 -0
- data/lib/schematic/types/plan_response_data.rb +16 -0
- data/lib/schematic/types/plan_selection.rb +11 -0
- data/lib/schematic/types/plan_snapshot_view.rb +13 -0
- data/lib/schematic/types/plan_trait_response_data.rb +17 -0
- data/lib/schematic/types/plan_type.rb +12 -0
- data/lib/schematic/types/plan_version_company_migration_response_data.rb +19 -0
- data/lib/schematic/types/plan_version_company_migration_status.rb +15 -0
- data/lib/schematic/types/plan_version_migration_response_data.rb +23 -0
- data/lib/schematic/types/plan_version_migration_status.rb +14 -0
- data/lib/schematic/types/plan_version_migration_strategy.rb +12 -0
- data/lib/schematic/types/plan_version_response_data.rb +19 -0
- data/lib/schematic/types/plan_version_snapshot_view.rb +11 -0
- data/lib/schematic/types/plan_version_status.rb +13 -0
- data/lib/schematic/types/plan_view_public_response_data.rb +38 -0
- data/lib/schematic/types/preview_object.rb +12 -0
- data/lib/schematic/types/preview_object_response_data.rb +12 -0
- data/lib/schematic/types/preview_subscription_change_response_data.rb +21 -0
- data/lib/schematic/types/preview_subscription_finance_response_data.rb +21 -0
- data/lib/schematic/types/preview_subscription_upcoming_invoice_line_items.rb +13 -0
- data/lib/schematic/types/proration_behavior.rb +12 -0
- data/lib/schematic/types/public_plans_response_data.rb +17 -0
- data/lib/schematic/types/quickstart_resp.rb +9 -0
- data/lib/schematic/types/raw_event_batch_response_data.rb +9 -0
- data/lib/schematic/types/raw_event_response_data.rb +13 -0
- data/lib/schematic/types/rule.rb +18 -0
- data/lib/schematic/types/rule_condition_detail_response_data.rb +29 -0
- data/lib/schematic/types/rule_condition_group_detail_response_data.rb +15 -0
- data/lib/schematic/types/rule_condition_group_response_data.rb +14 -0
- data/lib/schematic/types/rule_condition_response_data.rb +26 -0
- data/lib/schematic/types/rule_detail_response_data.rb +19 -0
- data/lib/schematic/types/rule_response_data.rb +17 -0
- data/lib/schematic/types/rule_rule_type.rb +17 -0
- data/lib/schematic/types/rule_view.rb +20 -0
- data/lib/schematic/types/rules_detail_response_data.rb +10 -0
- data/lib/schematic/types/rules_engine_schema_version.rb +12 -0
- data/lib/schematic/types/rulesengine_check_flag_result.rb +23 -0
- data/lib/schematic/types/rulesengine_check_flag_result_feature_usage_period.rb +14 -0
- data/lib/schematic/types/rulesengine_check_flag_result_rule_type.rb +17 -0
- data/lib/schematic/types/rulesengine_company.rb +22 -0
- data/lib/schematic/types/rulesengine_company_metric.rb +17 -0
- data/lib/schematic/types/rulesengine_company_metric_month_reset.rb +12 -0
- data/lib/schematic/types/rulesengine_company_metric_period.rb +14 -0
- data/lib/schematic/types/rulesengine_condition.rb +23 -0
- data/lib/schematic/types/rulesengine_condition_condition_type.rb +19 -0
- data/lib/schematic/types/rulesengine_condition_group.rb +9 -0
- data/lib/schematic/types/rulesengine_condition_metric_period.rb +14 -0
- data/lib/schematic/types/rulesengine_condition_metric_period_month_reset.rb +12 -0
- data/lib/schematic/types/rulesengine_condition_operator.rb +18 -0
- data/lib/schematic/types/rulesengine_entitlement_value_type.rb +16 -0
- data/lib/schematic/types/rulesengine_entity_type.rb +12 -0
- data/lib/schematic/types/rulesengine_feature_entitlement.rb +22 -0
- data/lib/schematic/types/rulesengine_feature_entitlement_metric_period.rb +14 -0
- data/lib/schematic/types/rulesengine_feature_entitlement_month_reset.rb +12 -0
- data/lib/schematic/types/rulesengine_flag.rb +14 -0
- data/lib/schematic/types/rulesengine_rule.rb +18 -0
- data/lib/schematic/types/rulesengine_rule_rule_type.rb +17 -0
- data/lib/schematic/types/rulesengine_subscription.rb +11 -0
- data/lib/schematic/types/rulesengine_trait.rb +10 -0
- data/lib/schematic/types/rulesengine_trait_definition.rb +11 -0
- data/lib/schematic/types/rulesengine_trait_definition_comparable_type.rb +14 -0
- data/lib/schematic/types/rulesengine_user.rb +14 -0
- data/lib/schematic/types/scheduled_checkout_response_data.rb +22 -0
- data/lib/schematic/types/scheduled_checkout_status.rb +15 -0
- data/lib/schematic/types/scheduled_downgrade_config_behavior.rb +12 -0
- data/lib/schematic/types/scheduled_downgrade_response_data.rb +19 -0
- data/lib/schematic/types/segment_status_resp.rb +11 -0
- data/lib/schematic/types/skipped_entitlement_error_response_data.rb +9 -0
- data/lib/schematic/types/skipped_entitlement_response_data.rb +12 -0
- data/lib/schematic/types/sort_direction.rb +12 -0
- data/lib/schematic/types/stripe_embed_info.rb +12 -0
- data/lib/schematic/types/subscription_status.rb +19 -0
- data/lib/schematic/types/subscription_trait_update.rb +15 -0
- data/lib/schematic/types/subscription_type.rb +14 -0
- data/lib/schematic/types/temporary_access_token_resource_type.rb +23 -0
- data/lib/schematic/types/temporary_access_token_response_data.rb +15 -0
- data/lib/schematic/types/time_series_granularity.rb +14 -0
- data/lib/schematic/types/trait_definition.rb +11 -0
- data/lib/schematic/types/trait_definition_comparable_type.rb +14 -0
- data/lib/schematic/types/trait_type.rb +16 -0
- data/lib/schematic/types/update_add_on_request_body.rb +10 -0
- data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +23 -0
- data/lib/schematic/types/update_credit_bundle_request_body.rb +10 -0
- data/lib/schematic/types/update_entitlement_req_common.rb +16 -0
- data/lib/schematic/types/update_entitlement_req_common_metric_period.rb +14 -0
- data/lib/schematic/types/update_entitlement_req_common_metric_period_month_reset.rb +12 -0
- data/lib/schematic/types/update_pay_in_advance_request_body.rb +10 -0
- data/lib/schematic/types/update_plan_request_body.rb +11 -0
- data/lib/schematic/types/update_plan_trait_trait_request_body.rb +10 -0
- data/lib/schematic/types/update_rule_request_body.rb +13 -0
- data/lib/schematic/types/upsert_billing_product_request_body.rb +20 -0
- data/lib/schematic/types/upsert_company_request_body.rb +15 -0
- data/lib/schematic/types/upsert_trait_request_body.rb +13 -0
- data/lib/schematic/types/upsert_user_request_body.rb +18 -0
- data/lib/schematic/types/upsert_user_sub_request_body.rb +16 -0
- data/lib/schematic/types/usage_based_entitlement_request_body.rb +25 -0
- data/lib/schematic/types/usage_based_entitlement_response_data.rb +20 -0
- data/lib/schematic/types/usage_time_series_point_response_data.rb +12 -0
- data/lib/schematic/types/user_detail_response_data.rb +18 -0
- data/lib/schematic/types/user_response_data.rb +14 -0
- data/lib/schematic/types/web_feature_usage_webhook_output.rb +15 -0
- data/lib/schematic/types/web_scheduled_downgrade_webhook_output.rb +15 -0
- data/lib/schematic/types/webhook_event_detail_response_data.rb +18 -0
- data/lib/schematic/types/webhook_event_response_data.rb +17 -0
- data/lib/schematic/types/webhook_event_status.rb +13 -0
- data/lib/schematic/types/webhook_request_type.rb +49 -0
- data/lib/schematic/types/webhook_response_data.rb +18 -0
- data/lib/schematic/types/webhook_status.rb +12 -0
- data/lib/schematic/types/who_am_i_response_data.rb +17 -0
- data/lib/schematic/version.rb +5 -0
- data/lib/schematic/wasm/rulesengine.wasm +0 -0
- data/lib/schematic/webhook_verification.rb +83 -0
- data/lib/schematic/webhooks/client.rb +355 -0
- data/lib/schematic/webhooks/types/count_webhook_events_params.rb +16 -0
- data/lib/schematic/webhooks/types/count_webhook_events_request.rb +15 -0
- data/lib/schematic/webhooks/types/count_webhook_events_response.rb +12 -0
- data/lib/schematic/webhooks/types/count_webhooks_params.rb +14 -0
- data/lib/schematic/webhooks/types/count_webhooks_request.rb +13 -0
- data/lib/schematic/webhooks/types/count_webhooks_response.rb +12 -0
- data/lib/schematic/webhooks/types/create_webhook_request_body.rb +15 -0
- data/lib/schematic/webhooks/types/create_webhook_response.rb +12 -0
- data/lib/schematic/webhooks/types/delete_webhook_response.rb +12 -0
- data/lib/schematic/webhooks/types/get_webhook_event_response.rb +12 -0
- data/lib/schematic/webhooks/types/get_webhook_response.rb +12 -0
- data/lib/schematic/webhooks/types/list_webhook_events_params.rb +16 -0
- data/lib/schematic/webhooks/types/list_webhook_events_request.rb +15 -0
- data/lib/schematic/webhooks/types/list_webhook_events_response.rb +12 -0
- data/lib/schematic/webhooks/types/list_webhooks_params.rb +14 -0
- data/lib/schematic/webhooks/types/list_webhooks_request.rb +13 -0
- data/lib/schematic/webhooks/types/list_webhooks_response.rb +12 -0
- data/lib/schematic/webhooks/types/update_webhook_request_body.rb +17 -0
- data/lib/schematic/webhooks/types/update_webhook_response.rb +12 -0
- data/lib/schematic.rb +821 -0
- data/lib/schematichq.rb +17 -0
- data/reference.md +16668 -0
- data/scripts/download-wasm.sh +82 -0
- data/scripts/webhook_test_server.rb +55 -0
- data/testapp/Gemfile +6 -0
- data/testapp/app.rb +307 -0
- metadata +917 -0
|
@@ -0,0 +1,1561 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Companies
|
|
5
|
+
class Client
|
|
6
|
+
# @param client [Schematic::Internal::Http::RawClient]
|
|
7
|
+
#
|
|
8
|
+
# @return [void]
|
|
9
|
+
def initialize(client:)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# @param request_options [Hash]
|
|
14
|
+
# @param params [Hash]
|
|
15
|
+
# @option request_options [String] :base_url
|
|
16
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
17
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
18
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
19
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
20
|
+
# @option params [String, nil] :credit_type_ids
|
|
21
|
+
# @option params [String, nil] :ids
|
|
22
|
+
# @option params [Boolean, nil] :monetized_subscriptions
|
|
23
|
+
# @option params [String, nil] :plan_id
|
|
24
|
+
# @option params [String, nil] :plan_ids
|
|
25
|
+
# @option params [String, nil] :plan_version_id
|
|
26
|
+
# @option params [String, nil] :q
|
|
27
|
+
# @option params [String, nil] :sort_order_column
|
|
28
|
+
# @option params [Schematic::Types::SortDirection, nil] :sort_order_direction
|
|
29
|
+
# @option params [Schematic::Types::SubscriptionStatus, nil] :subscription_statuses
|
|
30
|
+
# @option params [Schematic::Types::SubscriptionType, nil] :subscription_types
|
|
31
|
+
# @option params [String, nil] :with_entitlement_for
|
|
32
|
+
# @option params [String, nil] :without_feature_override_for
|
|
33
|
+
# @option params [Boolean, nil] :without_plan
|
|
34
|
+
# @option params [Boolean, nil] :without_subscription
|
|
35
|
+
# @option params [Boolean, nil] :with_subscription
|
|
36
|
+
# @option params [Integer, nil] :limit
|
|
37
|
+
# @option params [Integer, nil] :offset
|
|
38
|
+
#
|
|
39
|
+
# @return [Schematic::Companies::Types::ListCompaniesResponse]
|
|
40
|
+
def list_companies(request_options: {}, **params)
|
|
41
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
42
|
+
query_param_names = %i[credit_type_ids ids monetized_subscriptions plan_id plan_ids plan_version_id q sort_order_column sort_order_direction subscription_statuses subscription_types with_entitlement_for without_feature_override_for without_plan without_subscription with_subscription limit offset]
|
|
43
|
+
query_params = {}
|
|
44
|
+
query_params["credit_type_ids"] = params[:credit_type_ids] if params.key?(:credit_type_ids)
|
|
45
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
46
|
+
query_params["monetized_subscriptions"] = params[:monetized_subscriptions] if params.key?(:monetized_subscriptions)
|
|
47
|
+
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
48
|
+
query_params["plan_ids"] = params[:plan_ids] if params.key?(:plan_ids)
|
|
49
|
+
query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
|
|
50
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
51
|
+
query_params["sort_order_column"] = params[:sort_order_column] if params.key?(:sort_order_column)
|
|
52
|
+
query_params["sort_order_direction"] = params[:sort_order_direction] if params.key?(:sort_order_direction)
|
|
53
|
+
query_params["subscription_statuses"] = params[:subscription_statuses] if params.key?(:subscription_statuses)
|
|
54
|
+
query_params["subscription_types"] = params[:subscription_types] if params.key?(:subscription_types)
|
|
55
|
+
query_params["with_entitlement_for"] = params[:with_entitlement_for] if params.key?(:with_entitlement_for)
|
|
56
|
+
query_params["without_feature_override_for"] = params[:without_feature_override_for] if params.key?(:without_feature_override_for)
|
|
57
|
+
query_params["without_plan"] = params[:without_plan] if params.key?(:without_plan)
|
|
58
|
+
query_params["without_subscription"] = params[:without_subscription] if params.key?(:without_subscription)
|
|
59
|
+
query_params["with_subscription"] = params[:with_subscription] if params.key?(:with_subscription)
|
|
60
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
61
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
62
|
+
params.except(*query_param_names)
|
|
63
|
+
|
|
64
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
65
|
+
base_url: request_options[:base_url],
|
|
66
|
+
method: "GET",
|
|
67
|
+
path: "companies",
|
|
68
|
+
query: query_params,
|
|
69
|
+
request_options: request_options
|
|
70
|
+
)
|
|
71
|
+
begin
|
|
72
|
+
response = @client.send(request)
|
|
73
|
+
rescue Net::HTTPRequestTimeout
|
|
74
|
+
raise Schematic::Errors::TimeoutError
|
|
75
|
+
end
|
|
76
|
+
code = response.code.to_i
|
|
77
|
+
if code.between?(200, 299)
|
|
78
|
+
Schematic::Companies::Types::ListCompaniesResponse.load(response.body)
|
|
79
|
+
else
|
|
80
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
81
|
+
raise error_class.new(response.body, code: code)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# @param request_options [Hash]
|
|
86
|
+
# @param params [Schematic::Types::UpsertCompanyRequestBody]
|
|
87
|
+
# @option request_options [String] :base_url
|
|
88
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
89
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
90
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
91
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
92
|
+
#
|
|
93
|
+
# @return [Schematic::Companies::Types::UpsertCompanyResponse]
|
|
94
|
+
def upsert_company(request_options: {}, **params)
|
|
95
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
96
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
97
|
+
base_url: request_options[:base_url],
|
|
98
|
+
method: "POST",
|
|
99
|
+
path: "companies",
|
|
100
|
+
body: Schematic::Types::UpsertCompanyRequestBody.new(params).to_h,
|
|
101
|
+
request_options: request_options
|
|
102
|
+
)
|
|
103
|
+
begin
|
|
104
|
+
response = @client.send(request)
|
|
105
|
+
rescue Net::HTTPRequestTimeout
|
|
106
|
+
raise Schematic::Errors::TimeoutError
|
|
107
|
+
end
|
|
108
|
+
code = response.code.to_i
|
|
109
|
+
if code.between?(200, 299)
|
|
110
|
+
Schematic::Companies::Types::UpsertCompanyResponse.load(response.body)
|
|
111
|
+
else
|
|
112
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
113
|
+
raise error_class.new(response.body, code: code)
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# @param request_options [Hash]
|
|
118
|
+
# @param params [Hash]
|
|
119
|
+
# @option request_options [String] :base_url
|
|
120
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
121
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
122
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
123
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
124
|
+
# @option params [String] :company_id
|
|
125
|
+
#
|
|
126
|
+
# @return [Schematic::Companies::Types::GetCompanyResponse]
|
|
127
|
+
def get_company(request_options: {}, **params)
|
|
128
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
129
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
130
|
+
base_url: request_options[:base_url],
|
|
131
|
+
method: "GET",
|
|
132
|
+
path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}",
|
|
133
|
+
request_options: request_options
|
|
134
|
+
)
|
|
135
|
+
begin
|
|
136
|
+
response = @client.send(request)
|
|
137
|
+
rescue Net::HTTPRequestTimeout
|
|
138
|
+
raise Schematic::Errors::TimeoutError
|
|
139
|
+
end
|
|
140
|
+
code = response.code.to_i
|
|
141
|
+
if code.between?(200, 299)
|
|
142
|
+
Schematic::Companies::Types::GetCompanyResponse.load(response.body)
|
|
143
|
+
else
|
|
144
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
145
|
+
raise error_class.new(response.body, code: code)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# @param request_options [Hash]
|
|
150
|
+
# @param params [Hash]
|
|
151
|
+
# @option request_options [String] :base_url
|
|
152
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
153
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
154
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
155
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
156
|
+
# @option params [String] :company_id
|
|
157
|
+
# @option params [Boolean, nil] :cancel_subscription
|
|
158
|
+
# @option params [Boolean, nil] :prorate
|
|
159
|
+
#
|
|
160
|
+
# @return [Schematic::Companies::Types::DeleteCompanyResponse]
|
|
161
|
+
def delete_company(request_options: {}, **params)
|
|
162
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
163
|
+
query_param_names = %i[cancel_subscription prorate]
|
|
164
|
+
query_params = {}
|
|
165
|
+
query_params["cancel_subscription"] = params[:cancel_subscription] if params.key?(:cancel_subscription)
|
|
166
|
+
query_params["prorate"] = params[:prorate] if params.key?(:prorate)
|
|
167
|
+
params = params.except(*query_param_names)
|
|
168
|
+
|
|
169
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
170
|
+
base_url: request_options[:base_url],
|
|
171
|
+
method: "DELETE",
|
|
172
|
+
path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}",
|
|
173
|
+
query: query_params,
|
|
174
|
+
request_options: request_options
|
|
175
|
+
)
|
|
176
|
+
begin
|
|
177
|
+
response = @client.send(request)
|
|
178
|
+
rescue Net::HTTPRequestTimeout
|
|
179
|
+
raise Schematic::Errors::TimeoutError
|
|
180
|
+
end
|
|
181
|
+
code = response.code.to_i
|
|
182
|
+
if code.between?(200, 299)
|
|
183
|
+
Schematic::Companies::Types::DeleteCompanyResponse.load(response.body)
|
|
184
|
+
else
|
|
185
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
186
|
+
raise error_class.new(response.body, code: code)
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# @param request_options [Hash]
|
|
191
|
+
# @param params [Hash]
|
|
192
|
+
# @option request_options [String] :base_url
|
|
193
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
194
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
195
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
196
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
197
|
+
# @option params [String, nil] :credit_type_ids
|
|
198
|
+
# @option params [String, nil] :ids
|
|
199
|
+
# @option params [Boolean, nil] :monetized_subscriptions
|
|
200
|
+
# @option params [String, nil] :plan_id
|
|
201
|
+
# @option params [String, nil] :plan_ids
|
|
202
|
+
# @option params [String, nil] :plan_version_id
|
|
203
|
+
# @option params [String, nil] :q
|
|
204
|
+
# @option params [String, nil] :sort_order_column
|
|
205
|
+
# @option params [Schematic::Types::SortDirection, nil] :sort_order_direction
|
|
206
|
+
# @option params [Schematic::Types::SubscriptionStatus, nil] :subscription_statuses
|
|
207
|
+
# @option params [Schematic::Types::SubscriptionType, nil] :subscription_types
|
|
208
|
+
# @option params [String, nil] :with_entitlement_for
|
|
209
|
+
# @option params [String, nil] :without_feature_override_for
|
|
210
|
+
# @option params [Boolean, nil] :without_plan
|
|
211
|
+
# @option params [Boolean, nil] :without_subscription
|
|
212
|
+
# @option params [Boolean, nil] :with_subscription
|
|
213
|
+
# @option params [Integer, nil] :limit
|
|
214
|
+
# @option params [Integer, nil] :offset
|
|
215
|
+
#
|
|
216
|
+
# @return [Schematic::Companies::Types::CountCompaniesResponse]
|
|
217
|
+
def count_companies(request_options: {}, **params)
|
|
218
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
219
|
+
query_param_names = %i[credit_type_ids ids monetized_subscriptions plan_id plan_ids plan_version_id q sort_order_column sort_order_direction subscription_statuses subscription_types with_entitlement_for without_feature_override_for without_plan without_subscription with_subscription limit offset]
|
|
220
|
+
query_params = {}
|
|
221
|
+
query_params["credit_type_ids"] = params[:credit_type_ids] if params.key?(:credit_type_ids)
|
|
222
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
223
|
+
query_params["monetized_subscriptions"] = params[:monetized_subscriptions] if params.key?(:monetized_subscriptions)
|
|
224
|
+
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
225
|
+
query_params["plan_ids"] = params[:plan_ids] if params.key?(:plan_ids)
|
|
226
|
+
query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
|
|
227
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
228
|
+
query_params["sort_order_column"] = params[:sort_order_column] if params.key?(:sort_order_column)
|
|
229
|
+
query_params["sort_order_direction"] = params[:sort_order_direction] if params.key?(:sort_order_direction)
|
|
230
|
+
query_params["subscription_statuses"] = params[:subscription_statuses] if params.key?(:subscription_statuses)
|
|
231
|
+
query_params["subscription_types"] = params[:subscription_types] if params.key?(:subscription_types)
|
|
232
|
+
query_params["with_entitlement_for"] = params[:with_entitlement_for] if params.key?(:with_entitlement_for)
|
|
233
|
+
query_params["without_feature_override_for"] = params[:without_feature_override_for] if params.key?(:without_feature_override_for)
|
|
234
|
+
query_params["without_plan"] = params[:without_plan] if params.key?(:without_plan)
|
|
235
|
+
query_params["without_subscription"] = params[:without_subscription] if params.key?(:without_subscription)
|
|
236
|
+
query_params["with_subscription"] = params[:with_subscription] if params.key?(:with_subscription)
|
|
237
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
238
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
239
|
+
params.except(*query_param_names)
|
|
240
|
+
|
|
241
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
242
|
+
base_url: request_options[:base_url],
|
|
243
|
+
method: "GET",
|
|
244
|
+
path: "companies/count",
|
|
245
|
+
query: query_params,
|
|
246
|
+
request_options: request_options
|
|
247
|
+
)
|
|
248
|
+
begin
|
|
249
|
+
response = @client.send(request)
|
|
250
|
+
rescue Net::HTTPRequestTimeout
|
|
251
|
+
raise Schematic::Errors::TimeoutError
|
|
252
|
+
end
|
|
253
|
+
code = response.code.to_i
|
|
254
|
+
if code.between?(200, 299)
|
|
255
|
+
Schematic::Companies::Types::CountCompaniesResponse.load(response.body)
|
|
256
|
+
else
|
|
257
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
258
|
+
raise error_class.new(response.body, code: code)
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# @param request_options [Hash]
|
|
263
|
+
# @param params [Schematic::Types::UpsertCompanyRequestBody]
|
|
264
|
+
# @option request_options [String] :base_url
|
|
265
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
266
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
267
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
268
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
269
|
+
#
|
|
270
|
+
# @return [Schematic::Companies::Types::CreateCompanyResponse]
|
|
271
|
+
def create_company(request_options: {}, **params)
|
|
272
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
273
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
274
|
+
base_url: request_options[:base_url],
|
|
275
|
+
method: "POST",
|
|
276
|
+
path: "companies/create",
|
|
277
|
+
body: Schematic::Types::UpsertCompanyRequestBody.new(params).to_h,
|
|
278
|
+
request_options: request_options
|
|
279
|
+
)
|
|
280
|
+
begin
|
|
281
|
+
response = @client.send(request)
|
|
282
|
+
rescue Net::HTTPRequestTimeout
|
|
283
|
+
raise Schematic::Errors::TimeoutError
|
|
284
|
+
end
|
|
285
|
+
code = response.code.to_i
|
|
286
|
+
if code.between?(200, 299)
|
|
287
|
+
Schematic::Companies::Types::CreateCompanyResponse.load(response.body)
|
|
288
|
+
else
|
|
289
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
290
|
+
raise error_class.new(response.body, code: code)
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# @param request_options [Hash]
|
|
295
|
+
# @param params [Schematic::Types::KeysRequestBody]
|
|
296
|
+
# @option request_options [String] :base_url
|
|
297
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
298
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
299
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
300
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
301
|
+
#
|
|
302
|
+
# @return [Schematic::Companies::Types::DeleteCompanyByKeysResponse]
|
|
303
|
+
def delete_company_by_keys(request_options: {}, **params)
|
|
304
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
305
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
306
|
+
base_url: request_options[:base_url],
|
|
307
|
+
method: "POST",
|
|
308
|
+
path: "companies/delete",
|
|
309
|
+
body: Schematic::Types::KeysRequestBody.new(params).to_h,
|
|
310
|
+
request_options: request_options
|
|
311
|
+
)
|
|
312
|
+
begin
|
|
313
|
+
response = @client.send(request)
|
|
314
|
+
rescue Net::HTTPRequestTimeout
|
|
315
|
+
raise Schematic::Errors::TimeoutError
|
|
316
|
+
end
|
|
317
|
+
code = response.code.to_i
|
|
318
|
+
if code.between?(200, 299)
|
|
319
|
+
Schematic::Companies::Types::DeleteCompanyByKeysResponse.load(response.body)
|
|
320
|
+
else
|
|
321
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
322
|
+
raise error_class.new(response.body, code: code)
|
|
323
|
+
end
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# Company lookup is determined to resolve a company from its keys, similar to how many of our other apis work.
|
|
327
|
+
# The following approaches will all work to resolve a company and any of them are appropriate:
|
|
328
|
+
# 1. `/companies/lookup?keys={"foo": "bar", "fizz": "buzz"}`
|
|
329
|
+
# 2. `/companies/lookup?keys[foo]=bar&keys[fizz]=buzz`
|
|
330
|
+
# 2. `/companies/lookup?foo=bar&fizz=buzz`
|
|
331
|
+
#
|
|
332
|
+
# @param request_options [Hash]
|
|
333
|
+
# @param params [Hash]
|
|
334
|
+
# @option request_options [String] :base_url
|
|
335
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
336
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
337
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
338
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
339
|
+
# @option params [Hash[String, String]] :keys
|
|
340
|
+
#
|
|
341
|
+
# @return [Schematic::Companies::Types::LookupCompanyResponse]
|
|
342
|
+
def lookup_company(request_options: {}, **params)
|
|
343
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
344
|
+
query_param_names = %i[keys]
|
|
345
|
+
query_params = {}
|
|
346
|
+
query_params["keys"] = params[:keys] if params.key?(:keys)
|
|
347
|
+
params.except(*query_param_names)
|
|
348
|
+
|
|
349
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
350
|
+
base_url: request_options[:base_url],
|
|
351
|
+
method: "GET",
|
|
352
|
+
path: "companies/lookup",
|
|
353
|
+
query: query_params,
|
|
354
|
+
request_options: request_options
|
|
355
|
+
)
|
|
356
|
+
begin
|
|
357
|
+
response = @client.send(request)
|
|
358
|
+
rescue Net::HTTPRequestTimeout
|
|
359
|
+
raise Schematic::Errors::TimeoutError
|
|
360
|
+
end
|
|
361
|
+
code = response.code.to_i
|
|
362
|
+
if code.between?(200, 299)
|
|
363
|
+
Schematic::Companies::Types::LookupCompanyResponse.load(response.body)
|
|
364
|
+
else
|
|
365
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
366
|
+
raise error_class.new(response.body, code: code)
|
|
367
|
+
end
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
# @param request_options [Hash]
|
|
371
|
+
# @param params [Hash]
|
|
372
|
+
# @option request_options [String] :base_url
|
|
373
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
374
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
375
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
376
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
377
|
+
# @option params [String, nil] :company_id
|
|
378
|
+
# @option params [String, nil] :user_id
|
|
379
|
+
# @option params [Integer, nil] :limit
|
|
380
|
+
# @option params [Integer, nil] :offset
|
|
381
|
+
#
|
|
382
|
+
# @return [Schematic::Companies::Types::ListCompanyMembershipsResponse]
|
|
383
|
+
def list_company_memberships(request_options: {}, **params)
|
|
384
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
385
|
+
query_param_names = %i[company_id user_id limit offset]
|
|
386
|
+
query_params = {}
|
|
387
|
+
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
388
|
+
query_params["user_id"] = params[:user_id] if params.key?(:user_id)
|
|
389
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
390
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
391
|
+
params.except(*query_param_names)
|
|
392
|
+
|
|
393
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
394
|
+
base_url: request_options[:base_url],
|
|
395
|
+
method: "GET",
|
|
396
|
+
path: "company-memberships",
|
|
397
|
+
query: query_params,
|
|
398
|
+
request_options: request_options
|
|
399
|
+
)
|
|
400
|
+
begin
|
|
401
|
+
response = @client.send(request)
|
|
402
|
+
rescue Net::HTTPRequestTimeout
|
|
403
|
+
raise Schematic::Errors::TimeoutError
|
|
404
|
+
end
|
|
405
|
+
code = response.code.to_i
|
|
406
|
+
if code.between?(200, 299)
|
|
407
|
+
Schematic::Companies::Types::ListCompanyMembershipsResponse.load(response.body)
|
|
408
|
+
else
|
|
409
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
410
|
+
raise error_class.new(response.body, code: code)
|
|
411
|
+
end
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
# @param request_options [Hash]
|
|
415
|
+
# @param params [Schematic::Companies::Types::GetOrCreateCompanyMembershipRequestBody]
|
|
416
|
+
# @option request_options [String] :base_url
|
|
417
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
418
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
419
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
420
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
421
|
+
#
|
|
422
|
+
# @return [Schematic::Companies::Types::GetOrCreateCompanyMembershipResponse]
|
|
423
|
+
def get_or_create_company_membership(request_options: {}, **params)
|
|
424
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
425
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
426
|
+
base_url: request_options[:base_url],
|
|
427
|
+
method: "POST",
|
|
428
|
+
path: "company-memberships",
|
|
429
|
+
body: Schematic::Companies::Types::GetOrCreateCompanyMembershipRequestBody.new(params).to_h,
|
|
430
|
+
request_options: request_options
|
|
431
|
+
)
|
|
432
|
+
begin
|
|
433
|
+
response = @client.send(request)
|
|
434
|
+
rescue Net::HTTPRequestTimeout
|
|
435
|
+
raise Schematic::Errors::TimeoutError
|
|
436
|
+
end
|
|
437
|
+
code = response.code.to_i
|
|
438
|
+
if code.between?(200, 299)
|
|
439
|
+
Schematic::Companies::Types::GetOrCreateCompanyMembershipResponse.load(response.body)
|
|
440
|
+
else
|
|
441
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
442
|
+
raise error_class.new(response.body, code: code)
|
|
443
|
+
end
|
|
444
|
+
end
|
|
445
|
+
|
|
446
|
+
# @param request_options [Hash]
|
|
447
|
+
# @param params [Hash]
|
|
448
|
+
# @option request_options [String] :base_url
|
|
449
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
450
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
451
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
452
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
453
|
+
# @option params [String] :company_membership_id
|
|
454
|
+
#
|
|
455
|
+
# @return [Schematic::Companies::Types::DeleteCompanyMembershipResponse]
|
|
456
|
+
def delete_company_membership(request_options: {}, **params)
|
|
457
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
458
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
459
|
+
base_url: request_options[:base_url],
|
|
460
|
+
method: "DELETE",
|
|
461
|
+
path: "company-memberships/#{URI.encode_uri_component(params[:company_membership_id].to_s)}",
|
|
462
|
+
request_options: request_options
|
|
463
|
+
)
|
|
464
|
+
begin
|
|
465
|
+
response = @client.send(request)
|
|
466
|
+
rescue Net::HTTPRequestTimeout
|
|
467
|
+
raise Schematic::Errors::TimeoutError
|
|
468
|
+
end
|
|
469
|
+
code = response.code.to_i
|
|
470
|
+
if code.between?(200, 299)
|
|
471
|
+
Schematic::Companies::Types::DeleteCompanyMembershipResponse.load(response.body)
|
|
472
|
+
else
|
|
473
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
474
|
+
raise error_class.new(response.body, code: code)
|
|
475
|
+
end
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
# @param request_options [Hash]
|
|
479
|
+
# @param params [Hash]
|
|
480
|
+
# @option request_options [String] :base_url
|
|
481
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
482
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
483
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
484
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
485
|
+
# @option params [String, nil] :company_id
|
|
486
|
+
# @option params [String, nil] :company_ids
|
|
487
|
+
# @option params [Integer, nil] :limit
|
|
488
|
+
# @option params [Integer, nil] :offset
|
|
489
|
+
#
|
|
490
|
+
# @return [Schematic::Companies::Types::GetActiveCompanySubscriptionResponse]
|
|
491
|
+
def get_active_company_subscription(request_options: {}, **params)
|
|
492
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
493
|
+
query_param_names = %i[company_id company_ids limit offset]
|
|
494
|
+
query_params = {}
|
|
495
|
+
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
496
|
+
query_params["company_ids"] = params[:company_ids] if params.key?(:company_ids)
|
|
497
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
498
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
499
|
+
params.except(*query_param_names)
|
|
500
|
+
|
|
501
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
502
|
+
base_url: request_options[:base_url],
|
|
503
|
+
method: "GET",
|
|
504
|
+
path: "company-subscriptions",
|
|
505
|
+
query: query_params,
|
|
506
|
+
request_options: request_options
|
|
507
|
+
)
|
|
508
|
+
begin
|
|
509
|
+
response = @client.send(request)
|
|
510
|
+
rescue Net::HTTPRequestTimeout
|
|
511
|
+
raise Schematic::Errors::TimeoutError
|
|
512
|
+
end
|
|
513
|
+
code = response.code.to_i
|
|
514
|
+
if code.between?(200, 299)
|
|
515
|
+
Schematic::Companies::Types::GetActiveCompanySubscriptionResponse.load(response.body)
|
|
516
|
+
else
|
|
517
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
518
|
+
raise error_class.new(response.body, code: code)
|
|
519
|
+
end
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
# @param request_options [Hash]
|
|
523
|
+
# @param params [Schematic::Types::UpsertTraitRequestBody]
|
|
524
|
+
# @option request_options [String] :base_url
|
|
525
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
526
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
527
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
528
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
529
|
+
#
|
|
530
|
+
# @return [Schematic::Companies::Types::UpsertCompanyTraitResponse]
|
|
531
|
+
def upsert_company_trait(request_options: {}, **params)
|
|
532
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
533
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
534
|
+
base_url: request_options[:base_url],
|
|
535
|
+
method: "POST",
|
|
536
|
+
path: "company-traits",
|
|
537
|
+
body: Schematic::Types::UpsertTraitRequestBody.new(params).to_h,
|
|
538
|
+
request_options: request_options
|
|
539
|
+
)
|
|
540
|
+
begin
|
|
541
|
+
response = @client.send(request)
|
|
542
|
+
rescue Net::HTTPRequestTimeout
|
|
543
|
+
raise Schematic::Errors::TimeoutError
|
|
544
|
+
end
|
|
545
|
+
code = response.code.to_i
|
|
546
|
+
if code.between?(200, 299)
|
|
547
|
+
Schematic::Companies::Types::UpsertCompanyTraitResponse.load(response.body)
|
|
548
|
+
else
|
|
549
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
550
|
+
raise error_class.new(response.body, code: code)
|
|
551
|
+
end
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
# @param request_options [Hash]
|
|
555
|
+
# @param params [Hash]
|
|
556
|
+
# @option request_options [String] :base_url
|
|
557
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
558
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
559
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
560
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
561
|
+
# @option params [Schematic::Types::EntityType, nil] :entity_type
|
|
562
|
+
# @option params [String, nil] :ids
|
|
563
|
+
# @option params [String, nil] :q
|
|
564
|
+
# @option params [Integer, nil] :limit
|
|
565
|
+
# @option params [Integer, nil] :offset
|
|
566
|
+
#
|
|
567
|
+
# @return [Schematic::Companies::Types::ListEntityKeyDefinitionsResponse]
|
|
568
|
+
def list_entity_key_definitions(request_options: {}, **params)
|
|
569
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
570
|
+
query_param_names = %i[entity_type ids q limit offset]
|
|
571
|
+
query_params = {}
|
|
572
|
+
query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type)
|
|
573
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
574
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
575
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
576
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
577
|
+
params.except(*query_param_names)
|
|
578
|
+
|
|
579
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
580
|
+
base_url: request_options[:base_url],
|
|
581
|
+
method: "GET",
|
|
582
|
+
path: "entity-key-definitions",
|
|
583
|
+
query: query_params,
|
|
584
|
+
request_options: request_options
|
|
585
|
+
)
|
|
586
|
+
begin
|
|
587
|
+
response = @client.send(request)
|
|
588
|
+
rescue Net::HTTPRequestTimeout
|
|
589
|
+
raise Schematic::Errors::TimeoutError
|
|
590
|
+
end
|
|
591
|
+
code = response.code.to_i
|
|
592
|
+
if code.between?(200, 299)
|
|
593
|
+
Schematic::Companies::Types::ListEntityKeyDefinitionsResponse.load(response.body)
|
|
594
|
+
else
|
|
595
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
596
|
+
raise error_class.new(response.body, code: code)
|
|
597
|
+
end
|
|
598
|
+
end
|
|
599
|
+
|
|
600
|
+
# @param request_options [Hash]
|
|
601
|
+
# @param params [Hash]
|
|
602
|
+
# @option request_options [String] :base_url
|
|
603
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
604
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
605
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
606
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
607
|
+
# @option params [Schematic::Types::EntityType, nil] :entity_type
|
|
608
|
+
# @option params [String, nil] :ids
|
|
609
|
+
# @option params [String, nil] :q
|
|
610
|
+
# @option params [Integer, nil] :limit
|
|
611
|
+
# @option params [Integer, nil] :offset
|
|
612
|
+
#
|
|
613
|
+
# @return [Schematic::Companies::Types::CountEntityKeyDefinitionsResponse]
|
|
614
|
+
def count_entity_key_definitions(request_options: {}, **params)
|
|
615
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
616
|
+
query_param_names = %i[entity_type ids q limit offset]
|
|
617
|
+
query_params = {}
|
|
618
|
+
query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type)
|
|
619
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
620
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
621
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
622
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
623
|
+
params.except(*query_param_names)
|
|
624
|
+
|
|
625
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
626
|
+
base_url: request_options[:base_url],
|
|
627
|
+
method: "GET",
|
|
628
|
+
path: "entity-key-definitions/count",
|
|
629
|
+
query: query_params,
|
|
630
|
+
request_options: request_options
|
|
631
|
+
)
|
|
632
|
+
begin
|
|
633
|
+
response = @client.send(request)
|
|
634
|
+
rescue Net::HTTPRequestTimeout
|
|
635
|
+
raise Schematic::Errors::TimeoutError
|
|
636
|
+
end
|
|
637
|
+
code = response.code.to_i
|
|
638
|
+
if code.between?(200, 299)
|
|
639
|
+
Schematic::Companies::Types::CountEntityKeyDefinitionsResponse.load(response.body)
|
|
640
|
+
else
|
|
641
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
642
|
+
raise error_class.new(response.body, code: code)
|
|
643
|
+
end
|
|
644
|
+
end
|
|
645
|
+
|
|
646
|
+
# @param request_options [Hash]
|
|
647
|
+
# @param params [Hash]
|
|
648
|
+
# @option request_options [String] :base_url
|
|
649
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
650
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
651
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
652
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
653
|
+
# @option params [Schematic::Types::EntityType, nil] :entity_type
|
|
654
|
+
# @option params [String, nil] :ids
|
|
655
|
+
# @option params [String, nil] :q
|
|
656
|
+
# @option params [Schematic::Types::TraitType, nil] :trait_type
|
|
657
|
+
# @option params [Schematic::Types::TraitType, nil] :trait_types
|
|
658
|
+
# @option params [Integer, nil] :limit
|
|
659
|
+
# @option params [Integer, nil] :offset
|
|
660
|
+
#
|
|
661
|
+
# @return [Schematic::Companies::Types::ListEntityTraitDefinitionsResponse]
|
|
662
|
+
def list_entity_trait_definitions(request_options: {}, **params)
|
|
663
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
664
|
+
query_param_names = %i[entity_type ids q trait_type trait_types limit offset]
|
|
665
|
+
query_params = {}
|
|
666
|
+
query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type)
|
|
667
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
668
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
669
|
+
query_params["trait_type"] = params[:trait_type] if params.key?(:trait_type)
|
|
670
|
+
query_params["trait_types"] = params[:trait_types] if params.key?(:trait_types)
|
|
671
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
672
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
673
|
+
params.except(*query_param_names)
|
|
674
|
+
|
|
675
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
676
|
+
base_url: request_options[:base_url],
|
|
677
|
+
method: "GET",
|
|
678
|
+
path: "entity-trait-definitions",
|
|
679
|
+
query: query_params,
|
|
680
|
+
request_options: request_options
|
|
681
|
+
)
|
|
682
|
+
begin
|
|
683
|
+
response = @client.send(request)
|
|
684
|
+
rescue Net::HTTPRequestTimeout
|
|
685
|
+
raise Schematic::Errors::TimeoutError
|
|
686
|
+
end
|
|
687
|
+
code = response.code.to_i
|
|
688
|
+
if code.between?(200, 299)
|
|
689
|
+
Schematic::Companies::Types::ListEntityTraitDefinitionsResponse.load(response.body)
|
|
690
|
+
else
|
|
691
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
692
|
+
raise error_class.new(response.body, code: code)
|
|
693
|
+
end
|
|
694
|
+
end
|
|
695
|
+
|
|
696
|
+
# @param request_options [Hash]
|
|
697
|
+
# @param params [Schematic::Companies::Types::CreateEntityTraitDefinitionRequestBody]
|
|
698
|
+
# @option request_options [String] :base_url
|
|
699
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
700
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
701
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
702
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
703
|
+
#
|
|
704
|
+
# @return [Schematic::Companies::Types::GetOrCreateEntityTraitDefinitionResponse]
|
|
705
|
+
def get_or_create_entity_trait_definition(request_options: {}, **params)
|
|
706
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
707
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
708
|
+
base_url: request_options[:base_url],
|
|
709
|
+
method: "POST",
|
|
710
|
+
path: "entity-trait-definitions",
|
|
711
|
+
body: Schematic::Companies::Types::CreateEntityTraitDefinitionRequestBody.new(params).to_h,
|
|
712
|
+
request_options: request_options
|
|
713
|
+
)
|
|
714
|
+
begin
|
|
715
|
+
response = @client.send(request)
|
|
716
|
+
rescue Net::HTTPRequestTimeout
|
|
717
|
+
raise Schematic::Errors::TimeoutError
|
|
718
|
+
end
|
|
719
|
+
code = response.code.to_i
|
|
720
|
+
if code.between?(200, 299)
|
|
721
|
+
Schematic::Companies::Types::GetOrCreateEntityTraitDefinitionResponse.load(response.body)
|
|
722
|
+
else
|
|
723
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
724
|
+
raise error_class.new(response.body, code: code)
|
|
725
|
+
end
|
|
726
|
+
end
|
|
727
|
+
|
|
728
|
+
# @param request_options [Hash]
|
|
729
|
+
# @param params [Hash]
|
|
730
|
+
# @option request_options [String] :base_url
|
|
731
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
732
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
733
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
734
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
735
|
+
# @option params [String] :entity_trait_definition_id
|
|
736
|
+
#
|
|
737
|
+
# @return [Schematic::Companies::Types::GetEntityTraitDefinitionResponse]
|
|
738
|
+
def get_entity_trait_definition(request_options: {}, **params)
|
|
739
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
740
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
741
|
+
base_url: request_options[:base_url],
|
|
742
|
+
method: "GET",
|
|
743
|
+
path: "entity-trait-definitions/#{URI.encode_uri_component(params[:entity_trait_definition_id].to_s)}",
|
|
744
|
+
request_options: request_options
|
|
745
|
+
)
|
|
746
|
+
begin
|
|
747
|
+
response = @client.send(request)
|
|
748
|
+
rescue Net::HTTPRequestTimeout
|
|
749
|
+
raise Schematic::Errors::TimeoutError
|
|
750
|
+
end
|
|
751
|
+
code = response.code.to_i
|
|
752
|
+
if code.between?(200, 299)
|
|
753
|
+
Schematic::Companies::Types::GetEntityTraitDefinitionResponse.load(response.body)
|
|
754
|
+
else
|
|
755
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
756
|
+
raise error_class.new(response.body, code: code)
|
|
757
|
+
end
|
|
758
|
+
end
|
|
759
|
+
|
|
760
|
+
# @param request_options [Hash]
|
|
761
|
+
# @param params [Schematic::Companies::Types::UpdateEntityTraitDefinitionRequestBody]
|
|
762
|
+
# @option request_options [String] :base_url
|
|
763
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
764
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
765
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
766
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
767
|
+
# @option params [String] :entity_trait_definition_id
|
|
768
|
+
#
|
|
769
|
+
# @return [Schematic::Companies::Types::UpdateEntityTraitDefinitionResponse]
|
|
770
|
+
def update_entity_trait_definition(request_options: {}, **params)
|
|
771
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
772
|
+
request_data = Schematic::Companies::Types::UpdateEntityTraitDefinitionRequestBody.new(params).to_h
|
|
773
|
+
non_body_param_names = ["entity_trait_definition_id"]
|
|
774
|
+
body = request_data.except(*non_body_param_names)
|
|
775
|
+
|
|
776
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
777
|
+
base_url: request_options[:base_url],
|
|
778
|
+
method: "PUT",
|
|
779
|
+
path: "entity-trait-definitions/#{URI.encode_uri_component(params[:entity_trait_definition_id].to_s)}",
|
|
780
|
+
body: body,
|
|
781
|
+
request_options: request_options
|
|
782
|
+
)
|
|
783
|
+
begin
|
|
784
|
+
response = @client.send(request)
|
|
785
|
+
rescue Net::HTTPRequestTimeout
|
|
786
|
+
raise Schematic::Errors::TimeoutError
|
|
787
|
+
end
|
|
788
|
+
code = response.code.to_i
|
|
789
|
+
if code.between?(200, 299)
|
|
790
|
+
Schematic::Companies::Types::UpdateEntityTraitDefinitionResponse.load(response.body)
|
|
791
|
+
else
|
|
792
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
793
|
+
raise error_class.new(response.body, code: code)
|
|
794
|
+
end
|
|
795
|
+
end
|
|
796
|
+
|
|
797
|
+
# @param request_options [Hash]
|
|
798
|
+
# @param params [Hash]
|
|
799
|
+
# @option request_options [String] :base_url
|
|
800
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
801
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
802
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
803
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
804
|
+
# @option params [Schematic::Types::EntityType, nil] :entity_type
|
|
805
|
+
# @option params [String, nil] :ids
|
|
806
|
+
# @option params [String, nil] :q
|
|
807
|
+
# @option params [Schematic::Types::TraitType, nil] :trait_type
|
|
808
|
+
# @option params [Schematic::Types::TraitType, nil] :trait_types
|
|
809
|
+
# @option params [Integer, nil] :limit
|
|
810
|
+
# @option params [Integer, nil] :offset
|
|
811
|
+
#
|
|
812
|
+
# @return [Schematic::Companies::Types::CountEntityTraitDefinitionsResponse]
|
|
813
|
+
def count_entity_trait_definitions(request_options: {}, **params)
|
|
814
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
815
|
+
query_param_names = %i[entity_type ids q trait_type trait_types limit offset]
|
|
816
|
+
query_params = {}
|
|
817
|
+
query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type)
|
|
818
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
819
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
820
|
+
query_params["trait_type"] = params[:trait_type] if params.key?(:trait_type)
|
|
821
|
+
query_params["trait_types"] = params[:trait_types] if params.key?(:trait_types)
|
|
822
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
823
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
824
|
+
params.except(*query_param_names)
|
|
825
|
+
|
|
826
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
827
|
+
base_url: request_options[:base_url],
|
|
828
|
+
method: "GET",
|
|
829
|
+
path: "entity-trait-definitions/count",
|
|
830
|
+
query: query_params,
|
|
831
|
+
request_options: request_options
|
|
832
|
+
)
|
|
833
|
+
begin
|
|
834
|
+
response = @client.send(request)
|
|
835
|
+
rescue Net::HTTPRequestTimeout
|
|
836
|
+
raise Schematic::Errors::TimeoutError
|
|
837
|
+
end
|
|
838
|
+
code = response.code.to_i
|
|
839
|
+
if code.between?(200, 299)
|
|
840
|
+
Schematic::Companies::Types::CountEntityTraitDefinitionsResponse.load(response.body)
|
|
841
|
+
else
|
|
842
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
843
|
+
raise error_class.new(response.body, code: code)
|
|
844
|
+
end
|
|
845
|
+
end
|
|
846
|
+
|
|
847
|
+
# @param request_options [Hash]
|
|
848
|
+
# @param params [Hash]
|
|
849
|
+
# @option request_options [String] :base_url
|
|
850
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
851
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
852
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
853
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
854
|
+
# @option params [String] :definition_id
|
|
855
|
+
# @option params [String, nil] :q
|
|
856
|
+
# @option params [Integer, nil] :limit
|
|
857
|
+
# @option params [Integer, nil] :offset
|
|
858
|
+
#
|
|
859
|
+
# @return [Schematic::Companies::Types::GetEntityTraitValuesResponse]
|
|
860
|
+
def get_entity_trait_values(request_options: {}, **params)
|
|
861
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
862
|
+
query_param_names = %i[definition_id q limit offset]
|
|
863
|
+
query_params = {}
|
|
864
|
+
query_params["definition_id"] = params[:definition_id] if params.key?(:definition_id)
|
|
865
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
866
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
867
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
868
|
+
params.except(*query_param_names)
|
|
869
|
+
|
|
870
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
871
|
+
base_url: request_options[:base_url],
|
|
872
|
+
method: "GET",
|
|
873
|
+
path: "entity-trait-values",
|
|
874
|
+
query: query_params,
|
|
875
|
+
request_options: request_options
|
|
876
|
+
)
|
|
877
|
+
begin
|
|
878
|
+
response = @client.send(request)
|
|
879
|
+
rescue Net::HTTPRequestTimeout
|
|
880
|
+
raise Schematic::Errors::TimeoutError
|
|
881
|
+
end
|
|
882
|
+
code = response.code.to_i
|
|
883
|
+
if code.between?(200, 299)
|
|
884
|
+
Schematic::Companies::Types::GetEntityTraitValuesResponse.load(response.body)
|
|
885
|
+
else
|
|
886
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
887
|
+
raise error_class.new(response.body, code: code)
|
|
888
|
+
end
|
|
889
|
+
end
|
|
890
|
+
|
|
891
|
+
# @param request_options [Hash]
|
|
892
|
+
# @param params [Hash]
|
|
893
|
+
# @option request_options [String] :base_url
|
|
894
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
895
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
896
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
897
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
898
|
+
# @option params [String, nil] :action
|
|
899
|
+
# @option params [String, nil] :base_plan_action
|
|
900
|
+
# @option params [String, nil] :company_id
|
|
901
|
+
# @option params [String, nil] :company_ids
|
|
902
|
+
# @option params [String, nil] :plan_ids
|
|
903
|
+
# @option params [Integer, nil] :limit
|
|
904
|
+
# @option params [Integer, nil] :offset
|
|
905
|
+
#
|
|
906
|
+
# @return [Schematic::Companies::Types::ListPlanChangesResponse]
|
|
907
|
+
def list_plan_changes(request_options: {}, **params)
|
|
908
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
909
|
+
query_param_names = %i[action base_plan_action company_id company_ids plan_ids limit offset]
|
|
910
|
+
query_params = {}
|
|
911
|
+
query_params["action"] = params[:action] if params.key?(:action)
|
|
912
|
+
query_params["base_plan_action"] = params[:base_plan_action] if params.key?(:base_plan_action)
|
|
913
|
+
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
914
|
+
query_params["company_ids"] = params[:company_ids] if params.key?(:company_ids)
|
|
915
|
+
query_params["plan_ids"] = params[:plan_ids] if params.key?(:plan_ids)
|
|
916
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
917
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
918
|
+
params.except(*query_param_names)
|
|
919
|
+
|
|
920
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
921
|
+
base_url: request_options[:base_url],
|
|
922
|
+
method: "GET",
|
|
923
|
+
path: "plan-changes",
|
|
924
|
+
query: query_params,
|
|
925
|
+
request_options: request_options
|
|
926
|
+
)
|
|
927
|
+
begin
|
|
928
|
+
response = @client.send(request)
|
|
929
|
+
rescue Net::HTTPRequestTimeout
|
|
930
|
+
raise Schematic::Errors::TimeoutError
|
|
931
|
+
end
|
|
932
|
+
code = response.code.to_i
|
|
933
|
+
if code.between?(200, 299)
|
|
934
|
+
Schematic::Companies::Types::ListPlanChangesResponse.load(response.body)
|
|
935
|
+
else
|
|
936
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
937
|
+
raise error_class.new(response.body, code: code)
|
|
938
|
+
end
|
|
939
|
+
end
|
|
940
|
+
|
|
941
|
+
# @param request_options [Hash]
|
|
942
|
+
# @param params [Hash]
|
|
943
|
+
# @option request_options [String] :base_url
|
|
944
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
945
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
946
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
947
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
948
|
+
# @option params [String] :plan_change_id
|
|
949
|
+
#
|
|
950
|
+
# @return [Schematic::Companies::Types::GetPlanChangeResponse]
|
|
951
|
+
def get_plan_change(request_options: {}, **params)
|
|
952
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
953
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
954
|
+
base_url: request_options[:base_url],
|
|
955
|
+
method: "GET",
|
|
956
|
+
path: "plan-changes/#{URI.encode_uri_component(params[:plan_change_id].to_s)}",
|
|
957
|
+
request_options: request_options
|
|
958
|
+
)
|
|
959
|
+
begin
|
|
960
|
+
response = @client.send(request)
|
|
961
|
+
rescue Net::HTTPRequestTimeout
|
|
962
|
+
raise Schematic::Errors::TimeoutError
|
|
963
|
+
end
|
|
964
|
+
code = response.code.to_i
|
|
965
|
+
if code.between?(200, 299)
|
|
966
|
+
Schematic::Companies::Types::GetPlanChangeResponse.load(response.body)
|
|
967
|
+
else
|
|
968
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
969
|
+
raise error_class.new(response.body, code: code)
|
|
970
|
+
end
|
|
971
|
+
end
|
|
972
|
+
|
|
973
|
+
# @param request_options [Hash]
|
|
974
|
+
# @param params [Hash]
|
|
975
|
+
# @option request_options [String] :base_url
|
|
976
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
977
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
978
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
979
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
980
|
+
# @option params [String, nil] :ids
|
|
981
|
+
# @option params [String, nil] :plan_id
|
|
982
|
+
# @option params [String, nil] :trait_id
|
|
983
|
+
# @option params [String, nil] :trait_ids
|
|
984
|
+
# @option params [Integer, nil] :limit
|
|
985
|
+
# @option params [Integer, nil] :offset
|
|
986
|
+
#
|
|
987
|
+
# @return [Schematic::Companies::Types::ListPlanTraitsResponse]
|
|
988
|
+
def list_plan_traits(request_options: {}, **params)
|
|
989
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
990
|
+
query_param_names = %i[ids plan_id trait_id trait_ids limit offset]
|
|
991
|
+
query_params = {}
|
|
992
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
993
|
+
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
994
|
+
query_params["trait_id"] = params[:trait_id] if params.key?(:trait_id)
|
|
995
|
+
query_params["trait_ids"] = params[:trait_ids] if params.key?(:trait_ids)
|
|
996
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
997
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
998
|
+
params.except(*query_param_names)
|
|
999
|
+
|
|
1000
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1001
|
+
base_url: request_options[:base_url],
|
|
1002
|
+
method: "GET",
|
|
1003
|
+
path: "plan-traits",
|
|
1004
|
+
query: query_params,
|
|
1005
|
+
request_options: request_options
|
|
1006
|
+
)
|
|
1007
|
+
begin
|
|
1008
|
+
response = @client.send(request)
|
|
1009
|
+
rescue Net::HTTPRequestTimeout
|
|
1010
|
+
raise Schematic::Errors::TimeoutError
|
|
1011
|
+
end
|
|
1012
|
+
code = response.code.to_i
|
|
1013
|
+
if code.between?(200, 299)
|
|
1014
|
+
Schematic::Companies::Types::ListPlanTraitsResponse.load(response.body)
|
|
1015
|
+
else
|
|
1016
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1017
|
+
raise error_class.new(response.body, code: code)
|
|
1018
|
+
end
|
|
1019
|
+
end
|
|
1020
|
+
|
|
1021
|
+
# @param request_options [Hash]
|
|
1022
|
+
# @param params [Schematic::Companies::Types::CreatePlanTraitRequestBody]
|
|
1023
|
+
# @option request_options [String] :base_url
|
|
1024
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1025
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1026
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1027
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1028
|
+
#
|
|
1029
|
+
# @return [Schematic::Companies::Types::CreatePlanTraitResponse]
|
|
1030
|
+
def create_plan_trait(request_options: {}, **params)
|
|
1031
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1032
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1033
|
+
base_url: request_options[:base_url],
|
|
1034
|
+
method: "POST",
|
|
1035
|
+
path: "plan-traits",
|
|
1036
|
+
body: Schematic::Companies::Types::CreatePlanTraitRequestBody.new(params).to_h,
|
|
1037
|
+
request_options: request_options
|
|
1038
|
+
)
|
|
1039
|
+
begin
|
|
1040
|
+
response = @client.send(request)
|
|
1041
|
+
rescue Net::HTTPRequestTimeout
|
|
1042
|
+
raise Schematic::Errors::TimeoutError
|
|
1043
|
+
end
|
|
1044
|
+
code = response.code.to_i
|
|
1045
|
+
if code.between?(200, 299)
|
|
1046
|
+
Schematic::Companies::Types::CreatePlanTraitResponse.load(response.body)
|
|
1047
|
+
else
|
|
1048
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1049
|
+
raise error_class.new(response.body, code: code)
|
|
1050
|
+
end
|
|
1051
|
+
end
|
|
1052
|
+
|
|
1053
|
+
# @param request_options [Hash]
|
|
1054
|
+
# @param params [Hash]
|
|
1055
|
+
# @option request_options [String] :base_url
|
|
1056
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1057
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1058
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1059
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1060
|
+
# @option params [String] :plan_trait_id
|
|
1061
|
+
#
|
|
1062
|
+
# @return [Schematic::Companies::Types::GetPlanTraitResponse]
|
|
1063
|
+
def get_plan_trait(request_options: {}, **params)
|
|
1064
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1065
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1066
|
+
base_url: request_options[:base_url],
|
|
1067
|
+
method: "GET",
|
|
1068
|
+
path: "plan-traits/#{URI.encode_uri_component(params[:plan_trait_id].to_s)}",
|
|
1069
|
+
request_options: request_options
|
|
1070
|
+
)
|
|
1071
|
+
begin
|
|
1072
|
+
response = @client.send(request)
|
|
1073
|
+
rescue Net::HTTPRequestTimeout
|
|
1074
|
+
raise Schematic::Errors::TimeoutError
|
|
1075
|
+
end
|
|
1076
|
+
code = response.code.to_i
|
|
1077
|
+
if code.between?(200, 299)
|
|
1078
|
+
Schematic::Companies::Types::GetPlanTraitResponse.load(response.body)
|
|
1079
|
+
else
|
|
1080
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1081
|
+
raise error_class.new(response.body, code: code)
|
|
1082
|
+
end
|
|
1083
|
+
end
|
|
1084
|
+
|
|
1085
|
+
# @param request_options [Hash]
|
|
1086
|
+
# @param params [Schematic::Companies::Types::UpdatePlanTraitRequestBody]
|
|
1087
|
+
# @option request_options [String] :base_url
|
|
1088
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1089
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1090
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1091
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1092
|
+
# @option params [String] :plan_trait_id
|
|
1093
|
+
#
|
|
1094
|
+
# @return [Schematic::Companies::Types::UpdatePlanTraitResponse]
|
|
1095
|
+
def update_plan_trait(request_options: {}, **params)
|
|
1096
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1097
|
+
request_data = Schematic::Companies::Types::UpdatePlanTraitRequestBody.new(params).to_h
|
|
1098
|
+
non_body_param_names = ["plan_trait_id"]
|
|
1099
|
+
body = request_data.except(*non_body_param_names)
|
|
1100
|
+
|
|
1101
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1102
|
+
base_url: request_options[:base_url],
|
|
1103
|
+
method: "PUT",
|
|
1104
|
+
path: "plan-traits/#{URI.encode_uri_component(params[:plan_trait_id].to_s)}",
|
|
1105
|
+
body: body,
|
|
1106
|
+
request_options: request_options
|
|
1107
|
+
)
|
|
1108
|
+
begin
|
|
1109
|
+
response = @client.send(request)
|
|
1110
|
+
rescue Net::HTTPRequestTimeout
|
|
1111
|
+
raise Schematic::Errors::TimeoutError
|
|
1112
|
+
end
|
|
1113
|
+
code = response.code.to_i
|
|
1114
|
+
if code.between?(200, 299)
|
|
1115
|
+
Schematic::Companies::Types::UpdatePlanTraitResponse.load(response.body)
|
|
1116
|
+
else
|
|
1117
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1118
|
+
raise error_class.new(response.body, code: code)
|
|
1119
|
+
end
|
|
1120
|
+
end
|
|
1121
|
+
|
|
1122
|
+
# @param request_options [Hash]
|
|
1123
|
+
# @param params [Hash]
|
|
1124
|
+
# @option request_options [String] :base_url
|
|
1125
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1126
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1127
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1128
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1129
|
+
# @option params [String] :plan_trait_id
|
|
1130
|
+
#
|
|
1131
|
+
# @return [Schematic::Companies::Types::DeletePlanTraitResponse]
|
|
1132
|
+
def delete_plan_trait(request_options: {}, **params)
|
|
1133
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1134
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1135
|
+
base_url: request_options[:base_url],
|
|
1136
|
+
method: "DELETE",
|
|
1137
|
+
path: "plan-traits/#{URI.encode_uri_component(params[:plan_trait_id].to_s)}",
|
|
1138
|
+
request_options: request_options
|
|
1139
|
+
)
|
|
1140
|
+
begin
|
|
1141
|
+
response = @client.send(request)
|
|
1142
|
+
rescue Net::HTTPRequestTimeout
|
|
1143
|
+
raise Schematic::Errors::TimeoutError
|
|
1144
|
+
end
|
|
1145
|
+
code = response.code.to_i
|
|
1146
|
+
if code.between?(200, 299)
|
|
1147
|
+
Schematic::Companies::Types::DeletePlanTraitResponse.load(response.body)
|
|
1148
|
+
else
|
|
1149
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1150
|
+
raise error_class.new(response.body, code: code)
|
|
1151
|
+
end
|
|
1152
|
+
end
|
|
1153
|
+
|
|
1154
|
+
# @param request_options [Hash]
|
|
1155
|
+
# @param params [Schematic::Companies::Types::UpdatePlanTraitBulkRequestBody]
|
|
1156
|
+
# @option request_options [String] :base_url
|
|
1157
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1158
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1159
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1160
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1161
|
+
#
|
|
1162
|
+
# @return [Schematic::Companies::Types::UpdatePlanTraitsBulkResponse]
|
|
1163
|
+
def update_plan_traits_bulk(request_options: {}, **params)
|
|
1164
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1165
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1166
|
+
base_url: request_options[:base_url],
|
|
1167
|
+
method: "POST",
|
|
1168
|
+
path: "plan-traits/bulk",
|
|
1169
|
+
body: Schematic::Companies::Types::UpdatePlanTraitBulkRequestBody.new(params).to_h,
|
|
1170
|
+
request_options: request_options
|
|
1171
|
+
)
|
|
1172
|
+
begin
|
|
1173
|
+
response = @client.send(request)
|
|
1174
|
+
rescue Net::HTTPRequestTimeout
|
|
1175
|
+
raise Schematic::Errors::TimeoutError
|
|
1176
|
+
end
|
|
1177
|
+
code = response.code.to_i
|
|
1178
|
+
if code.between?(200, 299)
|
|
1179
|
+
Schematic::Companies::Types::UpdatePlanTraitsBulkResponse.load(response.body)
|
|
1180
|
+
else
|
|
1181
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1182
|
+
raise error_class.new(response.body, code: code)
|
|
1183
|
+
end
|
|
1184
|
+
end
|
|
1185
|
+
|
|
1186
|
+
# @param request_options [Hash]
|
|
1187
|
+
# @param params [Hash]
|
|
1188
|
+
# @option request_options [String] :base_url
|
|
1189
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1190
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1191
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1192
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1193
|
+
# @option params [String, nil] :ids
|
|
1194
|
+
# @option params [String, nil] :plan_id
|
|
1195
|
+
# @option params [String, nil] :trait_id
|
|
1196
|
+
# @option params [String, nil] :trait_ids
|
|
1197
|
+
# @option params [Integer, nil] :limit
|
|
1198
|
+
# @option params [Integer, nil] :offset
|
|
1199
|
+
#
|
|
1200
|
+
# @return [Schematic::Companies::Types::CountPlanTraitsResponse]
|
|
1201
|
+
def count_plan_traits(request_options: {}, **params)
|
|
1202
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1203
|
+
query_param_names = %i[ids plan_id trait_id trait_ids limit offset]
|
|
1204
|
+
query_params = {}
|
|
1205
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
1206
|
+
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
1207
|
+
query_params["trait_id"] = params[:trait_id] if params.key?(:trait_id)
|
|
1208
|
+
query_params["trait_ids"] = params[:trait_ids] if params.key?(:trait_ids)
|
|
1209
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
1210
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
1211
|
+
params.except(*query_param_names)
|
|
1212
|
+
|
|
1213
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1214
|
+
base_url: request_options[:base_url],
|
|
1215
|
+
method: "GET",
|
|
1216
|
+
path: "plan-traits/count",
|
|
1217
|
+
query: query_params,
|
|
1218
|
+
request_options: request_options
|
|
1219
|
+
)
|
|
1220
|
+
begin
|
|
1221
|
+
response = @client.send(request)
|
|
1222
|
+
rescue Net::HTTPRequestTimeout
|
|
1223
|
+
raise Schematic::Errors::TimeoutError
|
|
1224
|
+
end
|
|
1225
|
+
code = response.code.to_i
|
|
1226
|
+
if code.between?(200, 299)
|
|
1227
|
+
Schematic::Companies::Types::CountPlanTraitsResponse.load(response.body)
|
|
1228
|
+
else
|
|
1229
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1230
|
+
raise error_class.new(response.body, code: code)
|
|
1231
|
+
end
|
|
1232
|
+
end
|
|
1233
|
+
|
|
1234
|
+
# @param request_options [Hash]
|
|
1235
|
+
# @param params [Schematic::Types::UpsertTraitRequestBody]
|
|
1236
|
+
# @option request_options [String] :base_url
|
|
1237
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1238
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1239
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1240
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1241
|
+
#
|
|
1242
|
+
# @return [Schematic::Companies::Types::UpsertUserTraitResponse]
|
|
1243
|
+
def upsert_user_trait(request_options: {}, **params)
|
|
1244
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1245
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1246
|
+
base_url: request_options[:base_url],
|
|
1247
|
+
method: "POST",
|
|
1248
|
+
path: "user-traits",
|
|
1249
|
+
body: Schematic::Types::UpsertTraitRequestBody.new(params).to_h,
|
|
1250
|
+
request_options: request_options
|
|
1251
|
+
)
|
|
1252
|
+
begin
|
|
1253
|
+
response = @client.send(request)
|
|
1254
|
+
rescue Net::HTTPRequestTimeout
|
|
1255
|
+
raise Schematic::Errors::TimeoutError
|
|
1256
|
+
end
|
|
1257
|
+
code = response.code.to_i
|
|
1258
|
+
if code.between?(200, 299)
|
|
1259
|
+
Schematic::Companies::Types::UpsertUserTraitResponse.load(response.body)
|
|
1260
|
+
else
|
|
1261
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1262
|
+
raise error_class.new(response.body, code: code)
|
|
1263
|
+
end
|
|
1264
|
+
end
|
|
1265
|
+
|
|
1266
|
+
# @param request_options [Hash]
|
|
1267
|
+
# @param params [Hash]
|
|
1268
|
+
# @option request_options [String] :base_url
|
|
1269
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1270
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1271
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1272
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1273
|
+
# @option params [String, nil] :company_id
|
|
1274
|
+
# @option params [String, nil] :ids
|
|
1275
|
+
# @option params [String, nil] :plan_id
|
|
1276
|
+
# @option params [String, nil] :q
|
|
1277
|
+
# @option params [Integer, nil] :limit
|
|
1278
|
+
# @option params [Integer, nil] :offset
|
|
1279
|
+
#
|
|
1280
|
+
# @return [Schematic::Companies::Types::ListUsersResponse]
|
|
1281
|
+
def list_users(request_options: {}, **params)
|
|
1282
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1283
|
+
query_param_names = %i[company_id ids plan_id q limit offset]
|
|
1284
|
+
query_params = {}
|
|
1285
|
+
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
1286
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
1287
|
+
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
1288
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
1289
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
1290
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
1291
|
+
params.except(*query_param_names)
|
|
1292
|
+
|
|
1293
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1294
|
+
base_url: request_options[:base_url],
|
|
1295
|
+
method: "GET",
|
|
1296
|
+
path: "users",
|
|
1297
|
+
query: query_params,
|
|
1298
|
+
request_options: request_options
|
|
1299
|
+
)
|
|
1300
|
+
begin
|
|
1301
|
+
response = @client.send(request)
|
|
1302
|
+
rescue Net::HTTPRequestTimeout
|
|
1303
|
+
raise Schematic::Errors::TimeoutError
|
|
1304
|
+
end
|
|
1305
|
+
code = response.code.to_i
|
|
1306
|
+
if code.between?(200, 299)
|
|
1307
|
+
Schematic::Companies::Types::ListUsersResponse.load(response.body)
|
|
1308
|
+
else
|
|
1309
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1310
|
+
raise error_class.new(response.body, code: code)
|
|
1311
|
+
end
|
|
1312
|
+
end
|
|
1313
|
+
|
|
1314
|
+
# @param request_options [Hash]
|
|
1315
|
+
# @param params [Schematic::Types::UpsertUserRequestBody]
|
|
1316
|
+
# @option request_options [String] :base_url
|
|
1317
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1318
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1319
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1320
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1321
|
+
#
|
|
1322
|
+
# @return [Schematic::Companies::Types::UpsertUserResponse]
|
|
1323
|
+
def upsert_user(request_options: {}, **params)
|
|
1324
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1325
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1326
|
+
base_url: request_options[:base_url],
|
|
1327
|
+
method: "POST",
|
|
1328
|
+
path: "users",
|
|
1329
|
+
body: Schematic::Types::UpsertUserRequestBody.new(params).to_h,
|
|
1330
|
+
request_options: request_options
|
|
1331
|
+
)
|
|
1332
|
+
begin
|
|
1333
|
+
response = @client.send(request)
|
|
1334
|
+
rescue Net::HTTPRequestTimeout
|
|
1335
|
+
raise Schematic::Errors::TimeoutError
|
|
1336
|
+
end
|
|
1337
|
+
code = response.code.to_i
|
|
1338
|
+
if code.between?(200, 299)
|
|
1339
|
+
Schematic::Companies::Types::UpsertUserResponse.load(response.body)
|
|
1340
|
+
else
|
|
1341
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1342
|
+
raise error_class.new(response.body, code: code)
|
|
1343
|
+
end
|
|
1344
|
+
end
|
|
1345
|
+
|
|
1346
|
+
# @param request_options [Hash]
|
|
1347
|
+
# @param params [Hash]
|
|
1348
|
+
# @option request_options [String] :base_url
|
|
1349
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1350
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1351
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1352
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1353
|
+
# @option params [String] :user_id
|
|
1354
|
+
#
|
|
1355
|
+
# @return [Schematic::Companies::Types::GetUserResponse]
|
|
1356
|
+
def get_user(request_options: {}, **params)
|
|
1357
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1358
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1359
|
+
base_url: request_options[:base_url],
|
|
1360
|
+
method: "GET",
|
|
1361
|
+
path: "users/#{URI.encode_uri_component(params[:user_id].to_s)}",
|
|
1362
|
+
request_options: request_options
|
|
1363
|
+
)
|
|
1364
|
+
begin
|
|
1365
|
+
response = @client.send(request)
|
|
1366
|
+
rescue Net::HTTPRequestTimeout
|
|
1367
|
+
raise Schematic::Errors::TimeoutError
|
|
1368
|
+
end
|
|
1369
|
+
code = response.code.to_i
|
|
1370
|
+
if code.between?(200, 299)
|
|
1371
|
+
Schematic::Companies::Types::GetUserResponse.load(response.body)
|
|
1372
|
+
else
|
|
1373
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1374
|
+
raise error_class.new(response.body, code: code)
|
|
1375
|
+
end
|
|
1376
|
+
end
|
|
1377
|
+
|
|
1378
|
+
# @param request_options [Hash]
|
|
1379
|
+
# @param params [Hash]
|
|
1380
|
+
# @option request_options [String] :base_url
|
|
1381
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1382
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1383
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1384
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1385
|
+
# @option params [String] :user_id
|
|
1386
|
+
#
|
|
1387
|
+
# @return [Schematic::Companies::Types::DeleteUserResponse]
|
|
1388
|
+
def delete_user(request_options: {}, **params)
|
|
1389
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1390
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1391
|
+
base_url: request_options[:base_url],
|
|
1392
|
+
method: "DELETE",
|
|
1393
|
+
path: "users/#{URI.encode_uri_component(params[:user_id].to_s)}",
|
|
1394
|
+
request_options: request_options
|
|
1395
|
+
)
|
|
1396
|
+
begin
|
|
1397
|
+
response = @client.send(request)
|
|
1398
|
+
rescue Net::HTTPRequestTimeout
|
|
1399
|
+
raise Schematic::Errors::TimeoutError
|
|
1400
|
+
end
|
|
1401
|
+
code = response.code.to_i
|
|
1402
|
+
if code.between?(200, 299)
|
|
1403
|
+
Schematic::Companies::Types::DeleteUserResponse.load(response.body)
|
|
1404
|
+
else
|
|
1405
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1406
|
+
raise error_class.new(response.body, code: code)
|
|
1407
|
+
end
|
|
1408
|
+
end
|
|
1409
|
+
|
|
1410
|
+
# @param request_options [Hash]
|
|
1411
|
+
# @param params [Hash]
|
|
1412
|
+
# @option request_options [String] :base_url
|
|
1413
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1414
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1415
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1416
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1417
|
+
# @option params [String, nil] :company_id
|
|
1418
|
+
# @option params [String, nil] :ids
|
|
1419
|
+
# @option params [String, nil] :plan_id
|
|
1420
|
+
# @option params [String, nil] :q
|
|
1421
|
+
# @option params [Integer, nil] :limit
|
|
1422
|
+
# @option params [Integer, nil] :offset
|
|
1423
|
+
#
|
|
1424
|
+
# @return [Schematic::Companies::Types::CountUsersResponse]
|
|
1425
|
+
def count_users(request_options: {}, **params)
|
|
1426
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1427
|
+
query_param_names = %i[company_id ids plan_id q limit offset]
|
|
1428
|
+
query_params = {}
|
|
1429
|
+
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
1430
|
+
query_params["ids"] = params[:ids] if params.key?(:ids)
|
|
1431
|
+
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
1432
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
1433
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
1434
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
1435
|
+
params.except(*query_param_names)
|
|
1436
|
+
|
|
1437
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1438
|
+
base_url: request_options[:base_url],
|
|
1439
|
+
method: "GET",
|
|
1440
|
+
path: "users/count",
|
|
1441
|
+
query: query_params,
|
|
1442
|
+
request_options: request_options
|
|
1443
|
+
)
|
|
1444
|
+
begin
|
|
1445
|
+
response = @client.send(request)
|
|
1446
|
+
rescue Net::HTTPRequestTimeout
|
|
1447
|
+
raise Schematic::Errors::TimeoutError
|
|
1448
|
+
end
|
|
1449
|
+
code = response.code.to_i
|
|
1450
|
+
if code.between?(200, 299)
|
|
1451
|
+
Schematic::Companies::Types::CountUsersResponse.load(response.body)
|
|
1452
|
+
else
|
|
1453
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1454
|
+
raise error_class.new(response.body, code: code)
|
|
1455
|
+
end
|
|
1456
|
+
end
|
|
1457
|
+
|
|
1458
|
+
# @param request_options [Hash]
|
|
1459
|
+
# @param params [Schematic::Types::UpsertUserRequestBody]
|
|
1460
|
+
# @option request_options [String] :base_url
|
|
1461
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1462
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1463
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1464
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1465
|
+
#
|
|
1466
|
+
# @return [Schematic::Companies::Types::CreateUserResponse]
|
|
1467
|
+
def create_user(request_options: {}, **params)
|
|
1468
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1469
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1470
|
+
base_url: request_options[:base_url],
|
|
1471
|
+
method: "POST",
|
|
1472
|
+
path: "users/create",
|
|
1473
|
+
body: Schematic::Types::UpsertUserRequestBody.new(params).to_h,
|
|
1474
|
+
request_options: request_options
|
|
1475
|
+
)
|
|
1476
|
+
begin
|
|
1477
|
+
response = @client.send(request)
|
|
1478
|
+
rescue Net::HTTPRequestTimeout
|
|
1479
|
+
raise Schematic::Errors::TimeoutError
|
|
1480
|
+
end
|
|
1481
|
+
code = response.code.to_i
|
|
1482
|
+
if code.between?(200, 299)
|
|
1483
|
+
Schematic::Companies::Types::CreateUserResponse.load(response.body)
|
|
1484
|
+
else
|
|
1485
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1486
|
+
raise error_class.new(response.body, code: code)
|
|
1487
|
+
end
|
|
1488
|
+
end
|
|
1489
|
+
|
|
1490
|
+
# @param request_options [Hash]
|
|
1491
|
+
# @param params [Schematic::Types::KeysRequestBody]
|
|
1492
|
+
# @option request_options [String] :base_url
|
|
1493
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1494
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1495
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1496
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1497
|
+
#
|
|
1498
|
+
# @return [Schematic::Companies::Types::DeleteUserByKeysResponse]
|
|
1499
|
+
def delete_user_by_keys(request_options: {}, **params)
|
|
1500
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1501
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1502
|
+
base_url: request_options[:base_url],
|
|
1503
|
+
method: "POST",
|
|
1504
|
+
path: "users/delete",
|
|
1505
|
+
body: Schematic::Types::KeysRequestBody.new(params).to_h,
|
|
1506
|
+
request_options: request_options
|
|
1507
|
+
)
|
|
1508
|
+
begin
|
|
1509
|
+
response = @client.send(request)
|
|
1510
|
+
rescue Net::HTTPRequestTimeout
|
|
1511
|
+
raise Schematic::Errors::TimeoutError
|
|
1512
|
+
end
|
|
1513
|
+
code = response.code.to_i
|
|
1514
|
+
if code.between?(200, 299)
|
|
1515
|
+
Schematic::Companies::Types::DeleteUserByKeysResponse.load(response.body)
|
|
1516
|
+
else
|
|
1517
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1518
|
+
raise error_class.new(response.body, code: code)
|
|
1519
|
+
end
|
|
1520
|
+
end
|
|
1521
|
+
|
|
1522
|
+
# @param request_options [Hash]
|
|
1523
|
+
# @param params [Hash]
|
|
1524
|
+
# @option request_options [String] :base_url
|
|
1525
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
1526
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
1527
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
1528
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
1529
|
+
# @option params [Hash[String, String]] :keys
|
|
1530
|
+
#
|
|
1531
|
+
# @return [Schematic::Companies::Types::LookupUserResponse]
|
|
1532
|
+
def lookup_user(request_options: {}, **params)
|
|
1533
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
1534
|
+
query_param_names = %i[keys]
|
|
1535
|
+
query_params = {}
|
|
1536
|
+
query_params["keys"] = params[:keys] if params.key?(:keys)
|
|
1537
|
+
params.except(*query_param_names)
|
|
1538
|
+
|
|
1539
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
1540
|
+
base_url: request_options[:base_url],
|
|
1541
|
+
method: "GET",
|
|
1542
|
+
path: "users/lookup",
|
|
1543
|
+
query: query_params,
|
|
1544
|
+
request_options: request_options
|
|
1545
|
+
)
|
|
1546
|
+
begin
|
|
1547
|
+
response = @client.send(request)
|
|
1548
|
+
rescue Net::HTTPRequestTimeout
|
|
1549
|
+
raise Schematic::Errors::TimeoutError
|
|
1550
|
+
end
|
|
1551
|
+
code = response.code.to_i
|
|
1552
|
+
if code.between?(200, 299)
|
|
1553
|
+
Schematic::Companies::Types::LookupUserResponse.load(response.body)
|
|
1554
|
+
else
|
|
1555
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
1556
|
+
raise error_class.new(response.body, code: code)
|
|
1557
|
+
end
|
|
1558
|
+
end
|
|
1559
|
+
end
|
|
1560
|
+
end
|
|
1561
|
+
end
|