From 3fee84188115db15ecfccd57621cc4e3cb1d748f Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 15:13:14 +0000 Subject: [PATCH] SDK regeneration --- .fern/metadata.json | 2 +- changelog.md | 8 - poetry.lock | 103 +- reference.md | 2789 +++++++++++++---- src/schematic/__init__.py | 355 ++- src/schematic/accounts/__init__.py | 33 +- src/schematic/accounts/client.py | 285 +- src/schematic/accounts/raw_client.py | 346 +- src/schematic/accounts/types/__init__.py | 33 +- .../accounts/types/count_audit_logs_params.py | 39 + ...sponse.py => count_audit_logs_response.py} | 6 +- ..._response.py => get_audit_log_response.py} | 6 +- ...s_response.py => get_who_am_i_response.py} | 9 +- ...ts_params.py => list_audit_logs_params.py} | 8 +- .../types/list_audit_logs_response.py | 25 + src/schematic/base_client.py | 76 + src/schematic/billing/client.py | 57 +- src/schematic/billing/raw_client.py | 45 +- .../billing/types/count_customers_params.py | 1 - ...ist_customers_with_subscriptions_params.py | 1 - src/schematic/companies/__init__.py | 12 - src/schematic/companies/client.py | 734 ++--- src/schematic/companies/raw_client.py | 1018 ++---- src/schematic/companies/types/__init__.py | 12 - ...nt_companies_for_advanced_filter_params.py | 95 - .../companies/types/count_companies_params.py | 53 + ...st_companies_for_advanced_filter_params.py | 95 - ..._companies_for_advanced_filter_response.py | 25 - .../companies/types/list_companies_params.py | 53 + src/schematic/componentspublic/__init__.py | 34 + src/schematic/componentspublic/client.py | 98 + src/schematic/componentspublic/raw_client.py | 190 ++ .../componentspublic/types/__init__.py | 34 + .../types/get_public_plans_response.py | 24 + src/schematic/core/client_wrapper.py | 2 +- src/schematic/credits/__init__.py | 18 + src/schematic/credits/client.py | 478 ++- src/schematic/credits/raw_client.py | 972 +++++- src/schematic/credits/types/__init__.py | 18 + ...count_billing_plan_credit_grants_params.py | 1 + .../types/count_company_grants_params.py | 37 + .../types/count_company_grants_response.py} | 6 +- .../types/count_credit_event_ledger_params.py | 39 + .../count_credit_event_ledger_response.py | 25 + .../list_billing_plan_credit_grants_params.py | 1 + .../types/list_credit_event_ledger_params.py | 39 + .../list_credit_event_ledger_response.py | 25 + src/schematic/entitlements/__init__.py | 6 + src/schematic/entitlements/client.py | 185 ++ src/schematic/entitlements/raw_client.py | 263 ++ src/schematic/entitlements/types/__init__.py | 6 + .../types/count_plan_entitlements_params.py | 10 + .../get_feature_usage_time_series_params.py | 29 + .../get_feature_usage_time_series_response.py | 25 + .../types/list_plan_entitlements_params.py | 10 + src/schematic/events/client.py | 2 + src/schematic/events/raw_client.py | 2 + src/schematic/features/client.py | 24 + src/schematic/features/raw_client.py | 20 + .../features/types/count_features_params.py | 5 + .../features/types/list_features_params.py | 5 + src/schematic/planbundle/__init__.py | 34 + src/schematic/planbundle/client.py | 310 ++ src/schematic/planbundle/raw_client.py | 595 ++++ src/schematic/planbundle/types/__init__.py | 38 + .../types/create_plan_bundle_response.py | 24 + .../types/update_plan_bundle_response.py | 24 + src/schematic/plangroups/__init__.py | 5 +- src/schematic/plangroups/client.py | 107 +- src/schematic/plangroups/raw_client.py | 85 +- src/schematic/plangroups/types/__init__.py | 4 +- .../plangroups/types/get_plan_group_params.py | 23 + .../types/get_plan_group_response.py | 3 +- src/schematic/planmigrations/__init__.py | 64 + src/schematic/planmigrations/client.py | 556 ++++ src/schematic/planmigrations/raw_client.py | 1140 +++++++ .../planmigrations/types/__init__.py | 62 + .../types/count_company_migrations_params.py | 36 + .../count_company_migrations_response.py | 25 + .../types/count_migrations_params.py | 35 + .../types/count_migrations_response.py | 25 + .../types/get_migration_response.py | 24 + .../types/list_company_migrations_params.py | 36 + .../types/list_company_migrations_response.py | 25 + .../types/list_migrations_params.py | 35 + .../types/list_migrations_response.py | 25 + src/schematic/plans/__init__.py | 9 + src/schematic/plans/client.py | 253 +- src/schematic/plans/raw_client.py | 483 ++- src/schematic/plans/types/__init__.py | 9 + .../plans/types/count_plans_params.py | 11 +- .../types/delete_plan_version_response.py | 24 + src/schematic/plans/types/get_plan_params.py | 26 + .../plans/types/get_plan_response.py | 3 +- .../plans/types/list_plan_issues_params.py | 1 + .../plans/types/list_plans_params.py | 11 +- .../types/publish_plan_version_response.py | 24 + src/schematic/scheduledcheckout/__init__.py | 52 + src/schematic/scheduledcheckout/client.py | 435 +++ src/schematic/scheduledcheckout/raw_client.py | 896 ++++++ .../scheduledcheckout/types/__init__.py | 50 + .../create_scheduled_checkout_response.py | 24 + .../types/get_scheduled_checkout_response.py | 24 + .../types/list_scheduled_checkouts_params.py} | 8 +- .../list_scheduled_checkouts_response.py | 25 + .../update_scheduled_checkout_response.py | 24 + src/schematic/types/__init__.py | 211 +- src/schematic/types/actor_type.py | 7 + .../types/api_key_create_response_data.py | 1 + src/schematic/types/api_key_response_data.py | 1 + ...ata.py => audit_log_list_response_data.py} | 8 +- ...nse_data.py => audit_log_response_data.py} | 10 +- .../billing_credit_bundle_response_data.py | 1 - .../types/billing_credit_bundle_view.py | 1 - .../billing_credit_grant_response_data.py | 3 + .../types/billing_credit_response_data.py | 1 + src/schematic/types/billing_credit_view.py | 43 + .../types/billing_customer_response_data.py | 1 - ...stomer_with_subscriptions_response_data.py | 1 - ...billing_plan_credit_grant_response_data.py | 33 +- src/schematic/types/capture_raw_event.py | 24 + .../types/capture_raw_event_batch.py | 20 + .../types/check_flag_response_data.py | 16 +- .../types/check_flags_response_data.py | 2 + .../types/company_detail_response_data.py | 4 + .../company_plan_detail_response_data.py | 4 + .../company_plan_with_billing_sub_view.py | 1 + ...y_view_with_feature_usage_response_data.py | 54 - .../types/component_display_settings.py | 2 + .../types/component_hydrate_response_data.py | 2 + .../types/component_preview_response_data.py | 2 + .../types/component_settings_response_data.py | 2 + .../types/condition_condition_type.py | 2 +- .../types/condition_group_response_data.py | 27 + src/schematic/types/condition_group_view.py | 29 + .../types/condition_response_data.py | 45 + src/schematic/types/condition_view.py | 54 + ..._billing_plan_credit_grant_request_body.py | 42 + ...eate_entitlement_in_bundle_request_body.py | 57 + ...nt_in_bundle_request_body_metric_period.py | 7 + ..._request_body_metric_period_month_reset.py | 7 + .../types/create_event_request_body.py | 6 +- .../types/create_plan_request_body.py | 23 + .../types/credit_company_grant_view.py | 3 + .../credit_event_ledger_response_data.py | 58 + src/schematic/types/credit_event_type.py | 5 + .../types/credit_usage_response_data.py | 31 - .../credits_auto_topup_company_summary.py | 20 + .../credits_auto_topup_credit_summary.py | 20 + .../types/credits_auto_topup_hard_failure.py | 24 + .../types/credits_auto_topup_retry_failure.py | 25 + src/schematic/types/data_event_payload.py | 24 + .../types/datastream_company_plan.py | 22 + ..._billing_plan_credit_grant_request_body.py | 19 + .../types/event_detail_response_data.py | 2 +- src/schematic/types/event_response_data.py | 2 +- .../types/feature_company_response_data.py | 18 +- .../feature_company_user_response_data.py | 6 +- src/schematic/types/feature_entitlement.py | 91 + .../feature_entitlement_metric_period.py | 7 + .../types/feature_entitlement_month_reset.py | 5 + .../types/feature_usage_data_response_data.py | 38 - .../feature_usage_legacy_response_data.py | 31 + .../types/feature_usage_response_data.py | 18 +- ...feature_usage_time_series_response_data.py | 26 + src/schematic/types/feature_view.py | 43 + src/schematic/types/flag_view.py | 36 + src/schematic/types/invoice_request_body.py | 2 + src/schematic/types/invoice_response_data.py | 2 + src/schematic/types/invoice_status.py | 5 + .../limit_time_series_point_response_data.py | 27 + src/schematic/types/plan_bundle_action.py | 5 + .../plan_bundle_credit_grant_request_body.py | 27 + .../plan_bundle_entitlement_request_body.py | 23 + .../types/plan_bundle_response_data.py | 28 + src/schematic/types/plan_change_action.py | 1 + src/schematic/types/plan_change_actor_type.py | 7 - .../types/plan_change_response_data.py | 31 +- .../types/plan_change_subscription_action.py | 3 +- src/schematic/types/plan_credit_grant_view.py | 40 +- .../types/plan_detail_response_data.py | 4 + .../types/plan_group_detail_response_data.py | 2 + .../plan_group_plan_detail_response_data.py | 4 + .../types/plan_group_response_data.py | 2 + ...version_company_migration_response_data.py | 31 + .../plan_version_company_migration_status.py | 7 + .../plan_version_migration_response_data.py | 36 + .../types/plan_version_migration_status.py | 5 + .../types/plan_version_migration_strategy.py | 5 + .../types/plan_version_response_data.py | 32 + .../types/plan_version_snapshot_view.py | 21 + src/schematic/types/plan_version_status.py | 5 + .../types/plan_view_public_response_data.py | 58 + ...eview_subscription_change_response_data.py | 2 + .../types/public_plans_response_data.py | 31 + .../types/raw_event_response_data.py | 2 +- src/schematic/types/rule_view.py | 34 + .../types/rules_engine_schema_version.py | 2 +- .../types/rulesengine_check_flag_result.py | 2 + src/schematic/types/rulesengine_company.py | 4 +- .../rulesengine_condition_condition_type.py | 2 +- .../rulesengine_entitlement_value_type.py | 7 + .../types/rulesengine_feature_entitlement.py | 91 + ...ngine_feature_entitlement_metric_period.py | 7 + ...sengine_feature_entitlement_month_reset.py | 5 + .../types/scheduled_checkout_response_data.py | 34 + .../types/scheduled_checkout_status.py | 7 + .../scheduled_downgrade_config_behavior.py | 5 + .../scheduled_downgrade_response_data.py | 30 + .../types/time_series_granularity.py | 5 + ..._billing_plan_credit_grant_request_body.py | 39 + .../types/update_plan_request_body.py | 21 + .../upsert_billing_product_request_body.py | 30 + .../types/upsert_company_request_body.py | 1 + .../usage_time_series_point_response_data.py | 23 + .../types/web_feature_usage_webhook_output.py | 33 + src/schematic/types/webhook_request_type.py | 3 + src/schematic/types/who_am_i_response_data.py | 29 + 218 files changed, 14128 insertions(+), 2751 deletions(-) delete mode 100644 changelog.md create mode 100644 src/schematic/accounts/types/count_audit_logs_params.py rename src/schematic/accounts/types/{count_api_requests_response.py => count_audit_logs_response.py} (77%) rename src/schematic/accounts/types/{get_api_request_response.py => get_audit_log_response.py} (77%) rename src/schematic/accounts/types/{list_api_requests_response.py => get_who_am_i_response.py} (62%) rename src/schematic/accounts/types/{count_api_requests_params.py => list_audit_logs_params.py} (75%) create mode 100644 src/schematic/accounts/types/list_audit_logs_response.py delete mode 100644 src/schematic/companies/types/count_companies_for_advanced_filter_params.py delete mode 100644 src/schematic/companies/types/list_companies_for_advanced_filter_params.py delete mode 100644 src/schematic/companies/types/list_companies_for_advanced_filter_response.py create mode 100644 src/schematic/componentspublic/__init__.py create mode 100644 src/schematic/componentspublic/client.py create mode 100644 src/schematic/componentspublic/raw_client.py create mode 100644 src/schematic/componentspublic/types/__init__.py create mode 100644 src/schematic/componentspublic/types/get_public_plans_response.py create mode 100644 src/schematic/credits/types/count_company_grants_params.py rename src/schematic/{companies/types/count_companies_for_advanced_filter_response.py => credits/types/count_company_grants_response.py} (71%) create mode 100644 src/schematic/credits/types/count_credit_event_ledger_params.py create mode 100644 src/schematic/credits/types/count_credit_event_ledger_response.py create mode 100644 src/schematic/credits/types/list_credit_event_ledger_params.py create mode 100644 src/schematic/credits/types/list_credit_event_ledger_response.py create mode 100644 src/schematic/entitlements/types/get_feature_usage_time_series_params.py create mode 100644 src/schematic/entitlements/types/get_feature_usage_time_series_response.py create mode 100644 src/schematic/planbundle/__init__.py create mode 100644 src/schematic/planbundle/client.py create mode 100644 src/schematic/planbundle/raw_client.py create mode 100644 src/schematic/planbundle/types/__init__.py create mode 100644 src/schematic/planbundle/types/create_plan_bundle_response.py create mode 100644 src/schematic/planbundle/types/update_plan_bundle_response.py create mode 100644 src/schematic/plangroups/types/get_plan_group_params.py create mode 100644 src/schematic/planmigrations/__init__.py create mode 100644 src/schematic/planmigrations/client.py create mode 100644 src/schematic/planmigrations/raw_client.py create mode 100644 src/schematic/planmigrations/types/__init__.py create mode 100644 src/schematic/planmigrations/types/count_company_migrations_params.py create mode 100644 src/schematic/planmigrations/types/count_company_migrations_response.py create mode 100644 src/schematic/planmigrations/types/count_migrations_params.py create mode 100644 src/schematic/planmigrations/types/count_migrations_response.py create mode 100644 src/schematic/planmigrations/types/get_migration_response.py create mode 100644 src/schematic/planmigrations/types/list_company_migrations_params.py create mode 100644 src/schematic/planmigrations/types/list_company_migrations_response.py create mode 100644 src/schematic/planmigrations/types/list_migrations_params.py create mode 100644 src/schematic/planmigrations/types/list_migrations_response.py create mode 100644 src/schematic/plans/types/delete_plan_version_response.py create mode 100644 src/schematic/plans/types/get_plan_params.py create mode 100644 src/schematic/plans/types/publish_plan_version_response.py create mode 100644 src/schematic/scheduledcheckout/__init__.py create mode 100644 src/schematic/scheduledcheckout/client.py create mode 100644 src/schematic/scheduledcheckout/raw_client.py create mode 100644 src/schematic/scheduledcheckout/types/__init__.py create mode 100644 src/schematic/scheduledcheckout/types/create_scheduled_checkout_response.py create mode 100644 src/schematic/scheduledcheckout/types/get_scheduled_checkout_response.py rename src/schematic/{accounts/types/list_api_requests_params.py => scheduledcheckout/types/list_scheduled_checkouts_params.py} (75%) create mode 100644 src/schematic/scheduledcheckout/types/list_scheduled_checkouts_response.py create mode 100644 src/schematic/scheduledcheckout/types/update_scheduled_checkout_response.py create mode 100644 src/schematic/types/actor_type.py rename src/schematic/types/{api_key_request_list_response_data.py => audit_log_list_response_data.py} (85%) rename src/schematic/types/{api_key_request_response_data.py => audit_log_response_data.py} (80%) create mode 100644 src/schematic/types/billing_credit_view.py create mode 100644 src/schematic/types/capture_raw_event.py create mode 100644 src/schematic/types/capture_raw_event_batch.py delete mode 100644 src/schematic/types/company_view_with_feature_usage_response_data.py create mode 100644 src/schematic/types/condition_group_response_data.py create mode 100644 src/schematic/types/condition_group_view.py create mode 100644 src/schematic/types/condition_response_data.py create mode 100644 src/schematic/types/condition_view.py create mode 100644 src/schematic/types/create_billing_plan_credit_grant_request_body.py create mode 100644 src/schematic/types/create_entitlement_in_bundle_request_body.py create mode 100644 src/schematic/types/create_entitlement_in_bundle_request_body_metric_period.py create mode 100644 src/schematic/types/create_entitlement_in_bundle_request_body_metric_period_month_reset.py create mode 100644 src/schematic/types/create_plan_request_body.py create mode 100644 src/schematic/types/credit_event_ledger_response_data.py create mode 100644 src/schematic/types/credit_event_type.py delete mode 100644 src/schematic/types/credit_usage_response_data.py create mode 100644 src/schematic/types/credits_auto_topup_company_summary.py create mode 100644 src/schematic/types/credits_auto_topup_credit_summary.py create mode 100644 src/schematic/types/credits_auto_topup_hard_failure.py create mode 100644 src/schematic/types/credits_auto_topup_retry_failure.py create mode 100644 src/schematic/types/data_event_payload.py create mode 100644 src/schematic/types/datastream_company_plan.py create mode 100644 src/schematic/types/delete_billing_plan_credit_grant_request_body.py create mode 100644 src/schematic/types/feature_entitlement.py create mode 100644 src/schematic/types/feature_entitlement_metric_period.py create mode 100644 src/schematic/types/feature_entitlement_month_reset.py delete mode 100644 src/schematic/types/feature_usage_data_response_data.py create mode 100644 src/schematic/types/feature_usage_legacy_response_data.py create mode 100644 src/schematic/types/feature_usage_time_series_response_data.py create mode 100644 src/schematic/types/feature_view.py create mode 100644 src/schematic/types/flag_view.py create mode 100644 src/schematic/types/invoice_status.py create mode 100644 src/schematic/types/limit_time_series_point_response_data.py create mode 100644 src/schematic/types/plan_bundle_action.py create mode 100644 src/schematic/types/plan_bundle_credit_grant_request_body.py create mode 100644 src/schematic/types/plan_bundle_entitlement_request_body.py create mode 100644 src/schematic/types/plan_bundle_response_data.py delete mode 100644 src/schematic/types/plan_change_actor_type.py create mode 100644 src/schematic/types/plan_version_company_migration_response_data.py create mode 100644 src/schematic/types/plan_version_company_migration_status.py create mode 100644 src/schematic/types/plan_version_migration_response_data.py create mode 100644 src/schematic/types/plan_version_migration_status.py create mode 100644 src/schematic/types/plan_version_migration_strategy.py create mode 100644 src/schematic/types/plan_version_response_data.py create mode 100644 src/schematic/types/plan_version_snapshot_view.py create mode 100644 src/schematic/types/plan_version_status.py create mode 100644 src/schematic/types/plan_view_public_response_data.py create mode 100644 src/schematic/types/public_plans_response_data.py create mode 100644 src/schematic/types/rule_view.py create mode 100644 src/schematic/types/rulesengine_entitlement_value_type.py create mode 100644 src/schematic/types/rulesengine_feature_entitlement.py create mode 100644 src/schematic/types/rulesengine_feature_entitlement_metric_period.py create mode 100644 src/schematic/types/rulesengine_feature_entitlement_month_reset.py create mode 100644 src/schematic/types/scheduled_checkout_response_data.py create mode 100644 src/schematic/types/scheduled_checkout_status.py create mode 100644 src/schematic/types/scheduled_downgrade_config_behavior.py create mode 100644 src/schematic/types/scheduled_downgrade_response_data.py create mode 100644 src/schematic/types/time_series_granularity.py create mode 100644 src/schematic/types/update_billing_plan_credit_grant_request_body.py create mode 100644 src/schematic/types/update_plan_request_body.py create mode 100644 src/schematic/types/upsert_billing_product_request_body.py create mode 100644 src/schematic/types/usage_time_series_point_response_data.py create mode 100644 src/schematic/types/web_feature_usage_webhook_output.py create mode 100644 src/schematic/types/who_am_i_response_data.py diff --git a/.fern/metadata.json b/.fern/metadata.json index e525397..ecdb191 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "3.24.4", + "cliVersion": "3.47.0", "generatorName": "fernapi/fern-python-sdk", "generatorVersion": "4.46.3", "generatorConfig": { diff --git a/changelog.md b/changelog.md deleted file mode 100644 index 2394d2e..0000000 --- a/changelog.md +++ /dev/null @@ -1,8 +0,0 @@ -## 1.1.6 - 2025-12-22 -* SDK regeneration -* Unable to analyze changes with AI, incrementing PATCH version. - -## 1.1.5 - 2025-12-19 -* SDK regeneration -* Unable to analyze changes with AI, incrementing PATCH version. - diff --git a/poetry.lock b/poetry.lock index 9decbf8..83fdc8b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2025.11.12" +version = "2026.2.25" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ - {file = "certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b"}, - {file = "certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316"}, + {file = "certifi-2026.2.25-py3-none-any.whl", hash = "sha256:027692e4402ad994f1c42e52a4997a9763c646b73e4096e4d5d6db8af1d6f0fa"}, + {file = "certifi-2026.2.25.tar.gz", hash = "sha256:e887ab5cee78ea814d3472169153c2d12cd43b14bd03329a39a9c6e2e80bfba7"}, ] [[package]] @@ -236,13 +236,13 @@ files = [ [[package]] name = "packaging" -version = "25.0" +version = "26.0" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, - {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, + {file = "packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529"}, + {file = "packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4"}, ] [[package]] @@ -517,53 +517,58 @@ files = [ [[package]] name = "tomli" -version = "2.3.0" +version = "2.4.0" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"}, - {file = "tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba"}, - {file = "tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf"}, - {file = "tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441"}, - {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845"}, - {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c"}, - {file = "tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456"}, - {file = "tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be"}, - {file = "tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac"}, - {file = "tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22"}, - {file = "tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f"}, - {file = "tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52"}, - {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8"}, - {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6"}, - {file = "tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876"}, - {file = "tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878"}, - {file = "tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b"}, - {file = "tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae"}, - {file = "tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b"}, - {file = "tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf"}, - {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f"}, - {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05"}, - {file = "tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606"}, - {file = "tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999"}, - {file = "tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e"}, - {file = "tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3"}, - {file = "tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc"}, - {file = "tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0"}, - {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879"}, - {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005"}, - {file = "tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463"}, - {file = "tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8"}, - {file = "tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77"}, - {file = "tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf"}, - {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530"}, - {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b"}, - {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67"}, - {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f"}, - {file = "tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0"}, - {file = "tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba"}, - {file = "tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b"}, - {file = "tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549"}, + {file = "tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867"}, + {file = "tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9"}, + {file = "tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95"}, + {file = "tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76"}, + {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d"}, + {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576"}, + {file = "tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a"}, + {file = "tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa"}, + {file = "tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614"}, + {file = "tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1"}, + {file = "tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8"}, + {file = "tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a"}, + {file = "tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1"}, + {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b"}, + {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51"}, + {file = "tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729"}, + {file = "tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da"}, + {file = "tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3"}, + {file = "tomli-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0"}, + {file = "tomli-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e"}, + {file = "tomli-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4"}, + {file = "tomli-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e"}, + {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c"}, + {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f"}, + {file = "tomli-2.4.0-cp313-cp313-win32.whl", hash = "sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86"}, + {file = "tomli-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87"}, + {file = "tomli-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132"}, + {file = "tomli-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6"}, + {file = "tomli-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc"}, + {file = "tomli-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66"}, + {file = "tomli-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d"}, + {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702"}, + {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8"}, + {file = "tomli-2.4.0-cp314-cp314-win32.whl", hash = "sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776"}, + {file = "tomli-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475"}, + {file = "tomli-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2"}, + {file = "tomli-2.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9"}, + {file = "tomli-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0"}, + {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df"}, + {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d"}, + {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f"}, + {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b"}, + {file = "tomli-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087"}, + {file = "tomli-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd"}, + {file = "tomli-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4"}, + {file = "tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a"}, + {file = "tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c"}, ] [[package]] diff --git a/reference.md b/reference.md index ee03923..fc5f81a 100644 --- a/reference.md +++ b/reference.md @@ -1,5 +1,5 @@ # Reference -
client.put_plan_audiences_plan_audience_id(...) -> AsyncHttpResponse[None] +
client.put_plan_audiences_plan_audience_id(...) -> AsyncHttpResponse[None]
@@ -55,7 +55,7 @@ client.put_plan_audiences_plan_audience_id(
-
client.delete_plan_audiences_plan_audience_id(...) -> AsyncHttpResponse[None] +
client.delete_plan_audiences_plan_audience_id(...) -> AsyncHttpResponse[None]
@@ -112,7 +112,7 @@ client.delete_plan_audiences_plan_audience_id(
## accounts -
client.accounts.list_api_keys(...) -> AsyncHttpResponse[ListApiKeysResponse] +
client.accounts.list_api_keys(...) -> AsyncHttpResponse[ListApiKeysResponse]
@@ -195,7 +195,7 @@ client.accounts.list_api_keys(
-
client.accounts.create_api_key(...) -> AsyncHttpResponse[CreateApiKeyResponse] +
client.accounts.create_api_key(...) -> AsyncHttpResponse[CreateApiKeyResponse]
@@ -255,6 +255,14 @@ client.accounts.create_api_key(
+**readonly:** `typing.Optional[bool]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -267,7 +275,7 @@ client.accounts.create_api_key(
-
client.accounts.get_api_key(...) -> AsyncHttpResponse[GetApiKeyResponse] +
client.accounts.get_api_key(...) -> AsyncHttpResponse[GetApiKeyResponse]
@@ -323,7 +331,7 @@ client.accounts.get_api_key(
-
client.accounts.update_api_key(...) -> AsyncHttpResponse[UpdateApiKeyResponse] +
client.accounts.update_api_key(...) -> AsyncHttpResponse[UpdateApiKeyResponse]
@@ -395,7 +403,7 @@ client.accounts.update_api_key(
-
client.accounts.delete_api_key(...) -> AsyncHttpResponse[DeleteApiKeyResponse] +
client.accounts.delete_api_key(...) -> AsyncHttpResponse[DeleteApiKeyResponse]
@@ -451,7 +459,7 @@ client.accounts.delete_api_key(
-
client.accounts.count_api_keys(...) -> AsyncHttpResponse[CountApiKeysResponse] +
client.accounts.count_api_keys(...) -> AsyncHttpResponse[CountApiKeysResponse]
@@ -534,7 +542,7 @@ client.accounts.count_api_keys(
-
client.accounts.list_api_requests(...) -> AsyncHttpResponse[ListApiRequestsResponse] +
client.accounts.list_audit_logs(...) -> AsyncHttpResponse[ListAuditLogsResponse]
@@ -547,15 +555,23 @@ client.accounts.count_api_keys(
```python +import datetime + from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.accounts.list_api_requests( - q="q", - request_type="request_type", +client.accounts.list_audit_logs( + actor_type="api_key", + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), environment_id="environment_id", + q="q", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), limit=1, offset=1, ) @@ -574,7 +590,7 @@ client.accounts.list_api_requests(
-**q:** `typing.Optional[str]` +**actor_type:** `typing.Optional[ActorType]`
@@ -582,7 +598,7 @@ client.accounts.list_api_requests(
-**request_type:** `typing.Optional[str]` +**end_time:** `typing.Optional[dt.datetime]`
@@ -598,6 +614,22 @@ client.accounts.list_api_requests(
+**q:** `typing.Optional[str]` + +
+
+ +
+
+ +**start_time:** `typing.Optional[dt.datetime]` + +
+
+ +
+
+ **limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -626,7 +658,7 @@ client.accounts.list_api_requests(
-
client.accounts.get_api_request(...) -> AsyncHttpResponse[GetApiRequestResponse] +
client.accounts.get_audit_log(...) -> AsyncHttpResponse[GetAuditLogResponse]
@@ -644,8 +676,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.accounts.get_api_request( - api_request_id="api_request_id", +client.accounts.get_audit_log( + audit_log_id="audit_log_id", ) ``` @@ -662,7 +694,7 @@ client.accounts.get_api_request(
-**api_request_id:** `str` — api_request_id +**audit_log_id:** `str` — audit_log_id
@@ -682,7 +714,7 @@ client.accounts.get_api_request(
-
client.accounts.count_api_requests(...) -> AsyncHttpResponse[CountApiRequestsResponse] +
client.accounts.count_audit_logs(...) -> AsyncHttpResponse[CountAuditLogsResponse]
@@ -695,15 +727,23 @@ client.accounts.get_api_request(
```python +import datetime + from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.accounts.count_api_requests( - q="q", - request_type="request_type", +client.accounts.count_audit_logs( + actor_type="api_key", + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), environment_id="environment_id", + q="q", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), limit=1, offset=1, ) @@ -722,7 +762,7 @@ client.accounts.count_api_requests(
-**q:** `typing.Optional[str]` +**actor_type:** `typing.Optional[ActorType]`
@@ -730,7 +770,7 @@ client.accounts.count_api_requests(
-**request_type:** `typing.Optional[str]` +**end_time:** `typing.Optional[dt.datetime]`
@@ -746,6 +786,22 @@ client.accounts.count_api_requests(
+**q:** `typing.Optional[str]` + +
+
+ +
+
+ +**start_time:** `typing.Optional[dt.datetime]` + +
+
+ +
+
+ **limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -774,7 +830,7 @@ client.accounts.count_api_requests(
-
client.accounts.list_environments(...) -> AsyncHttpResponse[ListEnvironmentsResponse] +
client.accounts.list_environments(...) -> AsyncHttpResponse[ListEnvironmentsResponse]
@@ -847,7 +903,7 @@ client.accounts.list_environments(
-
client.accounts.create_environment(...) -> AsyncHttpResponse[CreateEnvironmentResponse] +
client.accounts.create_environment(...) -> AsyncHttpResponse[CreateEnvironmentResponse]
@@ -912,7 +968,7 @@ client.accounts.create_environment(
-
client.accounts.get_environment(...) -> AsyncHttpResponse[GetEnvironmentResponse] +
client.accounts.get_environment(...) -> AsyncHttpResponse[GetEnvironmentResponse]
@@ -968,7 +1024,7 @@ client.accounts.get_environment(
-
client.accounts.update_environment(...) -> AsyncHttpResponse[UpdateEnvironmentResponse] +
client.accounts.update_environment(...) -> AsyncHttpResponse[UpdateEnvironmentResponse]
@@ -1040,7 +1096,7 @@ client.accounts.update_environment(
-
client.accounts.delete_environment(...) -> AsyncHttpResponse[DeleteEnvironmentResponse] +
client.accounts.delete_environment(...) -> AsyncHttpResponse[DeleteEnvironmentResponse]
@@ -1096,7 +1152,7 @@ client.accounts.delete_environment(
-
client.accounts.quickstart() -> AsyncHttpResponse[QuickstartResponse] +
client.accounts.quickstart() -> AsyncHttpResponse[QuickstartResponse]
@@ -1138,12 +1194,58 @@ client.accounts.quickstart()
+ + +
+ +
client.accounts.get_who_am_i() -> AsyncHttpResponse[GetWhoAmIResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.accounts.get_who_am_i() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
## billing -
client.billing.list_coupons(...) -> AsyncHttpResponse[ListCouponsResponse] +
client.billing.list_coupons(...) -> AsyncHttpResponse[ListCouponsResponse]
@@ -1226,7 +1328,7 @@ client.billing.list_coupons(
-
client.billing.upsert_billing_coupon(...) -> AsyncHttpResponse[UpsertBillingCouponResponse] +
client.billing.upsert_billing_coupon(...) -> AsyncHttpResponse[UpsertBillingCouponResponse]
@@ -1353,7 +1455,7 @@ client.billing.upsert_billing_coupon(
-
client.billing.upsert_billing_customer(...) -> AsyncHttpResponse[UpsertBillingCustomerResponse] +
client.billing.upsert_billing_customer(...) -> AsyncHttpResponse[UpsertBillingCustomerResponse]
@@ -1374,7 +1476,6 @@ client = Schematic( client.billing.upsert_billing_customer( email="email", external_id="external_id", - failed_to_import=True, meta={"key": "value"}, name="name", ) @@ -1409,14 +1510,6 @@ client.billing.upsert_billing_customer(
-**failed_to_import:** `bool` - -
-
- -
-
- **meta:** `typing.Dict[str, str]`
@@ -1469,7 +1562,7 @@ client.billing.upsert_billing_customer(
-
client.billing.list_customers_with_subscriptions(...) -> AsyncHttpResponse[ListCustomersWithSubscriptionsResponse] +
client.billing.list_customers_with_subscriptions(...) -> AsyncHttpResponse[ListCustomersWithSubscriptionsResponse]
@@ -1488,7 +1581,6 @@ client = Schematic( api_key="YOUR_API_KEY", ) client.billing.list_customers_with_subscriptions( - failed_to_import=True, name="name", provider_type="schematic", q="q", @@ -1518,14 +1610,6 @@ client.billing.list_customers_with_subscriptions(
-**failed_to_import:** `typing.Optional[bool]` - -
-
- -
-
- **name:** `typing.Optional[str]`
@@ -1578,7 +1662,7 @@ client.billing.list_customers_with_subscriptions(
-
client.billing.count_customers(...) -> AsyncHttpResponse[CountCustomersResponse] +
client.billing.count_customers(...) -> AsyncHttpResponse[CountCustomersResponse]
@@ -1597,7 +1681,6 @@ client = Schematic( api_key="YOUR_API_KEY", ) client.billing.count_customers( - failed_to_import=True, name="name", provider_type="schematic", q="q", @@ -1627,14 +1710,6 @@ client.billing.count_customers(
-**failed_to_import:** `typing.Optional[bool]` - -
-
- -
-
- **name:** `typing.Optional[str]`
@@ -1687,7 +1762,7 @@ client.billing.count_customers(
-
client.billing.list_invoices(...) -> AsyncHttpResponse[ListInvoicesResponse] +
client.billing.list_invoices(...) -> AsyncHttpResponse[ListInvoicesResponse]
@@ -1779,7 +1854,7 @@ client.billing.list_invoices(
-
client.billing.upsert_invoice(...) -> AsyncHttpResponse[UpsertInvoiceResponse] +
client.billing.upsert_invoice(...) -> AsyncHttpResponse[UpsertInvoiceResponse]
@@ -1901,6 +1976,14 @@ client.billing.upsert_invoice(
+**status:** `typing.Optional[InvoiceStatus]` + +
+
+ +
+
+ **subscription_external_id:** `typing.Optional[str]`
@@ -1929,7 +2012,7 @@ client.billing.upsert_invoice(
-
client.billing.list_meters(...) -> AsyncHttpResponse[ListMetersResponse] +
client.billing.list_meters(...) -> AsyncHttpResponse[ListMetersResponse]
@@ -2003,7 +2086,7 @@ client.billing.list_meters(
-
client.billing.upsert_billing_meter(...) -> AsyncHttpResponse[UpsertBillingMeterResponse] +
client.billing.upsert_billing_meter(...) -> AsyncHttpResponse[UpsertBillingMeterResponse]
@@ -2086,7 +2169,7 @@ client.billing.upsert_billing_meter(
-
client.billing.list_payment_methods(...) -> AsyncHttpResponse[ListPaymentMethodsResponse] +
client.billing.list_payment_methods(...) -> AsyncHttpResponse[ListPaymentMethodsResponse]
@@ -2169,7 +2252,7 @@ client.billing.list_payment_methods(
-
client.billing.upsert_payment_method(...) -> AsyncHttpResponse[UpsertPaymentMethodResponse] +
client.billing.upsert_payment_method(...) -> AsyncHttpResponse[UpsertPaymentMethodResponse]
@@ -2315,7 +2398,7 @@ client.billing.upsert_payment_method(
-
client.billing.list_billing_prices(...) -> AsyncHttpResponse[ListBillingPricesResponse] +
client.billing.list_billing_prices(...) -> AsyncHttpResponse[ListBillingPricesResponse]
@@ -2495,7 +2578,7 @@ client.billing.list_billing_prices(
-
client.billing.upsert_billing_price(...) -> AsyncHttpResponse[UpsertBillingPriceResponse] +
client.billing.upsert_billing_price(...) -> AsyncHttpResponse[UpsertBillingPriceResponse]
@@ -2676,7 +2759,7 @@ client.billing.upsert_billing_price(
-
client.billing.delete_billing_product(...) -> AsyncHttpResponse[DeleteBillingProductResponse] +
client.billing.delete_billing_product(...) -> AsyncHttpResponse[DeleteBillingProductResponse]
@@ -2732,7 +2815,7 @@ client.billing.delete_billing_product(
-
client.billing.list_billing_product_prices(...) -> AsyncHttpResponse[ListBillingProductPricesResponse] +
client.billing.list_billing_product_prices(...) -> AsyncHttpResponse[ListBillingProductPricesResponse]
@@ -2912,7 +2995,7 @@ client.billing.list_billing_product_prices(
-
client.billing.delete_product_price(...) -> AsyncHttpResponse[DeleteProductPriceResponse] +
client.billing.delete_product_price(...) -> AsyncHttpResponse[DeleteProductPriceResponse]
@@ -2968,7 +3051,7 @@ client.billing.delete_product_price(
-
client.billing.upsert_billing_product(...) -> AsyncHttpResponse[UpsertBillingProductResponse] +
client.billing.upsert_billing_product(...) -> AsyncHttpResponse[UpsertBillingProductResponse]
@@ -2988,7 +3071,6 @@ client = Schematic( ) client.billing.upsert_billing_product( external_id="external_id", - name="name", price=1.1, ) @@ -3014,7 +3096,7 @@ client.billing.upsert_billing_product(
-**name:** `str` +**price:** `float`
@@ -3022,7 +3104,7 @@ client.billing.upsert_billing_product(
-**price:** `float` +**is_active:** `typing.Optional[bool]`
@@ -3030,7 +3112,7 @@ client.billing.upsert_billing_product(
-**is_active:** `typing.Optional[bool]` +**name:** `typing.Optional[str]`
@@ -3058,7 +3140,7 @@ client.billing.upsert_billing_product(
-
client.billing.list_billing_products(...) -> AsyncHttpResponse[ListBillingProductsResponse] +
client.billing.list_billing_products(...) -> AsyncHttpResponse[ListBillingProductsResponse]
@@ -3212,7 +3294,7 @@ client.billing.list_billing_products(
-
client.billing.count_billing_products(...) -> AsyncHttpResponse[CountBillingProductsResponse] +
client.billing.count_billing_products(...) -> AsyncHttpResponse[CountBillingProductsResponse]
@@ -3366,7 +3448,7 @@ client.billing.count_billing_products(
-
client.billing.upsert_billing_subscription(...) -> AsyncHttpResponse[UpsertBillingSubscriptionResponse] +
client.billing.upsert_billing_subscription(...) -> AsyncHttpResponse[UpsertBillingSubscriptionResponse]
@@ -3601,7 +3683,7 @@ client.billing.upsert_billing_subscription(
## credits -
client.credits.list_billing_credits(...) -> AsyncHttpResponse[ListBillingCreditsResponse] +
client.credits.list_billing_credits(...) -> AsyncHttpResponse[ListBillingCreditsResponse]
@@ -3683,7 +3765,7 @@ client.credits.list_billing_credits(
-
client.credits.create_billing_credit(...) -> AsyncHttpResponse[CreateBillingCreditResponse] +
client.credits.create_billing_credit(...) -> AsyncHttpResponse[CreateBillingCreditResponse]
@@ -3829,7 +3911,7 @@ client.credits.create_billing_credit(
-
client.credits.get_single_billing_credit(...) -> AsyncHttpResponse[GetSingleBillingCreditResponse] +
client.credits.get_single_billing_credit(...) -> AsyncHttpResponse[GetSingleBillingCreditResponse]
@@ -3885,7 +3967,7 @@ client.credits.get_single_billing_credit(
-
client.credits.update_billing_credit(...) -> AsyncHttpResponse[UpdateBillingCreditResponse] +
client.credits.update_billing_credit(...) -> AsyncHttpResponse[UpdateBillingCreditResponse]
@@ -4031,7 +4113,7 @@ client.credits.update_billing_credit(
-
client.credits.soft_delete_billing_credit(...) -> AsyncHttpResponse[SoftDeleteBillingCreditResponse] +
client.credits.soft_delete_billing_credit(...) -> AsyncHttpResponse[SoftDeleteBillingCreditResponse]
@@ -4087,7 +4169,7 @@ client.credits.soft_delete_billing_credit(
-
client.credits.list_credit_bundles(...) -> AsyncHttpResponse[ListCreditBundlesResponse] +
client.credits.list_credit_bundles(...) -> AsyncHttpResponse[ListCreditBundlesResponse]
@@ -4186,7 +4268,7 @@ client.credits.list_credit_bundles(
-
client.credits.create_credit_bundle(...) -> AsyncHttpResponse[CreateCreditBundleResponse] +
client.credits.create_credit_bundle(...) -> AsyncHttpResponse[CreateCreditBundleResponse]
@@ -4325,7 +4407,7 @@ client.credits.create_credit_bundle(
-
client.credits.get_credit_bundle(...) -> AsyncHttpResponse[GetCreditBundleResponse] +
client.credits.get_credit_bundle(...) -> AsyncHttpResponse[GetCreditBundleResponse]
@@ -4381,7 +4463,7 @@ client.credits.get_credit_bundle(
-
client.credits.update_credit_bundle_details(...) -> AsyncHttpResponse[UpdateCreditBundleDetailsResponse] +
client.credits.update_credit_bundle_details(...) -> AsyncHttpResponse[UpdateCreditBundleDetailsResponse]
@@ -4503,7 +4585,7 @@ client.credits.update_credit_bundle_details(
-
client.credits.delete_credit_bundle(...) -> AsyncHttpResponse[DeleteCreditBundleResponse] +
client.credits.delete_credit_bundle(...) -> AsyncHttpResponse[DeleteCreditBundleResponse]
@@ -4559,7 +4641,7 @@ client.credits.delete_credit_bundle(
-
client.credits.count_credit_bundles(...) -> AsyncHttpResponse[CountCreditBundlesResponse] +
client.credits.count_credit_bundles(...) -> AsyncHttpResponse[CountCreditBundlesResponse]
@@ -4658,7 +4740,7 @@ client.credits.count_credit_bundles(
-
client.credits.count_billing_credits(...) -> AsyncHttpResponse[CountBillingCreditsResponse] +
client.credits.count_billing_credits(...) -> AsyncHttpResponse[CountBillingCreditsResponse]
@@ -4740,7 +4822,7 @@ client.credits.count_billing_credits(
-
client.credits.zero_out_grant(...) -> AsyncHttpResponse[ZeroOutGrantResponse] +
client.credits.zero_out_grant(...) -> AsyncHttpResponse[ZeroOutGrantResponse]
@@ -4804,7 +4886,7 @@ client.credits.zero_out_grant(
-
client.credits.grant_billing_credits_to_company(...) -> AsyncHttpResponse[GrantBillingCreditsToCompanyResponse] +
client.credits.grant_billing_credits_to_company(...) -> AsyncHttpResponse[GrantBillingCreditsToCompanyResponse]
@@ -4943,7 +5025,99 @@ client.credits.grant_billing_credits_to_company(
-
client.credits.list_company_grants(...) -> AsyncHttpResponse[ListCompanyGrantsResponse] +
client.credits.count_company_grants(...) -> AsyncHttpResponse[CountCompanyGrantsResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.credits.count_company_grants( + company_id="company_id", + order="created_at", + dir="asc", + limit=1, + offset=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**order:** `typing.Optional[CreditGrantSortOrder]` + +
+
+ +
+
+ +**dir:** `typing.Optional[SortDirection]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.credits.list_company_grants(...) -> AsyncHttpResponse[ListCompanyGrantsResponse]
@@ -5035,7 +5209,7 @@ client.credits.list_company_grants(
-
client.credits.count_billing_credits_grants(...) -> AsyncHttpResponse[CountBillingCreditsGrantsResponse] +
client.credits.count_billing_credits_grants(...) -> AsyncHttpResponse[CountBillingCreditsGrantsResponse]
@@ -5117,7 +5291,7 @@ client.credits.count_billing_credits_grants(
-
client.credits.list_grants_for_credit(...) -> AsyncHttpResponse[ListGrantsForCreditResponse] +
client.credits.list_grants_for_credit(...) -> AsyncHttpResponse[ListGrantsForCreditResponse]
@@ -5199,7 +5373,7 @@ client.credits.list_grants_for_credit(
-
client.credits.get_enriched_credit_ledger(...) -> AsyncHttpResponse[GetEnrichedCreditLedgerResponse] +
client.credits.get_enriched_credit_ledger(...) -> AsyncHttpResponse[GetEnrichedCreditLedgerResponse]
@@ -5318,7 +5492,7 @@ client.credits.get_enriched_credit_ledger(
-
client.credits.count_credit_ledger(...) -> AsyncHttpResponse[CountCreditLedgerResponse] +
client.credits.count_credit_ledger(...) -> AsyncHttpResponse[CountCreditLedgerResponse]
@@ -5437,7 +5611,7 @@ client.credits.count_credit_ledger(
-
client.credits.list_billing_plan_credit_grants(...) -> AsyncHttpResponse[ListBillingPlanCreditGrantsResponse] +
client.credits.list_billing_plan_credit_grants(...) -> AsyncHttpResponse[ListBillingPlanCreditGrantsResponse]
@@ -5458,6 +5632,7 @@ client = Schematic( client.credits.list_billing_plan_credit_grants( credit_id="credit_id", plan_id="plan_id", + plan_version_id="plan_version_id", limit=1, offset=1, ) @@ -5484,6 +5659,14 @@ client.credits.list_billing_plan_credit_grants(
+**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` + +
+
+ +
+
+ **plan_id:** `typing.Optional[str]`
@@ -5500,7 +5683,7 @@ client.credits.list_billing_plan_credit_grants(
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**plan_version_id:** `typing.Optional[str]`
@@ -5536,7 +5719,7 @@ client.credits.list_billing_plan_credit_grants(
-
client.credits.create_billing_plan_credit_grant(...) -> AsyncHttpResponse[CreateBillingPlanCreditGrantResponse] +
client.credits.create_billing_plan_credit_grant(...) -> AsyncHttpResponse[CreateBillingPlanCreditGrantResponse]
@@ -5704,6 +5887,14 @@ client.credits.create_billing_plan_credit_grant(
+**plan_version_id:** `typing.Optional[str]` + +
+
+ +
+
+ **reset_type:** `typing.Optional[BillingPlanCreditGrantResetType]`
@@ -5724,7 +5915,7 @@ client.credits.create_billing_plan_credit_grant(
-
client.credits.update_billing_plan_credit_grant(...) -> AsyncHttpResponse[UpdateBillingPlanCreditGrantResponse] +
client.credits.update_billing_plan_credit_grant(...) -> AsyncHttpResponse[UpdateBillingPlanCreditGrantResponse]
@@ -5902,7 +6093,7 @@ client.credits.update_billing_plan_credit_grant(
-
client.credits.delete_billing_plan_credit_grant(...) -> AsyncHttpResponse[DeleteBillingPlanCreditGrantResponse] +
client.credits.delete_billing_plan_credit_grant(...) -> AsyncHttpResponse[DeleteBillingPlanCreditGrantResponse]
@@ -5967,7 +6158,7 @@ client.credits.delete_billing_plan_credit_grant(
-
client.credits.count_billing_plan_credit_grants(...) -> AsyncHttpResponse[CountBillingPlanCreditGrantsResponse] +
client.credits.count_billing_plan_credit_grants(...) -> AsyncHttpResponse[CountBillingPlanCreditGrantsResponse]
@@ -5988,6 +6179,7 @@ client = Schematic( client.credits.count_billing_plan_credit_grants( credit_id="credit_id", plan_id="plan_id", + plan_version_id="plan_version_id", limit=1, offset=1, ) @@ -6014,6 +6206,14 @@ client.credits.count_billing_plan_credit_grants(
+**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` + +
+
+ +
+
+ **plan_id:** `typing.Optional[str]`
@@ -6030,7 +6230,7 @@ client.credits.count_billing_plan_credit_grants(
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**plan_version_id:** `typing.Optional[str]`
@@ -6066,8 +6266,7 @@ client.credits.count_billing_plan_credit_grants(
-## checkout -
client.checkout.internal(...) -> AsyncHttpResponse[CheckoutInternalResponse] +
client.credits.list_credit_event_ledger(...) -> AsyncHttpResponse[ListCreditEventLedgerResponse]
@@ -6080,12 +6279,251 @@ client.credits.count_billing_plan_credit_grants(
```python -from schematic import ( - Schematic, - UpdateAddOnRequestBody, - UpdateCreditBundleRequestBody, - UpdatePayInAdvanceRequestBody, -) +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.credits.list_credit_event_ledger( + billing_credit_id="billing_credit_id", + company_id="company_id", + end_time="end_time", + event_type="grant", + feature_id="feature_id", + start_time="start_time", + limit=1, + offset=1, +) + +``` +
+
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `str` + +
+
+ +
+
+ +**billing_credit_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**end_time:** `typing.Optional[str]` + +
+
+ +
+
+ +**event_type:** `typing.Optional[CreditEventType]` + +
+
+ +
+
+ +**feature_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**start_time:** `typing.Optional[str]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + +
+ +
client.credits.count_credit_event_ledger(...) -> AsyncHttpResponse[CountCreditEventLedgerResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.credits.count_credit_event_ledger( + billing_credit_id="billing_credit_id", + company_id="company_id", + end_time="end_time", + event_type="grant", + feature_id="feature_id", + start_time="start_time", + limit=1, + offset=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `str` + +
+
+ +
+
+ +**billing_credit_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**end_time:** `typing.Optional[str]` + +
+
+ +
+
+ +**event_type:** `typing.Optional[CreditEventType]` + +
+
+ +
+
+ +**feature_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**start_time:** `typing.Optional[str]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## checkout +
client.checkout.internal(...) -> AsyncHttpResponse[CheckoutInternalResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import ( + Schematic, + UpdateAddOnRequestBody, + UpdateCreditBundleRequestBody, + UpdatePayInAdvanceRequestBody, +) client = Schematic( api_key="YOUR_API_KEY", @@ -6221,7 +6659,7 @@ client.checkout.internal(
-
client.checkout.get_checkout_data(...) -> AsyncHttpResponse[GetCheckoutDataResponse] +
client.checkout.get_checkout_data(...) -> AsyncHttpResponse[GetCheckoutDataResponse]
@@ -6285,7 +6723,7 @@ client.checkout.get_checkout_data(
-
client.checkout.preview_checkout_internal(...) -> AsyncHttpResponse[PreviewCheckoutInternalResponse] +
client.checkout.preview_checkout_internal(...) -> AsyncHttpResponse[PreviewCheckoutInternalResponse]
@@ -6439,7 +6877,7 @@ client.checkout.preview_checkout_internal(
-
client.checkout.manage_plan(...) -> AsyncHttpResponse[ManagePlanResponse] +
client.checkout.manage_plan(...) -> AsyncHttpResponse[ManagePlanResponse]
@@ -6605,7 +7043,7 @@ client.checkout.manage_plan(
-
client.checkout.preview_manage_plan(...) -> AsyncHttpResponse[PreviewManagePlanResponse] +
client.checkout.preview_manage_plan(...) -> AsyncHttpResponse[PreviewManagePlanResponse]
@@ -6771,7 +7209,7 @@ client.checkout.preview_manage_plan(
-
client.checkout.cancel_subscription(...) -> AsyncHttpResponse[CancelSubscriptionResponse] +
client.checkout.cancel_subscription(...) -> AsyncHttpResponse[CancelSubscriptionResponse]
@@ -6843,7 +7281,7 @@ client.checkout.cancel_subscription(
-
client.checkout.update_customer_subscription_trial_end(...) -> AsyncHttpResponse[UpdateCustomerSubscriptionTrialEndResponse] +
client.checkout.update_customer_subscription_trial_end(...) -> AsyncHttpResponse[UpdateCustomerSubscriptionTrialEndResponse]
@@ -6908,7 +7346,7 @@ client.checkout.update_customer_subscription_trial_end(
## companies -
client.companies.list_companies(...) -> AsyncHttpResponse[ListCompaniesResponse] +
client.companies.list_companies(...) -> AsyncHttpResponse[ListCompaniesResponse]
@@ -6927,10 +7365,16 @@ client = Schematic( api_key="YOUR_API_KEY", ) client.companies.list_companies( + monetized_subscriptions=True, plan_id="plan_id", + plan_version_id="plan_version_id", q="q", + sort_order_column="sort_order_column", + sort_order_direction="asc", + with_entitlement_for="with_entitlement_for", without_feature_override_for="without_feature_override_for", without_plan=True, + without_subscription=True, with_subscription=True, limit=1, offset=1, @@ -6950,7 +7394,7 @@ client.companies.list_companies(
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_) +**credit_type_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more credit type IDs (each ID starts with bcrd_)
@@ -6958,7 +7402,7 @@ client.companies.list_companies(
-**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan_) +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_)
@@ -6966,7 +7410,7 @@ client.companies.list_companies(
-**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits +**monetized_subscriptions:** `typing.Optional[bool]` — Filter companies that have monetized subscriptions
@@ -6974,7 +7418,7 @@ client.companies.list_companies(
-**without_feature_override_for:** `typing.Optional[str]` — Filter out companies that already have a company override for the specified feature ID +**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan_)
@@ -6982,7 +7426,7 @@ client.companies.list_companies(
-**without_plan:** `typing.Optional[bool]` — Filter out companies that have a plan +**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more plan IDs (each ID starts with plan_)
@@ -6990,7 +7434,7 @@ client.companies.list_companies(
-**with_subscription:** `typing.Optional[bool]` — Filter companies that have a subscription +**plan_version_id:** `typing.Optional[str]` — Filter companies by plan version ID (starts with plvr_)
@@ -6998,7 +7442,7 @@ client.companies.list_companies(
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits
@@ -7006,7 +7450,91 @@ client.companies.list_companies(
-**offset:** `typing.Optional[int]` — Page offset (default 0) +**sort_order_column:** `typing.Optional[str]` — Column to sort by (e.g. name, created_at, last_seen_at) + +
+
+ +
+
+ +**sort_order_direction:** `typing.Optional[SortDirection]` — Direction to sort by (asc or desc) + +
+
+ +
+
+ +**subscription_statuses:** `typing.Optional[ + typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] +]` — Filter companies by one or more subscription statuses + +
+
+ +
+
+ +**subscription_types:** `typing.Optional[ + typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]] +]` — Filter companies by one or more subscription types + +
+
+ +
+
+ +**with_entitlement_for:** `typing.Optional[str]` — Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID + +
+
+ +
+
+ +**without_feature_override_for:** `typing.Optional[str]` — Filter out companies that already have a company override for the specified feature ID + +
+
+ +
+
+ +**without_plan:** `typing.Optional[bool]` — Filter out companies that have a plan + +
+
+ +
+
+ +**without_subscription:** `typing.Optional[bool]` — Filter out companies that have a subscription + +
+
+ +
+
+ +**with_subscription:** `typing.Optional[bool]` — Filter companies that have a subscription + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -7026,7 +7554,7 @@ client.companies.list_companies(
-
client.companies.upsert_company(...) -> AsyncHttpResponse[UpsertCompanyResponse] +
client.companies.upsert_company(...) -> AsyncHttpResponse[UpsertCompanyResponse]
@@ -7094,6 +7622,14 @@ client.companies.upsert_company(
+**prevent_key_remap:** `typing.Optional[bool]` + +
+
+ +
+
+ **traits:** `typing.Optional[typing.Dict[str, typing.Any]]` — A map of trait names to trait values
@@ -7122,7 +7658,7 @@ client.companies.upsert_company(
-
client.companies.get_company(...) -> AsyncHttpResponse[GetCompanyResponse] +
client.companies.get_company(...) -> AsyncHttpResponse[GetCompanyResponse]
@@ -7178,7 +7714,7 @@ client.companies.get_company(
-
client.companies.delete_company(...) -> AsyncHttpResponse[DeleteCompanyResponse] +
client.companies.delete_company(...) -> AsyncHttpResponse[DeleteCompanyResponse]
@@ -7252,7 +7788,7 @@ client.companies.delete_company(
-
client.companies.count_companies(...) -> AsyncHttpResponse[CountCompaniesResponse] +
client.companies.count_companies(...) -> AsyncHttpResponse[CountCompaniesResponse]
@@ -7271,10 +7807,16 @@ client = Schematic( api_key="YOUR_API_KEY", ) client.companies.count_companies( + monetized_subscriptions=True, plan_id="plan_id", + plan_version_id="plan_version_id", q="q", + sort_order_column="sort_order_column", + sort_order_direction="asc", + with_entitlement_for="with_entitlement_for", without_feature_override_for="without_feature_override_for", without_plan=True, + without_subscription=True, with_subscription=True, limit=1, offset=1, @@ -7294,39 +7836,7 @@ client.companies.count_companies(
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_) - -
-
- -
-
- -**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan_) - -
-
- -
-
- -**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits - -
-
- -
-
- -**without_feature_override_for:** `typing.Optional[str]` — Filter out companies that already have a company override for the specified feature ID - -
-
- -
-
- -**without_plan:** `typing.Optional[bool]` — Filter out companies that have a plan +**credit_type_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more credit type IDs (each ID starts with bcrd_)
@@ -7334,7 +7844,7 @@ client.companies.count_companies(
-**with_subscription:** `typing.Optional[bool]` — Filter companies that have a subscription +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_)
@@ -7342,7 +7852,7 @@ client.companies.count_companies(
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**monetized_subscriptions:** `typing.Optional[bool]` — Filter companies that have monetized subscriptions
@@ -7350,7 +7860,7 @@ client.companies.count_companies(
-**offset:** `typing.Optional[int]` — Page offset (default 0) +**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan_)
@@ -7358,62 +7868,15 @@ client.companies.count_companies(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more plan IDs (each ID starts with plan_)
-
-
- - - - -
- -
client.companies.count_companies_for_advanced_filter(...) -> AsyncHttpResponse[CountCompaniesForAdvancedFilterResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from schematic import Schematic - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.companies.count_companies_for_advanced_filter( - monetized_subscriptions=True, - q="q", - without_plan=True, - without_subscription=True, - sort_order_column="sort_order_column", - sort_order_direction="asc", - limit=1, - offset=1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters
-
-
- -**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_) +**plan_version_id:** `typing.Optional[str]` — Filter companies by plan version ID (starts with plvr_)
@@ -7421,7 +7884,7 @@ client.companies.count_companies_for_advanced_filter(
-**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more plan IDs (each ID starts with plan_) +**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits
@@ -7429,7 +7892,7 @@ client.companies.count_companies_for_advanced_filter(
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more feature IDs (each ID starts with feat_) +**sort_order_column:** `typing.Optional[str]` — Column to sort by (e.g. name, created_at, last_seen_at)
@@ -7437,7 +7900,7 @@ client.companies.count_companies_for_advanced_filter(
-**credit_type_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more credit type IDs (each ID starts with bcrd_) +**sort_order_direction:** `typing.Optional[SortDirection]` — Direction to sort by (asc or desc)
@@ -7447,7 +7910,7 @@ client.companies.count_companies_for_advanced_filter( **subscription_statuses:** `typing.Optional[ typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] -]` — Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) +]` — Filter companies by one or more subscription statuses
@@ -7457,7 +7920,7 @@ client.companies.count_companies_for_advanced_filter( **subscription_types:** `typing.Optional[ typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]] -]` — Filter companies by one or more subscription types (paid, free, trial) +]` — Filter companies by one or more subscription types
@@ -7465,7 +7928,7 @@ client.companies.count_companies_for_advanced_filter(
-**monetized_subscriptions:** `typing.Optional[bool]` — Filter companies that have monetized subscriptions +**with_entitlement_for:** `typing.Optional[str]` — Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID
@@ -7473,7 +7936,7 @@ client.companies.count_companies_for_advanced_filter(
-**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits +**without_feature_override_for:** `typing.Optional[str]` — Filter out companies that already have a company override for the specified feature ID
@@ -7497,23 +7960,7 @@ client.companies.count_companies_for_advanced_filter(
-**sort_order_column:** `typing.Optional[str]` — Column to sort by (e.g. name, created_at, last_seen_at) - -
-
- -
-
- -**sort_order_direction:** `typing.Optional[SortDirection]` — Direction to sort by (asc or desc) - -
-
- -
-
- -**display_properties:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Select the display columns to return (e.g. plan, subscription, users, last_seen_at) +**with_subscription:** `typing.Optional[bool]` — Filter companies that have a subscription
@@ -7549,7 +7996,7 @@ client.companies.count_companies_for_advanced_filter(
-
client.companies.create_company(...) -> AsyncHttpResponse[CreateCompanyResponse] +
client.companies.create_company(...) -> AsyncHttpResponse[CreateCompanyResponse]
@@ -7617,6 +8064,14 @@ client.companies.create_company(
+**prevent_key_remap:** `typing.Optional[bool]` + +
+
+ +
+
+ **traits:** `typing.Optional[typing.Dict[str, typing.Any]]` — A map of trait names to trait values
@@ -7645,7 +8100,7 @@ client.companies.create_company(
-
client.companies.delete_company_by_keys(...) -> AsyncHttpResponse[DeleteCompanyByKeysResponse] +
client.companies.delete_company_by_keys(...) -> AsyncHttpResponse[DeleteCompanyByKeysResponse]
@@ -7701,7 +8156,7 @@ client.companies.delete_company_by_keys(
-
client.companies.list_companies_for_advanced_filter(...) -> AsyncHttpResponse[ListCompaniesForAdvancedFilterResponse] +
client.companies.lookup_company(...) -> AsyncHttpResponse[LookupCompanyResponse]
@@ -7719,15 +8174,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.list_companies_for_advanced_filter( - monetized_subscriptions=True, - q="q", - without_plan=True, - without_subscription=True, - sort_order_column="sort_order_column", - sort_order_direction="asc", - limit=1, - offset=1, +client.companies.lookup_company( + keys={"keys": "keys"}, ) ``` @@ -7744,7 +8192,7 @@ client.companies.list_companies_for_advanced_filter(
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_) +**keys:** `typing.Dict[str, str]` — Key/value pairs
@@ -7752,204 +8200,32 @@ client.companies.list_companies_for_advanced_filter(
-**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more plan IDs (each ID starts with plan_) +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more feature IDs (each ID starts with feat_) -
-
-
-**credit_type_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by one or more credit type IDs (each ID starts with bcrd_) -
+
+
client.companies.list_company_memberships(...) -> AsyncHttpResponse[ListCompanyMembershipsResponse]
-**subscription_statuses:** `typing.Optional[ - typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] -]` — Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) - -
-
+#### 🔌 Usage
-**subscription_types:** `typing.Optional[ - typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]] -]` — Filter companies by one or more subscription types (paid, free, trial) - -
-
-
-**monetized_subscriptions:** `typing.Optional[bool]` — Filter companies that have monetized subscriptions - -
-
- -
-
- -**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits - -
-
- -
-
- -**without_plan:** `typing.Optional[bool]` — Filter out companies that have a plan - -
-
- -
-
- -**without_subscription:** `typing.Optional[bool]` — Filter out companies that have a subscription - -
-
- -
-
- -**sort_order_column:** `typing.Optional[str]` — Column to sort by (e.g. name, created_at, last_seen_at) - -
-
- -
-
- -**sort_order_direction:** `typing.Optional[SortDirection]` — Direction to sort by (asc or desc) - -
-
- -
-
- -**display_properties:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Select the display columns to return (e.g. plan, subscription, users, last_seen_at) - -
-
- -
-
- -**limit:** `typing.Optional[int]` — Page limit (default 100) - -
-
- -
-
- -**offset:** `typing.Optional[int]` — Page offset (default 0) - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
- - - - - - -
- -
client.companies.lookup_company(...) -> AsyncHttpResponse[LookupCompanyResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from schematic import Schematic - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.companies.lookup_company( - keys={"keys": "keys"}, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**keys:** `typing.Dict[str, str]` — Key/value pairs - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.companies.list_company_memberships(...) -> AsyncHttpResponse[ListCompanyMembershipsResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from schematic import Schematic +```python +from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", @@ -8019,7 +8295,7 @@ client.companies.list_company_memberships(
-
client.companies.get_or_create_company_membership(...) -> AsyncHttpResponse[GetOrCreateCompanyMembershipResponse] +
client.companies.get_or_create_company_membership(...) -> AsyncHttpResponse[GetOrCreateCompanyMembershipResponse]
@@ -8084,7 +8360,7 @@ client.companies.get_or_create_company_membership(
-
client.companies.delete_company_membership(...) -> AsyncHttpResponse[DeleteCompanyMembershipResponse] +
client.companies.delete_company_membership(...) -> AsyncHttpResponse[DeleteCompanyMembershipResponse]
@@ -8140,7 +8416,7 @@ client.companies.delete_company_membership(
-
client.companies.get_active_company_subscription(...) -> AsyncHttpResponse[GetActiveCompanySubscriptionResponse] +
client.companies.get_active_company_subscription(...) -> AsyncHttpResponse[GetActiveCompanySubscriptionResponse]
@@ -8222,7 +8498,7 @@ client.companies.get_active_company_subscription(
-
client.companies.upsert_company_trait(...) -> AsyncHttpResponse[UpsertCompanyTraitResponse] +
client.companies.upsert_company_trait(...) -> AsyncHttpResponse[UpsertCompanyTraitResponse]
@@ -8311,7 +8587,7 @@ client.companies.upsert_company_trait(
-
client.companies.list_entity_key_definitions(...) -> AsyncHttpResponse[ListEntityKeyDefinitionsResponse] +
client.companies.list_entity_key_definitions(...) -> AsyncHttpResponse[ListEntityKeyDefinitionsResponse]
@@ -8402,7 +8678,7 @@ client.companies.list_entity_key_definitions(
-
client.companies.count_entity_key_definitions(...) -> AsyncHttpResponse[CountEntityKeyDefinitionsResponse] +
client.companies.count_entity_key_definitions(...) -> AsyncHttpResponse[CountEntityKeyDefinitionsResponse]
@@ -8493,7 +8769,7 @@ client.companies.count_entity_key_definitions(
-
client.companies.list_entity_trait_definitions(...) -> AsyncHttpResponse[ListEntityTraitDefinitionsResponse] +
client.companies.list_entity_trait_definitions(...) -> AsyncHttpResponse[ListEntityTraitDefinitionsResponse]
@@ -8601,7 +8877,7 @@ client.companies.list_entity_trait_definitions(
-
client.companies.get_or_create_entity_trait_definition(...) -> AsyncHttpResponse[GetOrCreateEntityTraitDefinitionResponse] +
client.companies.get_or_create_entity_trait_definition(...) -> AsyncHttpResponse[GetOrCreateEntityTraitDefinitionResponse]
@@ -8683,7 +8959,7 @@ client.companies.get_or_create_entity_trait_definition(
-
client.companies.get_entity_trait_definition(...) -> AsyncHttpResponse[GetEntityTraitDefinitionResponse] +
client.companies.get_entity_trait_definition(...) -> AsyncHttpResponse[GetEntityTraitDefinitionResponse]
@@ -8739,7 +9015,7 @@ client.companies.get_entity_trait_definition(
-
client.companies.update_entity_trait_definition(...) -> AsyncHttpResponse[UpdateEntityTraitDefinitionResponse] +
client.companies.update_entity_trait_definition(...) -> AsyncHttpResponse[UpdateEntityTraitDefinitionResponse]
@@ -8812,7 +9088,7 @@ client.companies.update_entity_trait_definition(
-
client.companies.count_entity_trait_definitions(...) -> AsyncHttpResponse[CountEntityTraitDefinitionsResponse] +
client.companies.count_entity_trait_definitions(...) -> AsyncHttpResponse[CountEntityTraitDefinitionsResponse]
@@ -8920,7 +9196,7 @@ client.companies.count_entity_trait_definitions(
-
client.companies.get_entity_trait_values(...) -> AsyncHttpResponse[GetEntityTraitValuesResponse] +
client.companies.get_entity_trait_values(...) -> AsyncHttpResponse[GetEntityTraitValuesResponse]
@@ -9003,7 +9279,7 @@ client.companies.get_entity_trait_values(
-
client.companies.list_plan_changes(...) -> AsyncHttpResponse[ListPlanChangesResponse] +
client.companies.list_plan_changes(...) -> AsyncHttpResponse[ListPlanChangesResponse]
@@ -9111,7 +9387,7 @@ client.companies.list_plan_changes(
-
client.companies.get_plan_change(...) -> AsyncHttpResponse[GetPlanChangeResponse] +
client.companies.get_plan_change(...) -> AsyncHttpResponse[GetPlanChangeResponse]
@@ -9167,7 +9443,7 @@ client.companies.get_plan_change(
-
client.companies.list_plan_traits(...) -> AsyncHttpResponse[ListPlanTraitsResponse] +
client.companies.list_plan_traits(...) -> AsyncHttpResponse[ListPlanTraitsResponse]
@@ -9266,7 +9542,7 @@ client.companies.list_plan_traits(
-
client.companies.create_plan_trait(...) -> AsyncHttpResponse[CreatePlanTraitResponse] +
client.companies.create_plan_trait(...) -> AsyncHttpResponse[CreatePlanTraitResponse]
@@ -9340,7 +9616,7 @@ client.companies.create_plan_trait(
-
client.companies.get_plan_trait(...) -> AsyncHttpResponse[GetPlanTraitResponse] +
client.companies.get_plan_trait(...) -> AsyncHttpResponse[GetPlanTraitResponse]
@@ -9396,7 +9672,7 @@ client.companies.get_plan_trait(
-
client.companies.update_plan_trait(...) -> AsyncHttpResponse[UpdatePlanTraitResponse] +
client.companies.update_plan_trait(...) -> AsyncHttpResponse[UpdatePlanTraitResponse]
@@ -9470,7 +9746,7 @@ client.companies.update_plan_trait(
-
client.companies.delete_plan_trait(...) -> AsyncHttpResponse[DeletePlanTraitResponse] +
client.companies.delete_plan_trait(...) -> AsyncHttpResponse[DeletePlanTraitResponse]
@@ -9526,7 +9802,7 @@ client.companies.delete_plan_trait(
-
client.companies.update_plan_traits_bulk(...) -> AsyncHttpResponse[UpdatePlanTraitsBulkResponse] +
client.companies.update_plan_traits_bulk(...) -> AsyncHttpResponse[UpdatePlanTraitsBulkResponse]
@@ -9605,7 +9881,7 @@ client.companies.update_plan_traits_bulk(
-
client.companies.count_plan_traits(...) -> AsyncHttpResponse[CountPlanTraitsResponse] +
client.companies.count_plan_traits(...) -> AsyncHttpResponse[CountPlanTraitsResponse]
@@ -9704,7 +9980,7 @@ client.companies.count_plan_traits(
-
client.companies.upsert_user_trait(...) -> AsyncHttpResponse[UpsertUserTraitResponse] +
client.companies.upsert_user_trait(...) -> AsyncHttpResponse[UpsertUserTraitResponse]
@@ -9793,7 +10069,7 @@ client.companies.upsert_user_trait(
-
client.companies.list_users(...) -> AsyncHttpResponse[ListUsersResponse] +
client.companies.list_users(...) -> AsyncHttpResponse[ListUsersResponse]
@@ -9893,7 +10169,7 @@ client.companies.list_users(
-
client.companies.upsert_user(...) -> AsyncHttpResponse[UpsertUserResponse] +
client.companies.upsert_user(...) -> AsyncHttpResponse[UpsertUserResponse]
@@ -10021,7 +10297,7 @@ client.companies.upsert_user(
-
client.companies.get_user(...) -> AsyncHttpResponse[GetUserResponse] +
client.companies.get_user(...) -> AsyncHttpResponse[GetUserResponse]
@@ -10077,7 +10353,7 @@ client.companies.get_user(
-
client.companies.delete_user(...) -> AsyncHttpResponse[DeleteUserResponse] +
client.companies.delete_user(...) -> AsyncHttpResponse[DeleteUserResponse]
@@ -10133,7 +10409,7 @@ client.companies.delete_user(
-
client.companies.count_users(...) -> AsyncHttpResponse[CountUsersResponse] +
client.companies.count_users(...) -> AsyncHttpResponse[CountUsersResponse]
@@ -10233,7 +10509,7 @@ client.companies.count_users(
-
client.companies.create_user(...) -> AsyncHttpResponse[CreateUserResponse] +
client.companies.create_user(...) -> AsyncHttpResponse[CreateUserResponse]
@@ -10361,7 +10637,7 @@ client.companies.create_user(
-
client.companies.delete_user_by_keys(...) -> AsyncHttpResponse[DeleteUserByKeysResponse] +
client.companies.delete_user_by_keys(...) -> AsyncHttpResponse[DeleteUserByKeysResponse]
@@ -10417,7 +10693,7 @@ client.companies.delete_user_by_keys(
-
client.companies.lookup_user(...) -> AsyncHttpResponse[LookupUserResponse] +
client.companies.lookup_user(...) -> AsyncHttpResponse[LookupUserResponse]
@@ -10474,7 +10750,7 @@ client.companies.lookup_user(
## entitlements -
client.entitlements.list_company_overrides(...) -> AsyncHttpResponse[ListCompanyOverridesResponse] +
client.entitlements.list_company_overrides(...) -> AsyncHttpResponse[ListCompanyOverridesResponse]
@@ -10599,7 +10875,7 @@ client.entitlements.list_company_overrides(
-
client.entitlements.create_company_override(...) -> AsyncHttpResponse[CreateCompanyOverrideResponse] +
client.entitlements.create_company_override(...) -> AsyncHttpResponse[CreateCompanyOverrideResponse]
@@ -10745,7 +11021,7 @@ client.entitlements.create_company_override(
-
client.entitlements.get_company_override(...) -> AsyncHttpResponse[GetCompanyOverrideResponse] +
client.entitlements.get_company_override(...) -> AsyncHttpResponse[GetCompanyOverrideResponse]
@@ -10801,7 +11077,7 @@ client.entitlements.get_company_override(
-
client.entitlements.update_company_override(...) -> AsyncHttpResponse[UpdateCompanyOverrideResponse] +
client.entitlements.update_company_override(...) -> AsyncHttpResponse[UpdateCompanyOverrideResponse]
@@ -10938,7 +11214,7 @@ client.entitlements.update_company_override(
-
client.entitlements.delete_company_override(...) -> AsyncHttpResponse[DeleteCompanyOverrideResponse] +
client.entitlements.delete_company_override(...) -> AsyncHttpResponse[DeleteCompanyOverrideResponse]
@@ -10994,7 +11270,7 @@ client.entitlements.delete_company_override(
-
client.entitlements.count_company_overrides(...) -> AsyncHttpResponse[CountCompanyOverridesResponse] +
client.entitlements.count_company_overrides(...) -> AsyncHttpResponse[CountCompanyOverridesResponse]
@@ -11119,7 +11395,7 @@ client.entitlements.count_company_overrides(
-
client.entitlements.list_feature_companies(...) -> AsyncHttpResponse[ListFeatureCompaniesResponse] +
client.entitlements.list_feature_companies(...) -> AsyncHttpResponse[ListFeatureCompaniesResponse]
@@ -11202,7 +11478,7 @@ client.entitlements.list_feature_companies(
-
client.entitlements.count_feature_companies(...) -> AsyncHttpResponse[CountFeatureCompaniesResponse] +
client.entitlements.count_feature_companies(...) -> AsyncHttpResponse[CountFeatureCompaniesResponse]
@@ -11285,7 +11561,7 @@ client.entitlements.count_feature_companies(
-
client.entitlements.list_feature_usage(...) -> AsyncHttpResponse[ListFeatureUsageResponse] +
client.entitlements.list_feature_usage(...) -> AsyncHttpResponse[ListFeatureUsageResponse]
@@ -11402,7 +11678,105 @@ client.entitlements.list_feature_usage(
-
client.entitlements.count_feature_usage(...) -> AsyncHttpResponse[CountFeatureUsageResponse] +
client.entitlements.get_feature_usage_time_series(...) -> AsyncHttpResponse[GetFeatureUsageTimeSeriesResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime + +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.entitlements.get_feature_usage_time_series( + company_id="company_id", + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + feature_id="feature_id", + granularity="daily", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `str` + +
+
+ +
+
+ +**end_time:** `dt.datetime` + +
+
+ +
+
+ +**feature_id:** `str` + +
+
+ +
+
+ +**start_time:** `dt.datetime` + +
+
+ +
+
+ +**granularity:** `typing.Optional[TimeSeriesGranularity]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.entitlements.count_feature_usage(...) -> AsyncHttpResponse[CountFeatureUsageResponse]
@@ -11519,7 +11893,7 @@ client.entitlements.count_feature_usage(
-
client.entitlements.list_feature_users(...) -> AsyncHttpResponse[ListFeatureUsersResponse] +
client.entitlements.list_feature_users(...) -> AsyncHttpResponse[ListFeatureUsersResponse]
@@ -11602,7 +11976,7 @@ client.entitlements.list_feature_users(
-
client.entitlements.count_feature_users(...) -> AsyncHttpResponse[CountFeatureUsersResponse] +
client.entitlements.count_feature_users(...) -> AsyncHttpResponse[CountFeatureUsersResponse]
@@ -11685,7 +12059,7 @@ client.entitlements.count_feature_users(
-
client.entitlements.list_plan_entitlements(...) -> AsyncHttpResponse[ListPlanEntitlementsResponse] +
client.entitlements.list_plan_entitlements(...) -> AsyncHttpResponse[ListPlanEntitlementsResponse]
@@ -11706,6 +12080,7 @@ client = Schematic( client.entitlements.list_plan_entitlements( feature_id="feature_id", plan_id="plan_id", + plan_version_id="plan_version_id", q="q", with_metered_products=True, limit=1, @@ -11766,6 +12141,22 @@ client.entitlements.list_plan_entitlements(
+**plan_version_id:** `typing.Optional[str]` — Filter plan entitlements by a single plan version ID (starting with plvr_) + +
+
+ +
+
+ +**plan_version_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan version IDs (starting with plvr_) + +
+
+ +
+
+ **q:** `typing.Optional[str]` — Search for plan entitlements by feature or company name
@@ -11810,7 +12201,7 @@ client.entitlements.list_plan_entitlements(
-
client.entitlements.create_plan_entitlement(...) -> AsyncHttpResponse[CreatePlanEntitlementResponse] +
client.entitlements.create_plan_entitlement(...) -> AsyncHttpResponse[CreatePlanEntitlementResponse]
@@ -11960,6 +12351,14 @@ client.entitlements.create_plan_entitlement(
+**plan_version_id:** `typing.Optional[str]` + +
+
+ +
+
+ **price_behavior:** `typing.Optional[EntitlementPriceBehavior]`
@@ -12068,7 +12467,7 @@ client.entitlements.create_plan_entitlement(
-
client.entitlements.get_plan_entitlement(...) -> AsyncHttpResponse[GetPlanEntitlementResponse] +
client.entitlements.get_plan_entitlement(...) -> AsyncHttpResponse[GetPlanEntitlementResponse]
@@ -12124,7 +12523,7 @@ client.entitlements.get_plan_entitlement(
-
client.entitlements.update_plan_entitlement(...) -> AsyncHttpResponse[UpdatePlanEntitlementResponse] +
client.entitlements.update_plan_entitlement(...) -> AsyncHttpResponse[UpdatePlanEntitlementResponse]
@@ -12373,7 +12772,7 @@ client.entitlements.update_plan_entitlement(
-
client.entitlements.delete_plan_entitlement(...) -> AsyncHttpResponse[DeletePlanEntitlementResponse] +
client.entitlements.delete_plan_entitlement(...) -> AsyncHttpResponse[DeletePlanEntitlementResponse]
@@ -12429,7 +12828,7 @@ client.entitlements.delete_plan_entitlement(
-
client.entitlements.count_plan_entitlements(...) -> AsyncHttpResponse[CountPlanEntitlementsResponse] +
client.entitlements.count_plan_entitlements(...) -> AsyncHttpResponse[CountPlanEntitlementsResponse]
@@ -12450,6 +12849,7 @@ client = Schematic( client.entitlements.count_plan_entitlements( feature_id="feature_id", plan_id="plan_id", + plan_version_id="plan_version_id", q="q", with_metered_products=True, limit=1, @@ -12510,6 +12910,22 @@ client.entitlements.count_plan_entitlements(
+**plan_version_id:** `typing.Optional[str]` — Filter plan entitlements by a single plan version ID (starting with plvr_) + +
+
+ +
+
+ +**plan_version_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan version IDs (starting with plvr_) + +
+
+ +
+
+ **q:** `typing.Optional[str]` — Search for plan entitlements by feature or company name
@@ -12554,7 +12970,7 @@ client.entitlements.count_plan_entitlements(
-
client.entitlements.duplicate_plan_entitlements(...) -> AsyncHttpResponse[DuplicatePlanEntitlementsResponse] +
client.entitlements.duplicate_plan_entitlements(...) -> AsyncHttpResponse[DuplicatePlanEntitlementsResponse]
@@ -12619,7 +13035,7 @@ client.entitlements.duplicate_plan_entitlements(
-
client.entitlements.get_feature_usage_by_company(...) -> AsyncHttpResponse[GetFeatureUsageByCompanyResponse] +
client.entitlements.get_feature_usage_by_company(...) -> AsyncHttpResponse[GetFeatureUsageByCompanyResponse]
@@ -12676,7 +13092,7 @@ client.entitlements.get_feature_usage_by_company(
## plans -
client.plans.update_company_plans(...) -> AsyncHttpResponse[UpdateCompanyPlansResponse] +
client.plans.update_company_plans(...) -> AsyncHttpResponse[UpdateCompanyPlansResponse]
@@ -12749,7 +13165,7 @@ client.plans.update_company_plans(
-
client.plans.list_plans(...) -> AsyncHttpResponse[ListPlansResponse] +
client.plans.list_plans(...) -> AsyncHttpResponse[ListPlansResponse]
@@ -12773,6 +13189,7 @@ client.plans.list_plans( for_initial_plan=True, for_trial_expiry_plan=True, has_product_id=True, + include_draft_versions=True, plan_type="plan", q="q", without_entitlement_for="without_entitlement_for", @@ -12843,6 +13260,14 @@ client.plans.list_plans(
+**include_draft_versions:** `typing.Optional[bool]` — Include billing settings from draft versions for plans which have draft version + +
+
+ +
+
+ **plan_type:** `typing.Optional[PlanType]` — Filter by plan type
@@ -12903,7 +13328,7 @@ client.plans.list_plans(
-
client.plans.create_plan(...) -> AsyncHttpResponse[CreatePlanResponse] +
client.plans.create_plan(...) -> AsyncHttpResponse[CreatePlanResponse]
@@ -12985,7 +13410,7 @@ client.plans.create_plan(
-
client.plans.get_plan(...) -> AsyncHttpResponse[GetPlanResponse] +
client.plans.get_plan(...) -> AsyncHttpResponse[GetPlanResponse]
@@ -13005,6 +13430,7 @@ client = Schematic( ) client.plans.get_plan( plan_id="plan_id", + plan_version_id="plan_version_id", ) ``` @@ -13029,6 +13455,14 @@ client.plans.get_plan(
+**plan_version_id:** `typing.Optional[str]` — Fetch billing settings for a specific plan version + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -13041,7 +13475,7 @@ client.plans.get_plan(
-
client.plans.update_plan(...) -> AsyncHttpResponse[UpdatePlanResponse] +
client.plans.update_plan(...) -> AsyncHttpResponse[UpdatePlanResponse]
@@ -13122,7 +13556,7 @@ client.plans.update_plan(
-
client.plans.delete_plan(...) -> AsyncHttpResponse[DeletePlanResponse] +
client.plans.delete_plan(...) -> AsyncHttpResponse[DeletePlanResponse]
@@ -13178,7 +13612,7 @@ client.plans.delete_plan(
-
client.plans.upsert_billing_product_plan(...) -> AsyncHttpResponse[UpsertBillingProductPlanResponse] +
client.plans.upsert_billing_product_plan(...) -> AsyncHttpResponse[UpsertBillingProductPlanResponse]
@@ -13324,7 +13758,7 @@ client.plans.upsert_billing_product_plan(
-
client.plans.count_plans(...) -> AsyncHttpResponse[CountPlansResponse] +
client.plans.count_plans(...) -> AsyncHttpResponse[CountPlansResponse]
@@ -13348,6 +13782,7 @@ client.plans.count_plans( for_initial_plan=True, for_trial_expiry_plan=True, has_product_id=True, + include_draft_versions=True, plan_type="plan", q="q", without_entitlement_for="without_entitlement_for", @@ -13418,6 +13853,14 @@ client.plans.count_plans(
+**include_draft_versions:** `typing.Optional[bool]` — Include billing settings from draft versions for plans which have draft version + +
+
+ +
+
+ **plan_type:** `typing.Optional[PlanType]` — Filter by plan type
@@ -13478,7 +13921,7 @@ client.plans.count_plans(
-
client.plans.list_plan_issues(...) -> AsyncHttpResponse[ListPlanIssuesResponse] +
client.plans.list_plan_issues(...) -> AsyncHttpResponse[ListPlanIssuesResponse]
@@ -13498,6 +13941,7 @@ client = Schematic( ) client.plans.list_plan_issues( plan_id="plan_id", + plan_version_id="plan_version_id", ) ``` @@ -13522,6 +13966,144 @@ client.plans.list_plan_issues(
+**plan_version_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + +
+ +
client.plans.delete_plan_version(...) -> AsyncHttpResponse[DeletePlanVersionResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.plans.delete_plan_version( + plan_id="plan_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**plan_id:** `str` — plan_id + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.plans.publish_plan_version(...) -> AsyncHttpResponse[PublishPlanVersionResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.plans.publish_plan_version( + plan_id="plan_id", + excluded_company_ids=["excluded_company_ids"], + migration_strategy="immediate", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**plan_id:** `str` — plan_id + +
+
+ +
+
+ +**excluded_company_ids:** `typing.Sequence[str]` + +
+
+ +
+
+ +**migration_strategy:** `PlanVersionMigrationStrategy` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -13535,7 +14117,7 @@ client.plans.list_plan_issues(
## components -
client.components.list_components(...) -> AsyncHttpResponse[ListComponentsResponse] +
client.components.list_components(...) -> AsyncHttpResponse[ListComponentsResponse]
@@ -13609,7 +14191,7 @@ client.components.list_components(
-
client.components.create_component(...) -> AsyncHttpResponse[CreateComponentResponse] +
client.components.create_component(...) -> AsyncHttpResponse[CreateComponentResponse]
@@ -13682,7 +14264,7 @@ client.components.create_component(
-
client.components.get_component(...) -> AsyncHttpResponse[GetComponentResponse] +
client.components.get_component(...) -> AsyncHttpResponse[GetComponentResponse]
@@ -13738,7 +14320,7 @@ client.components.get_component(
-
client.components.update_component(...) -> AsyncHttpResponse[UpdateComponentResponse] +
client.components.update_component(...) -> AsyncHttpResponse[UpdateComponentResponse]
@@ -13826,7 +14408,7 @@ client.components.update_component(
-
client.components.delete_component(...) -> AsyncHttpResponse[DeleteComponentResponse] +
client.components.delete_component(...) -> AsyncHttpResponse[DeleteComponentResponse]
@@ -13882,7 +14464,7 @@ client.components.delete_component(
-
client.components.count_components(...) -> AsyncHttpResponse[CountComponentsResponse] +
client.components.count_components(...) -> AsyncHttpResponse[CountComponentsResponse]
@@ -13956,7 +14538,7 @@ client.components.count_components(
-
client.components.preview_component_data(...) -> AsyncHttpResponse[PreviewComponentDataResponse] +
client.components.preview_component_data(...) -> AsyncHttpResponse[PreviewComponentDataResponse]
@@ -14022,7 +14604,7 @@ client.components.preview_component_data(
## dataexports -
client.dataexports.create_data_export(...) -> AsyncHttpResponse[CreateDataExportResponse] +
client.dataexports.create_data_export(...) -> AsyncHttpResponse[CreateDataExportResponse]
@@ -14078,7 +14660,7 @@ client.dataexports.create_data_export(
-
client.dataexports.get_data_export_artifact(...) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] +
client.dataexports.get_data_export_artifact(...) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]
@@ -14135,7 +14717,7 @@ client.dataexports.get_data_export_artifact(
## events -
client.events.create_event_batch(...) -> AsyncHttpResponse[CreateEventBatchResponse] +
client.events.create_event_batch(...) -> AsyncHttpResponse[CreateEventBatchResponse]
@@ -14195,7 +14777,7 @@ client.events.create_event_batch(
-
client.events.get_event_summaries(...) -> AsyncHttpResponse[GetEventSummariesResponse] +
client.events.get_event_summaries(...) -> AsyncHttpResponse[GetEventSummariesResponse]
@@ -14277,7 +14859,7 @@ client.events.get_event_summaries(
-
client.events.list_events(...) -> AsyncHttpResponse[ListEventsResponse] +
client.events.list_events(...) -> AsyncHttpResponse[ListEventsResponse]
@@ -14386,7 +14968,7 @@ client.events.list_events(
-
client.events.create_event(...) -> AsyncHttpResponse[CreateEventResponse] +
client.events.create_event(...) -> AsyncHttpResponse[CreateEventResponse]
@@ -14422,7 +15004,7 @@ client.events.create_event(
-**event_type:** `EventType` +**event_type:** `EventType` — Either 'identify' or 'track'
@@ -14458,7 +15040,7 @@ client.events.create_event(
-
client.events.get_event(...) -> AsyncHttpResponse[GetEventResponse] +
client.events.get_event(...) -> AsyncHttpResponse[GetEventResponse]
@@ -14514,7 +15096,7 @@ client.events.get_event(
-
client.events.get_segment_integration_status() -> AsyncHttpResponse[GetSegmentIntegrationStatusResponse] +
client.events.get_segment_integration_status() -> AsyncHttpResponse[GetSegmentIntegrationStatusResponse]
@@ -14561,7 +15143,7 @@ client.events.get_segment_integration_status()
## features -
client.features.list_features(...) -> AsyncHttpResponse[ListFeaturesResponse] +
client.features.list_features(...) -> AsyncHttpResponse[ListFeaturesResponse]
@@ -14582,6 +15164,7 @@ client = Schematic( client.features.list_features( q="q", without_company_override_for="without_company_override_for", + plan_version_id="plan_version_id", without_plan_entitlement_for="without_plan_entitlement_for", boolean_require_event=True, limit=1, @@ -14626,6 +15209,14 @@ client.features.list_features(
+**plan_version_id:** `typing.Optional[str]` — Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + +
+
+ +
+
+ **without_plan_entitlement_for:** `typing.Optional[str]` — Filter out features that already have a plan entitlement for the specified plan ID
@@ -14678,7 +15269,7 @@ client.features.list_features(
-
client.features.create_feature(...) -> AsyncHttpResponse[CreateFeatureResponse] +
client.features.create_feature(...) -> AsyncHttpResponse[CreateFeatureResponse]
@@ -14816,7 +15407,7 @@ client.features.create_feature(
-
client.features.get_feature(...) -> AsyncHttpResponse[GetFeatureResponse] +
client.features.get_feature(...) -> AsyncHttpResponse[GetFeatureResponse]
@@ -14872,7 +15463,7 @@ client.features.get_feature(
-
client.features.update_feature(...) -> AsyncHttpResponse[UpdateFeatureResponse] +
client.features.update_feature(...) -> AsyncHttpResponse[UpdateFeatureResponse]
@@ -15016,7 +15607,7 @@ client.features.update_feature(
-
client.features.delete_feature(...) -> AsyncHttpResponse[DeleteFeatureResponse] +
client.features.delete_feature(...) -> AsyncHttpResponse[DeleteFeatureResponse]
@@ -15072,7 +15663,7 @@ client.features.delete_feature(
-
client.features.count_features(...) -> AsyncHttpResponse[CountFeaturesResponse] +
client.features.count_features(...) -> AsyncHttpResponse[CountFeaturesResponse]
@@ -15093,6 +15684,7 @@ client = Schematic( client.features.count_features( q="q", without_company_override_for="without_company_override_for", + plan_version_id="plan_version_id", without_plan_entitlement_for="without_plan_entitlement_for", boolean_require_event=True, limit=1, @@ -15137,6 +15729,14 @@ client.features.count_features(
+**plan_version_id:** `typing.Optional[str]` — Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + +
+
+ +
+
+ **without_plan_entitlement_for:** `typing.Optional[str]` — Filter out features that already have a plan entitlement for the specified plan ID
@@ -15189,7 +15789,7 @@ client.features.count_features(
-
client.features.list_flags(...) -> AsyncHttpResponse[ListFlagsResponse] +
client.features.list_flags(...) -> AsyncHttpResponse[ListFlagsResponse]
@@ -15280,7 +15880,7 @@ client.features.list_flags(
-
client.features.create_flag(...) -> AsyncHttpResponse[CreateFlagResponse] +
client.features.create_flag(...) -> AsyncHttpResponse[CreateFlagResponse]
@@ -15379,7 +15979,7 @@ client.features.create_flag(
-
client.features.get_flag(...) -> AsyncHttpResponse[GetFlagResponse] +
client.features.get_flag(...) -> AsyncHttpResponse[GetFlagResponse]
@@ -15435,7 +16035,7 @@ client.features.get_flag(
-
client.features.update_flag(...) -> AsyncHttpResponse[UpdateFlagResponse] +
client.features.update_flag(...) -> AsyncHttpResponse[UpdateFlagResponse]
@@ -15543,7 +16143,7 @@ client.features.update_flag(
-
client.features.delete_flag(...) -> AsyncHttpResponse[DeleteFlagResponse] +
client.features.delete_flag(...) -> AsyncHttpResponse[DeleteFlagResponse]
@@ -15599,7 +16199,7 @@ client.features.delete_flag(
-
client.features.update_flag_rules(...) -> AsyncHttpResponse[UpdateFlagRulesResponse] +
client.features.update_flag_rules(...) -> AsyncHttpResponse[UpdateFlagRulesResponse]
@@ -15693,7 +16293,7 @@ client.features.update_flag_rules(
-
client.features.check_flag(...) -> AsyncHttpResponse[CheckFlagResponse] +
client.features.check_flag(...) -> AsyncHttpResponse[CheckFlagResponse]
@@ -15765,7 +16365,7 @@ client.features.check_flag(
-
client.features.check_flags(...) -> AsyncHttpResponse[CheckFlagsResponse] +
client.features.check_flags(...) -> AsyncHttpResponse[CheckFlagsResponse]
@@ -15827,7 +16427,7 @@ client.features.check_flags()
-
client.features.check_flags_bulk(...) -> AsyncHttpResponse[CheckFlagsBulkResponse] +
client.features.check_flags_bulk(...) -> AsyncHttpResponse[CheckFlagsBulkResponse]
@@ -15883,7 +16483,7 @@ client.features.check_flags_bulk(
-
client.features.count_flags(...) -> AsyncHttpResponse[CountFlagsResponse] +
client.features.count_flags(...) -> AsyncHttpResponse[CountFlagsResponse]
@@ -15974,8 +16574,8 @@ client.features.count_flags(
-## plangroups -
client.plangroups.get_plan_group() -> AsyncHttpResponse[GetPlanGroupResponse] +## planbundle +
client.planbundle.create_plan_bundle(...) -> AsyncHttpResponse[CreatePlanBundleResponse]
@@ -15988,12 +16588,18 @@ client.features.count_flags(
```python -from schematic import Schematic +from schematic import PlanBundleEntitlementRequestBody, Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.plangroups.get_plan_group() +client.planbundle.create_plan_bundle( + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) + ], +) ```
@@ -16009,6 +16615,46 @@ client.plangroups.get_plan_group()
+**entitlements:** `typing.Sequence[PlanBundleEntitlementRequestBody]` + +
+
+ +
+
+ +**billing_product:** `typing.Optional[UpsertBillingProductRequestBody]` + +
+
+ +
+
+ +**credit_grants:** `typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]]` + +
+
+ +
+
+ +**plan:** `typing.Optional[CreatePlanRequestBody]` + +
+
+ +
+
+ +**traits:** `typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -16021,7 +16667,7 @@ client.plangroups.get_plan_group()
-
client.plangroups.create_plan_group(...) -> AsyncHttpResponse[CreatePlanGroupResponse] +
client.planbundle.update_plan_bundle(...) -> AsyncHttpResponse[UpdatePlanBundleResponse]
@@ -16034,40 +16680,18 @@ client.plangroups.get_plan_group()
```python -from schematic import OrderedPlansInGroup, PlanGroupBundleOrder, Schematic +from schematic import PlanBundleEntitlementRequestBody, Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.plangroups.create_plan_group( - add_on_ids=["add_on_ids"], - checkout_collect_address=True, - checkout_collect_email=True, - checkout_collect_phone=True, - enable_tax_collection=True, - ordered_add_ons=[ - OrderedPlansInGroup( - plan_id="plan_id", - ) - ], - ordered_bundle_list=[ - PlanGroupBundleOrder( - bundle_id="bundleId", - ) - ], - ordered_plans=[ - OrderedPlansInGroup( - plan_id="plan_id", +client.planbundle.update_plan_bundle( + plan_bundle_id="plan_bundle_id", + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", ) ], - prevent_downgrades_when_over_limit=True, - prevent_self_service_downgrade=True, - proration_behavior="create_prorations", - show_as_monthly_prices=True, - show_credits=True, - show_period_toggle=True, - show_zero_price_as_free=True, - sync_customer_billing_details=True, ) ``` @@ -16084,7 +16708,7 @@ client.plangroups.create_plan_group(
-**add_on_ids:** `typing.Sequence[str]` — Use OrderedAddOns instead +**plan_bundle_id:** `str` — plan_bundle_id
@@ -16092,7 +16716,7 @@ client.plangroups.create_plan_group(
-**checkout_collect_address:** `bool` +**entitlements:** `typing.Sequence[PlanBundleEntitlementRequestBody]`
@@ -16100,7 +16724,7 @@ client.plangroups.create_plan_group(
-**checkout_collect_email:** `bool` +**billing_product:** `typing.Optional[UpsertBillingProductRequestBody]`
@@ -16108,7 +16732,7 @@ client.plangroups.create_plan_group(
-**checkout_collect_phone:** `bool` +**credit_grants:** `typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]]`
@@ -16116,7 +16740,7 @@ client.plangroups.create_plan_group(
-**enable_tax_collection:** `bool` +**plan:** `typing.Optional[UpdatePlanRequestBody]`
@@ -16124,7 +16748,7 @@ client.plangroups.create_plan_group(
-**ordered_add_ons:** `typing.Sequence[OrderedPlansInGroup]` +**plan_version_id:** `typing.Optional[str]`
@@ -16132,7 +16756,7 @@ client.plangroups.create_plan_group(
-**ordered_bundle_list:** `typing.Sequence[PlanGroupBundleOrder]` +**traits:** `typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]]`
@@ -16140,11 +16764,201 @@ client.plangroups.create_plan_group(
-**ordered_plans:** `typing.Sequence[OrderedPlansInGroup]` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- +
+
+ + + + +
+ +## plangroups +
client.plangroups.get_plan_group(...) -> AsyncHttpResponse[GetPlanGroupResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.plangroups.get_plan_group( + include_company_counts=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**include_company_counts:** `typing.Optional[bool]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.plangroups.create_plan_group(...) -> AsyncHttpResponse[CreatePlanGroupResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import OrderedPlansInGroup, PlanGroupBundleOrder, Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.plangroups.create_plan_group( + add_on_ids=["add_on_ids"], + checkout_collect_address=True, + checkout_collect_email=True, + checkout_collect_phone=True, + enable_tax_collection=True, + ordered_add_ons=[ + OrderedPlansInGroup( + plan_id="plan_id", + ) + ], + ordered_bundle_list=[ + PlanGroupBundleOrder( + bundle_id="bundleId", + ) + ], + ordered_plans=[ + OrderedPlansInGroup( + plan_id="plan_id", + ) + ], + prevent_downgrades_when_over_limit=True, + prevent_self_service_downgrade=True, + proration_behavior="create_prorations", + show_as_monthly_prices=True, + show_credits=True, + show_feature_description=True, + show_hard_limit=True, + show_period_toggle=True, + show_zero_price_as_free=True, + sync_customer_billing_details=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**add_on_ids:** `typing.Sequence[str]` — Use OrderedAddOns instead + +
+
+ +
+
+ +**checkout_collect_address:** `bool` + +
+
+ +
+
+ +**checkout_collect_email:** `bool` + +
+
+ +
+
+ +**checkout_collect_phone:** `bool` + +
+
+ +
+
+ +**enable_tax_collection:** `bool` + +
+
+ +
+
+ +**ordered_add_ons:** `typing.Sequence[OrderedPlansInGroup]` + +
+
+ +
+
+ +**ordered_bundle_list:** `typing.Sequence[PlanGroupBundleOrder]` + +
+
+ +
+
+ +**ordered_plans:** `typing.Sequence[OrderedPlansInGroup]` + +
+
+
@@ -16188,6 +17002,22 @@ client.plangroups.create_plan_group(
+**show_feature_description:** `bool` + +
+
+ +
+
+ +**show_hard_limit:** `bool` + +
+
+ +
+
+ **show_period_toggle:** `bool`
@@ -16276,6 +17106,22 @@ client.plangroups.create_plan_group(
+**scheduled_downgrade_behavior:** `typing.Optional[ScheduledDowngradeConfigBehavior]` + +
+
+ +
+
+ +**scheduled_downgrade_prevent_when_over_limit:** `typing.Optional[bool]` + +
+
+ +
+
+ **trial_days:** `typing.Optional[int]`
@@ -16320,7 +17166,7 @@ client.plangroups.create_plan_group(
-
client.plangroups.update_plan_group(...) -> AsyncHttpResponse[UpdatePlanGroupResponse] +
client.plangroups.update_plan_group(...) -> AsyncHttpResponse[UpdatePlanGroupResponse]
@@ -16365,6 +17211,8 @@ client.plangroups.update_plan_group( proration_behavior="create_prorations", show_as_monthly_prices=True, show_credits=True, + show_feature_description=True, + show_hard_limit=True, show_period_toggle=True, show_zero_price_as_free=True, sync_customer_billing_details=True, @@ -16496,6 +17344,22 @@ client.plangroups.update_plan_group(
+**show_feature_description:** `bool` + +
+
+ +
+
+ +**show_hard_limit:** `bool` + +
+
+ +
+
+ **show_period_toggle:** `bool`
@@ -16584,6 +17448,22 @@ client.plangroups.update_plan_group(
+**scheduled_downgrade_behavior:** `typing.Optional[ScheduledDowngradeConfigBehavior]` + +
+
+ +
+
+ +**scheduled_downgrade_prevent_when_over_limit:** `typing.Optional[bool]` + +
+
+ +
+
+ **trial_days:** `typing.Optional[int]`
@@ -16624,12 +17504,765 @@ client.plangroups.update_plan_group(
+
+
+
+ +## planmigrations +
client.planmigrations.list_company_migrations(...) -> AsyncHttpResponse[ListCompanyMigrationsResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.planmigrations.list_company_migrations( + migration_id="migration_id", + q="q", + status="completed", + limit=1, + offset=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**migration_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**q:** `typing.Optional[str]` + +
+
+ +
+
+ +**status:** `typing.Optional[PlanVersionCompanyMigrationStatus]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.planmigrations.count_company_migrations(...) -> AsyncHttpResponse[CountCompanyMigrationsResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.planmigrations.count_company_migrations( + migration_id="migration_id", + q="q", + status="completed", + limit=1, + offset=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**migration_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**q:** `typing.Optional[str]` + +
+
+ +
+
+ +**status:** `typing.Optional[PlanVersionCompanyMigrationStatus]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.planmigrations.list_migrations(...) -> AsyncHttpResponse[ListMigrationsResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.planmigrations.list_migrations( + plan_version_id="plan_version_id", + status="completed", + limit=1, + offset=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**plan_version_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**status:** `typing.Optional[PlanVersionMigrationStatus]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.planmigrations.get_migration(...) -> AsyncHttpResponse[GetMigrationResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.planmigrations.get_migration( + plan_version_migration_id="plan_version_migration_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**plan_version_migration_id:** `str` — plan_version_migration_id + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.planmigrations.count_migrations(...) -> AsyncHttpResponse[CountMigrationsResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.planmigrations.count_migrations( + plan_version_id="plan_version_id", + status="completed", + limit=1, + offset=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**plan_version_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**status:** `typing.Optional[PlanVersionMigrationStatus]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## componentspublic +
client.componentspublic.get_public_plans() -> AsyncHttpResponse[GetPublicPlansResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.componentspublic.get_public_plans() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## scheduledcheckout +
client.scheduledcheckout.list_scheduled_checkouts(...) -> AsyncHttpResponse[ListScheduledCheckoutsResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.scheduledcheckout.list_scheduled_checkouts( + company_id="company_id", + status="cancelled", + limit=1, + offset=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**status:** `typing.Optional[ScheduledCheckoutStatus]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduledcheckout.create_scheduled_checkout(...) -> AsyncHttpResponse[CreateScheduledCheckoutResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime + +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.scheduledcheckout.create_scheduled_checkout( + company_id="company_id", + execute_after=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + from_plan_id="from_plan_id", + to_plan_id="to_plan_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `str` + +
+
+ +
+
+ +**execute_after:** `dt.datetime` + +
+
+ +
+
+ +**from_plan_id:** `str` + +
+
+ +
+
+ +**to_plan_id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduledcheckout.get_scheduled_checkout(...) -> AsyncHttpResponse[GetScheduledCheckoutResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.scheduledcheckout.get_scheduled_checkout( + scheduled_checkout_id="scheduled_checkout_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**scheduled_checkout_id:** `str` — scheduled_checkout_id + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.scheduledcheckout.update_scheduled_checkout(...) -> AsyncHttpResponse[UpdateScheduledCheckoutResponse] +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.scheduledcheckout.update_scheduled_checkout( + scheduled_checkout_id="scheduled_checkout_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**scheduled_checkout_id:** `str` — scheduled_checkout_id + +
+
+ +
+
+ +**execute_after:** `typing.Optional[dt.datetime]` + +
+
+ +
+
+ +**status:** `typing.Optional[ScheduledCheckoutStatus]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
## accesstokens -
client.accesstokens.issue_temporary_access_token(...) -> AsyncHttpResponse[IssueTemporaryAccessTokenResponse] +
client.accesstokens.issue_temporary_access_token(...) -> AsyncHttpResponse[IssueTemporaryAccessTokenResponse]
@@ -16686,7 +18319,7 @@ client.accesstokens.issue_temporary_access_token(
## webhooks -
client.webhooks.list_webhook_events(...) -> AsyncHttpResponse[ListWebhookEventsResponse] +
client.webhooks.list_webhook_events(...) -> AsyncHttpResponse[ListWebhookEventsResponse]
@@ -16777,7 +18410,7 @@ client.webhooks.list_webhook_events(
-
client.webhooks.get_webhook_event(...) -> AsyncHttpResponse[GetWebhookEventResponse] +
client.webhooks.get_webhook_event(...) -> AsyncHttpResponse[GetWebhookEventResponse]
@@ -16833,7 +18466,7 @@ client.webhooks.get_webhook_event(
-
client.webhooks.count_webhook_events(...) -> AsyncHttpResponse[CountWebhookEventsResponse] +
client.webhooks.count_webhook_events(...) -> AsyncHttpResponse[CountWebhookEventsResponse]
@@ -16924,7 +18557,7 @@ client.webhooks.count_webhook_events(
-
client.webhooks.list_webhooks(...) -> AsyncHttpResponse[ListWebhooksResponse] +
client.webhooks.list_webhooks(...) -> AsyncHttpResponse[ListWebhooksResponse]
@@ -16998,7 +18631,7 @@ client.webhooks.list_webhooks(
-
client.webhooks.create_webhook(...) -> AsyncHttpResponse[CreateWebhookResponse] +
client.webhooks.create_webhook(...) -> AsyncHttpResponse[CreateWebhookResponse]
@@ -17088,7 +18721,7 @@ client.webhooks.create_webhook(
-
client.webhooks.get_webhook(...) -> AsyncHttpResponse[GetWebhookResponse] +
client.webhooks.get_webhook(...) -> AsyncHttpResponse[GetWebhookResponse]
@@ -17144,7 +18777,7 @@ client.webhooks.get_webhook(
-
client.webhooks.update_webhook(...) -> AsyncHttpResponse[UpdateWebhookResponse] +
client.webhooks.update_webhook(...) -> AsyncHttpResponse[UpdateWebhookResponse]
@@ -17248,7 +18881,7 @@ client.webhooks.update_webhook(
-
client.webhooks.delete_webhook(...) -> AsyncHttpResponse[DeleteWebhookResponse] +
client.webhooks.delete_webhook(...) -> AsyncHttpResponse[DeleteWebhookResponse]
@@ -17304,7 +18937,7 @@ client.webhooks.delete_webhook(
-
client.webhooks.count_webhooks(...) -> AsyncHttpResponse[CountWebhooksResponse] +
client.webhooks.count_webhooks(...) -> AsyncHttpResponse[CountWebhooksResponse]
diff --git a/src/schematic/__init__.py b/src/schematic/__init__.py index 1d61316..c2d8231 100644 --- a/src/schematic/__init__.py +++ b/src/schematic/__init__.py @@ -7,12 +7,13 @@ if typing.TYPE_CHECKING: from .types import ( + ActorType, ApiError, ApiKeyCreateResponseData, - ApiKeyRequestListResponseData, - ApiKeyRequestResponseData, ApiKeyResponseData, ApiKeyScope, + AuditLogListResponseData, + AuditLogResponseData, BillingCouponResponseData, BillingCreditBundleResponseData, BillingCreditBundleStatus, @@ -27,6 +28,7 @@ BillingCreditLedgerResponseData, BillingCreditResponseData, BillingCreditRolloverPolicy, + BillingCreditView, BillingCustomerResponseData, BillingCustomerSubscription, BillingCustomerWithSubscriptionsResponseData, @@ -54,6 +56,8 @@ BillingSubscriptionTrialEndSetting, BillingSubscriptionView, BillingTiersMode, + CaptureRawEvent, + CaptureRawEventBatch, ChangeSubscriptionInternalRequestBody, ChangeSubscriptionRequestBody, ChargeType, @@ -76,7 +80,6 @@ CompanyPlanWithBillingSubView, CompanyResponseData, CompanySubscriptionResponseData, - CompanyViewWithFeatureUsageResponseData, CompatiblePlans, CompatiblePlansResponseData, ComponentCapabilities, @@ -91,12 +94,20 @@ Condition, ConditionConditionType, ConditionGroup, + ConditionGroupResponseData, + ConditionGroupView, ConditionMetricPeriod, ConditionMetricPeriodMonthReset, ConditionOperator, + ConditionResponseData, + ConditionView, CountResponse, CouponRequestBody, + CreateBillingPlanCreditGrantRequestBody, CreateBillingPriceTierRequestBody, + CreateEntitlementInBundleRequestBody, + CreateEntitlementInBundleRequestBodyMetricPeriod, + CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset, CreateEntitlementReqCommon, CreateEntitlementReqCommonMetricPeriod, CreateEntitlementReqCommonMetricPeriodMonthReset, @@ -111,10 +122,13 @@ CreateOrUpdateFlagRequestBody, CreateOrUpdateRuleRequestBody, CreateOrUpdateRuleRequestBodyRuleType, + CreatePlanRequestBody, CreatePriceTierRequestBody, CreditAutoTopupAmountType, CreditBundlePurchaseResponseData, CreditCompanyGrantView, + CreditEventLedgerResponseData, + CreditEventType, CreditGrantDetail, CreditGrantExpiryRequestBody, CreditGrantSortOrder, @@ -125,13 +139,19 @@ CreditTriggerConfig, CreditUsage, CreditUsageAggregation, - CreditUsageResponseData, + CreditsAutoTopupCompanySummary, + CreditsAutoTopupCreditSummary, + CreditsAutoTopupHardFailure, + CreditsAutoTopupRetryFailure, CustomPlanConfig, CustomPlanViewConfigResponseData, + DataEventPayload, DataExportOutputFileType, DataExportResponseData, DataExportStatus, DataExportType, + DatastreamCompanyPlan, + DeleteBillingPlanCreditGrantRequestBody, DeleteResponse, DuplicatePlanEntitlementsResponseResponseData, EntitlementPriceBehavior, @@ -163,21 +183,29 @@ FeatureCompanyResponseData, FeatureCompanyUserResponseData, FeatureDetailResponseData, + FeatureEntitlement, + FeatureEntitlementMetricPeriod, + FeatureEntitlementMonthReset, FeatureLedgerResponseData, FeatureLifecyclePhase, FeatureResponseData, FeatureType, - FeatureUsageDataResponseData, FeatureUsageDetailResponseData, + FeatureUsageLegacyResponseData, FeatureUsageResponseData, + FeatureUsageTimeSeriesResponseData, + FeatureView, FlagDetailResponseData, FlagResponseData, FlagType, + FlagView, GenericPreviewObject, InvoiceRequestBody, InvoiceResponseData, + InvoiceStatus, IssueTemporaryAccessTokenResponseData, KeysRequestBody, + LimitTimeSeriesPointResponseData, ManagePlanPreviewResponseResponseData, ManagePlanRequest, ManagePlanResponseResponseData, @@ -185,8 +213,11 @@ OrderedPlansInGroup, PaymentMethodRequestBody, PaymentMethodResponseData, + PlanBundleAction, + PlanBundleCreditGrantRequestBody, + PlanBundleEntitlementRequestBody, + PlanBundleResponseData, PlanChangeAction, - PlanChangeActorType, PlanChangeBasePlanAction, PlanChangeResponseData, PlanChangeSubscriptionAction, @@ -206,12 +237,22 @@ PlanSnapshotView, PlanTraitResponseData, PlanType, + PlanVersionCompanyMigrationResponseData, + PlanVersionCompanyMigrationStatus, + PlanVersionMigrationResponseData, + PlanVersionMigrationStatus, + PlanVersionMigrationStrategy, + PlanVersionResponseData, + PlanVersionSnapshotView, + PlanVersionStatus, + PlanViewPublicResponseData, PreviewObject, PreviewObjectResponseData, PreviewSubscriptionChangeResponseData, PreviewSubscriptionFinanceResponseData, PreviewSubscriptionUpcomingInvoiceLineItems, ProrationBehavior, + PublicPlansResponseData, QuickstartResp, RawEventBatchResponseData, RawEventResponseData, @@ -223,6 +264,7 @@ RuleDetailResponseData, RuleResponseData, RuleRuleType, + RuleView, RulesDetailResponseData, RulesEngineSchemaVersion, RulesengineCheckFlagResult, @@ -238,7 +280,11 @@ RulesengineConditionMetricPeriod, RulesengineConditionMetricPeriodMonthReset, RulesengineConditionOperator, + RulesengineEntitlementValueType, RulesengineEntityType, + RulesengineFeatureEntitlement, + RulesengineFeatureEntitlementMetricPeriod, + RulesengineFeatureEntitlementMonthReset, RulesengineFlag, RulesengineRule, RulesengineRuleRuleType, @@ -247,6 +293,10 @@ RulesengineTraitDefinition, RulesengineTraitDefinitionComparableType, RulesengineUser, + ScheduledCheckoutResponseData, + ScheduledCheckoutStatus, + ScheduledDowngradeConfigBehavior, + ScheduledDowngradeResponseData, SegmentStatusResp, SkippedEntitlementErrorResponseData, SkippedEntitlementResponseData, @@ -257,31 +307,38 @@ SubscriptionType, TemporaryAccessTokenResourceType, TemporaryAccessTokenResponseData, + TimeSeriesGranularity, TraitDefinition, TraitDefinitionComparableType, TraitType, UpdateAddOnRequestBody, + UpdateBillingPlanCreditGrantRequestBody, UpdateCreditBundleRequestBody, UpdateEntitlementReqCommon, UpdateEntitlementReqCommonMetricPeriod, UpdateEntitlementReqCommonMetricPeriodMonthReset, UpdatePayInAdvanceRequestBody, + UpdatePlanRequestBody, UpdatePlanTraitTraitRequestBody, UpdateRuleRequestBody, + UpsertBillingProductRequestBody, UpsertCompanyRequestBody, UpsertTraitRequestBody, UpsertUserRequestBody, UpsertUserSubRequestBody, UsageBasedEntitlementRequestBody, UsageBasedEntitlementResponseData, + UsageTimeSeriesPointResponseData, UserDetailResponseData, UserResponseData, + WebFeatureUsageWebhookOutput, WebhookEventDetailResponseData, WebhookEventResponseData, WebhookEventStatus, WebhookRequestType, WebhookResponseData, WebhookStatus, + WhoAmIResponseData, ) from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError, UnauthorizedError from . import ( @@ -291,32 +348,37 @@ checkout, companies, components, + componentspublic, credits, dataexports, entitlements, events, features, + planbundle, plangroups, + planmigrations, plans, + scheduledcheckout, webhooks, ) from .accesstokens import IssueTemporaryAccessTokenResponse from .accounts import ( CountApiKeysParams, CountApiKeysResponse, - CountApiRequestsParams, - CountApiRequestsResponse, + CountAuditLogsParams, + CountAuditLogsResponse, CreateApiKeyResponse, CreateEnvironmentResponse, DeleteApiKeyResponse, DeleteEnvironmentResponse, GetApiKeyResponse, - GetApiRequestResponse, + GetAuditLogResponse, GetEnvironmentResponse, + GetWhoAmIResponse, ListApiKeysParams, ListApiKeysResponse, - ListApiRequestsParams, - ListApiRequestsResponse, + ListAuditLogsParams, + ListAuditLogsResponse, ListEnvironmentsParams, ListEnvironmentsResponse, QuickstartResponse, @@ -366,8 +428,6 @@ ) from .client import AsyncSchematic, AsyncSchematicConfig, LocalCache, Schematic, SchematicConfig from .companies import ( - CountCompaniesForAdvancedFilterParams, - CountCompaniesForAdvancedFilterResponse, CountCompaniesParams, CountCompaniesResponse, CountEntityKeyDefinitionsParams, @@ -399,8 +459,6 @@ GetPlanChangeResponse, GetPlanTraitResponse, GetUserResponse, - ListCompaniesForAdvancedFilterParams, - ListCompaniesForAdvancedFilterResponse, ListCompaniesParams, ListCompaniesResponse, ListCompanyMembershipsParams, @@ -439,6 +497,7 @@ PreviewComponentDataResponse, UpdateComponentResponse, ) + from .componentspublic import GetPublicPlansResponse from .credits import ( CountBillingCreditsGrantsParams, CountBillingCreditsGrantsResponse, @@ -446,8 +505,12 @@ CountBillingCreditsResponse, CountBillingPlanCreditGrantsParams, CountBillingPlanCreditGrantsResponse, + CountCompanyGrantsParams, + CountCompanyGrantsResponse, CountCreditBundlesParams, CountCreditBundlesResponse, + CountCreditEventLedgerParams, + CountCreditEventLedgerResponse, CountCreditLedgerParams, CountCreditLedgerResponse, CreateBillingCreditResponse, @@ -469,6 +532,8 @@ ListCompanyGrantsResponse, ListCreditBundlesParams, ListCreditBundlesResponse, + ListCreditEventLedgerParams, + ListCreditEventLedgerResponse, ListGrantsForCreditParams, ListGrantsForCreditResponse, SoftDeleteBillingCreditResponse, @@ -501,6 +566,8 @@ GetCompanyOverrideResponse, GetFeatureUsageByCompanyParams, GetFeatureUsageByCompanyResponse, + GetFeatureUsageTimeSeriesParams, + GetFeatureUsageTimeSeriesResponse, GetPlanEntitlementResponse, ListCompanyOverridesParams, ListCompanyOverridesResponse, @@ -552,21 +619,43 @@ UpdateFlagResponse, UpdateFlagRulesResponse, ) - from .plangroups import CreatePlanGroupResponse, GetPlanGroupResponse, UpdatePlanGroupResponse + from .planbundle import CreatePlanBundleResponse, UpdatePlanBundleResponse + from .plangroups import CreatePlanGroupResponse, GetPlanGroupParams, GetPlanGroupResponse, UpdatePlanGroupResponse + from .planmigrations import ( + CountCompanyMigrationsParams, + CountCompanyMigrationsResponse, + CountMigrationsParams, + CountMigrationsResponse, + GetMigrationResponse, + ListCompanyMigrationsParams, + ListCompanyMigrationsResponse, + ListMigrationsParams, + ListMigrationsResponse, + ) from .plans import ( CountPlansParams, CountPlansResponse, CreatePlanResponse, DeletePlanResponse, + DeletePlanVersionResponse, + GetPlanParams, GetPlanResponse, ListPlanIssuesParams, ListPlanIssuesResponse, ListPlansParams, ListPlansResponse, + PublishPlanVersionResponse, UpdateCompanyPlansResponse, UpdatePlanResponse, UpsertBillingProductPlanResponse, ) + from .scheduledcheckout import ( + CreateScheduledCheckoutResponse, + GetScheduledCheckoutResponse, + ListScheduledCheckoutsParams, + ListScheduledCheckoutsResponse, + UpdateScheduledCheckoutResponse, + ) from .version import __version__ from .webhooks import ( CountWebhookEventsParams, @@ -584,14 +673,15 @@ UpdateWebhookResponse, ) _dynamic_imports: typing.Dict[str, str] = { + "ActorType": ".types", "ApiError": ".types", "ApiKeyCreateResponseData": ".types", - "ApiKeyRequestListResponseData": ".types", - "ApiKeyRequestResponseData": ".types", "ApiKeyResponseData": ".types", "ApiKeyScope": ".types", "AsyncSchematic": ".client", "AsyncSchematicConfig": ".client", + "AuditLogListResponseData": ".types", + "AuditLogResponseData": ".types", "BadRequestError": ".errors", "BillingCouponResponseData": ".types", "BillingCreditBundleResponseData": ".types", @@ -607,6 +697,7 @@ "BillingCreditLedgerResponseData": ".types", "BillingCreditResponseData": ".types", "BillingCreditRolloverPolicy": ".types", + "BillingCreditView": ".types", "BillingCustomerResponseData": ".types", "BillingCustomerSubscription": ".types", "BillingCustomerWithSubscriptionsResponseData": ".types", @@ -635,6 +726,8 @@ "BillingSubscriptionView": ".types", "BillingTiersMode": ".types", "CancelSubscriptionResponse": ".checkout", + "CaptureRawEvent": ".types", + "CaptureRawEventBatch": ".types", "ChangeSubscriptionInternalRequestBody": ".types", "ChangeSubscriptionRequestBody": ".types", "ChargeType": ".types", @@ -661,7 +754,6 @@ "CompanyPlanWithBillingSubView": ".types", "CompanyResponseData": ".types", "CompanySubscriptionResponseData": ".types", - "CompanyViewWithFeatureUsageResponseData": ".types", "CompatiblePlans": ".types", "CompatiblePlansResponseData": ".types", "ComponentCapabilities": ".types", @@ -676,13 +768,17 @@ "Condition": ".types", "ConditionConditionType": ".types", "ConditionGroup": ".types", + "ConditionGroupResponseData": ".types", + "ConditionGroupView": ".types", "ConditionMetricPeriod": ".types", "ConditionMetricPeriodMonthReset": ".types", "ConditionOperator": ".types", + "ConditionResponseData": ".types", + "ConditionView": ".types", "CountApiKeysParams": ".accounts", "CountApiKeysResponse": ".accounts", - "CountApiRequestsParams": ".accounts", - "CountApiRequestsResponse": ".accounts", + "CountAuditLogsParams": ".accounts", + "CountAuditLogsResponse": ".accounts", "CountBillingCreditsGrantsParams": ".credits", "CountBillingCreditsGrantsResponse": ".credits", "CountBillingCreditsParams": ".credits", @@ -691,16 +787,20 @@ "CountBillingPlanCreditGrantsResponse": ".credits", "CountBillingProductsParams": ".billing", "CountBillingProductsResponse": ".billing", - "CountCompaniesForAdvancedFilterParams": ".companies", - "CountCompaniesForAdvancedFilterResponse": ".companies", "CountCompaniesParams": ".companies", "CountCompaniesResponse": ".companies", + "CountCompanyGrantsParams": ".credits", + "CountCompanyGrantsResponse": ".credits", + "CountCompanyMigrationsParams": ".planmigrations", + "CountCompanyMigrationsResponse": ".planmigrations", "CountCompanyOverridesParams": ".entitlements", "CountCompanyOverridesResponse": ".entitlements", "CountComponentsParams": ".components", "CountComponentsResponse": ".components", "CountCreditBundlesParams": ".credits", "CountCreditBundlesResponse": ".credits", + "CountCreditEventLedgerParams": ".credits", + "CountCreditEventLedgerResponse": ".credits", "CountCreditLedgerParams": ".credits", "CountCreditLedgerResponse": ".credits", "CountCustomersParams": ".billing", @@ -719,6 +819,8 @@ "CountFeaturesResponse": ".features", "CountFlagsParams": ".features", "CountFlagsResponse": ".features", + "CountMigrationsParams": ".planmigrations", + "CountMigrationsResponse": ".planmigrations", "CountPlanEntitlementsParams": ".entitlements", "CountPlanEntitlementsResponse": ".entitlements", "CountPlanTraitsParams": ".companies", @@ -735,6 +837,7 @@ "CouponRequestBody": ".types", "CreateApiKeyResponse": ".accounts", "CreateBillingCreditResponse": ".credits", + "CreateBillingPlanCreditGrantRequestBody": ".types", "CreateBillingPlanCreditGrantResponse": ".credits", "CreateBillingPriceTierRequestBody": ".types", "CreateCompanyOverrideRequestBodyMetricPeriod": ".entitlements", @@ -744,6 +847,9 @@ "CreateComponentResponse": ".components", "CreateCreditBundleResponse": ".credits", "CreateDataExportResponse": ".dataexports", + "CreateEntitlementInBundleRequestBody": ".types", + "CreateEntitlementInBundleRequestBodyMetricPeriod": ".types", + "CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset": ".types", "CreateEntitlementReqCommon": ".types", "CreateEntitlementReqCommonMetricPeriod": ".types", "CreateEntitlementReqCommonMetricPeriodMonthReset": ".types", @@ -763,18 +869,23 @@ "CreateOrUpdateFlagRequestBody": ".types", "CreateOrUpdateRuleRequestBody": ".types", "CreateOrUpdateRuleRequestBodyRuleType": ".types", + "CreatePlanBundleResponse": ".planbundle", "CreatePlanEntitlementRequestBodyMetricPeriod": ".entitlements", "CreatePlanEntitlementRequestBodyMetricPeriodMonthReset": ".entitlements", "CreatePlanEntitlementResponse": ".entitlements", "CreatePlanGroupResponse": ".plangroups", + "CreatePlanRequestBody": ".types", "CreatePlanResponse": ".plans", "CreatePlanTraitResponse": ".companies", "CreatePriceTierRequestBody": ".types", + "CreateScheduledCheckoutResponse": ".scheduledcheckout", "CreateUserResponse": ".companies", "CreateWebhookResponse": ".webhooks", "CreditAutoTopupAmountType": ".types", "CreditBundlePurchaseResponseData": ".types", "CreditCompanyGrantView": ".types", + "CreditEventLedgerResponseData": ".types", + "CreditEventType": ".types", "CreditGrantDetail": ".types", "CreditGrantExpiryRequestBody": ".types", "CreditGrantSortOrder": ".types", @@ -785,15 +896,21 @@ "CreditTriggerConfig": ".types", "CreditUsage": ".types", "CreditUsageAggregation": ".types", - "CreditUsageResponseData": ".types", + "CreditsAutoTopupCompanySummary": ".types", + "CreditsAutoTopupCreditSummary": ".types", + "CreditsAutoTopupHardFailure": ".types", + "CreditsAutoTopupRetryFailure": ".types", "CustomPlanConfig": ".types", "CustomPlanViewConfigResponseData": ".types", + "DataEventPayload": ".types", "DataExportOutputFileType": ".types", "DataExportResponseData": ".types", "DataExportStatus": ".types", "DataExportType": ".types", + "DatastreamCompanyPlan": ".types", "DeleteApiKeyResponse": ".accounts", "DeleteBillingPlanCreditGrantParams": ".credits", + "DeleteBillingPlanCreditGrantRequestBody": ".types", "DeleteBillingPlanCreditGrantResponse": ".credits", "DeleteBillingProductResponse": ".billing", "DeleteCompanyByKeysResponse": ".companies", @@ -809,6 +926,7 @@ "DeletePlanEntitlementResponse": ".entitlements", "DeletePlanResponse": ".plans", "DeletePlanTraitResponse": ".companies", + "DeletePlanVersionResponse": ".plans", "DeleteProductPriceResponse": ".billing", "DeleteResponse": ".types", "DeleteUserByKeysResponse": ".companies", @@ -845,22 +963,28 @@ "FeatureCompanyResponseData": ".types", "FeatureCompanyUserResponseData": ".types", "FeatureDetailResponseData": ".types", + "FeatureEntitlement": ".types", + "FeatureEntitlementMetricPeriod": ".types", + "FeatureEntitlementMonthReset": ".types", "FeatureLedgerResponseData": ".types", "FeatureLifecyclePhase": ".types", "FeatureResponseData": ".types", "FeatureType": ".types", - "FeatureUsageDataResponseData": ".types", "FeatureUsageDetailResponseData": ".types", + "FeatureUsageLegacyResponseData": ".types", "FeatureUsageResponseData": ".types", + "FeatureUsageTimeSeriesResponseData": ".types", + "FeatureView": ".types", "FlagDetailResponseData": ".types", "FlagResponseData": ".types", "FlagType": ".types", + "FlagView": ".types", "ForbiddenError": ".errors", "GenericPreviewObject": ".types", "GetActiveCompanySubscriptionParams": ".companies", "GetActiveCompanySubscriptionResponse": ".companies", "GetApiKeyResponse": ".accounts", - "GetApiRequestResponse": ".accounts", + "GetAuditLogResponse": ".accounts", "GetCheckoutDataResponse": ".checkout", "GetCompanyOverrideResponse": ".entitlements", "GetCompanyResponse": ".companies", @@ -878,30 +1002,40 @@ "GetFeatureResponse": ".features", "GetFeatureUsageByCompanyParams": ".entitlements", "GetFeatureUsageByCompanyResponse": ".entitlements", + "GetFeatureUsageTimeSeriesParams": ".entitlements", + "GetFeatureUsageTimeSeriesResponse": ".entitlements", "GetFlagResponse": ".features", + "GetMigrationResponse": ".planmigrations", "GetOrCreateCompanyMembershipResponse": ".companies", "GetOrCreateEntityTraitDefinitionResponse": ".companies", "GetPlanChangeResponse": ".companies", "GetPlanEntitlementResponse": ".entitlements", + "GetPlanGroupParams": ".plangroups", "GetPlanGroupResponse": ".plangroups", + "GetPlanParams": ".plans", "GetPlanResponse": ".plans", "GetPlanTraitResponse": ".companies", + "GetPublicPlansResponse": ".componentspublic", + "GetScheduledCheckoutResponse": ".scheduledcheckout", "GetSegmentIntegrationStatusResponse": ".events", "GetSingleBillingCreditResponse": ".credits", "GetUserResponse": ".companies", "GetWebhookEventResponse": ".webhooks", "GetWebhookResponse": ".webhooks", + "GetWhoAmIResponse": ".accounts", "GrantBillingCreditsToCompanyResponse": ".credits", "InternalServerError": ".errors", "InvoiceRequestBody": ".types", "InvoiceResponseData": ".types", + "InvoiceStatus": ".types", "IssueTemporaryAccessTokenResponse": ".accesstokens", "IssueTemporaryAccessTokenResponseData": ".types", "KeysRequestBody": ".types", + "LimitTimeSeriesPointResponseData": ".types", "ListApiKeysParams": ".accounts", "ListApiKeysResponse": ".accounts", - "ListApiRequestsParams": ".accounts", - "ListApiRequestsResponse": ".accounts", + "ListAuditLogsParams": ".accounts", + "ListAuditLogsResponse": ".accounts", "ListBillingCreditsParams": ".credits", "ListBillingCreditsResponse": ".credits", "ListBillingPlanCreditGrantsParams": ".credits", @@ -912,14 +1046,14 @@ "ListBillingProductPricesResponse": ".billing", "ListBillingProductsParams": ".billing", "ListBillingProductsResponse": ".billing", - "ListCompaniesForAdvancedFilterParams": ".companies", - "ListCompaniesForAdvancedFilterResponse": ".companies", "ListCompaniesParams": ".companies", "ListCompaniesResponse": ".companies", "ListCompanyGrantsParams": ".credits", "ListCompanyGrantsResponse": ".credits", "ListCompanyMembershipsParams": ".companies", "ListCompanyMembershipsResponse": ".companies", + "ListCompanyMigrationsParams": ".planmigrations", + "ListCompanyMigrationsResponse": ".planmigrations", "ListCompanyOverridesParams": ".entitlements", "ListCompanyOverridesResponse": ".entitlements", "ListComponentsParams": ".components", @@ -928,6 +1062,8 @@ "ListCouponsResponse": ".billing", "ListCreditBundlesParams": ".credits", "ListCreditBundlesResponse": ".credits", + "ListCreditEventLedgerParams": ".credits", + "ListCreditEventLedgerResponse": ".credits", "ListCustomersWithSubscriptionsParams": ".billing", "ListCustomersWithSubscriptionsResponse": ".billing", "ListEntityKeyDefinitionsParams": ".companies", @@ -954,6 +1090,8 @@ "ListInvoicesResponse": ".billing", "ListMetersParams": ".billing", "ListMetersResponse": ".billing", + "ListMigrationsParams": ".planmigrations", + "ListMigrationsResponse": ".planmigrations", "ListPaymentMethodsParams": ".billing", "ListPaymentMethodsResponse": ".billing", "ListPlanChangesParams": ".companies", @@ -966,6 +1104,8 @@ "ListPlanTraitsResponse": ".companies", "ListPlansParams": ".plans", "ListPlansResponse": ".plans", + "ListScheduledCheckoutsParams": ".scheduledcheckout", + "ListScheduledCheckoutsResponse": ".scheduledcheckout", "ListUsersParams": ".companies", "ListUsersResponse": ".companies", "ListWebhookEventsParams": ".webhooks", @@ -986,8 +1126,11 @@ "OrderedPlansInGroup": ".types", "PaymentMethodRequestBody": ".types", "PaymentMethodResponseData": ".types", + "PlanBundleAction": ".types", + "PlanBundleCreditGrantRequestBody": ".types", + "PlanBundleEntitlementRequestBody": ".types", + "PlanBundleResponseData": ".types", "PlanChangeAction": ".types", - "PlanChangeActorType": ".types", "PlanChangeBasePlanAction": ".types", "PlanChangeResponseData": ".types", "PlanChangeSubscriptionAction": ".types", @@ -1007,6 +1150,15 @@ "PlanSnapshotView": ".types", "PlanTraitResponseData": ".types", "PlanType": ".types", + "PlanVersionCompanyMigrationResponseData": ".types", + "PlanVersionCompanyMigrationStatus": ".types", + "PlanVersionMigrationResponseData": ".types", + "PlanVersionMigrationStatus": ".types", + "PlanVersionMigrationStrategy": ".types", + "PlanVersionResponseData": ".types", + "PlanVersionSnapshotView": ".types", + "PlanVersionStatus": ".types", + "PlanViewPublicResponseData": ".types", "PreviewCheckoutInternalResponse": ".checkout", "PreviewComponentDataParams": ".components", "PreviewComponentDataResponse": ".components", @@ -1017,6 +1169,8 @@ "PreviewSubscriptionFinanceResponseData": ".types", "PreviewSubscriptionUpcomingInvoiceLineItems": ".types", "ProrationBehavior": ".types", + "PublicPlansResponseData": ".types", + "PublishPlanVersionResponse": ".plans", "QuickstartResp": ".types", "QuickstartResponse": ".accounts", "RawEventBatchResponseData": ".types", @@ -1029,6 +1183,7 @@ "RuleDetailResponseData": ".types", "RuleResponseData": ".types", "RuleRuleType": ".types", + "RuleView": ".types", "RulesDetailResponseData": ".types", "RulesEngineSchemaVersion": ".types", "RulesengineCheckFlagResult": ".types", @@ -1044,7 +1199,11 @@ "RulesengineConditionMetricPeriod": ".types", "RulesengineConditionMetricPeriodMonthReset": ".types", "RulesengineConditionOperator": ".types", + "RulesengineEntitlementValueType": ".types", "RulesengineEntityType": ".types", + "RulesengineFeatureEntitlement": ".types", + "RulesengineFeatureEntitlementMetricPeriod": ".types", + "RulesengineFeatureEntitlementMonthReset": ".types", "RulesengineFlag": ".types", "RulesengineRule": ".types", "RulesengineRuleRuleType": ".types", @@ -1053,6 +1212,10 @@ "RulesengineTraitDefinition": ".types", "RulesengineTraitDefinitionComparableType": ".types", "RulesengineUser": ".types", + "ScheduledCheckoutResponseData": ".types", + "ScheduledCheckoutStatus": ".types", + "ScheduledDowngradeConfigBehavior": ".types", + "ScheduledDowngradeResponseData": ".types", "Schematic": ".client", "SchematicConfig": ".client", "SchematicEnvironment": ".environment", @@ -1067,6 +1230,7 @@ "SubscriptionType": ".types", "TemporaryAccessTokenResourceType": ".types", "TemporaryAccessTokenResponseData": ".types", + "TimeSeriesGranularity": ".types", "TraitDefinition": ".types", "TraitDefinitionComparableType": ".types", "TraitType": ".types", @@ -1074,6 +1238,7 @@ "UpdateAddOnRequestBody": ".types", "UpdateApiKeyResponse": ".accounts", "UpdateBillingCreditResponse": ".credits", + "UpdateBillingPlanCreditGrantRequestBody": ".types", "UpdateBillingPlanCreditGrantResponse": ".credits", "UpdateCompanyOverrideRequestBodyMetricPeriod": ".entitlements", "UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset": ".entitlements", @@ -1092,21 +1257,25 @@ "UpdateFlagResponse": ".features", "UpdateFlagRulesResponse": ".features", "UpdatePayInAdvanceRequestBody": ".types", + "UpdatePlanBundleResponse": ".planbundle", "UpdatePlanEntitlementRequestBodyMetricPeriod": ".entitlements", "UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset": ".entitlements", "UpdatePlanEntitlementResponse": ".entitlements", "UpdatePlanGroupResponse": ".plangroups", + "UpdatePlanRequestBody": ".types", "UpdatePlanResponse": ".plans", "UpdatePlanTraitResponse": ".companies", "UpdatePlanTraitTraitRequestBody": ".types", "UpdatePlanTraitsBulkResponse": ".companies", "UpdateRuleRequestBody": ".types", + "UpdateScheduledCheckoutResponse": ".scheduledcheckout", "UpdateWebhookResponse": ".webhooks", "UpsertBillingCouponResponse": ".billing", "UpsertBillingCustomerResponse": ".billing", "UpsertBillingMeterResponse": ".billing", "UpsertBillingPriceResponse": ".billing", "UpsertBillingProductPlanResponse": ".plans", + "UpsertBillingProductRequestBody": ".types", "UpsertBillingProductResponse": ".billing", "UpsertBillingSubscriptionResponse": ".billing", "UpsertCompanyRequestBody": ".types", @@ -1121,14 +1290,17 @@ "UpsertUserTraitResponse": ".companies", "UsageBasedEntitlementRequestBody": ".types", "UsageBasedEntitlementResponseData": ".types", + "UsageTimeSeriesPointResponseData": ".types", "UserDetailResponseData": ".types", "UserResponseData": ".types", + "WebFeatureUsageWebhookOutput": ".types", "WebhookEventDetailResponseData": ".types", "WebhookEventResponseData": ".types", "WebhookEventStatus": ".types", "WebhookRequestType": ".types", "WebhookResponseData": ".types", "WebhookStatus": ".types", + "WhoAmIResponseData": ".types", "ZeroOutGrantResponse": ".credits", "__version__": ".version", "accesstokens": ".accesstokens", @@ -1137,13 +1309,17 @@ "checkout": ".checkout", "companies": ".companies", "components": ".components", + "componentspublic": ".componentspublic", "credits": ".credits", "dataexports": ".dataexports", "entitlements": ".entitlements", "events": ".events", "features": ".features", + "planbundle": ".planbundle", "plangroups": ".plangroups", + "planmigrations": ".planmigrations", "plans": ".plans", + "scheduledcheckout": ".scheduledcheckout", "webhooks": ".webhooks", } @@ -1170,14 +1346,15 @@ def __dir__(): __all__ = [ + "ActorType", "ApiError", "ApiKeyCreateResponseData", - "ApiKeyRequestListResponseData", - "ApiKeyRequestResponseData", "ApiKeyResponseData", "ApiKeyScope", "AsyncSchematic", "AsyncSchematicConfig", + "AuditLogListResponseData", + "AuditLogResponseData", "BadRequestError", "BillingCouponResponseData", "BillingCreditBundleResponseData", @@ -1193,6 +1370,7 @@ def __dir__(): "BillingCreditLedgerResponseData", "BillingCreditResponseData", "BillingCreditRolloverPolicy", + "BillingCreditView", "BillingCustomerResponseData", "BillingCustomerSubscription", "BillingCustomerWithSubscriptionsResponseData", @@ -1221,6 +1399,8 @@ def __dir__(): "BillingSubscriptionView", "BillingTiersMode", "CancelSubscriptionResponse", + "CaptureRawEvent", + "CaptureRawEventBatch", "ChangeSubscriptionInternalRequestBody", "ChangeSubscriptionRequestBody", "ChargeType", @@ -1247,7 +1427,6 @@ def __dir__(): "CompanyPlanWithBillingSubView", "CompanyResponseData", "CompanySubscriptionResponseData", - "CompanyViewWithFeatureUsageResponseData", "CompatiblePlans", "CompatiblePlansResponseData", "ComponentCapabilities", @@ -1262,13 +1441,17 @@ def __dir__(): "Condition", "ConditionConditionType", "ConditionGroup", + "ConditionGroupResponseData", + "ConditionGroupView", "ConditionMetricPeriod", "ConditionMetricPeriodMonthReset", "ConditionOperator", + "ConditionResponseData", + "ConditionView", "CountApiKeysParams", "CountApiKeysResponse", - "CountApiRequestsParams", - "CountApiRequestsResponse", + "CountAuditLogsParams", + "CountAuditLogsResponse", "CountBillingCreditsGrantsParams", "CountBillingCreditsGrantsResponse", "CountBillingCreditsParams", @@ -1277,16 +1460,20 @@ def __dir__(): "CountBillingPlanCreditGrantsResponse", "CountBillingProductsParams", "CountBillingProductsResponse", - "CountCompaniesForAdvancedFilterParams", - "CountCompaniesForAdvancedFilterResponse", "CountCompaniesParams", "CountCompaniesResponse", + "CountCompanyGrantsParams", + "CountCompanyGrantsResponse", + "CountCompanyMigrationsParams", + "CountCompanyMigrationsResponse", "CountCompanyOverridesParams", "CountCompanyOverridesResponse", "CountComponentsParams", "CountComponentsResponse", "CountCreditBundlesParams", "CountCreditBundlesResponse", + "CountCreditEventLedgerParams", + "CountCreditEventLedgerResponse", "CountCreditLedgerParams", "CountCreditLedgerResponse", "CountCustomersParams", @@ -1305,6 +1492,8 @@ def __dir__(): "CountFeaturesResponse", "CountFlagsParams", "CountFlagsResponse", + "CountMigrationsParams", + "CountMigrationsResponse", "CountPlanEntitlementsParams", "CountPlanEntitlementsResponse", "CountPlanTraitsParams", @@ -1321,6 +1510,7 @@ def __dir__(): "CouponRequestBody", "CreateApiKeyResponse", "CreateBillingCreditResponse", + "CreateBillingPlanCreditGrantRequestBody", "CreateBillingPlanCreditGrantResponse", "CreateBillingPriceTierRequestBody", "CreateCompanyOverrideRequestBodyMetricPeriod", @@ -1330,6 +1520,9 @@ def __dir__(): "CreateComponentResponse", "CreateCreditBundleResponse", "CreateDataExportResponse", + "CreateEntitlementInBundleRequestBody", + "CreateEntitlementInBundleRequestBodyMetricPeriod", + "CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset", "CreateEntitlementReqCommon", "CreateEntitlementReqCommonMetricPeriod", "CreateEntitlementReqCommonMetricPeriodMonthReset", @@ -1349,18 +1542,23 @@ def __dir__(): "CreateOrUpdateFlagRequestBody", "CreateOrUpdateRuleRequestBody", "CreateOrUpdateRuleRequestBodyRuleType", + "CreatePlanBundleResponse", "CreatePlanEntitlementRequestBodyMetricPeriod", "CreatePlanEntitlementRequestBodyMetricPeriodMonthReset", "CreatePlanEntitlementResponse", "CreatePlanGroupResponse", + "CreatePlanRequestBody", "CreatePlanResponse", "CreatePlanTraitResponse", "CreatePriceTierRequestBody", + "CreateScheduledCheckoutResponse", "CreateUserResponse", "CreateWebhookResponse", "CreditAutoTopupAmountType", "CreditBundlePurchaseResponseData", "CreditCompanyGrantView", + "CreditEventLedgerResponseData", + "CreditEventType", "CreditGrantDetail", "CreditGrantExpiryRequestBody", "CreditGrantSortOrder", @@ -1371,15 +1569,21 @@ def __dir__(): "CreditTriggerConfig", "CreditUsage", "CreditUsageAggregation", - "CreditUsageResponseData", + "CreditsAutoTopupCompanySummary", + "CreditsAutoTopupCreditSummary", + "CreditsAutoTopupHardFailure", + "CreditsAutoTopupRetryFailure", "CustomPlanConfig", "CustomPlanViewConfigResponseData", + "DataEventPayload", "DataExportOutputFileType", "DataExportResponseData", "DataExportStatus", "DataExportType", + "DatastreamCompanyPlan", "DeleteApiKeyResponse", "DeleteBillingPlanCreditGrantParams", + "DeleteBillingPlanCreditGrantRequestBody", "DeleteBillingPlanCreditGrantResponse", "DeleteBillingProductResponse", "DeleteCompanyByKeysResponse", @@ -1395,6 +1599,7 @@ def __dir__(): "DeletePlanEntitlementResponse", "DeletePlanResponse", "DeletePlanTraitResponse", + "DeletePlanVersionResponse", "DeleteProductPriceResponse", "DeleteResponse", "DeleteUserByKeysResponse", @@ -1431,22 +1636,28 @@ def __dir__(): "FeatureCompanyResponseData", "FeatureCompanyUserResponseData", "FeatureDetailResponseData", + "FeatureEntitlement", + "FeatureEntitlementMetricPeriod", + "FeatureEntitlementMonthReset", "FeatureLedgerResponseData", "FeatureLifecyclePhase", "FeatureResponseData", "FeatureType", - "FeatureUsageDataResponseData", "FeatureUsageDetailResponseData", + "FeatureUsageLegacyResponseData", "FeatureUsageResponseData", + "FeatureUsageTimeSeriesResponseData", + "FeatureView", "FlagDetailResponseData", "FlagResponseData", "FlagType", + "FlagView", "ForbiddenError", "GenericPreviewObject", "GetActiveCompanySubscriptionParams", "GetActiveCompanySubscriptionResponse", "GetApiKeyResponse", - "GetApiRequestResponse", + "GetAuditLogResponse", "GetCheckoutDataResponse", "GetCompanyOverrideResponse", "GetCompanyResponse", @@ -1464,30 +1675,40 @@ def __dir__(): "GetFeatureResponse", "GetFeatureUsageByCompanyParams", "GetFeatureUsageByCompanyResponse", + "GetFeatureUsageTimeSeriesParams", + "GetFeatureUsageTimeSeriesResponse", "GetFlagResponse", + "GetMigrationResponse", "GetOrCreateCompanyMembershipResponse", "GetOrCreateEntityTraitDefinitionResponse", "GetPlanChangeResponse", "GetPlanEntitlementResponse", + "GetPlanGroupParams", "GetPlanGroupResponse", + "GetPlanParams", "GetPlanResponse", "GetPlanTraitResponse", + "GetPublicPlansResponse", + "GetScheduledCheckoutResponse", "GetSegmentIntegrationStatusResponse", "GetSingleBillingCreditResponse", "GetUserResponse", "GetWebhookEventResponse", "GetWebhookResponse", + "GetWhoAmIResponse", "GrantBillingCreditsToCompanyResponse", "InternalServerError", "InvoiceRequestBody", "InvoiceResponseData", + "InvoiceStatus", "IssueTemporaryAccessTokenResponse", "IssueTemporaryAccessTokenResponseData", "KeysRequestBody", + "LimitTimeSeriesPointResponseData", "ListApiKeysParams", "ListApiKeysResponse", - "ListApiRequestsParams", - "ListApiRequestsResponse", + "ListAuditLogsParams", + "ListAuditLogsResponse", "ListBillingCreditsParams", "ListBillingCreditsResponse", "ListBillingPlanCreditGrantsParams", @@ -1498,14 +1719,14 @@ def __dir__(): "ListBillingProductPricesResponse", "ListBillingProductsParams", "ListBillingProductsResponse", - "ListCompaniesForAdvancedFilterParams", - "ListCompaniesForAdvancedFilterResponse", "ListCompaniesParams", "ListCompaniesResponse", "ListCompanyGrantsParams", "ListCompanyGrantsResponse", "ListCompanyMembershipsParams", "ListCompanyMembershipsResponse", + "ListCompanyMigrationsParams", + "ListCompanyMigrationsResponse", "ListCompanyOverridesParams", "ListCompanyOverridesResponse", "ListComponentsParams", @@ -1514,6 +1735,8 @@ def __dir__(): "ListCouponsResponse", "ListCreditBundlesParams", "ListCreditBundlesResponse", + "ListCreditEventLedgerParams", + "ListCreditEventLedgerResponse", "ListCustomersWithSubscriptionsParams", "ListCustomersWithSubscriptionsResponse", "ListEntityKeyDefinitionsParams", @@ -1540,6 +1763,8 @@ def __dir__(): "ListInvoicesResponse", "ListMetersParams", "ListMetersResponse", + "ListMigrationsParams", + "ListMigrationsResponse", "ListPaymentMethodsParams", "ListPaymentMethodsResponse", "ListPlanChangesParams", @@ -1552,6 +1777,8 @@ def __dir__(): "ListPlanTraitsResponse", "ListPlansParams", "ListPlansResponse", + "ListScheduledCheckoutsParams", + "ListScheduledCheckoutsResponse", "ListUsersParams", "ListUsersResponse", "ListWebhookEventsParams", @@ -1572,8 +1799,11 @@ def __dir__(): "OrderedPlansInGroup", "PaymentMethodRequestBody", "PaymentMethodResponseData", + "PlanBundleAction", + "PlanBundleCreditGrantRequestBody", + "PlanBundleEntitlementRequestBody", + "PlanBundleResponseData", "PlanChangeAction", - "PlanChangeActorType", "PlanChangeBasePlanAction", "PlanChangeResponseData", "PlanChangeSubscriptionAction", @@ -1593,6 +1823,15 @@ def __dir__(): "PlanSnapshotView", "PlanTraitResponseData", "PlanType", + "PlanVersionCompanyMigrationResponseData", + "PlanVersionCompanyMigrationStatus", + "PlanVersionMigrationResponseData", + "PlanVersionMigrationStatus", + "PlanVersionMigrationStrategy", + "PlanVersionResponseData", + "PlanVersionSnapshotView", + "PlanVersionStatus", + "PlanViewPublicResponseData", "PreviewCheckoutInternalResponse", "PreviewComponentDataParams", "PreviewComponentDataResponse", @@ -1603,6 +1842,8 @@ def __dir__(): "PreviewSubscriptionFinanceResponseData", "PreviewSubscriptionUpcomingInvoiceLineItems", "ProrationBehavior", + "PublicPlansResponseData", + "PublishPlanVersionResponse", "QuickstartResp", "QuickstartResponse", "RawEventBatchResponseData", @@ -1615,6 +1856,7 @@ def __dir__(): "RuleDetailResponseData", "RuleResponseData", "RuleRuleType", + "RuleView", "RulesDetailResponseData", "RulesEngineSchemaVersion", "RulesengineCheckFlagResult", @@ -1630,7 +1872,11 @@ def __dir__(): "RulesengineConditionMetricPeriod", "RulesengineConditionMetricPeriodMonthReset", "RulesengineConditionOperator", + "RulesengineEntitlementValueType", "RulesengineEntityType", + "RulesengineFeatureEntitlement", + "RulesengineFeatureEntitlementMetricPeriod", + "RulesengineFeatureEntitlementMonthReset", "RulesengineFlag", "RulesengineRule", "RulesengineRuleRuleType", @@ -1639,6 +1885,10 @@ def __dir__(): "RulesengineTraitDefinition", "RulesengineTraitDefinitionComparableType", "RulesengineUser", + "ScheduledCheckoutResponseData", + "ScheduledCheckoutStatus", + "ScheduledDowngradeConfigBehavior", + "ScheduledDowngradeResponseData", "Schematic", "SchematicConfig", "SchematicEnvironment", @@ -1653,6 +1903,7 @@ def __dir__(): "SubscriptionType", "TemporaryAccessTokenResourceType", "TemporaryAccessTokenResponseData", + "TimeSeriesGranularity", "TraitDefinition", "TraitDefinitionComparableType", "TraitType", @@ -1660,6 +1911,7 @@ def __dir__(): "UpdateAddOnRequestBody", "UpdateApiKeyResponse", "UpdateBillingCreditResponse", + "UpdateBillingPlanCreditGrantRequestBody", "UpdateBillingPlanCreditGrantResponse", "UpdateCompanyOverrideRequestBodyMetricPeriod", "UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset", @@ -1678,21 +1930,25 @@ def __dir__(): "UpdateFlagResponse", "UpdateFlagRulesResponse", "UpdatePayInAdvanceRequestBody", + "UpdatePlanBundleResponse", "UpdatePlanEntitlementRequestBodyMetricPeriod", "UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset", "UpdatePlanEntitlementResponse", "UpdatePlanGroupResponse", + "UpdatePlanRequestBody", "UpdatePlanResponse", "UpdatePlanTraitResponse", "UpdatePlanTraitTraitRequestBody", "UpdatePlanTraitsBulkResponse", "UpdateRuleRequestBody", + "UpdateScheduledCheckoutResponse", "UpdateWebhookResponse", "UpsertBillingCouponResponse", "UpsertBillingCustomerResponse", "UpsertBillingMeterResponse", "UpsertBillingPriceResponse", "UpsertBillingProductPlanResponse", + "UpsertBillingProductRequestBody", "UpsertBillingProductResponse", "UpsertBillingSubscriptionResponse", "UpsertCompanyRequestBody", @@ -1707,14 +1963,17 @@ def __dir__(): "UpsertUserTraitResponse", "UsageBasedEntitlementRequestBody", "UsageBasedEntitlementResponseData", + "UsageTimeSeriesPointResponseData", "UserDetailResponseData", "UserResponseData", + "WebFeatureUsageWebhookOutput", "WebhookEventDetailResponseData", "WebhookEventResponseData", "WebhookEventStatus", "WebhookRequestType", "WebhookResponseData", "WebhookStatus", + "WhoAmIResponseData", "ZeroOutGrantResponse", "__version__", "accesstokens", @@ -1723,12 +1982,16 @@ def __dir__(): "checkout", "companies", "components", + "componentspublic", "credits", "dataexports", "entitlements", "events", "features", + "planbundle", "plangroups", + "planmigrations", "plans", + "scheduledcheckout", "webhooks", ] diff --git a/src/schematic/accounts/__init__.py b/src/schematic/accounts/__init__.py index b134589..5204404 100644 --- a/src/schematic/accounts/__init__.py +++ b/src/schematic/accounts/__init__.py @@ -9,19 +9,20 @@ from .types import ( CountApiKeysParams, CountApiKeysResponse, - CountApiRequestsParams, - CountApiRequestsResponse, + CountAuditLogsParams, + CountAuditLogsResponse, CreateApiKeyResponse, CreateEnvironmentResponse, DeleteApiKeyResponse, DeleteEnvironmentResponse, GetApiKeyResponse, - GetApiRequestResponse, + GetAuditLogResponse, GetEnvironmentResponse, + GetWhoAmIResponse, ListApiKeysParams, ListApiKeysResponse, - ListApiRequestsParams, - ListApiRequestsResponse, + ListAuditLogsParams, + ListAuditLogsResponse, ListEnvironmentsParams, ListEnvironmentsResponse, QuickstartResponse, @@ -31,19 +32,20 @@ _dynamic_imports: typing.Dict[str, str] = { "CountApiKeysParams": ".types", "CountApiKeysResponse": ".types", - "CountApiRequestsParams": ".types", - "CountApiRequestsResponse": ".types", + "CountAuditLogsParams": ".types", + "CountAuditLogsResponse": ".types", "CreateApiKeyResponse": ".types", "CreateEnvironmentResponse": ".types", "DeleteApiKeyResponse": ".types", "DeleteEnvironmentResponse": ".types", "GetApiKeyResponse": ".types", - "GetApiRequestResponse": ".types", + "GetAuditLogResponse": ".types", "GetEnvironmentResponse": ".types", + "GetWhoAmIResponse": ".types", "ListApiKeysParams": ".types", "ListApiKeysResponse": ".types", - "ListApiRequestsParams": ".types", - "ListApiRequestsResponse": ".types", + "ListAuditLogsParams": ".types", + "ListAuditLogsResponse": ".types", "ListEnvironmentsParams": ".types", "ListEnvironmentsResponse": ".types", "QuickstartResponse": ".types", @@ -76,19 +78,20 @@ def __dir__(): __all__ = [ "CountApiKeysParams", "CountApiKeysResponse", - "CountApiRequestsParams", - "CountApiRequestsResponse", + "CountAuditLogsParams", + "CountAuditLogsResponse", "CreateApiKeyResponse", "CreateEnvironmentResponse", "DeleteApiKeyResponse", "DeleteEnvironmentResponse", "GetApiKeyResponse", - "GetApiRequestResponse", + "GetAuditLogResponse", "GetEnvironmentResponse", + "GetWhoAmIResponse", "ListApiKeysParams", "ListApiKeysResponse", - "ListApiRequestsParams", - "ListApiRequestsResponse", + "ListAuditLogsParams", + "ListAuditLogsResponse", "ListEnvironmentsParams", "ListEnvironmentsResponse", "QuickstartResponse", diff --git a/src/schematic/accounts/client.py b/src/schematic/accounts/client.py index b24c03f..30e5ecb 100644 --- a/src/schematic/accounts/client.py +++ b/src/schematic/accounts/client.py @@ -1,22 +1,25 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions +from ..types.actor_type import ActorType from ..types.environment_type import EnvironmentType from .raw_client import AsyncRawAccountsClient, RawAccountsClient from .types.count_api_keys_response import CountApiKeysResponse -from .types.count_api_requests_response import CountApiRequestsResponse +from .types.count_audit_logs_response import CountAuditLogsResponse from .types.create_api_key_response import CreateApiKeyResponse from .types.create_environment_response import CreateEnvironmentResponse from .types.delete_api_key_response import DeleteApiKeyResponse from .types.delete_environment_response import DeleteEnvironmentResponse from .types.get_api_key_response import GetApiKeyResponse -from .types.get_api_request_response import GetApiRequestResponse +from .types.get_audit_log_response import GetAuditLogResponse from .types.get_environment_response import GetEnvironmentResponse +from .types.get_who_am_i_response import GetWhoAmIResponse from .types.list_api_keys_response import ListApiKeysResponse -from .types.list_api_requests_response import ListApiRequestsResponse +from .types.list_audit_logs_response import ListAuditLogsResponse from .types.list_environments_response import ListEnvironmentsResponse from .types.quickstart_response import QuickstartResponse from .types.update_api_key_response import UpdateApiKeyResponse @@ -100,6 +103,7 @@ def create_api_key( name: str, description: typing.Optional[str] = OMIT, environment_id: typing.Optional[str] = OMIT, + readonly: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateApiKeyResponse: """ @@ -111,6 +115,8 @@ def create_api_key( environment_id : typing.Optional[str] + readonly : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -131,7 +137,11 @@ def create_api_key( ) """ _response = self._raw_client.create_api_key( - name=name, description=description, environment_id=environment_id, request_options=request_options + name=name, + description=description, + environment_id=environment_id, + readonly=readonly, + request_options=request_options, ) return _response.data @@ -292,25 +302,31 @@ def count_api_keys( ) return _response.data - def list_api_requests( + def list_audit_logs( self, *, - q: typing.Optional[str] = None, - request_type: typing.Optional[str] = None, + actor_type: typing.Optional[ActorType] = None, + end_time: typing.Optional[dt.datetime] = None, environment_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + start_time: typing.Optional[dt.datetime] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> ListApiRequestsResponse: + ) -> ListAuditLogsResponse: """ Parameters ---------- - q : typing.Optional[str] + actor_type : typing.Optional[ActorType] - request_type : typing.Optional[str] + end_time : typing.Optional[dt.datetime] environment_id : typing.Optional[str] + q : typing.Optional[str] + + start_time : typing.Optional[dt.datetime] + limit : typing.Optional[int] Page limit (default 100) @@ -322,49 +338,59 @@ def list_api_requests( Returns ------- - ListApiRequestsResponse + ListAuditLogsResponse OK Examples -------- + import datetime + from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) - client.accounts.list_api_requests( - q="q", - request_type="request_type", + client.accounts.list_audit_logs( + actor_type="api_key", + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), environment_id="environment_id", + q="q", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), limit=1, offset=1, ) """ - _response = self._raw_client.list_api_requests( - q=q, - request_type=request_type, + _response = self._raw_client.list_audit_logs( + actor_type=actor_type, + end_time=end_time, environment_id=environment_id, + q=q, + start_time=start_time, limit=limit, offset=offset, request_options=request_options, ) return _response.data - def get_api_request( - self, api_request_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> GetApiRequestResponse: + def get_audit_log( + self, audit_log_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetAuditLogResponse: """ Parameters ---------- - api_request_id : str - api_request_id + audit_log_id : str + audit_log_id request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - GetApiRequestResponse + GetAuditLogResponse OK Examples @@ -374,32 +400,38 @@ def get_api_request( client = Schematic( api_key="YOUR_API_KEY", ) - client.accounts.get_api_request( - api_request_id="api_request_id", + client.accounts.get_audit_log( + audit_log_id="audit_log_id", ) """ - _response = self._raw_client.get_api_request(api_request_id, request_options=request_options) + _response = self._raw_client.get_audit_log(audit_log_id, request_options=request_options) return _response.data - def count_api_requests( + def count_audit_logs( self, *, - q: typing.Optional[str] = None, - request_type: typing.Optional[str] = None, + actor_type: typing.Optional[ActorType] = None, + end_time: typing.Optional[dt.datetime] = None, environment_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + start_time: typing.Optional[dt.datetime] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> CountApiRequestsResponse: + ) -> CountAuditLogsResponse: """ Parameters ---------- - q : typing.Optional[str] + actor_type : typing.Optional[ActorType] - request_type : typing.Optional[str] + end_time : typing.Optional[dt.datetime] environment_id : typing.Optional[str] + q : typing.Optional[str] + + start_time : typing.Optional[dt.datetime] + limit : typing.Optional[int] Page limit (default 100) @@ -411,28 +443,38 @@ def count_api_requests( Returns ------- - CountApiRequestsResponse + CountAuditLogsResponse OK Examples -------- + import datetime + from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) - client.accounts.count_api_requests( - q="q", - request_type="request_type", + client.accounts.count_audit_logs( + actor_type="api_key", + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), environment_id="environment_id", + q="q", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), limit=1, offset=1, ) """ - _response = self._raw_client.count_api_requests( - q=q, - request_type=request_type, + _response = self._raw_client.count_audit_logs( + actor_type=actor_type, + end_time=end_time, environment_id=environment_id, + q=q, + start_time=start_time, limit=limit, offset=offset, request_options=request_options, @@ -646,6 +688,30 @@ def quickstart(self, *, request_options: typing.Optional[RequestOptions] = None) _response = self._raw_client.quickstart(request_options=request_options) return _response.data + def get_who_am_i(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetWhoAmIResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetWhoAmIResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.accounts.get_who_am_i() + """ + _response = self._raw_client.get_who_am_i(request_options=request_options) + return _response.data + class AsyncAccountsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -729,6 +795,7 @@ async def create_api_key( name: str, description: typing.Optional[str] = OMIT, environment_id: typing.Optional[str] = OMIT, + readonly: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateApiKeyResponse: """ @@ -740,6 +807,8 @@ async def create_api_key( environment_id : typing.Optional[str] + readonly : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -768,7 +837,11 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.create_api_key( - name=name, description=description, environment_id=environment_id, request_options=request_options + name=name, + description=description, + environment_id=environment_id, + readonly=readonly, + request_options=request_options, ) return _response.data @@ -961,25 +1034,31 @@ async def main() -> None: ) return _response.data - async def list_api_requests( + async def list_audit_logs( self, *, - q: typing.Optional[str] = None, - request_type: typing.Optional[str] = None, + actor_type: typing.Optional[ActorType] = None, + end_time: typing.Optional[dt.datetime] = None, environment_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + start_time: typing.Optional[dt.datetime] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> ListApiRequestsResponse: + ) -> ListAuditLogsResponse: """ Parameters ---------- - q : typing.Optional[str] + actor_type : typing.Optional[ActorType] - request_type : typing.Optional[str] + end_time : typing.Optional[dt.datetime] environment_id : typing.Optional[str] + q : typing.Optional[str] + + start_time : typing.Optional[dt.datetime] + limit : typing.Optional[int] Page limit (default 100) @@ -991,12 +1070,13 @@ async def list_api_requests( Returns ------- - ListApiRequestsResponse + ListAuditLogsResponse OK Examples -------- import asyncio + import datetime from schematic import AsyncSchematic @@ -1006,10 +1086,16 @@ async def list_api_requests( async def main() -> None: - await client.accounts.list_api_requests( - q="q", - request_type="request_type", + await client.accounts.list_audit_logs( + actor_type="api_key", + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), environment_id="environment_id", + q="q", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), limit=1, offset=1, ) @@ -1017,31 +1103,33 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.list_api_requests( - q=q, - request_type=request_type, + _response = await self._raw_client.list_audit_logs( + actor_type=actor_type, + end_time=end_time, environment_id=environment_id, + q=q, + start_time=start_time, limit=limit, offset=offset, request_options=request_options, ) return _response.data - async def get_api_request( - self, api_request_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> GetApiRequestResponse: + async def get_audit_log( + self, audit_log_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetAuditLogResponse: """ Parameters ---------- - api_request_id : str - api_request_id + audit_log_id : str + audit_log_id request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - GetApiRequestResponse + GetAuditLogResponse OK Examples @@ -1056,35 +1144,41 @@ async def get_api_request( async def main() -> None: - await client.accounts.get_api_request( - api_request_id="api_request_id", + await client.accounts.get_audit_log( + audit_log_id="audit_log_id", ) asyncio.run(main()) """ - _response = await self._raw_client.get_api_request(api_request_id, request_options=request_options) + _response = await self._raw_client.get_audit_log(audit_log_id, request_options=request_options) return _response.data - async def count_api_requests( + async def count_audit_logs( self, *, - q: typing.Optional[str] = None, - request_type: typing.Optional[str] = None, + actor_type: typing.Optional[ActorType] = None, + end_time: typing.Optional[dt.datetime] = None, environment_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + start_time: typing.Optional[dt.datetime] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> CountApiRequestsResponse: + ) -> CountAuditLogsResponse: """ Parameters ---------- - q : typing.Optional[str] + actor_type : typing.Optional[ActorType] - request_type : typing.Optional[str] + end_time : typing.Optional[dt.datetime] environment_id : typing.Optional[str] + q : typing.Optional[str] + + start_time : typing.Optional[dt.datetime] + limit : typing.Optional[int] Page limit (default 100) @@ -1096,12 +1190,13 @@ async def count_api_requests( Returns ------- - CountApiRequestsResponse + CountAuditLogsResponse OK Examples -------- import asyncio + import datetime from schematic import AsyncSchematic @@ -1111,10 +1206,16 @@ async def count_api_requests( async def main() -> None: - await client.accounts.count_api_requests( - q="q", - request_type="request_type", + await client.accounts.count_audit_logs( + actor_type="api_key", + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), environment_id="environment_id", + q="q", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), limit=1, offset=1, ) @@ -1122,10 +1223,12 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.count_api_requests( - q=q, - request_type=request_type, + _response = await self._raw_client.count_audit_logs( + actor_type=actor_type, + end_time=end_time, environment_id=environment_id, + q=q, + start_time=start_time, limit=limit, offset=offset, request_options=request_options, @@ -1386,3 +1489,35 @@ async def main() -> None: """ _response = await self._raw_client.quickstart(request_options=request_options) return _response.data + + async def get_who_am_i(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetWhoAmIResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetWhoAmIResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.accounts.get_who_am_i() + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_who_am_i(request_options=request_options) + return _response.data diff --git a/src/schematic/accounts/raw_client.py b/src/schematic/accounts/raw_client.py index 82923a1..b3b5a37 100644 --- a/src/schematic/accounts/raw_client.py +++ b/src/schematic/accounts/raw_client.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from json.decoder import JSONDecodeError from ..core.api_error import ApiError as core_api_error_ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.datetime_utils import serialize_datetime from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.pydantic_utilities import parse_obj_as @@ -14,19 +16,21 @@ from ..errors.internal_server_error import InternalServerError from ..errors.not_found_error import NotFoundError from ..errors.unauthorized_error import UnauthorizedError +from ..types.actor_type import ActorType from ..types.api_error import ApiError as types_api_error_ApiError from ..types.environment_type import EnvironmentType from .types.count_api_keys_response import CountApiKeysResponse -from .types.count_api_requests_response import CountApiRequestsResponse +from .types.count_audit_logs_response import CountAuditLogsResponse from .types.create_api_key_response import CreateApiKeyResponse from .types.create_environment_response import CreateEnvironmentResponse from .types.delete_api_key_response import DeleteApiKeyResponse from .types.delete_environment_response import DeleteEnvironmentResponse from .types.get_api_key_response import GetApiKeyResponse -from .types.get_api_request_response import GetApiRequestResponse +from .types.get_audit_log_response import GetAuditLogResponse from .types.get_environment_response import GetEnvironmentResponse +from .types.get_who_am_i_response import GetWhoAmIResponse from .types.list_api_keys_response import ListApiKeysResponse -from .types.list_api_requests_response import ListApiRequestsResponse +from .types.list_audit_logs_response import ListAuditLogsResponse from .types.list_environments_response import ListEnvironmentsResponse from .types.quickstart_response import QuickstartResponse from .types.update_api_key_response import UpdateApiKeyResponse @@ -161,6 +165,7 @@ def create_api_key( name: str, description: typing.Optional[str] = OMIT, environment_id: typing.Optional[str] = OMIT, + readonly: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateApiKeyResponse]: """ @@ -172,6 +177,8 @@ def create_api_key( environment_id : typing.Optional[str] + readonly : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -187,6 +194,7 @@ def create_api_key( "description": description, "environment_id": environment_id, "name": name, + "readonly": readonly, }, headers={ "content-type": "application/json", @@ -677,25 +685,31 @@ def count_api_keys( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - def list_api_requests( + def list_audit_logs( self, *, - q: typing.Optional[str] = None, - request_type: typing.Optional[str] = None, + actor_type: typing.Optional[ActorType] = None, + end_time: typing.Optional[dt.datetime] = None, environment_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + start_time: typing.Optional[dt.datetime] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[ListApiRequestsResponse]: + ) -> HttpResponse[ListAuditLogsResponse]: """ Parameters ---------- - q : typing.Optional[str] + actor_type : typing.Optional[ActorType] - request_type : typing.Optional[str] + end_time : typing.Optional[dt.datetime] environment_id : typing.Optional[str] + q : typing.Optional[str] + + start_time : typing.Optional[dt.datetime] + limit : typing.Optional[int] Page limit (default 100) @@ -707,16 +721,18 @@ def list_api_requests( Returns ------- - HttpResponse[ListApiRequestsResponse] + HttpResponse[ListAuditLogsResponse] OK """ _response = self._client_wrapper.httpx_client.request( - "api-requests", + "audit-log", method="GET", params={ - "q": q, - "request_type": request_type, + "actor_type": actor_type, + "end_time": serialize_datetime(end_time) if end_time is not None else None, "environment_id": environment_id, + "q": q, + "start_time": serialize_datetime(start_time) if start_time is not None else None, "limit": limit, "offset": offset, }, @@ -725,9 +741,9 @@ def list_api_requests( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ListApiRequestsResponse, + ListAuditLogsResponse, parse_obj_as( - type_=ListApiRequestsResponse, # type: ignore + type_=ListAuditLogsResponse, # type: ignore object_=_response.json(), ), ) @@ -796,34 +812,34 @@ def list_api_requests( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - def get_api_request( - self, api_request_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[GetApiRequestResponse]: + def get_audit_log( + self, audit_log_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetAuditLogResponse]: """ Parameters ---------- - api_request_id : str - api_request_id + audit_log_id : str + audit_log_id request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[GetApiRequestResponse] + HttpResponse[GetAuditLogResponse] OK """ _response = self._client_wrapper.httpx_client.request( - f"api-requests/{jsonable_encoder(api_request_id)}", + f"audit-log/{jsonable_encoder(audit_log_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - GetApiRequestResponse, + GetAuditLogResponse, parse_obj_as( - type_=GetApiRequestResponse, # type: ignore + type_=GetAuditLogResponse, # type: ignore object_=_response.json(), ), ) @@ -881,25 +897,31 @@ def get_api_request( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - def count_api_requests( + def count_audit_logs( self, *, - q: typing.Optional[str] = None, - request_type: typing.Optional[str] = None, + actor_type: typing.Optional[ActorType] = None, + end_time: typing.Optional[dt.datetime] = None, environment_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + start_time: typing.Optional[dt.datetime] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[CountApiRequestsResponse]: + ) -> HttpResponse[CountAuditLogsResponse]: """ Parameters ---------- - q : typing.Optional[str] + actor_type : typing.Optional[ActorType] - request_type : typing.Optional[str] + end_time : typing.Optional[dt.datetime] environment_id : typing.Optional[str] + q : typing.Optional[str] + + start_time : typing.Optional[dt.datetime] + limit : typing.Optional[int] Page limit (default 100) @@ -911,16 +933,18 @@ def count_api_requests( Returns ------- - HttpResponse[CountApiRequestsResponse] + HttpResponse[CountAuditLogsResponse] OK """ _response = self._client_wrapper.httpx_client.request( - "api-requests/count", + "audit-log/count", method="GET", params={ - "q": q, - "request_type": request_type, + "actor_type": actor_type, + "end_time": serialize_datetime(end_time) if end_time is not None else None, "environment_id": environment_id, + "q": q, + "start_time": serialize_datetime(start_time) if start_time is not None else None, "limit": limit, "offset": offset, }, @@ -929,9 +953,9 @@ def count_api_requests( try: if 200 <= _response.status_code < 300: _data = typing.cast( - CountApiRequestsResponse, + CountAuditLogsResponse, parse_obj_as( - type_=CountApiRequestsResponse, # type: ignore + type_=CountAuditLogsResponse, # type: ignore object_=_response.json(), ), ) @@ -1603,6 +1627,88 @@ def quickstart( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def get_who_am_i( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetWhoAmIResponse]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetWhoAmIResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "whoami", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetWhoAmIResponse, + parse_obj_as( + type_=GetWhoAmIResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + class AsyncRawAccountsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -1729,6 +1835,7 @@ async def create_api_key( name: str, description: typing.Optional[str] = OMIT, environment_id: typing.Optional[str] = OMIT, + readonly: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateApiKeyResponse]: """ @@ -1740,6 +1847,8 @@ async def create_api_key( environment_id : typing.Optional[str] + readonly : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1755,6 +1864,7 @@ async def create_api_key( "description": description, "environment_id": environment_id, "name": name, + "readonly": readonly, }, headers={ "content-type": "application/json", @@ -2245,25 +2355,31 @@ async def count_api_keys( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - async def list_api_requests( + async def list_audit_logs( self, *, - q: typing.Optional[str] = None, - request_type: typing.Optional[str] = None, + actor_type: typing.Optional[ActorType] = None, + end_time: typing.Optional[dt.datetime] = None, environment_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + start_time: typing.Optional[dt.datetime] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[ListApiRequestsResponse]: + ) -> AsyncHttpResponse[ListAuditLogsResponse]: """ Parameters ---------- - q : typing.Optional[str] + actor_type : typing.Optional[ActorType] - request_type : typing.Optional[str] + end_time : typing.Optional[dt.datetime] environment_id : typing.Optional[str] + q : typing.Optional[str] + + start_time : typing.Optional[dt.datetime] + limit : typing.Optional[int] Page limit (default 100) @@ -2275,16 +2391,18 @@ async def list_api_requests( Returns ------- - AsyncHttpResponse[ListApiRequestsResponse] + AsyncHttpResponse[ListAuditLogsResponse] OK """ _response = await self._client_wrapper.httpx_client.request( - "api-requests", + "audit-log", method="GET", params={ - "q": q, - "request_type": request_type, + "actor_type": actor_type, + "end_time": serialize_datetime(end_time) if end_time is not None else None, "environment_id": environment_id, + "q": q, + "start_time": serialize_datetime(start_time) if start_time is not None else None, "limit": limit, "offset": offset, }, @@ -2293,9 +2411,9 @@ async def list_api_requests( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ListApiRequestsResponse, + ListAuditLogsResponse, parse_obj_as( - type_=ListApiRequestsResponse, # type: ignore + type_=ListAuditLogsResponse, # type: ignore object_=_response.json(), ), ) @@ -2364,34 +2482,34 @@ async def list_api_requests( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - async def get_api_request( - self, api_request_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[GetApiRequestResponse]: + async def get_audit_log( + self, audit_log_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetAuditLogResponse]: """ Parameters ---------- - api_request_id : str - api_request_id + audit_log_id : str + audit_log_id request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[GetApiRequestResponse] + AsyncHttpResponse[GetAuditLogResponse] OK """ _response = await self._client_wrapper.httpx_client.request( - f"api-requests/{jsonable_encoder(api_request_id)}", + f"audit-log/{jsonable_encoder(audit_log_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - GetApiRequestResponse, + GetAuditLogResponse, parse_obj_as( - type_=GetApiRequestResponse, # type: ignore + type_=GetAuditLogResponse, # type: ignore object_=_response.json(), ), ) @@ -2449,25 +2567,31 @@ async def get_api_request( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - async def count_api_requests( + async def count_audit_logs( self, *, - q: typing.Optional[str] = None, - request_type: typing.Optional[str] = None, + actor_type: typing.Optional[ActorType] = None, + end_time: typing.Optional[dt.datetime] = None, environment_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + start_time: typing.Optional[dt.datetime] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[CountApiRequestsResponse]: + ) -> AsyncHttpResponse[CountAuditLogsResponse]: """ Parameters ---------- - q : typing.Optional[str] + actor_type : typing.Optional[ActorType] - request_type : typing.Optional[str] + end_time : typing.Optional[dt.datetime] environment_id : typing.Optional[str] + q : typing.Optional[str] + + start_time : typing.Optional[dt.datetime] + limit : typing.Optional[int] Page limit (default 100) @@ -2479,16 +2603,18 @@ async def count_api_requests( Returns ------- - AsyncHttpResponse[CountApiRequestsResponse] + AsyncHttpResponse[CountAuditLogsResponse] OK """ _response = await self._client_wrapper.httpx_client.request( - "api-requests/count", + "audit-log/count", method="GET", params={ - "q": q, - "request_type": request_type, + "actor_type": actor_type, + "end_time": serialize_datetime(end_time) if end_time is not None else None, "environment_id": environment_id, + "q": q, + "start_time": serialize_datetime(start_time) if start_time is not None else None, "limit": limit, "offset": offset, }, @@ -2497,9 +2623,9 @@ async def count_api_requests( try: if 200 <= _response.status_code < 300: _data = typing.cast( - CountApiRequestsResponse, + CountAuditLogsResponse, parse_obj_as( - type_=CountApiRequestsResponse, # type: ignore + type_=CountAuditLogsResponse, # type: ignore object_=_response.json(), ), ) @@ -3170,3 +3296,85 @@ async def quickstart( raise core_api_error_ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + + async def get_who_am_i( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetWhoAmIResponse]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetWhoAmIResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "whoami", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetWhoAmIResponse, + parse_obj_as( + type_=GetWhoAmIResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) diff --git a/src/schematic/accounts/types/__init__.py b/src/schematic/accounts/types/__init__.py index 8b5064a..fabbff2 100644 --- a/src/schematic/accounts/types/__init__.py +++ b/src/schematic/accounts/types/__init__.py @@ -8,19 +8,20 @@ if typing.TYPE_CHECKING: from .count_api_keys_params import CountApiKeysParams from .count_api_keys_response import CountApiKeysResponse - from .count_api_requests_params import CountApiRequestsParams - from .count_api_requests_response import CountApiRequestsResponse + from .count_audit_logs_params import CountAuditLogsParams + from .count_audit_logs_response import CountAuditLogsResponse from .create_api_key_response import CreateApiKeyResponse from .create_environment_response import CreateEnvironmentResponse from .delete_api_key_response import DeleteApiKeyResponse from .delete_environment_response import DeleteEnvironmentResponse from .get_api_key_response import GetApiKeyResponse - from .get_api_request_response import GetApiRequestResponse + from .get_audit_log_response import GetAuditLogResponse from .get_environment_response import GetEnvironmentResponse + from .get_who_am_i_response import GetWhoAmIResponse from .list_api_keys_params import ListApiKeysParams from .list_api_keys_response import ListApiKeysResponse - from .list_api_requests_params import ListApiRequestsParams - from .list_api_requests_response import ListApiRequestsResponse + from .list_audit_logs_params import ListAuditLogsParams + from .list_audit_logs_response import ListAuditLogsResponse from .list_environments_params import ListEnvironmentsParams from .list_environments_response import ListEnvironmentsResponse from .quickstart_response import QuickstartResponse @@ -29,19 +30,20 @@ _dynamic_imports: typing.Dict[str, str] = { "CountApiKeysParams": ".count_api_keys_params", "CountApiKeysResponse": ".count_api_keys_response", - "CountApiRequestsParams": ".count_api_requests_params", - "CountApiRequestsResponse": ".count_api_requests_response", + "CountAuditLogsParams": ".count_audit_logs_params", + "CountAuditLogsResponse": ".count_audit_logs_response", "CreateApiKeyResponse": ".create_api_key_response", "CreateEnvironmentResponse": ".create_environment_response", "DeleteApiKeyResponse": ".delete_api_key_response", "DeleteEnvironmentResponse": ".delete_environment_response", "GetApiKeyResponse": ".get_api_key_response", - "GetApiRequestResponse": ".get_api_request_response", + "GetAuditLogResponse": ".get_audit_log_response", "GetEnvironmentResponse": ".get_environment_response", + "GetWhoAmIResponse": ".get_who_am_i_response", "ListApiKeysParams": ".list_api_keys_params", "ListApiKeysResponse": ".list_api_keys_response", - "ListApiRequestsParams": ".list_api_requests_params", - "ListApiRequestsResponse": ".list_api_requests_response", + "ListAuditLogsParams": ".list_audit_logs_params", + "ListAuditLogsResponse": ".list_audit_logs_response", "ListEnvironmentsParams": ".list_environments_params", "ListEnvironmentsResponse": ".list_environments_response", "QuickstartResponse": ".quickstart_response", @@ -74,19 +76,20 @@ def __dir__(): __all__ = [ "CountApiKeysParams", "CountApiKeysResponse", - "CountApiRequestsParams", - "CountApiRequestsResponse", + "CountAuditLogsParams", + "CountAuditLogsResponse", "CreateApiKeyResponse", "CreateEnvironmentResponse", "DeleteApiKeyResponse", "DeleteEnvironmentResponse", "GetApiKeyResponse", - "GetApiRequestResponse", + "GetAuditLogResponse", "GetEnvironmentResponse", + "GetWhoAmIResponse", "ListApiKeysParams", "ListApiKeysResponse", - "ListApiRequestsParams", - "ListApiRequestsResponse", + "ListAuditLogsParams", + "ListAuditLogsResponse", "ListEnvironmentsParams", "ListEnvironmentsResponse", "QuickstartResponse", diff --git a/src/schematic/accounts/types/count_audit_logs_params.py b/src/schematic/accounts/types/count_audit_logs_params.py new file mode 100644 index 0000000..126b8df --- /dev/null +++ b/src/schematic/accounts/types/count_audit_logs_params.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.actor_type import ActorType + + +class CountAuditLogsParams(UniversalBaseModel): + """ + Input parameters + """ + + actor_type: typing.Optional[ActorType] = None + end_time: typing.Optional[dt.datetime] = None + environment_id: typing.Optional[str] = None + limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Page limit (default 100) + """ + + offset: typing.Optional[int] = pydantic.Field(default=None) + """ + Page offset (default 0) + """ + + q: typing.Optional[str] = None + start_time: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/accounts/types/count_api_requests_response.py b/src/schematic/accounts/types/count_audit_logs_response.py similarity index 77% rename from src/schematic/accounts/types/count_api_requests_response.py rename to src/schematic/accounts/types/count_audit_logs_response.py index e9c9873..9c40ec2 100644 --- a/src/schematic/accounts/types/count_api_requests_response.py +++ b/src/schematic/accounts/types/count_audit_logs_response.py @@ -5,12 +5,12 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ...types.count_response import CountResponse -from .count_api_requests_params import CountApiRequestsParams +from .count_audit_logs_params import CountAuditLogsParams -class CountApiRequestsResponse(UniversalBaseModel): +class CountAuditLogsResponse(UniversalBaseModel): data: CountResponse - params: CountApiRequestsParams = pydantic.Field() + params: CountAuditLogsParams = pydantic.Field() """ Input parameters """ diff --git a/src/schematic/accounts/types/get_api_request_response.py b/src/schematic/accounts/types/get_audit_log_response.py similarity index 77% rename from src/schematic/accounts/types/get_api_request_response.py rename to src/schematic/accounts/types/get_audit_log_response.py index 00c140b..7d49ce9 100644 --- a/src/schematic/accounts/types/get_api_request_response.py +++ b/src/schematic/accounts/types/get_audit_log_response.py @@ -4,11 +4,11 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.api_key_request_response_data import ApiKeyRequestResponseData +from ...types.audit_log_response_data import AuditLogResponseData -class GetApiRequestResponse(UniversalBaseModel): - data: ApiKeyRequestResponseData +class GetAuditLogResponse(UniversalBaseModel): + data: AuditLogResponseData params: typing.Dict[str, typing.Any] = pydantic.Field() """ Input parameters diff --git a/src/schematic/accounts/types/list_api_requests_response.py b/src/schematic/accounts/types/get_who_am_i_response.py similarity index 62% rename from src/schematic/accounts/types/list_api_requests_response.py rename to src/schematic/accounts/types/get_who_am_i_response.py index d3cc23a..25cbf7f 100644 --- a/src/schematic/accounts/types/list_api_requests_response.py +++ b/src/schematic/accounts/types/get_who_am_i_response.py @@ -4,13 +4,12 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.api_key_request_list_response_data import ApiKeyRequestListResponseData -from .list_api_requests_params import ListApiRequestsParams +from ...types.who_am_i_response_data import WhoAmIResponseData -class ListApiRequestsResponse(UniversalBaseModel): - data: typing.List[ApiKeyRequestListResponseData] - params: ListApiRequestsParams = pydantic.Field() +class GetWhoAmIResponse(UniversalBaseModel): + data: WhoAmIResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() """ Input parameters """ diff --git a/src/schematic/accounts/types/count_api_requests_params.py b/src/schematic/accounts/types/list_audit_logs_params.py similarity index 75% rename from src/schematic/accounts/types/count_api_requests_params.py rename to src/schematic/accounts/types/list_audit_logs_params.py index cedd3a5..e8ba7b0 100644 --- a/src/schematic/accounts/types/count_api_requests_params.py +++ b/src/schematic/accounts/types/list_audit_logs_params.py @@ -1,16 +1,20 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.actor_type import ActorType -class CountApiRequestsParams(UniversalBaseModel): +class ListAuditLogsParams(UniversalBaseModel): """ Input parameters """ + actor_type: typing.Optional[ActorType] = None + end_time: typing.Optional[dt.datetime] = None environment_id: typing.Optional[str] = None limit: typing.Optional[int] = pydantic.Field(default=None) """ @@ -23,7 +27,7 @@ class CountApiRequestsParams(UniversalBaseModel): """ q: typing.Optional[str] = None - request_type: typing.Optional[str] = None + start_time: typing.Optional[dt.datetime] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/accounts/types/list_audit_logs_response.py b/src/schematic/accounts/types/list_audit_logs_response.py new file mode 100644 index 0000000..b81bade --- /dev/null +++ b/src/schematic/accounts/types/list_audit_logs_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.audit_log_list_response_data import AuditLogListResponseData +from .list_audit_logs_params import ListAuditLogsParams + + +class ListAuditLogsResponse(UniversalBaseModel): + data: typing.List[AuditLogListResponseData] + params: ListAuditLogsParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/base_client.py b/src/schematic/base_client.py index f0b30a4..455fe67 100644 --- a/src/schematic/base_client.py +++ b/src/schematic/base_client.py @@ -17,13 +17,17 @@ from .checkout.client import AsyncCheckoutClient, CheckoutClient from .companies.client import AsyncCompaniesClient, CompaniesClient from .components.client import AsyncComponentsClient, ComponentsClient + from .componentspublic.client import AsyncComponentspublicClient, ComponentspublicClient from .credits.client import AsyncCreditsClient, CreditsClient from .dataexports.client import AsyncDataexportsClient, DataexportsClient from .entitlements.client import AsyncEntitlementsClient, EntitlementsClient from .events.client import AsyncEventsClient, EventsClient from .features.client import AsyncFeaturesClient, FeaturesClient + from .planbundle.client import AsyncPlanbundleClient, PlanbundleClient from .plangroups.client import AsyncPlangroupsClient, PlangroupsClient + from .planmigrations.client import AsyncPlanmigrationsClient, PlanmigrationsClient from .plans.client import AsyncPlansClient, PlansClient + from .scheduledcheckout.client import AsyncScheduledcheckoutClient, ScheduledcheckoutClient from .webhooks.client import AsyncWebhooksClient, WebhooksClient @@ -104,7 +108,11 @@ def __init__( self._dataexports: typing.Optional[DataexportsClient] = None self._events: typing.Optional[EventsClient] = None self._features: typing.Optional[FeaturesClient] = None + self._planbundle: typing.Optional[PlanbundleClient] = None self._plangroups: typing.Optional[PlangroupsClient] = None + self._planmigrations: typing.Optional[PlanmigrationsClient] = None + self._componentspublic: typing.Optional[ComponentspublicClient] = None + self._scheduledcheckout: typing.Optional[ScheduledcheckoutClient] = None self._accesstokens: typing.Optional[AccesstokensClient] = None self._webhooks: typing.Optional[WebhooksClient] = None @@ -269,6 +277,14 @@ def features(self): self._features = FeaturesClient(client_wrapper=self._client_wrapper) return self._features + @property + def planbundle(self): + if self._planbundle is None: + from .planbundle.client import PlanbundleClient # noqa: E402 + + self._planbundle = PlanbundleClient(client_wrapper=self._client_wrapper) + return self._planbundle + @property def plangroups(self): if self._plangroups is None: @@ -277,6 +293,30 @@ def plangroups(self): self._plangroups = PlangroupsClient(client_wrapper=self._client_wrapper) return self._plangroups + @property + def planmigrations(self): + if self._planmigrations is None: + from .planmigrations.client import PlanmigrationsClient # noqa: E402 + + self._planmigrations = PlanmigrationsClient(client_wrapper=self._client_wrapper) + return self._planmigrations + + @property + def componentspublic(self): + if self._componentspublic is None: + from .componentspublic.client import ComponentspublicClient # noqa: E402 + + self._componentspublic = ComponentspublicClient(client_wrapper=self._client_wrapper) + return self._componentspublic + + @property + def scheduledcheckout(self): + if self._scheduledcheckout is None: + from .scheduledcheckout.client import ScheduledcheckoutClient # noqa: E402 + + self._scheduledcheckout = ScheduledcheckoutClient(client_wrapper=self._client_wrapper) + return self._scheduledcheckout + @property def accesstokens(self): if self._accesstokens is None: @@ -371,7 +411,11 @@ def __init__( self._dataexports: typing.Optional[AsyncDataexportsClient] = None self._events: typing.Optional[AsyncEventsClient] = None self._features: typing.Optional[AsyncFeaturesClient] = None + self._planbundle: typing.Optional[AsyncPlanbundleClient] = None self._plangroups: typing.Optional[AsyncPlangroupsClient] = None + self._planmigrations: typing.Optional[AsyncPlanmigrationsClient] = None + self._componentspublic: typing.Optional[AsyncComponentspublicClient] = None + self._scheduledcheckout: typing.Optional[AsyncScheduledcheckoutClient] = None self._accesstokens: typing.Optional[AsyncAccesstokensClient] = None self._webhooks: typing.Optional[AsyncWebhooksClient] = None @@ -552,6 +596,14 @@ def features(self): self._features = AsyncFeaturesClient(client_wrapper=self._client_wrapper) return self._features + @property + def planbundle(self): + if self._planbundle is None: + from .planbundle.client import AsyncPlanbundleClient # noqa: E402 + + self._planbundle = AsyncPlanbundleClient(client_wrapper=self._client_wrapper) + return self._planbundle + @property def plangroups(self): if self._plangroups is None: @@ -560,6 +612,30 @@ def plangroups(self): self._plangroups = AsyncPlangroupsClient(client_wrapper=self._client_wrapper) return self._plangroups + @property + def planmigrations(self): + if self._planmigrations is None: + from .planmigrations.client import AsyncPlanmigrationsClient # noqa: E402 + + self._planmigrations = AsyncPlanmigrationsClient(client_wrapper=self._client_wrapper) + return self._planmigrations + + @property + def componentspublic(self): + if self._componentspublic is None: + from .componentspublic.client import AsyncComponentspublicClient # noqa: E402 + + self._componentspublic = AsyncComponentspublicClient(client_wrapper=self._client_wrapper) + return self._componentspublic + + @property + def scheduledcheckout(self): + if self._scheduledcheckout is None: + from .scheduledcheckout.client import AsyncScheduledcheckoutClient # noqa: E402 + + self._scheduledcheckout = AsyncScheduledcheckoutClient(client_wrapper=self._client_wrapper) + return self._scheduledcheckout + @property def accesstokens(self): if self._accesstokens is None: diff --git a/src/schematic/billing/client.py b/src/schematic/billing/client.py index 4b78ac2..6873a4c 100644 --- a/src/schematic/billing/client.py +++ b/src/schematic/billing/client.py @@ -13,6 +13,7 @@ from ..types.billing_subscription_trial_end_setting import BillingSubscriptionTrialEndSetting from ..types.billing_tiers_mode import BillingTiersMode from ..types.create_billing_price_tier_request_body import CreateBillingPriceTierRequestBody +from ..types.invoice_status import InvoiceStatus from .raw_client import AsyncRawBillingClient, RawBillingClient from .types.count_billing_products_response import CountBillingProductsResponse from .types.count_customers_response import CountCustomersResponse @@ -183,7 +184,6 @@ def upsert_billing_customer( *, email: str, external_id: str, - failed_to_import: bool, meta: typing.Dict[str, str], name: str, company_id: typing.Optional[str] = OMIT, @@ -198,8 +198,6 @@ def upsert_billing_customer( external_id : str - failed_to_import : bool - meta : typing.Dict[str, str] name : str @@ -228,7 +226,6 @@ def upsert_billing_customer( client.billing.upsert_billing_customer( email="email", external_id="external_id", - failed_to_import=True, meta={"key": "value"}, name="name", ) @@ -236,7 +233,6 @@ def upsert_billing_customer( _response = self._raw_client.upsert_billing_customer( email=email, external_id=external_id, - failed_to_import=failed_to_import, meta=meta, name=name, company_id=company_id, @@ -250,7 +246,6 @@ def list_customers_with_subscriptions( self, *, company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - failed_to_import: typing.Optional[bool] = None, name: typing.Optional[str] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, @@ -263,8 +258,6 @@ def list_customers_with_subscriptions( ---------- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - failed_to_import : typing.Optional[bool] - name : typing.Optional[str] provider_type : typing.Optional[BillingProviderType] @@ -293,7 +286,6 @@ def list_customers_with_subscriptions( api_key="YOUR_API_KEY", ) client.billing.list_customers_with_subscriptions( - failed_to_import=True, name="name", provider_type="schematic", q="q", @@ -303,7 +295,6 @@ def list_customers_with_subscriptions( """ _response = self._raw_client.list_customers_with_subscriptions( company_ids=company_ids, - failed_to_import=failed_to_import, name=name, provider_type=provider_type, q=q, @@ -317,7 +308,6 @@ def count_customers( self, *, company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - failed_to_import: typing.Optional[bool] = None, name: typing.Optional[str] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, @@ -330,8 +320,6 @@ def count_customers( ---------- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - failed_to_import : typing.Optional[bool] - name : typing.Optional[str] provider_type : typing.Optional[BillingProviderType] @@ -360,7 +348,6 @@ def count_customers( api_key="YOUR_API_KEY", ) client.billing.count_customers( - failed_to_import=True, name="name", provider_type="schematic", q="q", @@ -370,7 +357,6 @@ def count_customers( """ _response = self._raw_client.count_customers( company_ids=company_ids, - failed_to_import=failed_to_import, name=name, provider_type=provider_type, q=q, @@ -451,6 +437,7 @@ def upsert_invoice( due_date: typing.Optional[dt.datetime] = OMIT, external_id: typing.Optional[str] = OMIT, payment_method_external_id: typing.Optional[str] = OMIT, + status: typing.Optional[InvoiceStatus] = OMIT, subscription_external_id: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -478,6 +465,8 @@ def upsert_invoice( payment_method_external_id : typing.Optional[str] + status : typing.Optional[InvoiceStatus] + subscription_external_id : typing.Optional[str] url : typing.Optional[str] @@ -518,6 +507,7 @@ def upsert_invoice( due_date=due_date, external_id=external_id, payment_method_external_id=payment_method_external_id, + status=status, subscription_external_id=subscription_external_id, url=url, request_options=request_options, @@ -1146,9 +1136,9 @@ def upsert_billing_product( self, *, external_id: str, - name: str, price: float, is_active: typing.Optional[bool] = OMIT, + name: typing.Optional[str] = OMIT, provider_type: typing.Optional[BillingProviderType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertBillingProductResponse: @@ -1157,12 +1147,12 @@ def upsert_billing_product( ---------- external_id : str - name : str - price : float is_active : typing.Optional[bool] + name : typing.Optional[str] + provider_type : typing.Optional[BillingProviderType] request_options : typing.Optional[RequestOptions] @@ -1182,15 +1172,14 @@ def upsert_billing_product( ) client.billing.upsert_billing_product( external_id="external_id", - name="name", price=1.1, ) """ _response = self._raw_client.upsert_billing_product( external_id=external_id, - name=name, price=price, is_active=is_active, + name=name, provider_type=provider_type, request_options=request_options, ) @@ -1693,7 +1682,6 @@ async def upsert_billing_customer( *, email: str, external_id: str, - failed_to_import: bool, meta: typing.Dict[str, str], name: str, company_id: typing.Optional[str] = OMIT, @@ -1708,8 +1696,6 @@ async def upsert_billing_customer( external_id : str - failed_to_import : bool - meta : typing.Dict[str, str] name : str @@ -1743,7 +1729,6 @@ async def main() -> None: await client.billing.upsert_billing_customer( email="email", external_id="external_id", - failed_to_import=True, meta={"key": "value"}, name="name", ) @@ -1754,7 +1739,6 @@ async def main() -> None: _response = await self._raw_client.upsert_billing_customer( email=email, external_id=external_id, - failed_to_import=failed_to_import, meta=meta, name=name, company_id=company_id, @@ -1768,7 +1752,6 @@ async def list_customers_with_subscriptions( self, *, company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - failed_to_import: typing.Optional[bool] = None, name: typing.Optional[str] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, @@ -1781,8 +1764,6 @@ async def list_customers_with_subscriptions( ---------- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - failed_to_import : typing.Optional[bool] - name : typing.Optional[str] provider_type : typing.Optional[BillingProviderType] @@ -1816,7 +1797,6 @@ async def list_customers_with_subscriptions( async def main() -> None: await client.billing.list_customers_with_subscriptions( - failed_to_import=True, name="name", provider_type="schematic", q="q", @@ -1829,7 +1809,6 @@ async def main() -> None: """ _response = await self._raw_client.list_customers_with_subscriptions( company_ids=company_ids, - failed_to_import=failed_to_import, name=name, provider_type=provider_type, q=q, @@ -1843,7 +1822,6 @@ async def count_customers( self, *, company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - failed_to_import: typing.Optional[bool] = None, name: typing.Optional[str] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, @@ -1856,8 +1834,6 @@ async def count_customers( ---------- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - failed_to_import : typing.Optional[bool] - name : typing.Optional[str] provider_type : typing.Optional[BillingProviderType] @@ -1891,7 +1867,6 @@ async def count_customers( async def main() -> None: await client.billing.count_customers( - failed_to_import=True, name="name", provider_type="schematic", q="q", @@ -1904,7 +1879,6 @@ async def main() -> None: """ _response = await self._raw_client.count_customers( company_ids=company_ids, - failed_to_import=failed_to_import, name=name, provider_type=provider_type, q=q, @@ -1993,6 +1967,7 @@ async def upsert_invoice( due_date: typing.Optional[dt.datetime] = OMIT, external_id: typing.Optional[str] = OMIT, payment_method_external_id: typing.Optional[str] = OMIT, + status: typing.Optional[InvoiceStatus] = OMIT, subscription_external_id: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -2020,6 +1995,8 @@ async def upsert_invoice( payment_method_external_id : typing.Optional[str] + status : typing.Optional[InvoiceStatus] + subscription_external_id : typing.Optional[str] url : typing.Optional[str] @@ -2068,6 +2045,7 @@ async def main() -> None: due_date=due_date, external_id=external_id, payment_method_external_id=payment_method_external_id, + status=status, subscription_external_id=subscription_external_id, url=url, request_options=request_options, @@ -2768,9 +2746,9 @@ async def upsert_billing_product( self, *, external_id: str, - name: str, price: float, is_active: typing.Optional[bool] = OMIT, + name: typing.Optional[str] = OMIT, provider_type: typing.Optional[BillingProviderType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertBillingProductResponse: @@ -2779,12 +2757,12 @@ async def upsert_billing_product( ---------- external_id : str - name : str - price : float is_active : typing.Optional[bool] + name : typing.Optional[str] + provider_type : typing.Optional[BillingProviderType] request_options : typing.Optional[RequestOptions] @@ -2809,7 +2787,6 @@ async def upsert_billing_product( async def main() -> None: await client.billing.upsert_billing_product( external_id="external_id", - name="name", price=1.1, ) @@ -2818,9 +2795,9 @@ async def main() -> None: """ _response = await self._raw_client.upsert_billing_product( external_id=external_id, - name=name, price=price, is_active=is_active, + name=name, provider_type=provider_type, request_options=request_options, ) diff --git a/src/schematic/billing/raw_client.py b/src/schematic/billing/raw_client.py index 4b03870..f71e867 100644 --- a/src/schematic/billing/raw_client.py +++ b/src/schematic/billing/raw_client.py @@ -25,6 +25,7 @@ from ..types.billing_subscription_trial_end_setting import BillingSubscriptionTrialEndSetting from ..types.billing_tiers_mode import BillingTiersMode from ..types.create_billing_price_tier_request_body import CreateBillingPriceTierRequestBody +from ..types.invoice_status import InvoiceStatus from .types.count_billing_products_response import CountBillingProductsResponse from .types.count_customers_response import CountCustomersResponse from .types.delete_billing_product_response import DeleteBillingProductResponse @@ -311,7 +312,6 @@ def upsert_billing_customer( *, email: str, external_id: str, - failed_to_import: bool, meta: typing.Dict[str, str], name: str, company_id: typing.Optional[str] = OMIT, @@ -326,8 +326,6 @@ def upsert_billing_customer( external_id : str - failed_to_import : bool - meta : typing.Dict[str, str] name : str @@ -354,7 +352,6 @@ def upsert_billing_customer( "default_payment_method_id": default_payment_method_id, "email": email, "external_id": external_id, - "failed_to_import": failed_to_import, "meta": meta, "name": name, "provider_type": provider_type, @@ -443,7 +440,6 @@ def list_customers_with_subscriptions( self, *, company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - failed_to_import: typing.Optional[bool] = None, name: typing.Optional[str] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, @@ -456,8 +452,6 @@ def list_customers_with_subscriptions( ---------- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - failed_to_import : typing.Optional[bool] - name : typing.Optional[str] provider_type : typing.Optional[BillingProviderType] @@ -483,7 +477,6 @@ def list_customers_with_subscriptions( method="GET", params={ "company_ids": company_ids, - "failed_to_import": failed_to_import, "name": name, "provider_type": provider_type, "q": q, @@ -570,7 +563,6 @@ def count_customers( self, *, company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - failed_to_import: typing.Optional[bool] = None, name: typing.Optional[str] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, @@ -583,8 +575,6 @@ def count_customers( ---------- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - failed_to_import : typing.Optional[bool] - name : typing.Optional[str] provider_type : typing.Optional[BillingProviderType] @@ -610,7 +600,6 @@ def count_customers( method="GET", params={ "company_ids": company_ids, - "failed_to_import": failed_to_import, "name": name, "provider_type": provider_type, "q": q, @@ -825,6 +814,7 @@ def upsert_invoice( due_date: typing.Optional[dt.datetime] = OMIT, external_id: typing.Optional[str] = OMIT, payment_method_external_id: typing.Optional[str] = OMIT, + status: typing.Optional[InvoiceStatus] = OMIT, subscription_external_id: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -852,6 +842,8 @@ def upsert_invoice( payment_method_external_id : typing.Optional[str] + status : typing.Optional[InvoiceStatus] + subscription_external_id : typing.Optional[str] url : typing.Optional[str] @@ -877,6 +869,7 @@ def upsert_invoice( "due_date": due_date, "external_id": external_id, "payment_method_external_id": payment_method_external_id, + "status": status, "subscription_external_id": subscription_external_id, "subtotal": subtotal, "url": url, @@ -2140,9 +2133,9 @@ def upsert_billing_product( self, *, external_id: str, - name: str, price: float, is_active: typing.Optional[bool] = OMIT, + name: typing.Optional[str] = OMIT, provider_type: typing.Optional[BillingProviderType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpsertBillingProductResponse]: @@ -2151,12 +2144,12 @@ def upsert_billing_product( ---------- external_id : str - name : str - price : float is_active : typing.Optional[bool] + name : typing.Optional[str] + provider_type : typing.Optional[BillingProviderType] request_options : typing.Optional[RequestOptions] @@ -3004,7 +2997,6 @@ async def upsert_billing_customer( *, email: str, external_id: str, - failed_to_import: bool, meta: typing.Dict[str, str], name: str, company_id: typing.Optional[str] = OMIT, @@ -3019,8 +3011,6 @@ async def upsert_billing_customer( external_id : str - failed_to_import : bool - meta : typing.Dict[str, str] name : str @@ -3047,7 +3037,6 @@ async def upsert_billing_customer( "default_payment_method_id": default_payment_method_id, "email": email, "external_id": external_id, - "failed_to_import": failed_to_import, "meta": meta, "name": name, "provider_type": provider_type, @@ -3136,7 +3125,6 @@ async def list_customers_with_subscriptions( self, *, company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - failed_to_import: typing.Optional[bool] = None, name: typing.Optional[str] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, @@ -3149,8 +3137,6 @@ async def list_customers_with_subscriptions( ---------- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - failed_to_import : typing.Optional[bool] - name : typing.Optional[str] provider_type : typing.Optional[BillingProviderType] @@ -3176,7 +3162,6 @@ async def list_customers_with_subscriptions( method="GET", params={ "company_ids": company_ids, - "failed_to_import": failed_to_import, "name": name, "provider_type": provider_type, "q": q, @@ -3263,7 +3248,6 @@ async def count_customers( self, *, company_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - failed_to_import: typing.Optional[bool] = None, name: typing.Optional[str] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, @@ -3276,8 +3260,6 @@ async def count_customers( ---------- company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - failed_to_import : typing.Optional[bool] - name : typing.Optional[str] provider_type : typing.Optional[BillingProviderType] @@ -3303,7 +3285,6 @@ async def count_customers( method="GET", params={ "company_ids": company_ids, - "failed_to_import": failed_to_import, "name": name, "provider_type": provider_type, "q": q, @@ -3518,6 +3499,7 @@ async def upsert_invoice( due_date: typing.Optional[dt.datetime] = OMIT, external_id: typing.Optional[str] = OMIT, payment_method_external_id: typing.Optional[str] = OMIT, + status: typing.Optional[InvoiceStatus] = OMIT, subscription_external_id: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -3545,6 +3527,8 @@ async def upsert_invoice( payment_method_external_id : typing.Optional[str] + status : typing.Optional[InvoiceStatus] + subscription_external_id : typing.Optional[str] url : typing.Optional[str] @@ -3570,6 +3554,7 @@ async def upsert_invoice( "due_date": due_date, "external_id": external_id, "payment_method_external_id": payment_method_external_id, + "status": status, "subscription_external_id": subscription_external_id, "subtotal": subtotal, "url": url, @@ -4833,9 +4818,9 @@ async def upsert_billing_product( self, *, external_id: str, - name: str, price: float, is_active: typing.Optional[bool] = OMIT, + name: typing.Optional[str] = OMIT, provider_type: typing.Optional[BillingProviderType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpsertBillingProductResponse]: @@ -4844,12 +4829,12 @@ async def upsert_billing_product( ---------- external_id : str - name : str - price : float is_active : typing.Optional[bool] + name : typing.Optional[str] + provider_type : typing.Optional[BillingProviderType] request_options : typing.Optional[RequestOptions] diff --git a/src/schematic/billing/types/count_customers_params.py b/src/schematic/billing/types/count_customers_params.py index 4f707dd..617af5d 100644 --- a/src/schematic/billing/types/count_customers_params.py +++ b/src/schematic/billing/types/count_customers_params.py @@ -13,7 +13,6 @@ class CountCustomersParams(UniversalBaseModel): """ company_ids: typing.Optional[typing.List[str]] = None - failed_to_import: typing.Optional[bool] = None limit: typing.Optional[int] = pydantic.Field(default=None) """ Page limit (default 100) diff --git a/src/schematic/billing/types/list_customers_with_subscriptions_params.py b/src/schematic/billing/types/list_customers_with_subscriptions_params.py index 98dc01d..620fad5 100644 --- a/src/schematic/billing/types/list_customers_with_subscriptions_params.py +++ b/src/schematic/billing/types/list_customers_with_subscriptions_params.py @@ -13,7 +13,6 @@ class ListCustomersWithSubscriptionsParams(UniversalBaseModel): """ company_ids: typing.Optional[typing.List[str]] = None - failed_to_import: typing.Optional[bool] = None limit: typing.Optional[int] = pydantic.Field(default=None) """ Page limit (default 100) diff --git a/src/schematic/companies/__init__.py b/src/schematic/companies/__init__.py index 679dddc..95ab31d 100644 --- a/src/schematic/companies/__init__.py +++ b/src/schematic/companies/__init__.py @@ -7,8 +7,6 @@ if typing.TYPE_CHECKING: from .types import ( - CountCompaniesForAdvancedFilterParams, - CountCompaniesForAdvancedFilterResponse, CountCompaniesParams, CountCompaniesResponse, CountEntityKeyDefinitionsParams, @@ -40,8 +38,6 @@ GetPlanChangeResponse, GetPlanTraitResponse, GetUserResponse, - ListCompaniesForAdvancedFilterParams, - ListCompaniesForAdvancedFilterResponse, ListCompaniesParams, ListCompaniesResponse, ListCompanyMembershipsParams, @@ -69,8 +65,6 @@ UpsertUserTraitResponse, ) _dynamic_imports: typing.Dict[str, str] = { - "CountCompaniesForAdvancedFilterParams": ".types", - "CountCompaniesForAdvancedFilterResponse": ".types", "CountCompaniesParams": ".types", "CountCompaniesResponse": ".types", "CountEntityKeyDefinitionsParams": ".types", @@ -102,8 +96,6 @@ "GetPlanChangeResponse": ".types", "GetPlanTraitResponse": ".types", "GetUserResponse": ".types", - "ListCompaniesForAdvancedFilterParams": ".types", - "ListCompaniesForAdvancedFilterResponse": ".types", "ListCompaniesParams": ".types", "ListCompaniesResponse": ".types", "ListCompanyMembershipsParams": ".types", @@ -154,8 +146,6 @@ def __dir__(): __all__ = [ - "CountCompaniesForAdvancedFilterParams", - "CountCompaniesForAdvancedFilterResponse", "CountCompaniesParams", "CountCompaniesResponse", "CountEntityKeyDefinitionsParams", @@ -187,8 +177,6 @@ def __dir__(): "GetPlanChangeResponse", "GetPlanTraitResponse", "GetUserResponse", - "ListCompaniesForAdvancedFilterParams", - "ListCompaniesForAdvancedFilterResponse", "ListCompaniesParams", "ListCompaniesResponse", "ListCompanyMembershipsParams", diff --git a/src/schematic/companies/client.py b/src/schematic/companies/client.py index 8c74d33..2e5ed7e 100644 --- a/src/schematic/companies/client.py +++ b/src/schematic/companies/client.py @@ -12,7 +12,6 @@ from ..types.trait_type import TraitType from ..types.update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody from .raw_client import AsyncRawCompaniesClient, RawCompaniesClient -from .types.count_companies_for_advanced_filter_response import CountCompaniesForAdvancedFilterResponse from .types.count_companies_response import CountCompaniesResponse from .types.count_entity_key_definitions_response import CountEntityKeyDefinitionsResponse from .types.count_entity_trait_definitions_response import CountEntityTraitDefinitionsResponse @@ -36,7 +35,6 @@ from .types.get_plan_change_response import GetPlanChangeResponse from .types.get_plan_trait_response import GetPlanTraitResponse from .types.get_user_response import GetUserResponse -from .types.list_companies_for_advanced_filter_response import ListCompaniesForAdvancedFilterResponse from .types.list_companies_response import ListCompaniesResponse from .types.list_company_memberships_response import ListCompanyMembershipsResponse from .types.list_entity_key_definitions_response import ListEntityKeyDefinitionsResponse @@ -76,11 +74,23 @@ def with_raw_response(self) -> RawCompaniesClient: def list_companies( self, *, + credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + monetized_subscriptions: typing.Optional[bool] = None, plan_id: typing.Optional[str] = None, + plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, + sort_order_column: typing.Optional[str] = None, + sort_order_direction: typing.Optional[SortDirection] = None, + subscription_statuses: typing.Optional[ + typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] + ] = None, + subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, + with_entitlement_for: typing.Optional[str] = None, without_feature_override_for: typing.Optional[str] = None, without_plan: typing.Optional[bool] = None, + without_subscription: typing.Optional[bool] = None, with_subscription: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -89,21 +99,51 @@ def list_companies( """ Parameters ---------- + credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by multiple company IDs (starts with comp_) + monetized_subscriptions : typing.Optional[bool] + Filter companies that have monetized subscriptions + plan_id : typing.Optional[str] Filter companies by plan ID (starts with plan_) + plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more plan IDs (each ID starts with plan_) + + plan_version_id : typing.Optional[str] + Filter companies by plan version ID (starts with plvr_) + q : typing.Optional[str] Search for companies by name, keys or string traits + sort_order_column : typing.Optional[str] + Column to sort by (e.g. name, created_at, last_seen_at) + + sort_order_direction : typing.Optional[SortDirection] + Direction to sort by (asc or desc) + + subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] + Filter companies by one or more subscription statuses + + subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] + Filter companies by one or more subscription types + + with_entitlement_for : typing.Optional[str] + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID + without_feature_override_for : typing.Optional[str] Filter out companies that already have a company override for the specified feature ID without_plan : typing.Optional[bool] Filter out companies that have a plan + without_subscription : typing.Optional[bool] + Filter out companies that have a subscription + with_subscription : typing.Optional[bool] Filter companies that have a subscription @@ -129,21 +169,37 @@ def list_companies( api_key="YOUR_API_KEY", ) client.companies.list_companies( + monetized_subscriptions=True, plan_id="plan_id", + plan_version_id="plan_version_id", q="q", + sort_order_column="sort_order_column", + sort_order_direction="asc", + with_entitlement_for="with_entitlement_for", without_feature_override_for="without_feature_override_for", without_plan=True, + without_subscription=True, with_subscription=True, limit=1, offset=1, ) """ _response = self._raw_client.list_companies( + credit_type_ids=credit_type_ids, ids=ids, + monetized_subscriptions=monetized_subscriptions, plan_id=plan_id, + plan_ids=plan_ids, + plan_version_id=plan_version_id, q=q, + sort_order_column=sort_order_column, + sort_order_direction=sort_order_direction, + subscription_statuses=subscription_statuses, + subscription_types=subscription_types, + with_entitlement_for=with_entitlement_for, without_feature_override_for=without_feature_override_for, without_plan=without_plan, + without_subscription=without_subscription, with_subscription=with_subscription, limit=limit, offset=offset, @@ -158,6 +214,7 @@ def upsert_company( id: typing.Optional[str] = OMIT, last_seen_at: typing.Optional[dt.datetime] = OMIT, name: typing.Optional[str] = OMIT, + prevent_key_remap: typing.Optional[bool] = OMIT, traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, update_only: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -175,6 +232,8 @@ def upsert_company( name : typing.Optional[str] + prevent_key_remap : typing.Optional[bool] + traits : typing.Optional[typing.Dict[str, typing.Any]] A map of trait names to trait values @@ -204,6 +263,7 @@ def upsert_company( id=id, last_seen_at=last_seen_at, name=name, + prevent_key_remap=prevent_key_remap, traits=traits, update_only=update_only, request_options=request_options, @@ -288,11 +348,23 @@ def delete_company( def count_companies( self, *, + credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + monetized_subscriptions: typing.Optional[bool] = None, plan_id: typing.Optional[str] = None, + plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, + sort_order_column: typing.Optional[str] = None, + sort_order_direction: typing.Optional[SortDirection] = None, + subscription_statuses: typing.Optional[ + typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] + ] = None, + subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, + with_entitlement_for: typing.Optional[str] = None, without_feature_override_for: typing.Optional[str] = None, without_plan: typing.Optional[bool] = None, + without_subscription: typing.Optional[bool] = None, with_subscription: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -301,116 +373,44 @@ def count_companies( """ Parameters ---------- + credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by multiple company IDs (starts with comp_) + monetized_subscriptions : typing.Optional[bool] + Filter companies that have monetized subscriptions + plan_id : typing.Optional[str] Filter companies by plan ID (starts with plan_) - q : typing.Optional[str] - Search for companies by name, keys or string traits - - without_feature_override_for : typing.Optional[str] - Filter out companies that already have a company override for the specified feature ID - - without_plan : typing.Optional[bool] - Filter out companies that have a plan - - with_subscription : typing.Optional[bool] - Filter companies that have a subscription - - limit : typing.Optional[int] - Page limit (default 100) - - offset : typing.Optional[int] - Page offset (default 0) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CountCompaniesResponse - OK - - Examples - -------- - from schematic import Schematic - - client = Schematic( - api_key="YOUR_API_KEY", - ) - client.companies.count_companies( - plan_id="plan_id", - q="q", - without_feature_override_for="without_feature_override_for", - without_plan=True, - with_subscription=True, - limit=1, - offset=1, - ) - """ - _response = self._raw_client.count_companies( - ids=ids, - plan_id=plan_id, - q=q, - without_feature_override_for=without_feature_override_for, - without_plan=without_plan, - with_subscription=with_subscription, - limit=limit, - offset=offset, - request_options=request_options, - ) - return _response.data - - def count_companies_for_advanced_filter( - self, - *, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - subscription_statuses: typing.Optional[ - typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] - ] = None, - subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, - monetized_subscriptions: typing.Optional[bool] = None, - q: typing.Optional[str] = None, - without_plan: typing.Optional[bool] = None, - without_subscription: typing.Optional[bool] = None, - sort_order_column: typing.Optional[str] = None, - sort_order_direction: typing.Optional[SortDirection] = None, - display_properties: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> CountCompaniesForAdvancedFilterResponse: - """ - Parameters - ---------- - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp_) - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by one or more plan IDs (each ID starts with plan_) - feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more feature IDs (each ID starts with feat_) + plan_version_id : typing.Optional[str] + Filter companies by plan version ID (starts with plvr_) - credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more credit type IDs (each ID starts with bcrd_) + q : typing.Optional[str] + Search for companies by name, keys or string traits + + sort_order_column : typing.Optional[str] + Column to sort by (e.g. name, created_at, last_seen_at) + + sort_order_direction : typing.Optional[SortDirection] + Direction to sort by (asc or desc) subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) + Filter companies by one or more subscription statuses subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] - Filter companies by one or more subscription types (paid, free, trial) + Filter companies by one or more subscription types - monetized_subscriptions : typing.Optional[bool] - Filter companies that have monetized subscriptions + with_entitlement_for : typing.Optional[str] + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID - q : typing.Optional[str] - Search for companies by name, keys or string traits + without_feature_override_for : typing.Optional[str] + Filter out companies that already have a company override for the specified feature ID without_plan : typing.Optional[bool] Filter out companies that have a plan @@ -418,14 +418,8 @@ def count_companies_for_advanced_filter( without_subscription : typing.Optional[bool] Filter out companies that have a subscription - sort_order_column : typing.Optional[str] - Column to sort by (e.g. name, created_at, last_seen_at) - - sort_order_direction : typing.Optional[SortDirection] - Direction to sort by (asc or desc) - - display_properties : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) + with_subscription : typing.Optional[bool] + Filter companies that have a subscription limit : typing.Optional[int] Page limit (default 100) @@ -438,7 +432,7 @@ def count_companies_for_advanced_filter( Returns ------- - CountCompaniesForAdvancedFilterResponse + CountCompaniesResponse OK Examples @@ -448,31 +442,39 @@ def count_companies_for_advanced_filter( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.count_companies_for_advanced_filter( + client.companies.count_companies( monetized_subscriptions=True, + plan_id="plan_id", + plan_version_id="plan_version_id", q="q", - without_plan=True, - without_subscription=True, sort_order_column="sort_order_column", sort_order_direction="asc", + with_entitlement_for="with_entitlement_for", + without_feature_override_for="without_feature_override_for", + without_plan=True, + without_subscription=True, + with_subscription=True, limit=1, offset=1, ) """ - _response = self._raw_client.count_companies_for_advanced_filter( + _response = self._raw_client.count_companies( + credit_type_ids=credit_type_ids, ids=ids, + monetized_subscriptions=monetized_subscriptions, + plan_id=plan_id, plan_ids=plan_ids, - feature_ids=feature_ids, - credit_type_ids=credit_type_ids, + plan_version_id=plan_version_id, + q=q, + sort_order_column=sort_order_column, + sort_order_direction=sort_order_direction, subscription_statuses=subscription_statuses, subscription_types=subscription_types, - monetized_subscriptions=monetized_subscriptions, - q=q, + with_entitlement_for=with_entitlement_for, + without_feature_override_for=without_feature_override_for, without_plan=without_plan, without_subscription=without_subscription, - sort_order_column=sort_order_column, - sort_order_direction=sort_order_direction, - display_properties=display_properties, + with_subscription=with_subscription, limit=limit, offset=offset, request_options=request_options, @@ -486,6 +488,7 @@ def create_company( id: typing.Optional[str] = OMIT, last_seen_at: typing.Optional[dt.datetime] = OMIT, name: typing.Optional[str] = OMIT, + prevent_key_remap: typing.Optional[bool] = OMIT, traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, update_only: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -503,6 +506,8 @@ def create_company( name : typing.Optional[str] + prevent_key_remap : typing.Optional[bool] + traits : typing.Optional[typing.Dict[str, typing.Any]] A map of trait names to trait values @@ -532,6 +537,7 @@ def create_company( id=id, last_seen_at=last_seen_at, name=name, + prevent_key_remap=prevent_key_remap, traits=traits, update_only=update_only, request_options=request_options, @@ -568,137 +574,21 @@ def delete_company_by_keys( _response = self._raw_client.delete_company_by_keys(keys=keys, request_options=request_options) return _response.data - def list_companies_for_advanced_filter( - self, - *, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - subscription_statuses: typing.Optional[ - typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] - ] = None, - subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, - monetized_subscriptions: typing.Optional[bool] = None, - q: typing.Optional[str] = None, - without_plan: typing.Optional[bool] = None, - without_subscription: typing.Optional[bool] = None, - sort_order_column: typing.Optional[str] = None, - sort_order_direction: typing.Optional[SortDirection] = None, - display_properties: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> ListCompaniesForAdvancedFilterResponse: + def lookup_company( + self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None + ) -> LookupCompanyResponse: """ Parameters ---------- - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp_) - - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more plan IDs (each ID starts with plan_) - - feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more feature IDs (each ID starts with feat_) - - credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more credit type IDs (each ID starts with bcrd_) - - subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) - - subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] - Filter companies by one or more subscription types (paid, free, trial) - - monetized_subscriptions : typing.Optional[bool] - Filter companies that have monetized subscriptions - - q : typing.Optional[str] - Search for companies by name, keys or string traits - - without_plan : typing.Optional[bool] - Filter out companies that have a plan - - without_subscription : typing.Optional[bool] - Filter out companies that have a subscription - - sort_order_column : typing.Optional[str] - Column to sort by (e.g. name, created_at, last_seen_at) - - sort_order_direction : typing.Optional[SortDirection] - Direction to sort by (asc or desc) - - display_properties : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) - - limit : typing.Optional[int] - Page limit (default 100) - - offset : typing.Optional[int] - Page offset (default 0) + keys : typing.Dict[str, str] + Key/value pairs request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - ListCompaniesForAdvancedFilterResponse - OK - - Examples - -------- - from schematic import Schematic - - client = Schematic( - api_key="YOUR_API_KEY", - ) - client.companies.list_companies_for_advanced_filter( - monetized_subscriptions=True, - q="q", - without_plan=True, - without_subscription=True, - sort_order_column="sort_order_column", - sort_order_direction="asc", - limit=1, - offset=1, - ) - """ - _response = self._raw_client.list_companies_for_advanced_filter( - ids=ids, - plan_ids=plan_ids, - feature_ids=feature_ids, - credit_type_ids=credit_type_ids, - subscription_statuses=subscription_statuses, - subscription_types=subscription_types, - monetized_subscriptions=monetized_subscriptions, - q=q, - without_plan=without_plan, - without_subscription=without_subscription, - sort_order_column=sort_order_column, - sort_order_direction=sort_order_direction, - display_properties=display_properties, - limit=limit, - offset=offset, - request_options=request_options, - ) - return _response.data - - def lookup_company( - self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None - ) -> LookupCompanyResponse: - """ - Parameters - ---------- - keys : typing.Dict[str, str] - Key/value pairs - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - LookupCompanyResponse + LookupCompanyResponse OK Examples @@ -2242,11 +2132,23 @@ def with_raw_response(self) -> AsyncRawCompaniesClient: async def list_companies( self, *, + credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + monetized_subscriptions: typing.Optional[bool] = None, plan_id: typing.Optional[str] = None, + plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, + sort_order_column: typing.Optional[str] = None, + sort_order_direction: typing.Optional[SortDirection] = None, + subscription_statuses: typing.Optional[ + typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] + ] = None, + subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, + with_entitlement_for: typing.Optional[str] = None, without_feature_override_for: typing.Optional[str] = None, without_plan: typing.Optional[bool] = None, + without_subscription: typing.Optional[bool] = None, with_subscription: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -2255,21 +2157,51 @@ async def list_companies( """ Parameters ---------- + credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by multiple company IDs (starts with comp_) + monetized_subscriptions : typing.Optional[bool] + Filter companies that have monetized subscriptions + plan_id : typing.Optional[str] Filter companies by plan ID (starts with plan_) + plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more plan IDs (each ID starts with plan_) + + plan_version_id : typing.Optional[str] + Filter companies by plan version ID (starts with plvr_) + q : typing.Optional[str] Search for companies by name, keys or string traits + sort_order_column : typing.Optional[str] + Column to sort by (e.g. name, created_at, last_seen_at) + + sort_order_direction : typing.Optional[SortDirection] + Direction to sort by (asc or desc) + + subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] + Filter companies by one or more subscription statuses + + subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] + Filter companies by one or more subscription types + + with_entitlement_for : typing.Optional[str] + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID + without_feature_override_for : typing.Optional[str] Filter out companies that already have a company override for the specified feature ID without_plan : typing.Optional[bool] Filter out companies that have a plan + without_subscription : typing.Optional[bool] + Filter out companies that have a subscription + with_subscription : typing.Optional[bool] Filter companies that have a subscription @@ -2300,10 +2232,16 @@ async def list_companies( async def main() -> None: await client.companies.list_companies( + monetized_subscriptions=True, plan_id="plan_id", + plan_version_id="plan_version_id", q="q", + sort_order_column="sort_order_column", + sort_order_direction="asc", + with_entitlement_for="with_entitlement_for", without_feature_override_for="without_feature_override_for", without_plan=True, + without_subscription=True, with_subscription=True, limit=1, offset=1, @@ -2313,11 +2251,21 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.list_companies( + credit_type_ids=credit_type_ids, ids=ids, + monetized_subscriptions=monetized_subscriptions, plan_id=plan_id, + plan_ids=plan_ids, + plan_version_id=plan_version_id, q=q, + sort_order_column=sort_order_column, + sort_order_direction=sort_order_direction, + subscription_statuses=subscription_statuses, + subscription_types=subscription_types, + with_entitlement_for=with_entitlement_for, without_feature_override_for=without_feature_override_for, without_plan=without_plan, + without_subscription=without_subscription, with_subscription=with_subscription, limit=limit, offset=offset, @@ -2332,6 +2280,7 @@ async def upsert_company( id: typing.Optional[str] = OMIT, last_seen_at: typing.Optional[dt.datetime] = OMIT, name: typing.Optional[str] = OMIT, + prevent_key_remap: typing.Optional[bool] = OMIT, traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, update_only: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -2349,6 +2298,8 @@ async def upsert_company( name : typing.Optional[str] + prevent_key_remap : typing.Optional[bool] + traits : typing.Optional[typing.Dict[str, typing.Any]] A map of trait names to trait values @@ -2386,6 +2337,7 @@ async def main() -> None: id=id, last_seen_at=last_seen_at, name=name, + prevent_key_remap=prevent_key_remap, traits=traits, update_only=update_only, request_options=request_options, @@ -2486,11 +2438,23 @@ async def main() -> None: async def count_companies( self, *, + credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + monetized_subscriptions: typing.Optional[bool] = None, plan_id: typing.Optional[str] = None, + plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, + sort_order_column: typing.Optional[str] = None, + sort_order_direction: typing.Optional[SortDirection] = None, + subscription_statuses: typing.Optional[ + typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] + ] = None, + subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, + with_entitlement_for: typing.Optional[str] = None, without_feature_override_for: typing.Optional[str] = None, without_plan: typing.Optional[bool] = None, + without_subscription: typing.Optional[bool] = None, with_subscription: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -2499,124 +2463,44 @@ async def count_companies( """ Parameters ---------- + credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by multiple company IDs (starts with comp_) + monetized_subscriptions : typing.Optional[bool] + Filter companies that have monetized subscriptions + plan_id : typing.Optional[str] Filter companies by plan ID (starts with plan_) - q : typing.Optional[str] - Search for companies by name, keys or string traits - - without_feature_override_for : typing.Optional[str] - Filter out companies that already have a company override for the specified feature ID - - without_plan : typing.Optional[bool] - Filter out companies that have a plan - - with_subscription : typing.Optional[bool] - Filter companies that have a subscription - - limit : typing.Optional[int] - Page limit (default 100) - - offset : typing.Optional[int] - Page offset (default 0) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - CountCompaniesResponse - OK - - Examples - -------- - import asyncio - - from schematic import AsyncSchematic - - client = AsyncSchematic( - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.companies.count_companies( - plan_id="plan_id", - q="q", - without_feature_override_for="without_feature_override_for", - without_plan=True, - with_subscription=True, - limit=1, - offset=1, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.count_companies( - ids=ids, - plan_id=plan_id, - q=q, - without_feature_override_for=without_feature_override_for, - without_plan=without_plan, - with_subscription=with_subscription, - limit=limit, - offset=offset, - request_options=request_options, - ) - return _response.data - - async def count_companies_for_advanced_filter( - self, - *, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - subscription_statuses: typing.Optional[ - typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] - ] = None, - subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, - monetized_subscriptions: typing.Optional[bool] = None, - q: typing.Optional[str] = None, - without_plan: typing.Optional[bool] = None, - without_subscription: typing.Optional[bool] = None, - sort_order_column: typing.Optional[str] = None, - sort_order_direction: typing.Optional[SortDirection] = None, - display_properties: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> CountCompaniesForAdvancedFilterResponse: - """ - Parameters - ---------- - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp_) - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by one or more plan IDs (each ID starts with plan_) - feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more feature IDs (each ID starts with feat_) + plan_version_id : typing.Optional[str] + Filter companies by plan version ID (starts with plvr_) - credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more credit type IDs (each ID starts with bcrd_) + q : typing.Optional[str] + Search for companies by name, keys or string traits + + sort_order_column : typing.Optional[str] + Column to sort by (e.g. name, created_at, last_seen_at) + + sort_order_direction : typing.Optional[SortDirection] + Direction to sort by (asc or desc) subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) + Filter companies by one or more subscription statuses subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] - Filter companies by one or more subscription types (paid, free, trial) + Filter companies by one or more subscription types - monetized_subscriptions : typing.Optional[bool] - Filter companies that have monetized subscriptions + with_entitlement_for : typing.Optional[str] + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID - q : typing.Optional[str] - Search for companies by name, keys or string traits + without_feature_override_for : typing.Optional[str] + Filter out companies that already have a company override for the specified feature ID without_plan : typing.Optional[bool] Filter out companies that have a plan @@ -2624,14 +2508,8 @@ async def count_companies_for_advanced_filter( without_subscription : typing.Optional[bool] Filter out companies that have a subscription - sort_order_column : typing.Optional[str] - Column to sort by (e.g. name, created_at, last_seen_at) - - sort_order_direction : typing.Optional[SortDirection] - Direction to sort by (asc or desc) - - display_properties : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) + with_subscription : typing.Optional[bool] + Filter companies that have a subscription limit : typing.Optional[int] Page limit (default 100) @@ -2644,7 +2522,7 @@ async def count_companies_for_advanced_filter( Returns ------- - CountCompaniesForAdvancedFilterResponse + CountCompaniesResponse OK Examples @@ -2659,13 +2537,18 @@ async def count_companies_for_advanced_filter( async def main() -> None: - await client.companies.count_companies_for_advanced_filter( + await client.companies.count_companies( monetized_subscriptions=True, + plan_id="plan_id", + plan_version_id="plan_version_id", q="q", - without_plan=True, - without_subscription=True, sort_order_column="sort_order_column", sort_order_direction="asc", + with_entitlement_for="with_entitlement_for", + without_feature_override_for="without_feature_override_for", + without_plan=True, + without_subscription=True, + with_subscription=True, limit=1, offset=1, ) @@ -2673,20 +2556,23 @@ async def main() -> None: asyncio.run(main()) """ - _response = await self._raw_client.count_companies_for_advanced_filter( + _response = await self._raw_client.count_companies( + credit_type_ids=credit_type_ids, ids=ids, + monetized_subscriptions=monetized_subscriptions, + plan_id=plan_id, plan_ids=plan_ids, - feature_ids=feature_ids, - credit_type_ids=credit_type_ids, + plan_version_id=plan_version_id, + q=q, + sort_order_column=sort_order_column, + sort_order_direction=sort_order_direction, subscription_statuses=subscription_statuses, subscription_types=subscription_types, - monetized_subscriptions=monetized_subscriptions, - q=q, + with_entitlement_for=with_entitlement_for, + without_feature_override_for=without_feature_override_for, without_plan=without_plan, without_subscription=without_subscription, - sort_order_column=sort_order_column, - sort_order_direction=sort_order_direction, - display_properties=display_properties, + with_subscription=with_subscription, limit=limit, offset=offset, request_options=request_options, @@ -2700,6 +2586,7 @@ async def create_company( id: typing.Optional[str] = OMIT, last_seen_at: typing.Optional[dt.datetime] = OMIT, name: typing.Optional[str] = OMIT, + prevent_key_remap: typing.Optional[bool] = OMIT, traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, update_only: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -2717,6 +2604,8 @@ async def create_company( name : typing.Optional[str] + prevent_key_remap : typing.Optional[bool] + traits : typing.Optional[typing.Dict[str, typing.Any]] A map of trait names to trait values @@ -2754,6 +2643,7 @@ async def main() -> None: id=id, last_seen_at=last_seen_at, name=name, + prevent_key_remap=prevent_key_remap, traits=traits, update_only=update_only, request_options=request_options, @@ -2798,130 +2688,6 @@ async def main() -> None: _response = await self._raw_client.delete_company_by_keys(keys=keys, request_options=request_options) return _response.data - async def list_companies_for_advanced_filter( - self, - *, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - subscription_statuses: typing.Optional[ - typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] - ] = None, - subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, - monetized_subscriptions: typing.Optional[bool] = None, - q: typing.Optional[str] = None, - without_plan: typing.Optional[bool] = None, - without_subscription: typing.Optional[bool] = None, - sort_order_column: typing.Optional[str] = None, - sort_order_direction: typing.Optional[SortDirection] = None, - display_properties: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> ListCompaniesForAdvancedFilterResponse: - """ - Parameters - ---------- - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp_) - - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more plan IDs (each ID starts with plan_) - - feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more feature IDs (each ID starts with feat_) - - credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more credit type IDs (each ID starts with bcrd_) - - subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) - - subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] - Filter companies by one or more subscription types (paid, free, trial) - - monetized_subscriptions : typing.Optional[bool] - Filter companies that have monetized subscriptions - - q : typing.Optional[str] - Search for companies by name, keys or string traits - - without_plan : typing.Optional[bool] - Filter out companies that have a plan - - without_subscription : typing.Optional[bool] - Filter out companies that have a subscription - - sort_order_column : typing.Optional[str] - Column to sort by (e.g. name, created_at, last_seen_at) - - sort_order_direction : typing.Optional[SortDirection] - Direction to sort by (asc or desc) - - display_properties : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) - - limit : typing.Optional[int] - Page limit (default 100) - - offset : typing.Optional[int] - Page offset (default 0) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ListCompaniesForAdvancedFilterResponse - OK - - Examples - -------- - import asyncio - - from schematic import AsyncSchematic - - client = AsyncSchematic( - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.companies.list_companies_for_advanced_filter( - monetized_subscriptions=True, - q="q", - without_plan=True, - without_subscription=True, - sort_order_column="sort_order_column", - sort_order_direction="asc", - limit=1, - offset=1, - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.list_companies_for_advanced_filter( - ids=ids, - plan_ids=plan_ids, - feature_ids=feature_ids, - credit_type_ids=credit_type_ids, - subscription_statuses=subscription_statuses, - subscription_types=subscription_types, - monetized_subscriptions=monetized_subscriptions, - q=q, - without_plan=without_plan, - without_subscription=without_subscription, - sort_order_column=sort_order_column, - sort_order_direction=sort_order_direction, - display_properties=display_properties, - limit=limit, - offset=offset, - request_options=request_options, - ) - return _response.data - async def lookup_company( self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None ) -> LookupCompanyResponse: diff --git a/src/schematic/companies/raw_client.py b/src/schematic/companies/raw_client.py index ecf99e8..b85e9d4 100644 --- a/src/schematic/companies/raw_client.py +++ b/src/schematic/companies/raw_client.py @@ -23,7 +23,6 @@ from ..types.subscription_type import SubscriptionType from ..types.trait_type import TraitType from ..types.update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody -from .types.count_companies_for_advanced_filter_response import CountCompaniesForAdvancedFilterResponse from .types.count_companies_response import CountCompaniesResponse from .types.count_entity_key_definitions_response import CountEntityKeyDefinitionsResponse from .types.count_entity_trait_definitions_response import CountEntityTraitDefinitionsResponse @@ -47,7 +46,6 @@ from .types.get_plan_change_response import GetPlanChangeResponse from .types.get_plan_trait_response import GetPlanTraitResponse from .types.get_user_response import GetUserResponse -from .types.list_companies_for_advanced_filter_response import ListCompaniesForAdvancedFilterResponse from .types.list_companies_response import ListCompaniesResponse from .types.list_company_memberships_response import ListCompanyMembershipsResponse from .types.list_entity_key_definitions_response import ListEntityKeyDefinitionsResponse @@ -76,11 +74,23 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list_companies( self, *, + credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + monetized_subscriptions: typing.Optional[bool] = None, plan_id: typing.Optional[str] = None, + plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, + sort_order_column: typing.Optional[str] = None, + sort_order_direction: typing.Optional[SortDirection] = None, + subscription_statuses: typing.Optional[ + typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] + ] = None, + subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, + with_entitlement_for: typing.Optional[str] = None, without_feature_override_for: typing.Optional[str] = None, without_plan: typing.Optional[bool] = None, + without_subscription: typing.Optional[bool] = None, with_subscription: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -89,21 +99,51 @@ def list_companies( """ Parameters ---------- + credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by multiple company IDs (starts with comp_) + monetized_subscriptions : typing.Optional[bool] + Filter companies that have monetized subscriptions + plan_id : typing.Optional[str] Filter companies by plan ID (starts with plan_) + plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more plan IDs (each ID starts with plan_) + + plan_version_id : typing.Optional[str] + Filter companies by plan version ID (starts with plvr_) + q : typing.Optional[str] Search for companies by name, keys or string traits + sort_order_column : typing.Optional[str] + Column to sort by (e.g. name, created_at, last_seen_at) + + sort_order_direction : typing.Optional[SortDirection] + Direction to sort by (asc or desc) + + subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] + Filter companies by one or more subscription statuses + + subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] + Filter companies by one or more subscription types + + with_entitlement_for : typing.Optional[str] + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID + without_feature_override_for : typing.Optional[str] Filter out companies that already have a company override for the specified feature ID without_plan : typing.Optional[bool] Filter out companies that have a plan + without_subscription : typing.Optional[bool] + Filter out companies that have a subscription + with_subscription : typing.Optional[bool] Filter companies that have a subscription @@ -125,11 +165,21 @@ def list_companies( "companies", method="GET", params={ + "credit_type_ids": credit_type_ids, "ids": ids, + "monetized_subscriptions": monetized_subscriptions, "plan_id": plan_id, + "plan_ids": plan_ids, + "plan_version_id": plan_version_id, "q": q, + "sort_order_column": sort_order_column, + "sort_order_direction": sort_order_direction, + "subscription_statuses": subscription_statuses, + "subscription_types": subscription_types, + "with_entitlement_for": with_entitlement_for, "without_feature_override_for": without_feature_override_for, "without_plan": without_plan, + "without_subscription": without_subscription, "with_subscription": with_subscription, "limit": limit, "offset": offset, @@ -217,6 +267,7 @@ def upsert_company( id: typing.Optional[str] = OMIT, last_seen_at: typing.Optional[dt.datetime] = OMIT, name: typing.Optional[str] = OMIT, + prevent_key_remap: typing.Optional[bool] = OMIT, traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, update_only: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -234,6 +285,8 @@ def upsert_company( name : typing.Optional[str] + prevent_key_remap : typing.Optional[bool] + traits : typing.Optional[typing.Dict[str, typing.Any]] A map of trait names to trait values @@ -255,6 +308,7 @@ def upsert_company( "keys": keys, "last_seen_at": last_seen_at, "name": name, + "prevent_key_remap": prevent_key_remap, "traits": traits, "update_only": update_only, }, @@ -535,11 +589,23 @@ def delete_company( def count_companies( self, *, + credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + monetized_subscriptions: typing.Optional[bool] = None, plan_id: typing.Optional[str] = None, + plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, + sort_order_column: typing.Optional[str] = None, + sort_order_direction: typing.Optional[SortDirection] = None, + subscription_statuses: typing.Optional[ + typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] + ] = None, + subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, + with_entitlement_for: typing.Optional[str] = None, without_feature_override_for: typing.Optional[str] = None, without_plan: typing.Optional[bool] = None, + without_subscription: typing.Optional[bool] = None, with_subscription: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -548,21 +614,51 @@ def count_companies( """ Parameters ---------- + credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by multiple company IDs (starts with comp_) + monetized_subscriptions : typing.Optional[bool] + Filter companies that have monetized subscriptions + plan_id : typing.Optional[str] Filter companies by plan ID (starts with plan_) + plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more plan IDs (each ID starts with plan_) + + plan_version_id : typing.Optional[str] + Filter companies by plan version ID (starts with plvr_) + q : typing.Optional[str] Search for companies by name, keys or string traits + sort_order_column : typing.Optional[str] + Column to sort by (e.g. name, created_at, last_seen_at) + + sort_order_direction : typing.Optional[SortDirection] + Direction to sort by (asc or desc) + + subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] + Filter companies by one or more subscription statuses + + subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] + Filter companies by one or more subscription types + + with_entitlement_for : typing.Optional[str] + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID + without_feature_override_for : typing.Optional[str] Filter out companies that already have a company override for the specified feature ID without_plan : typing.Optional[bool] Filter out companies that have a plan + without_subscription : typing.Optional[bool] + Filter out companies that have a subscription + with_subscription : typing.Optional[bool] Filter companies that have a subscription @@ -584,11 +680,21 @@ def count_companies( "companies/count", method="GET", params={ + "credit_type_ids": credit_type_ids, "ids": ids, + "monetized_subscriptions": monetized_subscriptions, "plan_id": plan_id, + "plan_ids": plan_ids, + "plan_version_id": plan_version_id, "q": q, + "sort_order_column": sort_order_column, + "sort_order_direction": sort_order_direction, + "subscription_statuses": subscription_statuses, + "subscription_types": subscription_types, + "with_entitlement_for": with_entitlement_for, "without_feature_override_for": without_feature_override_for, "without_plan": without_plan, + "without_subscription": without_subscription, "with_subscription": with_subscription, "limit": limit, "offset": offset, @@ -669,112 +775,70 @@ def count_companies( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - def count_companies_for_advanced_filter( + def create_company( self, *, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - subscription_statuses: typing.Optional[ - typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] - ] = None, - subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, - monetized_subscriptions: typing.Optional[bool] = None, - q: typing.Optional[str] = None, - without_plan: typing.Optional[bool] = None, - without_subscription: typing.Optional[bool] = None, - sort_order_column: typing.Optional[str] = None, - sort_order_direction: typing.Optional[SortDirection] = None, - display_properties: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, + keys: typing.Dict[str, str], + id: typing.Optional[str] = OMIT, + last_seen_at: typing.Optional[dt.datetime] = OMIT, + name: typing.Optional[str] = OMIT, + prevent_key_remap: typing.Optional[bool] = OMIT, + traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + update_only: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[CountCompaniesForAdvancedFilterResponse]: + ) -> HttpResponse[CreateCompanyResponse]: """ Parameters ---------- - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp_) - - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more plan IDs (each ID starts with plan_) - - feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more feature IDs (each ID starts with feat_) - - credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more credit type IDs (each ID starts with bcrd_) - - subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) - - subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] - Filter companies by one or more subscription types (paid, free, trial) - - monetized_subscriptions : typing.Optional[bool] - Filter companies that have monetized subscriptions - - q : typing.Optional[str] - Search for companies by name, keys or string traits - - without_plan : typing.Optional[bool] - Filter out companies that have a plan + keys : typing.Dict[str, str] + See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information - without_subscription : typing.Optional[bool] - Filter out companies that have a subscription + id : typing.Optional[str] + If you know the Schematic ID, you can use that here instead of keys - sort_order_column : typing.Optional[str] - Column to sort by (e.g. name, created_at, last_seen_at) + last_seen_at : typing.Optional[dt.datetime] - sort_order_direction : typing.Optional[SortDirection] - Direction to sort by (asc or desc) + name : typing.Optional[str] - display_properties : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) + prevent_key_remap : typing.Optional[bool] - limit : typing.Optional[int] - Page limit (default 100) + traits : typing.Optional[typing.Dict[str, typing.Any]] + A map of trait names to trait values - offset : typing.Optional[int] - Page offset (default 0) + update_only : typing.Optional[bool] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[CountCompaniesForAdvancedFilterResponse] - OK + HttpResponse[CreateCompanyResponse] + Created """ _response = self._client_wrapper.httpx_client.request( - "companies/count2", - method="GET", - params={ - "ids": ids, - "plan_ids": plan_ids, - "feature_ids": feature_ids, - "credit_type_ids": credit_type_ids, - "subscription_statuses": subscription_statuses, - "subscription_types": subscription_types, - "monetized_subscriptions": monetized_subscriptions, - "q": q, - "without_plan": without_plan, - "without_subscription": without_subscription, - "sort_order_column": sort_order_column, - "sort_order_direction": sort_order_direction, - "display_properties": display_properties, - "limit": limit, - "offset": offset, + "companies/create", + method="POST", + json={ + "id": id, + "keys": keys, + "last_seen_at": last_seen_at, + "name": name, + "prevent_key_remap": prevent_key_remap, + "traits": traits, + "update_only": update_only, + }, + headers={ + "content-type": "application/json", }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - CountCompaniesForAdvancedFilterResponse, + CreateCompanyResponse, parse_obj_as( - type_=CountCompaniesForAdvancedFilterResponse, # type: ignore + type_=CreateCompanyResponse, # type: ignore object_=_response.json(), ), ) @@ -843,53 +907,27 @@ def count_companies_for_advanced_filter( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - def create_company( - self, - *, - keys: typing.Dict[str, str], - id: typing.Optional[str] = OMIT, - last_seen_at: typing.Optional[dt.datetime] = OMIT, - name: typing.Optional[str] = OMIT, - traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, - update_only: typing.Optional[bool] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[CreateCompanyResponse]: + def delete_company_by_keys( + self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[DeleteCompanyByKeysResponse]: """ Parameters ---------- keys : typing.Dict[str, str] - See [Key Management](https://docs.schematichq.com/developer_resources/key_management) for more information - - id : typing.Optional[str] - If you know the Schematic ID, you can use that here instead of keys - - last_seen_at : typing.Optional[dt.datetime] - - name : typing.Optional[str] - - traits : typing.Optional[typing.Dict[str, typing.Any]] - A map of trait names to trait values - - update_only : typing.Optional[bool] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[CreateCompanyResponse] - Created + HttpResponse[DeleteCompanyByKeysResponse] + OK """ _response = self._client_wrapper.httpx_client.request( - "companies/create", + "companies/delete", method="POST", json={ - "id": id, "keys": keys, - "last_seen_at": last_seen_at, - "name": name, - "traits": traits, - "update_only": update_only, }, headers={ "content-type": "application/json", @@ -900,9 +938,9 @@ def create_company( try: if 200 <= _response.status_code < 300: _data = typing.cast( - CreateCompanyResponse, + DeleteCompanyByKeysResponse, parse_obj_as( - type_=CreateCompanyResponse, # type: ignore + type_=DeleteCompanyByKeysResponse, # type: ignore object_=_response.json(), ), ) @@ -971,313 +1009,37 @@ def create_company( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - def delete_company_by_keys( + def lookup_company( self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[DeleteCompanyByKeysResponse]: + ) -> HttpResponse[LookupCompanyResponse]: """ Parameters ---------- keys : typing.Dict[str, str] + Key/value pairs request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[DeleteCompanyByKeysResponse] + HttpResponse[LookupCompanyResponse] OK """ _response = self._client_wrapper.httpx_client.request( - "companies/delete", - method="POST", - json={ + "companies/lookup", + method="GET", + params={ "keys": keys, }, - headers={ - "content-type": "application/json", - }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - DeleteCompanyByKeysResponse, + LookupCompanyResponse, parse_obj_as( - type_=DeleteCompanyByKeysResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise core_api_error_ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - raise core_api_error_ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response_json - ) - - def list_companies_for_advanced_filter( - self, - *, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - subscription_statuses: typing.Optional[ - typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] - ] = None, - subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, - monetized_subscriptions: typing.Optional[bool] = None, - q: typing.Optional[str] = None, - without_plan: typing.Optional[bool] = None, - without_subscription: typing.Optional[bool] = None, - sort_order_column: typing.Optional[str] = None, - sort_order_direction: typing.Optional[SortDirection] = None, - display_properties: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[ListCompaniesForAdvancedFilterResponse]: - """ - Parameters - ---------- - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp_) - - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more plan IDs (each ID starts with plan_) - - feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more feature IDs (each ID starts with feat_) - - credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more credit type IDs (each ID starts with bcrd_) - - subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) - - subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] - Filter companies by one or more subscription types (paid, free, trial) - - monetized_subscriptions : typing.Optional[bool] - Filter companies that have monetized subscriptions - - q : typing.Optional[str] - Search for companies by name, keys or string traits - - without_plan : typing.Optional[bool] - Filter out companies that have a plan - - without_subscription : typing.Optional[bool] - Filter out companies that have a subscription - - sort_order_column : typing.Optional[str] - Column to sort by (e.g. name, created_at, last_seen_at) - - sort_order_direction : typing.Optional[SortDirection] - Direction to sort by (asc or desc) - - display_properties : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) - - limit : typing.Optional[int] - Page limit (default 100) - - offset : typing.Optional[int] - Page offset (default 0) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[ListCompaniesForAdvancedFilterResponse] - OK - """ - _response = self._client_wrapper.httpx_client.request( - "companies/list2", - method="GET", - params={ - "ids": ids, - "plan_ids": plan_ids, - "feature_ids": feature_ids, - "credit_type_ids": credit_type_ids, - "subscription_statuses": subscription_statuses, - "subscription_types": subscription_types, - "monetized_subscriptions": monetized_subscriptions, - "q": q, - "without_plan": without_plan, - "without_subscription": without_subscription, - "sort_order_column": sort_order_column, - "sort_order_direction": sort_order_direction, - "display_properties": display_properties, - "limit": limit, - "offset": offset, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - ListCompaniesForAdvancedFilterResponse, - parse_obj_as( - type_=ListCompaniesForAdvancedFilterResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise core_api_error_ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - raise core_api_error_ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response_json - ) - - def lookup_company( - self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[LookupCompanyResponse]: - """ - Parameters - ---------- - keys : typing.Dict[str, str] - Key/value pairs - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[LookupCompanyResponse] - OK - """ - _response = self._client_wrapper.httpx_client.request( - "companies/lookup", - method="GET", - params={ - "keys": keys, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - LookupCompanyResponse, - parse_obj_as( - type_=LookupCompanyResponse, # type: ignore + type_=LookupCompanyResponse, # type: ignore object_=_response.json(), ), ) @@ -4844,11 +4606,23 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list_companies( self, *, + credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + monetized_subscriptions: typing.Optional[bool] = None, plan_id: typing.Optional[str] = None, + plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, + sort_order_column: typing.Optional[str] = None, + sort_order_direction: typing.Optional[SortDirection] = None, + subscription_statuses: typing.Optional[ + typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] + ] = None, + subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, + with_entitlement_for: typing.Optional[str] = None, without_feature_override_for: typing.Optional[str] = None, without_plan: typing.Optional[bool] = None, + without_subscription: typing.Optional[bool] = None, with_subscription: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -4857,21 +4631,51 @@ async def list_companies( """ Parameters ---------- + credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by multiple company IDs (starts with comp_) + monetized_subscriptions : typing.Optional[bool] + Filter companies that have monetized subscriptions + plan_id : typing.Optional[str] Filter companies by plan ID (starts with plan_) + plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more plan IDs (each ID starts with plan_) + + plan_version_id : typing.Optional[str] + Filter companies by plan version ID (starts with plvr_) + q : typing.Optional[str] Search for companies by name, keys or string traits + sort_order_column : typing.Optional[str] + Column to sort by (e.g. name, created_at, last_seen_at) + + sort_order_direction : typing.Optional[SortDirection] + Direction to sort by (asc or desc) + + subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] + Filter companies by one or more subscription statuses + + subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] + Filter companies by one or more subscription types + + with_entitlement_for : typing.Optional[str] + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID + without_feature_override_for : typing.Optional[str] Filter out companies that already have a company override for the specified feature ID without_plan : typing.Optional[bool] Filter out companies that have a plan + without_subscription : typing.Optional[bool] + Filter out companies that have a subscription + with_subscription : typing.Optional[bool] Filter companies that have a subscription @@ -4893,11 +4697,21 @@ async def list_companies( "companies", method="GET", params={ + "credit_type_ids": credit_type_ids, "ids": ids, + "monetized_subscriptions": monetized_subscriptions, "plan_id": plan_id, + "plan_ids": plan_ids, + "plan_version_id": plan_version_id, "q": q, + "sort_order_column": sort_order_column, + "sort_order_direction": sort_order_direction, + "subscription_statuses": subscription_statuses, + "subscription_types": subscription_types, + "with_entitlement_for": with_entitlement_for, "without_feature_override_for": without_feature_override_for, "without_plan": without_plan, + "without_subscription": without_subscription, "with_subscription": with_subscription, "limit": limit, "offset": offset, @@ -4985,6 +4799,7 @@ async def upsert_company( id: typing.Optional[str] = OMIT, last_seen_at: typing.Optional[dt.datetime] = OMIT, name: typing.Optional[str] = OMIT, + prevent_key_remap: typing.Optional[bool] = OMIT, traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, update_only: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -5002,6 +4817,8 @@ async def upsert_company( name : typing.Optional[str] + prevent_key_remap : typing.Optional[bool] + traits : typing.Optional[typing.Dict[str, typing.Any]] A map of trait names to trait values @@ -5023,6 +4840,7 @@ async def upsert_company( "keys": keys, "last_seen_at": last_seen_at, "name": name, + "prevent_key_remap": prevent_key_remap, "traits": traits, "update_only": update_only, }, @@ -5303,11 +5121,23 @@ async def delete_company( async def count_companies( self, *, + credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + monetized_subscriptions: typing.Optional[bool] = None, plan_id: typing.Optional[str] = None, + plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, + sort_order_column: typing.Optional[str] = None, + sort_order_direction: typing.Optional[SortDirection] = None, + subscription_statuses: typing.Optional[ + typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] + ] = None, + subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, + with_entitlement_for: typing.Optional[str] = None, without_feature_override_for: typing.Optional[str] = None, without_plan: typing.Optional[bool] = None, + without_subscription: typing.Optional[bool] = None, with_subscription: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -5316,175 +5146,44 @@ async def count_companies( """ Parameters ---------- + credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by multiple company IDs (starts with comp_) + monetized_subscriptions : typing.Optional[bool] + Filter companies that have monetized subscriptions + plan_id : typing.Optional[str] Filter companies by plan ID (starts with plan_) - q : typing.Optional[str] - Search for companies by name, keys or string traits - - without_feature_override_for : typing.Optional[str] - Filter out companies that already have a company override for the specified feature ID - - without_plan : typing.Optional[bool] - Filter out companies that have a plan - - with_subscription : typing.Optional[bool] - Filter companies that have a subscription - - limit : typing.Optional[int] - Page limit (default 100) - - offset : typing.Optional[int] - Page offset (default 0) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[CountCompaniesResponse] - OK - """ - _response = await self._client_wrapper.httpx_client.request( - "companies/count", - method="GET", - params={ - "ids": ids, - "plan_id": plan_id, - "q": q, - "without_feature_override_for": without_feature_override_for, - "without_plan": without_plan, - "with_subscription": with_subscription, - "limit": limit, - "offset": offset, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - CountCompaniesResponse, - parse_obj_as( - type_=CountCompaniesResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise core_api_error_ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - raise core_api_error_ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response_json - ) - - async def count_companies_for_advanced_filter( - self, - *, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - subscription_statuses: typing.Optional[ - typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] - ] = None, - subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, - monetized_subscriptions: typing.Optional[bool] = None, - q: typing.Optional[str] = None, - without_plan: typing.Optional[bool] = None, - without_subscription: typing.Optional[bool] = None, - sort_order_column: typing.Optional[str] = None, - sort_order_direction: typing.Optional[SortDirection] = None, - display_properties: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[CountCompaniesForAdvancedFilterResponse]: - """ - Parameters - ---------- - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp_) - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter companies by one or more plan IDs (each ID starts with plan_) - feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more feature IDs (each ID starts with feat_) + plan_version_id : typing.Optional[str] + Filter companies by plan version ID (starts with plvr_) - credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more credit type IDs (each ID starts with bcrd_) + q : typing.Optional[str] + Search for companies by name, keys or string traits + + sort_order_column : typing.Optional[str] + Column to sort by (e.g. name, created_at, last_seen_at) + + sort_order_direction : typing.Optional[SortDirection] + Direction to sort by (asc or desc) subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) + Filter companies by one or more subscription statuses subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] - Filter companies by one or more subscription types (paid, free, trial) + Filter companies by one or more subscription types - monetized_subscriptions : typing.Optional[bool] - Filter companies that have monetized subscriptions + with_entitlement_for : typing.Optional[str] + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID - q : typing.Optional[str] - Search for companies by name, keys or string traits + without_feature_override_for : typing.Optional[str] + Filter out companies that already have a company override for the specified feature ID without_plan : typing.Optional[bool] Filter out companies that have a plan @@ -5492,14 +5191,8 @@ async def count_companies_for_advanced_filter( without_subscription : typing.Optional[bool] Filter out companies that have a subscription - sort_order_column : typing.Optional[str] - Column to sort by (e.g. name, created_at, last_seen_at) - - sort_order_direction : typing.Optional[SortDirection] - Direction to sort by (asc or desc) - - display_properties : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) + with_subscription : typing.Optional[bool] + Filter companies that have a subscription limit : typing.Optional[int] Page limit (default 100) @@ -5512,26 +5205,29 @@ async def count_companies_for_advanced_filter( Returns ------- - AsyncHttpResponse[CountCompaniesForAdvancedFilterResponse] + AsyncHttpResponse[CountCompaniesResponse] OK """ _response = await self._client_wrapper.httpx_client.request( - "companies/count2", + "companies/count", method="GET", params={ + "credit_type_ids": credit_type_ids, "ids": ids, + "monetized_subscriptions": monetized_subscriptions, + "plan_id": plan_id, "plan_ids": plan_ids, - "feature_ids": feature_ids, - "credit_type_ids": credit_type_ids, + "plan_version_id": plan_version_id, + "q": q, + "sort_order_column": sort_order_column, + "sort_order_direction": sort_order_direction, "subscription_statuses": subscription_statuses, "subscription_types": subscription_types, - "monetized_subscriptions": monetized_subscriptions, - "q": q, + "with_entitlement_for": with_entitlement_for, + "without_feature_override_for": without_feature_override_for, "without_plan": without_plan, "without_subscription": without_subscription, - "sort_order_column": sort_order_column, - "sort_order_direction": sort_order_direction, - "display_properties": display_properties, + "with_subscription": with_subscription, "limit": limit, "offset": offset, }, @@ -5540,9 +5236,9 @@ async def count_companies_for_advanced_filter( try: if 200 <= _response.status_code < 300: _data = typing.cast( - CountCompaniesForAdvancedFilterResponse, + CountCompaniesResponse, parse_obj_as( - type_=CountCompaniesForAdvancedFilterResponse, # type: ignore + type_=CountCompaniesResponse, # type: ignore object_=_response.json(), ), ) @@ -5618,6 +5314,7 @@ async def create_company( id: typing.Optional[str] = OMIT, last_seen_at: typing.Optional[dt.datetime] = OMIT, name: typing.Optional[str] = OMIT, + prevent_key_remap: typing.Optional[bool] = OMIT, traits: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, update_only: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -5635,6 +5332,8 @@ async def create_company( name : typing.Optional[str] + prevent_key_remap : typing.Optional[bool] + traits : typing.Optional[typing.Dict[str, typing.Any]] A map of trait names to trait values @@ -5656,6 +5355,7 @@ async def create_company( "keys": keys, "last_seen_at": last_seen_at, "name": name, + "prevent_key_remap": prevent_key_remap, "traits": traits, "update_only": update_only, }, @@ -5841,180 +5541,6 @@ async def delete_company_by_keys( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - async def list_companies_for_advanced_filter( - self, - *, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - credit_type_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - subscription_statuses: typing.Optional[ - typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]] - ] = None, - subscription_types: typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] = None, - monetized_subscriptions: typing.Optional[bool] = None, - q: typing.Optional[str] = None, - without_plan: typing.Optional[bool] = None, - without_subscription: typing.Optional[bool] = None, - sort_order_column: typing.Optional[str] = None, - sort_order_direction: typing.Optional[SortDirection] = None, - display_properties: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - limit: typing.Optional[int] = None, - offset: typing.Optional[int] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[ListCompaniesForAdvancedFilterResponse]: - """ - Parameters - ---------- - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp_) - - plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more plan IDs (each ID starts with plan_) - - feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more feature IDs (each ID starts with feat_) - - credit_type_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by one or more credit type IDs (each ID starts with bcrd_) - - subscription_statuses : typing.Optional[typing.Union[SubscriptionStatus, typing.Sequence[SubscriptionStatus]]] - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) - - subscription_types : typing.Optional[typing.Union[SubscriptionType, typing.Sequence[SubscriptionType]]] - Filter companies by one or more subscription types (paid, free, trial) - - monetized_subscriptions : typing.Optional[bool] - Filter companies that have monetized subscriptions - - q : typing.Optional[str] - Search for companies by name, keys or string traits - - without_plan : typing.Optional[bool] - Filter out companies that have a plan - - without_subscription : typing.Optional[bool] - Filter out companies that have a subscription - - sort_order_column : typing.Optional[str] - Column to sort by (e.g. name, created_at, last_seen_at) - - sort_order_direction : typing.Optional[SortDirection] - Direction to sort by (asc or desc) - - display_properties : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) - - limit : typing.Optional[int] - Page limit (default 100) - - offset : typing.Optional[int] - Page offset (default 0) - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[ListCompaniesForAdvancedFilterResponse] - OK - """ - _response = await self._client_wrapper.httpx_client.request( - "companies/list2", - method="GET", - params={ - "ids": ids, - "plan_ids": plan_ids, - "feature_ids": feature_ids, - "credit_type_ids": credit_type_ids, - "subscription_statuses": subscription_statuses, - "subscription_types": subscription_types, - "monetized_subscriptions": monetized_subscriptions, - "q": q, - "without_plan": without_plan, - "without_subscription": without_subscription, - "sort_order_column": sort_order_column, - "sort_order_direction": sort_order_direction, - "display_properties": display_properties, - "limit": limit, - "offset": offset, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - ListCompaniesForAdvancedFilterResponse, - parse_obj_as( - type_=ListCompaniesForAdvancedFilterResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - if _response.status_code == 400: - raise BadRequestError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 403: - raise ForbiddenError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 404: - raise NotFoundError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - if _response.status_code == 500: - raise InternalServerError( - headers=dict(_response.headers), - body=typing.cast( - types_api_error_ApiError, - parse_obj_as( - type_=types_api_error_ApiError, # type: ignore - object_=_response.json(), - ), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise core_api_error_ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response.text - ) - raise core_api_error_ApiError( - status_code=_response.status_code, headers=dict(_response.headers), body=_response_json - ) - async def lookup_company( self, *, keys: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[LookupCompanyResponse]: diff --git a/src/schematic/companies/types/__init__.py b/src/schematic/companies/types/__init__.py index 43825a3..50aa598 100644 --- a/src/schematic/companies/types/__init__.py +++ b/src/schematic/companies/types/__init__.py @@ -6,8 +6,6 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .count_companies_for_advanced_filter_params import CountCompaniesForAdvancedFilterParams - from .count_companies_for_advanced_filter_response import CountCompaniesForAdvancedFilterResponse from .count_companies_params import CountCompaniesParams from .count_companies_response import CountCompaniesResponse from .count_entity_key_definitions_params import CountEntityKeyDefinitionsParams @@ -39,8 +37,6 @@ from .get_plan_change_response import GetPlanChangeResponse from .get_plan_trait_response import GetPlanTraitResponse from .get_user_response import GetUserResponse - from .list_companies_for_advanced_filter_params import ListCompaniesForAdvancedFilterParams - from .list_companies_for_advanced_filter_response import ListCompaniesForAdvancedFilterResponse from .list_companies_params import ListCompaniesParams from .list_companies_response import ListCompaniesResponse from .list_company_memberships_params import ListCompanyMembershipsParams @@ -67,8 +63,6 @@ from .upsert_user_response import UpsertUserResponse from .upsert_user_trait_response import UpsertUserTraitResponse _dynamic_imports: typing.Dict[str, str] = { - "CountCompaniesForAdvancedFilterParams": ".count_companies_for_advanced_filter_params", - "CountCompaniesForAdvancedFilterResponse": ".count_companies_for_advanced_filter_response", "CountCompaniesParams": ".count_companies_params", "CountCompaniesResponse": ".count_companies_response", "CountEntityKeyDefinitionsParams": ".count_entity_key_definitions_params", @@ -100,8 +94,6 @@ "GetPlanChangeResponse": ".get_plan_change_response", "GetPlanTraitResponse": ".get_plan_trait_response", "GetUserResponse": ".get_user_response", - "ListCompaniesForAdvancedFilterParams": ".list_companies_for_advanced_filter_params", - "ListCompaniesForAdvancedFilterResponse": ".list_companies_for_advanced_filter_response", "ListCompaniesParams": ".list_companies_params", "ListCompaniesResponse": ".list_companies_response", "ListCompanyMembershipsParams": ".list_company_memberships_params", @@ -152,8 +144,6 @@ def __dir__(): __all__ = [ - "CountCompaniesForAdvancedFilterParams", - "CountCompaniesForAdvancedFilterResponse", "CountCompaniesParams", "CountCompaniesResponse", "CountEntityKeyDefinitionsParams", @@ -185,8 +175,6 @@ def __dir__(): "GetPlanChangeResponse", "GetPlanTraitResponse", "GetUserResponse", - "ListCompaniesForAdvancedFilterParams", - "ListCompaniesForAdvancedFilterResponse", "ListCompaniesParams", "ListCompaniesResponse", "ListCompanyMembershipsParams", diff --git a/src/schematic/companies/types/count_companies_for_advanced_filter_params.py b/src/schematic/companies/types/count_companies_for_advanced_filter_params.py deleted file mode 100644 index bc63781..0000000 --- a/src/schematic/companies/types/count_companies_for_advanced_filter_params.py +++ /dev/null @@ -1,95 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.sort_direction import SortDirection -from ...types.subscription_status import SubscriptionStatus -from ...types.subscription_type import SubscriptionType - - -class CountCompaniesForAdvancedFilterParams(UniversalBaseModel): - """ - Input parameters - """ - - credit_type_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter companies by one or more credit type IDs (each ID starts with bcrd_) - """ - - display_properties: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) - """ - - feature_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter companies by one or more feature IDs (each ID starts with feat_) - """ - - ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter companies by multiple company IDs (starts with comp_) - """ - - limit: typing.Optional[int] = pydantic.Field(default=None) - """ - Page limit (default 100) - """ - - monetized_subscriptions: typing.Optional[bool] = pydantic.Field(default=None) - """ - Filter companies that have monetized subscriptions - """ - - offset: typing.Optional[int] = pydantic.Field(default=None) - """ - Page offset (default 0) - """ - - plan_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter companies by one or more plan IDs (each ID starts with plan_) - """ - - q: typing.Optional[str] = pydantic.Field(default=None) - """ - Search for companies by name, keys or string traits - """ - - sort_order_column: typing.Optional[str] = pydantic.Field(default=None) - """ - Column to sort by (e.g. name, created_at, last_seen_at) - """ - - sort_order_direction: typing.Optional[SortDirection] = None - subscription_statuses: typing.Optional[typing.List[SubscriptionStatus]] = pydantic.Field(default=None) - """ - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) - """ - - subscription_types: typing.Optional[typing.List[SubscriptionType]] = pydantic.Field(default=None) - """ - Filter companies by one or more subscription types (paid, free, trial) - """ - - without_plan: typing.Optional[bool] = pydantic.Field(default=None) - """ - Filter out companies that have a plan - """ - - without_subscription: typing.Optional[bool] = pydantic.Field(default=None) - """ - Filter out companies that have a subscription - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/schematic/companies/types/count_companies_params.py b/src/schematic/companies/types/count_companies_params.py index d355b13..0d64050 100644 --- a/src/schematic/companies/types/count_companies_params.py +++ b/src/schematic/companies/types/count_companies_params.py @@ -4,6 +4,9 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.sort_direction import SortDirection +from ...types.subscription_status import SubscriptionStatus +from ...types.subscription_type import SubscriptionType class CountCompaniesParams(UniversalBaseModel): @@ -11,6 +14,11 @@ class CountCompaniesParams(UniversalBaseModel): Input parameters """ + credit_type_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + """ + ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Filter companies by multiple company IDs (starts with comp_) @@ -21,6 +29,11 @@ class CountCompaniesParams(UniversalBaseModel): Page limit (default 100) """ + monetized_subscriptions: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter companies that have monetized subscriptions + """ + offset: typing.Optional[int] = pydantic.Field(default=None) """ Page offset (default 0) @@ -31,11 +44,46 @@ class CountCompaniesParams(UniversalBaseModel): Filter companies by plan ID (starts with plan_) """ + plan_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Filter companies by one or more plan IDs (each ID starts with plan_) + """ + + plan_version_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Filter companies by plan version ID (starts with plvr_) + """ + q: typing.Optional[str] = pydantic.Field(default=None) """ Search for companies by name, keys or string traits """ + sort_order_column: typing.Optional[str] = pydantic.Field(default=None) + """ + Column to sort by (e.g. name, created_at, last_seen_at) + """ + + sort_order_direction: typing.Optional[SortDirection] = pydantic.Field(default=None) + """ + Direction to sort by (asc or desc) + """ + + subscription_statuses: typing.Optional[typing.List[SubscriptionStatus]] = pydantic.Field(default=None) + """ + Filter companies by one or more subscription statuses + """ + + subscription_types: typing.Optional[typing.List[SubscriptionType]] = pydantic.Field(default=None) + """ + Filter companies by one or more subscription types + """ + + with_entitlement_for: typing.Optional[str] = pydantic.Field(default=None) + """ + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID + """ + with_subscription: typing.Optional[bool] = pydantic.Field(default=None) """ Filter companies that have a subscription @@ -51,6 +99,11 @@ class CountCompaniesParams(UniversalBaseModel): Filter out companies that have a plan """ + without_subscription: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter out companies that have a subscription + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/schematic/companies/types/list_companies_for_advanced_filter_params.py b/src/schematic/companies/types/list_companies_for_advanced_filter_params.py deleted file mode 100644 index 72ebd68..0000000 --- a/src/schematic/companies/types/list_companies_for_advanced_filter_params.py +++ /dev/null @@ -1,95 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.sort_direction import SortDirection -from ...types.subscription_status import SubscriptionStatus -from ...types.subscription_type import SubscriptionType - - -class ListCompaniesForAdvancedFilterParams(UniversalBaseModel): - """ - Input parameters - """ - - credit_type_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter companies by one or more credit type IDs (each ID starts with bcrd_) - """ - - display_properties: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Select the display columns to return (e.g. plan, subscription, users, last_seen_at) - """ - - feature_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter companies by one or more feature IDs (each ID starts with feat_) - """ - - ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter companies by multiple company IDs (starts with comp_) - """ - - limit: typing.Optional[int] = pydantic.Field(default=None) - """ - Page limit (default 100) - """ - - monetized_subscriptions: typing.Optional[bool] = pydantic.Field(default=None) - """ - Filter companies that have monetized subscriptions - """ - - offset: typing.Optional[int] = pydantic.Field(default=None) - """ - Page offset (default 0) - """ - - plan_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - Filter companies by one or more plan IDs (each ID starts with plan_) - """ - - q: typing.Optional[str] = pydantic.Field(default=None) - """ - Search for companies by name, keys or string traits - """ - - sort_order_column: typing.Optional[str] = pydantic.Field(default=None) - """ - Column to sort by (e.g. name, created_at, last_seen_at) - """ - - sort_order_direction: typing.Optional[SortDirection] = None - subscription_statuses: typing.Optional[typing.List[SubscriptionStatus]] = pydantic.Field(default=None) - """ - Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) - """ - - subscription_types: typing.Optional[typing.List[SubscriptionType]] = pydantic.Field(default=None) - """ - Filter companies by one or more subscription types (paid, free, trial) - """ - - without_plan: typing.Optional[bool] = pydantic.Field(default=None) - """ - Filter out companies that have a plan - """ - - without_subscription: typing.Optional[bool] = pydantic.Field(default=None) - """ - Filter out companies that have a subscription - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/schematic/companies/types/list_companies_for_advanced_filter_response.py b/src/schematic/companies/types/list_companies_for_advanced_filter_response.py deleted file mode 100644 index a1f40ca..0000000 --- a/src/schematic/companies/types/list_companies_for_advanced_filter_response.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.company_view_with_feature_usage_response_data import CompanyViewWithFeatureUsageResponseData -from .list_companies_for_advanced_filter_params import ListCompaniesForAdvancedFilterParams - - -class ListCompaniesForAdvancedFilterResponse(UniversalBaseModel): - data: typing.List[CompanyViewWithFeatureUsageResponseData] - params: ListCompaniesForAdvancedFilterParams = pydantic.Field() - """ - Input parameters - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/schematic/companies/types/list_companies_params.py b/src/schematic/companies/types/list_companies_params.py index 45b090a..2ee4f79 100644 --- a/src/schematic/companies/types/list_companies_params.py +++ b/src/schematic/companies/types/list_companies_params.py @@ -4,6 +4,9 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.sort_direction import SortDirection +from ...types.subscription_status import SubscriptionStatus +from ...types.subscription_type import SubscriptionType class ListCompaniesParams(UniversalBaseModel): @@ -11,6 +14,11 @@ class ListCompaniesParams(UniversalBaseModel): Input parameters """ + credit_type_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Filter companies by one or more credit type IDs (each ID starts with bcrd_) + """ + ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ Filter companies by multiple company IDs (starts with comp_) @@ -21,6 +29,11 @@ class ListCompaniesParams(UniversalBaseModel): Page limit (default 100) """ + monetized_subscriptions: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter companies that have monetized subscriptions + """ + offset: typing.Optional[int] = pydantic.Field(default=None) """ Page offset (default 0) @@ -31,11 +44,46 @@ class ListCompaniesParams(UniversalBaseModel): Filter companies by plan ID (starts with plan_) """ + plan_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Filter companies by one or more plan IDs (each ID starts with plan_) + """ + + plan_version_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Filter companies by plan version ID (starts with plvr_) + """ + q: typing.Optional[str] = pydantic.Field(default=None) """ Search for companies by name, keys or string traits """ + sort_order_column: typing.Optional[str] = pydantic.Field(default=None) + """ + Column to sort by (e.g. name, created_at, last_seen_at) + """ + + sort_order_direction: typing.Optional[SortDirection] = pydantic.Field(default=None) + """ + Direction to sort by (asc or desc) + """ + + subscription_statuses: typing.Optional[typing.List[SubscriptionStatus]] = pydantic.Field(default=None) + """ + Filter companies by one or more subscription statuses + """ + + subscription_types: typing.Optional[typing.List[SubscriptionType]] = pydantic.Field(default=None) + """ + Filter companies by one or more subscription types + """ + + with_entitlement_for: typing.Optional[str] = pydantic.Field(default=None) + """ + Filter companies that have an entitlement (plan entitlement or company override) for the specified feature ID + """ + with_subscription: typing.Optional[bool] = pydantic.Field(default=None) """ Filter companies that have a subscription @@ -51,6 +99,11 @@ class ListCompaniesParams(UniversalBaseModel): Filter out companies that have a plan """ + without_subscription: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter out companies that have a subscription + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/schematic/componentspublic/__init__.py b/src/schematic/componentspublic/__init__.py new file mode 100644 index 0000000..da0b6e5 --- /dev/null +++ b/src/schematic/componentspublic/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import GetPublicPlansResponse +_dynamic_imports: typing.Dict[str, str] = {"GetPublicPlansResponse": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["GetPublicPlansResponse"] diff --git a/src/schematic/componentspublic/client.py b/src/schematic/componentspublic/client.py new file mode 100644 index 0000000..0626339 --- /dev/null +++ b/src/schematic/componentspublic/client.py @@ -0,0 +1,98 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from .raw_client import AsyncRawComponentspublicClient, RawComponentspublicClient +from .types.get_public_plans_response import GetPublicPlansResponse + + +class ComponentspublicClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawComponentspublicClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawComponentspublicClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawComponentspublicClient + """ + return self._raw_client + + def get_public_plans(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetPublicPlansResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetPublicPlansResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.componentspublic.get_public_plans() + """ + _response = self._raw_client.get_public_plans(request_options=request_options) + return _response.data + + +class AsyncComponentspublicClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawComponentspublicClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawComponentspublicClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawComponentspublicClient + """ + return self._raw_client + + async def get_public_plans( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetPublicPlansResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetPublicPlansResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.componentspublic.get_public_plans() + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_public_plans(request_options=request_options) + return _response.data diff --git a/src/schematic/componentspublic/raw_client.py b/src/schematic/componentspublic/raw_client.py new file mode 100644 index 0000000..f59e572 --- /dev/null +++ b/src/schematic/componentspublic/raw_client.py @@ -0,0 +1,190 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError as core_api_error_ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..errors.forbidden_error import ForbiddenError +from ..errors.internal_server_error import InternalServerError +from ..errors.not_found_error import NotFoundError +from ..errors.unauthorized_error import UnauthorizedError +from ..types.api_error import ApiError as types_api_error_ApiError +from .types.get_public_plans_response import GetPublicPlansResponse + + +class RawComponentspublicClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_public_plans( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetPublicPlansResponse]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetPublicPlansResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "public/plans", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetPublicPlansResponse, + parse_obj_as( + type_=GetPublicPlansResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + +class AsyncRawComponentspublicClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_public_plans( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetPublicPlansResponse]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetPublicPlansResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "public/plans", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetPublicPlansResponse, + parse_obj_as( + type_=GetPublicPlansResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) diff --git a/src/schematic/componentspublic/types/__init__.py b/src/schematic/componentspublic/types/__init__.py new file mode 100644 index 0000000..bd816f8 --- /dev/null +++ b/src/schematic/componentspublic/types/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .get_public_plans_response import GetPublicPlansResponse +_dynamic_imports: typing.Dict[str, str] = {"GetPublicPlansResponse": ".get_public_plans_response"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["GetPublicPlansResponse"] diff --git a/src/schematic/componentspublic/types/get_public_plans_response.py b/src/schematic/componentspublic/types/get_public_plans_response.py new file mode 100644 index 0000000..9becaff --- /dev/null +++ b/src/schematic/componentspublic/types/get_public_plans_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.public_plans_response_data import PublicPlansResponseData + + +class GetPublicPlansResponse(UniversalBaseModel): + data: PublicPlansResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/core/client_wrapper.py b/src/schematic/core/client_wrapper.py index efb1347..9cf060a 100644 --- a/src/schematic/core/client_wrapper.py +++ b/src/schematic/core/client_wrapper.py @@ -22,7 +22,7 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "schematichq/AUTO", + "User-Agent": "schematichq/1.1.6", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "schematichq", "X-Fern-SDK-Version": "1.1.6", diff --git a/src/schematic/credits/__init__.py b/src/schematic/credits/__init__.py index 3ca5760..6827ccd 100644 --- a/src/schematic/credits/__init__.py +++ b/src/schematic/credits/__init__.py @@ -13,8 +13,12 @@ CountBillingCreditsResponse, CountBillingPlanCreditGrantsParams, CountBillingPlanCreditGrantsResponse, + CountCompanyGrantsParams, + CountCompanyGrantsResponse, CountCreditBundlesParams, CountCreditBundlesResponse, + CountCreditEventLedgerParams, + CountCreditEventLedgerResponse, CountCreditLedgerParams, CountCreditLedgerResponse, CreateBillingCreditResponse, @@ -36,6 +40,8 @@ ListCompanyGrantsResponse, ListCreditBundlesParams, ListCreditBundlesResponse, + ListCreditEventLedgerParams, + ListCreditEventLedgerResponse, ListGrantsForCreditParams, ListGrantsForCreditResponse, SoftDeleteBillingCreditResponse, @@ -51,8 +57,12 @@ "CountBillingCreditsResponse": ".types", "CountBillingPlanCreditGrantsParams": ".types", "CountBillingPlanCreditGrantsResponse": ".types", + "CountCompanyGrantsParams": ".types", + "CountCompanyGrantsResponse": ".types", "CountCreditBundlesParams": ".types", "CountCreditBundlesResponse": ".types", + "CountCreditEventLedgerParams": ".types", + "CountCreditEventLedgerResponse": ".types", "CountCreditLedgerParams": ".types", "CountCreditLedgerResponse": ".types", "CreateBillingCreditResponse": ".types", @@ -74,6 +84,8 @@ "ListCompanyGrantsResponse": ".types", "ListCreditBundlesParams": ".types", "ListCreditBundlesResponse": ".types", + "ListCreditEventLedgerParams": ".types", + "ListCreditEventLedgerResponse": ".types", "ListGrantsForCreditParams": ".types", "ListGrantsForCreditResponse": ".types", "SoftDeleteBillingCreditResponse": ".types", @@ -112,8 +124,12 @@ def __dir__(): "CountBillingCreditsResponse", "CountBillingPlanCreditGrantsParams", "CountBillingPlanCreditGrantsResponse", + "CountCompanyGrantsParams", + "CountCompanyGrantsResponse", "CountCreditBundlesParams", "CountCreditBundlesResponse", + "CountCreditEventLedgerParams", + "CountCreditEventLedgerResponse", "CountCreditLedgerParams", "CountCreditLedgerResponse", "CreateBillingCreditResponse", @@ -135,6 +151,8 @@ def __dir__(): "ListCompanyGrantsResponse", "ListCreditBundlesParams", "ListCreditBundlesResponse", + "ListCreditEventLedgerParams", + "ListCreditEventLedgerResponse", "ListGrantsForCreditParams", "ListGrantsForCreditResponse", "SoftDeleteBillingCreditResponse", diff --git a/src/schematic/credits/client.py b/src/schematic/credits/client.py index 6555cfc..f7188eb 100644 --- a/src/schematic/credits/client.py +++ b/src/schematic/credits/client.py @@ -17,6 +17,7 @@ from ..types.billing_plan_credit_grant_reset_start import BillingPlanCreditGrantResetStart from ..types.billing_plan_credit_grant_reset_type import BillingPlanCreditGrantResetType from ..types.credit_auto_topup_amount_type import CreditAutoTopupAmountType +from ..types.credit_event_type import CreditEventType from ..types.credit_grant_sort_order import CreditGrantSortOrder from ..types.credit_ledger_period import CreditLedgerPeriod from ..types.sort_direction import SortDirection @@ -24,7 +25,9 @@ from .types.count_billing_credits_grants_response import CountBillingCreditsGrantsResponse from .types.count_billing_credits_response import CountBillingCreditsResponse from .types.count_billing_plan_credit_grants_response import CountBillingPlanCreditGrantsResponse +from .types.count_company_grants_response import CountCompanyGrantsResponse from .types.count_credit_bundles_response import CountCreditBundlesResponse +from .types.count_credit_event_ledger_response import CountCreditEventLedgerResponse from .types.count_credit_ledger_response import CountCreditLedgerResponse from .types.create_billing_credit_response import CreateBillingCreditResponse from .types.create_billing_plan_credit_grant_response import CreateBillingPlanCreditGrantResponse @@ -39,6 +42,7 @@ from .types.list_billing_plan_credit_grants_response import ListBillingPlanCreditGrantsResponse from .types.list_company_grants_response import ListCompanyGrantsResponse from .types.list_credit_bundles_response import ListCreditBundlesResponse +from .types.list_credit_event_ledger_response import ListCreditEventLedgerResponse from .types.list_grants_for_credit_response import ListGrantsForCreditResponse from .types.soft_delete_billing_credit_response import SoftDeleteBillingCreditResponse from .types.update_billing_credit_response import UpdateBillingCreditResponse @@ -838,6 +842,59 @@ def grant_billing_credits_to_company( ) return _response.data + def count_company_grants( + self, + *, + company_id: typing.Optional[str] = None, + order: typing.Optional[CreditGrantSortOrder] = None, + dir: typing.Optional[SortDirection] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountCompanyGrantsResponse: + """ + Parameters + ---------- + company_id : typing.Optional[str] + + order : typing.Optional[CreditGrantSortOrder] + + dir : typing.Optional[SortDirection] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CountCompanyGrantsResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.credits.count_company_grants( + company_id="company_id", + order="created_at", + dir="asc", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.count_company_grants( + company_id=company_id, order=order, dir=dir, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + def list_company_grants( self, *, @@ -1137,9 +1194,10 @@ def list_billing_plan_credit_grants( self, *, credit_id: typing.Optional[str] = None, + ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -1149,11 +1207,13 @@ def list_billing_plan_credit_grants( ---------- credit_id : typing.Optional[str] + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_id : typing.Optional[str] plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_version_id : typing.Optional[str] limit : typing.Optional[int] Page limit (default 100) @@ -1179,15 +1239,17 @@ def list_billing_plan_credit_grants( client.credits.list_billing_plan_credit_grants( credit_id="credit_id", plan_id="plan_id", + plan_version_id="plan_version_id", limit=1, offset=1, ) """ _response = self._raw_client.list_billing_plan_credit_grants( credit_id=credit_id, + ids=ids, plan_id=plan_id, plan_ids=plan_ids, - ids=ids, + plan_version_id=plan_version_id, limit=limit, offset=offset, request_options=request_options, @@ -1213,6 +1275,7 @@ def create_billing_plan_credit_grant( expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, reset_type: typing.Optional[BillingPlanCreditGrantResetType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateBillingPlanCreditGrantResponse: @@ -1251,6 +1314,8 @@ def create_billing_plan_credit_grant( expiry_unit_count : typing.Optional[int] + plan_version_id : typing.Optional[str] + reset_type : typing.Optional[BillingPlanCreditGrantResetType] request_options : typing.Optional[RequestOptions] @@ -1293,6 +1358,7 @@ def create_billing_plan_credit_grant( expiry_type=expiry_type, expiry_unit=expiry_unit, expiry_unit_count=expiry_unit_count, + plan_version_id=plan_version_id, reset_type=reset_type, request_options=request_options, ) @@ -1441,9 +1507,10 @@ def count_billing_plan_credit_grants( self, *, credit_id: typing.Optional[str] = None, + ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -1453,11 +1520,13 @@ def count_billing_plan_credit_grants( ---------- credit_id : typing.Optional[str] + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_id : typing.Optional[str] plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_version_id : typing.Optional[str] limit : typing.Optional[int] Page limit (default 100) @@ -1483,15 +1552,163 @@ def count_billing_plan_credit_grants( client.credits.count_billing_plan_credit_grants( credit_id="credit_id", plan_id="plan_id", + plan_version_id="plan_version_id", limit=1, offset=1, ) """ _response = self._raw_client.count_billing_plan_credit_grants( credit_id=credit_id, + ids=ids, plan_id=plan_id, plan_ids=plan_ids, - ids=ids, + plan_version_id=plan_version_id, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + + def list_credit_event_ledger( + self, + *, + company_id: str, + billing_credit_id: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + event_type: typing.Optional[CreditEventType] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListCreditEventLedgerResponse: + """ + Parameters + ---------- + company_id : str + + billing_credit_id : typing.Optional[str] + + end_time : typing.Optional[str] + + event_type : typing.Optional[CreditEventType] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListCreditEventLedgerResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.credits.list_credit_event_ledger( + billing_credit_id="billing_credit_id", + company_id="company_id", + end_time="end_time", + event_type="grant", + feature_id="feature_id", + start_time="start_time", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.list_credit_event_ledger( + company_id=company_id, + billing_credit_id=billing_credit_id, + end_time=end_time, + event_type=event_type, + feature_id=feature_id, + start_time=start_time, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + + def count_credit_event_ledger( + self, + *, + company_id: str, + billing_credit_id: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + event_type: typing.Optional[CreditEventType] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountCreditEventLedgerResponse: + """ + Parameters + ---------- + company_id : str + + billing_credit_id : typing.Optional[str] + + end_time : typing.Optional[str] + + event_type : typing.Optional[CreditEventType] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CountCreditEventLedgerResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.credits.count_credit_event_ledger( + billing_credit_id="billing_credit_id", + company_id="company_id", + end_time="end_time", + event_type="grant", + feature_id="feature_id", + start_time="start_time", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.count_credit_event_ledger( + company_id=company_id, + billing_credit_id=billing_credit_id, + end_time=end_time, + event_type=event_type, + feature_id=feature_id, + start_time=start_time, limit=limit, offset=offset, request_options=request_options, @@ -2399,6 +2616,67 @@ async def main() -> None: ) return _response.data + async def count_company_grants( + self, + *, + company_id: typing.Optional[str] = None, + order: typing.Optional[CreditGrantSortOrder] = None, + dir: typing.Optional[SortDirection] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountCompanyGrantsResponse: + """ + Parameters + ---------- + company_id : typing.Optional[str] + + order : typing.Optional[CreditGrantSortOrder] + + dir : typing.Optional[SortDirection] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CountCompanyGrantsResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.credits.count_company_grants( + company_id="company_id", + order="created_at", + dir="asc", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.count_company_grants( + company_id=company_id, order=order, dir=dir, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + async def list_company_grants( self, *, @@ -2738,9 +3016,10 @@ async def list_billing_plan_credit_grants( self, *, credit_id: typing.Optional[str] = None, + ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -2750,11 +3029,13 @@ async def list_billing_plan_credit_grants( ---------- credit_id : typing.Optional[str] + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_id : typing.Optional[str] plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_version_id : typing.Optional[str] limit : typing.Optional[int] Page limit (default 100) @@ -2785,6 +3066,7 @@ async def main() -> None: await client.credits.list_billing_plan_credit_grants( credit_id="credit_id", plan_id="plan_id", + plan_version_id="plan_version_id", limit=1, offset=1, ) @@ -2794,9 +3076,10 @@ async def main() -> None: """ _response = await self._raw_client.list_billing_plan_credit_grants( credit_id=credit_id, + ids=ids, plan_id=plan_id, plan_ids=plan_ids, - ids=ids, + plan_version_id=plan_version_id, limit=limit, offset=offset, request_options=request_options, @@ -2822,6 +3105,7 @@ async def create_billing_plan_credit_grant( expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, reset_type: typing.Optional[BillingPlanCreditGrantResetType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateBillingPlanCreditGrantResponse: @@ -2860,6 +3144,8 @@ async def create_billing_plan_credit_grant( expiry_unit_count : typing.Optional[int] + plan_version_id : typing.Optional[str] + reset_type : typing.Optional[BillingPlanCreditGrantResetType] request_options : typing.Optional[RequestOptions] @@ -2910,6 +3196,7 @@ async def main() -> None: expiry_type=expiry_type, expiry_unit=expiry_unit, expiry_unit_count=expiry_unit_count, + plan_version_id=plan_version_id, reset_type=reset_type, request_options=request_options, ) @@ -3074,9 +3361,10 @@ async def count_billing_plan_credit_grants( self, *, credit_id: typing.Optional[str] = None, + ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -3086,11 +3374,13 @@ async def count_billing_plan_credit_grants( ---------- credit_id : typing.Optional[str] + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_id : typing.Optional[str] plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_version_id : typing.Optional[str] limit : typing.Optional[int] Page limit (default 100) @@ -3121,6 +3411,7 @@ async def main() -> None: await client.credits.count_billing_plan_credit_grants( credit_id="credit_id", plan_id="plan_id", + plan_version_id="plan_version_id", limit=1, offset=1, ) @@ -3130,9 +3421,172 @@ async def main() -> None: """ _response = await self._raw_client.count_billing_plan_credit_grants( credit_id=credit_id, + ids=ids, plan_id=plan_id, plan_ids=plan_ids, - ids=ids, + plan_version_id=plan_version_id, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + + async def list_credit_event_ledger( + self, + *, + company_id: str, + billing_credit_id: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + event_type: typing.Optional[CreditEventType] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListCreditEventLedgerResponse: + """ + Parameters + ---------- + company_id : str + + billing_credit_id : typing.Optional[str] + + end_time : typing.Optional[str] + + event_type : typing.Optional[CreditEventType] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListCreditEventLedgerResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.credits.list_credit_event_ledger( + billing_credit_id="billing_credit_id", + company_id="company_id", + end_time="end_time", + event_type="grant", + feature_id="feature_id", + start_time="start_time", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_credit_event_ledger( + company_id=company_id, + billing_credit_id=billing_credit_id, + end_time=end_time, + event_type=event_type, + feature_id=feature_id, + start_time=start_time, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + + async def count_credit_event_ledger( + self, + *, + company_id: str, + billing_credit_id: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + event_type: typing.Optional[CreditEventType] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountCreditEventLedgerResponse: + """ + Parameters + ---------- + company_id : str + + billing_credit_id : typing.Optional[str] + + end_time : typing.Optional[str] + + event_type : typing.Optional[CreditEventType] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CountCreditEventLedgerResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.credits.count_credit_event_ledger( + billing_credit_id="billing_credit_id", + company_id="company_id", + end_time="end_time", + event_type="grant", + feature_id="feature_id", + start_time="start_time", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.count_credit_event_ledger( + company_id=company_id, + billing_credit_id=billing_credit_id, + end_time=end_time, + event_type=event_type, + feature_id=feature_id, + start_time=start_time, limit=limit, offset=offset, request_options=request_options, diff --git a/src/schematic/credits/raw_client.py b/src/schematic/credits/raw_client.py index cc3181b..672e906 100644 --- a/src/schematic/credits/raw_client.py +++ b/src/schematic/credits/raw_client.py @@ -28,13 +28,16 @@ from ..types.billing_plan_credit_grant_reset_start import BillingPlanCreditGrantResetStart from ..types.billing_plan_credit_grant_reset_type import BillingPlanCreditGrantResetType from ..types.credit_auto_topup_amount_type import CreditAutoTopupAmountType +from ..types.credit_event_type import CreditEventType from ..types.credit_grant_sort_order import CreditGrantSortOrder from ..types.credit_ledger_period import CreditLedgerPeriod from ..types.sort_direction import SortDirection from .types.count_billing_credits_grants_response import CountBillingCreditsGrantsResponse from .types.count_billing_credits_response import CountBillingCreditsResponse from .types.count_billing_plan_credit_grants_response import CountBillingPlanCreditGrantsResponse +from .types.count_company_grants_response import CountCompanyGrantsResponse from .types.count_credit_bundles_response import CountCreditBundlesResponse +from .types.count_credit_event_ledger_response import CountCreditEventLedgerResponse from .types.count_credit_ledger_response import CountCreditLedgerResponse from .types.create_billing_credit_response import CreateBillingCreditResponse from .types.create_billing_plan_credit_grant_response import CreateBillingPlanCreditGrantResponse @@ -49,6 +52,7 @@ from .types.list_billing_plan_credit_grants_response import ListBillingPlanCreditGrantsResponse from .types.list_company_grants_response import ListCompanyGrantsResponse from .types.list_credit_bundles_response import ListCreditBundlesResponse +from .types.list_credit_event_ledger_response import ListCreditEventLedgerResponse from .types.list_grants_for_credit_response import ListGrantsForCreditResponse from .types.soft_delete_billing_credit_response import SoftDeleteBillingCreditResponse from .types.update_billing_credit_response import UpdateBillingCreditResponse @@ -1736,6 +1740,125 @@ def grant_billing_credits_to_company( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def count_company_grants( + self, + *, + company_id: typing.Optional[str] = None, + order: typing.Optional[CreditGrantSortOrder] = None, + dir: typing.Optional[SortDirection] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[CountCompanyGrantsResponse]: + """ + Parameters + ---------- + company_id : typing.Optional[str] + + order : typing.Optional[CreditGrantSortOrder] + + dir : typing.Optional[SortDirection] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CountCompanyGrantsResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "billing/credits/grants/company/count", + method="GET", + params={ + "company_id": company_id, + "order": order, + "dir": dir, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CountCompanyGrantsResponse, + parse_obj_as( + type_=CountCompanyGrantsResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + def list_company_grants( self, *, @@ -2351,9 +2474,10 @@ def list_billing_plan_credit_grants( self, *, credit_id: typing.Optional[str] = None, + ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -2363,11 +2487,13 @@ def list_billing_plan_credit_grants( ---------- credit_id : typing.Optional[str] + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_id : typing.Optional[str] plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_version_id : typing.Optional[str] limit : typing.Optional[int] Page limit (default 100) @@ -2388,9 +2514,10 @@ def list_billing_plan_credit_grants( method="GET", params={ "credit_id": credit_id, + "ids": ids, "plan_id": plan_id, "plan_ids": plan_ids, - "ids": ids, + "plan_version_id": plan_version_id, "limit": limit, "offset": offset, }, @@ -2489,6 +2616,7 @@ def create_billing_plan_credit_grant( expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, reset_type: typing.Optional[BillingPlanCreditGrantResetType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateBillingPlanCreditGrantResponse]: @@ -2527,6 +2655,8 @@ def create_billing_plan_credit_grant( expiry_unit_count : typing.Optional[int] + plan_version_id : typing.Optional[str] + reset_type : typing.Optional[BillingPlanCreditGrantResetType] request_options : typing.Optional[RequestOptions] @@ -2555,6 +2685,7 @@ def create_billing_plan_credit_grant( "expiry_unit": expiry_unit, "expiry_unit_count": expiry_unit_count, "plan_id": plan_id, + "plan_version_id": plan_version_id, "reset_cadence": reset_cadence, "reset_start": reset_start, "reset_type": reset_type, @@ -2913,9 +3044,10 @@ def count_billing_plan_credit_grants( self, *, credit_id: typing.Optional[str] = None, + ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -2925,11 +3057,13 @@ def count_billing_plan_credit_grants( ---------- credit_id : typing.Optional[str] + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_id : typing.Optional[str] plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_version_id : typing.Optional[str] limit : typing.Optional[int] Page limit (default 100) @@ -2950,9 +3084,10 @@ def count_billing_plan_credit_grants( method="GET", params={ "credit_id": credit_id, + "ids": ids, "plan_id": plan_id, "plan_ids": plan_ids, - "ids": ids, + "plan_version_id": plan_version_id, "limit": limit, "offset": offset, }, @@ -3032,26 +3167,33 @@ def count_billing_plan_credit_grants( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - -class AsyncRawCreditsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def list_billing_credits( + def list_credit_event_ledger( self, *, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - name: typing.Optional[str] = None, + company_id: str, + billing_credit_id: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + event_type: typing.Optional[CreditEventType] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[ListBillingCreditsResponse]: + ) -> HttpResponse[ListCreditEventLedgerResponse]: """ Parameters ---------- - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + company_id : str - name : typing.Optional[str] + billing_credit_id : typing.Optional[str] + + end_time : typing.Optional[str] + + event_type : typing.Optional[CreditEventType] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] limit : typing.Optional[int] Page limit (default 100) @@ -3064,15 +3206,19 @@ async def list_billing_credits( Returns ------- - AsyncHttpResponse[ListBillingCreditsResponse] + HttpResponse[ListCreditEventLedgerResponse] OK """ - _response = await self._client_wrapper.httpx_client.request( - "billing/credits", + _response = self._client_wrapper.httpx_client.request( + "v2/billing/credits/ledger", method="GET", params={ - "ids": ids, - "name": name, + "billing_credit_id": billing_credit_id, + "company_id": company_id, + "end_time": end_time, + "event_type": event_type, + "feature_id": feature_id, + "start_time": start_time, "limit": limit, "offset": offset, }, @@ -3081,13 +3227,13 @@ async def list_billing_credits( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ListBillingCreditsResponse, + ListCreditEventLedgerResponse, parse_obj_as( - type_=ListBillingCreditsResponse, # type: ignore + type_=ListCreditEventLedgerResponse, # type: ignore object_=_response.json(), ), ) - return AsyncHttpResponse(response=_response, data=_data) + return HttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), @@ -3152,91 +3298,73 @@ async def list_billing_credits( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - async def create_billing_credit( + def count_credit_event_ledger( self, *, - currency: str, - description: str, - name: str, - burn_strategy: typing.Optional[BillingCreditBurnStrategy] = OMIT, - default_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, - default_expiry_unit_count: typing.Optional[int] = OMIT, - default_rollover_policy: typing.Optional[BillingCreditRolloverPolicy] = OMIT, - icon: typing.Optional[str] = OMIT, - per_unit_price: typing.Optional[int] = OMIT, - per_unit_price_decimal: typing.Optional[str] = OMIT, - plural_name: typing.Optional[str] = OMIT, - singular_name: typing.Optional[str] = OMIT, + company_id: str, + billing_credit_id: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + event_type: typing.Optional[CreditEventType] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[CreateBillingCreditResponse]: + ) -> HttpResponse[CountCreditEventLedgerResponse]: """ Parameters ---------- - currency : str - - description : str - - name : str - - burn_strategy : typing.Optional[BillingCreditBurnStrategy] - - default_expiry_unit : typing.Optional[BillingCreditExpiryUnit] + company_id : str - default_expiry_unit_count : typing.Optional[int] + billing_credit_id : typing.Optional[str] - default_rollover_policy : typing.Optional[BillingCreditRolloverPolicy] + end_time : typing.Optional[str] - icon : typing.Optional[str] + event_type : typing.Optional[CreditEventType] - per_unit_price : typing.Optional[int] + feature_id : typing.Optional[str] - per_unit_price_decimal : typing.Optional[str] + start_time : typing.Optional[str] - plural_name : typing.Optional[str] + limit : typing.Optional[int] + Page limit (default 100) - singular_name : typing.Optional[str] + offset : typing.Optional[int] + Page offset (default 0) request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[CreateBillingCreditResponse] - Created + HttpResponse[CountCreditEventLedgerResponse] + OK """ - _response = await self._client_wrapper.httpx_client.request( - "billing/credits", - method="POST", - json={ - "burn_strategy": burn_strategy, - "currency": currency, - "default_expiry_unit": default_expiry_unit, - "default_expiry_unit_count": default_expiry_unit_count, - "default_rollover_policy": default_rollover_policy, - "description": description, - "icon": icon, - "name": name, - "per_unit_price": per_unit_price, - "per_unit_price_decimal": per_unit_price_decimal, - "plural_name": plural_name, - "singular_name": singular_name, - }, - headers={ - "content-type": "application/json", + _response = self._client_wrapper.httpx_client.request( + "v2/billing/credits/ledger/count", + method="GET", + params={ + "billing_credit_id": billing_credit_id, + "company_id": company_id, + "end_time": end_time, + "event_type": event_type, + "feature_id": feature_id, + "start_time": start_time, + "limit": limit, + "offset": offset, }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - CreateBillingCreditResponse, + CountCreditEventLedgerResponse, parse_obj_as( - type_=CreateBillingCreditResponse, # type: ignore + type_=CountCreditEventLedgerResponse, # type: ignore object_=_response.json(), ), ) - return AsyncHttpResponse(response=_response, data=_data) + return HttpResponse(response=_response, data=_data) if _response.status_code == 400: raise BadRequestError( headers=dict(_response.headers), @@ -3301,11 +3429,280 @@ async def create_billing_credit( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) - async def get_single_billing_credit( - self, credit_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[GetSingleBillingCreditResponse]: - """ - Parameters + +class AsyncRawCreditsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list_billing_credits( + self, + *, + ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + name: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ListBillingCreditsResponse]: + """ + Parameters + ---------- + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + + name : typing.Optional[str] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ListBillingCreditsResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "billing/credits", + method="GET", + params={ + "ids": ids, + "name": name, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListBillingCreditsResponse, + parse_obj_as( + type_=ListBillingCreditsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def create_billing_credit( + self, + *, + currency: str, + description: str, + name: str, + burn_strategy: typing.Optional[BillingCreditBurnStrategy] = OMIT, + default_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, + default_expiry_unit_count: typing.Optional[int] = OMIT, + default_rollover_policy: typing.Optional[BillingCreditRolloverPolicy] = OMIT, + icon: typing.Optional[str] = OMIT, + per_unit_price: typing.Optional[int] = OMIT, + per_unit_price_decimal: typing.Optional[str] = OMIT, + plural_name: typing.Optional[str] = OMIT, + singular_name: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CreateBillingCreditResponse]: + """ + Parameters + ---------- + currency : str + + description : str + + name : str + + burn_strategy : typing.Optional[BillingCreditBurnStrategy] + + default_expiry_unit : typing.Optional[BillingCreditExpiryUnit] + + default_expiry_unit_count : typing.Optional[int] + + default_rollover_policy : typing.Optional[BillingCreditRolloverPolicy] + + icon : typing.Optional[str] + + per_unit_price : typing.Optional[int] + + per_unit_price_decimal : typing.Optional[str] + + plural_name : typing.Optional[str] + + singular_name : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CreateBillingCreditResponse] + Created + """ + _response = await self._client_wrapper.httpx_client.request( + "billing/credits", + method="POST", + json={ + "burn_strategy": burn_strategy, + "currency": currency, + "default_expiry_unit": default_expiry_unit, + "default_expiry_unit_count": default_expiry_unit_count, + "default_rollover_policy": default_rollover_policy, + "description": description, + "icon": icon, + "name": name, + "per_unit_price": per_unit_price, + "per_unit_price_decimal": per_unit_price_decimal, + "plural_name": plural_name, + "singular_name": singular_name, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CreateBillingCreditResponse, + parse_obj_as( + type_=CreateBillingCreditResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get_single_billing_credit( + self, credit_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetSingleBillingCreditResponse]: + """ + Parameters ---------- credit_id : str credit_id @@ -4709,6 +5106,125 @@ async def grant_billing_credits_to_company( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + async def count_company_grants( + self, + *, + company_id: typing.Optional[str] = None, + order: typing.Optional[CreditGrantSortOrder] = None, + dir: typing.Optional[SortDirection] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CountCompanyGrantsResponse]: + """ + Parameters + ---------- + company_id : typing.Optional[str] + + order : typing.Optional[CreditGrantSortOrder] + + dir : typing.Optional[SortDirection] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CountCompanyGrantsResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "billing/credits/grants/company/count", + method="GET", + params={ + "company_id": company_id, + "order": order, + "dir": dir, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CountCompanyGrantsResponse, + parse_obj_as( + type_=CountCompanyGrantsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + async def list_company_grants( self, *, @@ -5324,9 +5840,10 @@ async def list_billing_plan_credit_grants( self, *, credit_id: typing.Optional[str] = None, + ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -5336,11 +5853,13 @@ async def list_billing_plan_credit_grants( ---------- credit_id : typing.Optional[str] + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_id : typing.Optional[str] plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_version_id : typing.Optional[str] limit : typing.Optional[int] Page limit (default 100) @@ -5361,9 +5880,10 @@ async def list_billing_plan_credit_grants( method="GET", params={ "credit_id": credit_id, + "ids": ids, "plan_id": plan_id, "plan_ids": plan_ids, - "ids": ids, + "plan_version_id": plan_version_id, "limit": limit, "offset": offset, }, @@ -5462,6 +5982,7 @@ async def create_billing_plan_credit_grant( expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, reset_type: typing.Optional[BillingPlanCreditGrantResetType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateBillingPlanCreditGrantResponse]: @@ -5500,6 +6021,8 @@ async def create_billing_plan_credit_grant( expiry_unit_count : typing.Optional[int] + plan_version_id : typing.Optional[str] + reset_type : typing.Optional[BillingPlanCreditGrantResetType] request_options : typing.Optional[RequestOptions] @@ -5528,6 +6051,7 @@ async def create_billing_plan_credit_grant( "expiry_unit": expiry_unit, "expiry_unit_count": expiry_unit_count, "plan_id": plan_id, + "plan_version_id": plan_version_id, "reset_cadence": reset_cadence, "reset_start": reset_start, "reset_type": reset_type, @@ -5886,9 +6410,10 @@ async def count_billing_plan_credit_grants( self, *, credit_id: typing.Optional[str] = None, + ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -5898,11 +6423,13 @@ async def count_billing_plan_credit_grants( ---------- credit_id : typing.Optional[str] + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_id : typing.Optional[str] plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + plan_version_id : typing.Optional[str] limit : typing.Optional[int] Page limit (default 100) @@ -5923,9 +6450,10 @@ async def count_billing_plan_credit_grants( method="GET", params={ "credit_id": credit_id, + "ids": ids, "plan_id": plan_id, "plan_ids": plan_ids, - "ids": ids, + "plan_version_id": plan_version_id, "limit": limit, "offset": offset, }, @@ -6004,3 +6532,265 @@ async def count_billing_plan_credit_grants( raise core_api_error_ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + + async def list_credit_event_ledger( + self, + *, + company_id: str, + billing_credit_id: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + event_type: typing.Optional[CreditEventType] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ListCreditEventLedgerResponse]: + """ + Parameters + ---------- + company_id : str + + billing_credit_id : typing.Optional[str] + + end_time : typing.Optional[str] + + event_type : typing.Optional[CreditEventType] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ListCreditEventLedgerResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "v2/billing/credits/ledger", + method="GET", + params={ + "billing_credit_id": billing_credit_id, + "company_id": company_id, + "end_time": end_time, + "event_type": event_type, + "feature_id": feature_id, + "start_time": start_time, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListCreditEventLedgerResponse, + parse_obj_as( + type_=ListCreditEventLedgerResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def count_credit_event_ledger( + self, + *, + company_id: str, + billing_credit_id: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + event_type: typing.Optional[CreditEventType] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CountCreditEventLedgerResponse]: + """ + Parameters + ---------- + company_id : str + + billing_credit_id : typing.Optional[str] + + end_time : typing.Optional[str] + + event_type : typing.Optional[CreditEventType] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CountCreditEventLedgerResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "v2/billing/credits/ledger/count", + method="GET", + params={ + "billing_credit_id": billing_credit_id, + "company_id": company_id, + "end_time": end_time, + "event_type": event_type, + "feature_id": feature_id, + "start_time": start_time, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CountCreditEventLedgerResponse, + parse_obj_as( + type_=CountCreditEventLedgerResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) diff --git a/src/schematic/credits/types/__init__.py b/src/schematic/credits/types/__init__.py index 1639493..88cf334 100644 --- a/src/schematic/credits/types/__init__.py +++ b/src/schematic/credits/types/__init__.py @@ -12,8 +12,12 @@ from .count_billing_credits_response import CountBillingCreditsResponse from .count_billing_plan_credit_grants_params import CountBillingPlanCreditGrantsParams from .count_billing_plan_credit_grants_response import CountBillingPlanCreditGrantsResponse + from .count_company_grants_params import CountCompanyGrantsParams + from .count_company_grants_response import CountCompanyGrantsResponse from .count_credit_bundles_params import CountCreditBundlesParams from .count_credit_bundles_response import CountCreditBundlesResponse + from .count_credit_event_ledger_params import CountCreditEventLedgerParams + from .count_credit_event_ledger_response import CountCreditEventLedgerResponse from .count_credit_ledger_params import CountCreditLedgerParams from .count_credit_ledger_response import CountCreditLedgerResponse from .create_billing_credit_response import CreateBillingCreditResponse @@ -35,6 +39,8 @@ from .list_company_grants_response import ListCompanyGrantsResponse from .list_credit_bundles_params import ListCreditBundlesParams from .list_credit_bundles_response import ListCreditBundlesResponse + from .list_credit_event_ledger_params import ListCreditEventLedgerParams + from .list_credit_event_ledger_response import ListCreditEventLedgerResponse from .list_grants_for_credit_params import ListGrantsForCreditParams from .list_grants_for_credit_response import ListGrantsForCreditResponse from .soft_delete_billing_credit_response import SoftDeleteBillingCreditResponse @@ -49,8 +55,12 @@ "CountBillingCreditsResponse": ".count_billing_credits_response", "CountBillingPlanCreditGrantsParams": ".count_billing_plan_credit_grants_params", "CountBillingPlanCreditGrantsResponse": ".count_billing_plan_credit_grants_response", + "CountCompanyGrantsParams": ".count_company_grants_params", + "CountCompanyGrantsResponse": ".count_company_grants_response", "CountCreditBundlesParams": ".count_credit_bundles_params", "CountCreditBundlesResponse": ".count_credit_bundles_response", + "CountCreditEventLedgerParams": ".count_credit_event_ledger_params", + "CountCreditEventLedgerResponse": ".count_credit_event_ledger_response", "CountCreditLedgerParams": ".count_credit_ledger_params", "CountCreditLedgerResponse": ".count_credit_ledger_response", "CreateBillingCreditResponse": ".create_billing_credit_response", @@ -72,6 +82,8 @@ "ListCompanyGrantsResponse": ".list_company_grants_response", "ListCreditBundlesParams": ".list_credit_bundles_params", "ListCreditBundlesResponse": ".list_credit_bundles_response", + "ListCreditEventLedgerParams": ".list_credit_event_ledger_params", + "ListCreditEventLedgerResponse": ".list_credit_event_ledger_response", "ListGrantsForCreditParams": ".list_grants_for_credit_params", "ListGrantsForCreditResponse": ".list_grants_for_credit_response", "SoftDeleteBillingCreditResponse": ".soft_delete_billing_credit_response", @@ -110,8 +122,12 @@ def __dir__(): "CountBillingCreditsResponse", "CountBillingPlanCreditGrantsParams", "CountBillingPlanCreditGrantsResponse", + "CountCompanyGrantsParams", + "CountCompanyGrantsResponse", "CountCreditBundlesParams", "CountCreditBundlesResponse", + "CountCreditEventLedgerParams", + "CountCreditEventLedgerResponse", "CountCreditLedgerParams", "CountCreditLedgerResponse", "CreateBillingCreditResponse", @@ -133,6 +149,8 @@ def __dir__(): "ListCompanyGrantsResponse", "ListCreditBundlesParams", "ListCreditBundlesResponse", + "ListCreditEventLedgerParams", + "ListCreditEventLedgerResponse", "ListGrantsForCreditParams", "ListGrantsForCreditResponse", "SoftDeleteBillingCreditResponse", diff --git a/src/schematic/credits/types/count_billing_plan_credit_grants_params.py b/src/schematic/credits/types/count_billing_plan_credit_grants_params.py index 00a4c58..4cca569 100644 --- a/src/schematic/credits/types/count_billing_plan_credit_grants_params.py +++ b/src/schematic/credits/types/count_billing_plan_credit_grants_params.py @@ -25,6 +25,7 @@ class CountBillingPlanCreditGrantsParams(UniversalBaseModel): plan_id: typing.Optional[str] = None plan_ids: typing.Optional[typing.List[str]] = None + plan_version_id: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/credits/types/count_company_grants_params.py b/src/schematic/credits/types/count_company_grants_params.py new file mode 100644 index 0000000..6bb7f81 --- /dev/null +++ b/src/schematic/credits/types/count_company_grants_params.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.credit_grant_sort_order import CreditGrantSortOrder +from ...types.sort_direction import SortDirection + + +class CountCompanyGrantsParams(UniversalBaseModel): + """ + Input parameters + """ + + company_id: typing.Optional[str] = None + dir: typing.Optional[SortDirection] = None + limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Page limit (default 100) + """ + + offset: typing.Optional[int] = pydantic.Field(default=None) + """ + Page offset (default 0) + """ + + order: typing.Optional[CreditGrantSortOrder] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/companies/types/count_companies_for_advanced_filter_response.py b/src/schematic/credits/types/count_company_grants_response.py similarity index 71% rename from src/schematic/companies/types/count_companies_for_advanced_filter_response.py rename to src/schematic/credits/types/count_company_grants_response.py index 5fb16f3..c80835e 100644 --- a/src/schematic/companies/types/count_companies_for_advanced_filter_response.py +++ b/src/schematic/credits/types/count_company_grants_response.py @@ -5,12 +5,12 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ...types.count_response import CountResponse -from .count_companies_for_advanced_filter_params import CountCompaniesForAdvancedFilterParams +from .count_company_grants_params import CountCompanyGrantsParams -class CountCompaniesForAdvancedFilterResponse(UniversalBaseModel): +class CountCompanyGrantsResponse(UniversalBaseModel): data: CountResponse - params: CountCompaniesForAdvancedFilterParams = pydantic.Field() + params: CountCompanyGrantsParams = pydantic.Field() """ Input parameters """ diff --git a/src/schematic/credits/types/count_credit_event_ledger_params.py b/src/schematic/credits/types/count_credit_event_ledger_params.py new file mode 100644 index 0000000..cccb56d --- /dev/null +++ b/src/schematic/credits/types/count_credit_event_ledger_params.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.credit_event_type import CreditEventType + + +class CountCreditEventLedgerParams(UniversalBaseModel): + """ + Input parameters + """ + + billing_credit_id: typing.Optional[str] = None + company_id: typing.Optional[str] = None + end_time: typing.Optional[str] = None + event_type: typing.Optional[CreditEventType] = None + feature_id: typing.Optional[str] = None + limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Page limit (default 100) + """ + + offset: typing.Optional[int] = pydantic.Field(default=None) + """ + Page offset (default 0) + """ + + start_time: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/credits/types/count_credit_event_ledger_response.py b/src/schematic/credits/types/count_credit_event_ledger_response.py new file mode 100644 index 0000000..4358d67 --- /dev/null +++ b/src/schematic/credits/types/count_credit_event_ledger_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.count_response import CountResponse +from .count_credit_event_ledger_params import CountCreditEventLedgerParams + + +class CountCreditEventLedgerResponse(UniversalBaseModel): + data: CountResponse + params: CountCreditEventLedgerParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/credits/types/list_billing_plan_credit_grants_params.py b/src/schematic/credits/types/list_billing_plan_credit_grants_params.py index 1a23728..6c1a67b 100644 --- a/src/schematic/credits/types/list_billing_plan_credit_grants_params.py +++ b/src/schematic/credits/types/list_billing_plan_credit_grants_params.py @@ -25,6 +25,7 @@ class ListBillingPlanCreditGrantsParams(UniversalBaseModel): plan_id: typing.Optional[str] = None plan_ids: typing.Optional[typing.List[str]] = None + plan_version_id: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/credits/types/list_credit_event_ledger_params.py b/src/schematic/credits/types/list_credit_event_ledger_params.py new file mode 100644 index 0000000..ed37e42 --- /dev/null +++ b/src/schematic/credits/types/list_credit_event_ledger_params.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.credit_event_type import CreditEventType + + +class ListCreditEventLedgerParams(UniversalBaseModel): + """ + Input parameters + """ + + billing_credit_id: typing.Optional[str] = None + company_id: typing.Optional[str] = None + end_time: typing.Optional[str] = None + event_type: typing.Optional[CreditEventType] = None + feature_id: typing.Optional[str] = None + limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Page limit (default 100) + """ + + offset: typing.Optional[int] = pydantic.Field(default=None) + """ + Page offset (default 0) + """ + + start_time: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/credits/types/list_credit_event_ledger_response.py b/src/schematic/credits/types/list_credit_event_ledger_response.py new file mode 100644 index 0000000..f8cb36b --- /dev/null +++ b/src/schematic/credits/types/list_credit_event_ledger_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.credit_event_ledger_response_data import CreditEventLedgerResponseData +from .list_credit_event_ledger_params import ListCreditEventLedgerParams + + +class ListCreditEventLedgerResponse(UniversalBaseModel): + data: typing.List[CreditEventLedgerResponseData] + params: ListCreditEventLedgerParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/entitlements/__init__.py b/src/schematic/entitlements/__init__.py index 77befb3..0772885 100644 --- a/src/schematic/entitlements/__init__.py +++ b/src/schematic/entitlements/__init__.py @@ -29,6 +29,8 @@ GetCompanyOverrideResponse, GetFeatureUsageByCompanyParams, GetFeatureUsageByCompanyResponse, + GetFeatureUsageTimeSeriesParams, + GetFeatureUsageTimeSeriesResponse, GetPlanEntitlementResponse, ListCompanyOverridesParams, ListCompanyOverridesResponse, @@ -70,6 +72,8 @@ "GetCompanyOverrideResponse": ".types", "GetFeatureUsageByCompanyParams": ".types", "GetFeatureUsageByCompanyResponse": ".types", + "GetFeatureUsageTimeSeriesParams": ".types", + "GetFeatureUsageTimeSeriesResponse": ".types", "GetPlanEntitlementResponse": ".types", "ListCompanyOverridesParams": ".types", "ListCompanyOverridesResponse": ".types", @@ -134,6 +138,8 @@ def __dir__(): "GetCompanyOverrideResponse", "GetFeatureUsageByCompanyParams", "GetFeatureUsageByCompanyResponse", + "GetFeatureUsageTimeSeriesParams", + "GetFeatureUsageTimeSeriesResponse", "GetPlanEntitlementResponse", "ListCompanyOverridesParams", "ListCompanyOverridesResponse", diff --git a/src/schematic/entitlements/client.py b/src/schematic/entitlements/client.py index fbd8ad2..7ce5077 100644 --- a/src/schematic/entitlements/client.py +++ b/src/schematic/entitlements/client.py @@ -9,6 +9,7 @@ from ..types.create_price_tier_request_body import CreatePriceTierRequestBody from ..types.entitlement_price_behavior import EntitlementPriceBehavior from ..types.entitlement_value_type import EntitlementValueType +from ..types.time_series_granularity import TimeSeriesGranularity from .raw_client import AsyncRawEntitlementsClient, RawEntitlementsClient from .types.count_company_overrides_response import CountCompanyOverridesResponse from .types.count_feature_companies_response import CountFeatureCompaniesResponse @@ -30,6 +31,7 @@ from .types.duplicate_plan_entitlements_response import DuplicatePlanEntitlementsResponse from .types.get_company_override_response import GetCompanyOverrideResponse from .types.get_feature_usage_by_company_response import GetFeatureUsageByCompanyResponse +from .types.get_feature_usage_time_series_response import GetFeatureUsageTimeSeriesResponse from .types.get_plan_entitlement_response import GetPlanEntitlementResponse from .types.list_company_overrides_response import ListCompanyOverridesResponse from .types.list_feature_companies_response import ListFeatureCompaniesResponse @@ -622,6 +624,68 @@ def list_feature_usage( ) return _response.data + def get_feature_usage_time_series( + self, + *, + company_id: str, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetFeatureUsageTimeSeriesResponse: + """ + Parameters + ---------- + company_id : str + + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetFeatureUsageTimeSeriesResponse + OK + + Examples + -------- + import datetime + + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.entitlements.get_feature_usage_time_series( + company_id="company_id", + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + feature_id="feature_id", + granularity="daily", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + """ + _response = self._raw_client.get_feature_usage_time_series( + company_id=company_id, + end_time=end_time, + feature_id=feature_id, + start_time=start_time, + granularity=granularity, + request_options=request_options, + ) + return _response.data + def count_feature_usage( self, *, @@ -800,6 +864,8 @@ def list_plan_entitlements( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, with_metered_products: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -824,6 +890,12 @@ def list_plan_entitlements( plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter plan entitlements by multiple plan IDs (starting with plan_) + plan_version_id : typing.Optional[str] + Filter plan entitlements by a single plan version ID (starting with plvr_) + + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -854,6 +926,7 @@ def list_plan_entitlements( client.entitlements.list_plan_entitlements( feature_id="feature_id", plan_id="plan_id", + plan_version_id="plan_version_id", q="q", with_metered_products=True, limit=1, @@ -866,6 +939,8 @@ def list_plan_entitlements( ids=ids, plan_id=plan_id, plan_ids=plan_ids, + plan_version_id=plan_version_id, + plan_version_ids=plan_version_ids, q=q, with_metered_products=with_metered_products, limit=limit, @@ -891,6 +966,7 @@ def create_plan_entitlement( monthly_unit_price: typing.Optional[int] = OMIT, monthly_unit_price_decimal: typing.Optional[str] = OMIT, overage_billing_product_id: typing.Optional[str] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, soft_limit: typing.Optional[int] = OMIT, @@ -936,6 +1012,8 @@ def create_plan_entitlement( overage_billing_product_id : typing.Optional[str] + plan_version_id : typing.Optional[str] + price_behavior : typing.Optional[EntitlementPriceBehavior] price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] @@ -997,6 +1075,7 @@ def create_plan_entitlement( monthly_unit_price=monthly_unit_price, monthly_unit_price_decimal=monthly_unit_price_decimal, overage_billing_product_id=overage_billing_product_id, + plan_version_id=plan_version_id, price_behavior=price_behavior, price_tiers=price_tiers, soft_limit=soft_limit, @@ -1218,6 +1297,8 @@ def count_plan_entitlements( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, with_metered_products: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -1242,6 +1323,12 @@ def count_plan_entitlements( plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter plan entitlements by multiple plan IDs (starting with plan_) + plan_version_id : typing.Optional[str] + Filter plan entitlements by a single plan version ID (starting with plvr_) + + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -1272,6 +1359,7 @@ def count_plan_entitlements( client.entitlements.count_plan_entitlements( feature_id="feature_id", plan_id="plan_id", + plan_version_id="plan_version_id", q="q", with_metered_products=True, limit=1, @@ -1284,6 +1372,8 @@ def count_plan_entitlements( ids=ids, plan_id=plan_id, plan_ids=plan_ids, + plan_version_id=plan_version_id, + plan_version_ids=plan_version_ids, q=q, with_metered_products=with_metered_products, limit=limit, @@ -2002,6 +2092,75 @@ async def main() -> None: ) return _response.data + async def get_feature_usage_time_series( + self, + *, + company_id: str, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetFeatureUsageTimeSeriesResponse: + """ + Parameters + ---------- + company_id : str + + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetFeatureUsageTimeSeriesResponse + OK + + Examples + -------- + import asyncio + import datetime + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.entitlements.get_feature_usage_time_series( + company_id="company_id", + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + feature_id="feature_id", + granularity="daily", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_feature_usage_time_series( + company_id=company_id, + end_time=end_time, + feature_id=feature_id, + start_time=start_time, + granularity=granularity, + request_options=request_options, + ) + return _response.data + async def count_feature_usage( self, *, @@ -2204,6 +2363,8 @@ async def list_plan_entitlements( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, with_metered_products: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -2228,6 +2389,12 @@ async def list_plan_entitlements( plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter plan entitlements by multiple plan IDs (starting with plan_) + plan_version_id : typing.Optional[str] + Filter plan entitlements by a single plan version ID (starting with plvr_) + + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -2263,6 +2430,7 @@ async def main() -> None: await client.entitlements.list_plan_entitlements( feature_id="feature_id", plan_id="plan_id", + plan_version_id="plan_version_id", q="q", with_metered_products=True, limit=1, @@ -2278,6 +2446,8 @@ async def main() -> None: ids=ids, plan_id=plan_id, plan_ids=plan_ids, + plan_version_id=plan_version_id, + plan_version_ids=plan_version_ids, q=q, with_metered_products=with_metered_products, limit=limit, @@ -2303,6 +2473,7 @@ async def create_plan_entitlement( monthly_unit_price: typing.Optional[int] = OMIT, monthly_unit_price_decimal: typing.Optional[str] = OMIT, overage_billing_product_id: typing.Optional[str] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, soft_limit: typing.Optional[int] = OMIT, @@ -2348,6 +2519,8 @@ async def create_plan_entitlement( overage_billing_product_id : typing.Optional[str] + plan_version_id : typing.Optional[str] + price_behavior : typing.Optional[EntitlementPriceBehavior] price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] @@ -2417,6 +2590,7 @@ async def main() -> None: monthly_unit_price=monthly_unit_price, monthly_unit_price_decimal=monthly_unit_price_decimal, overage_billing_product_id=overage_billing_product_id, + plan_version_id=plan_version_id, price_behavior=price_behavior, price_tiers=price_tiers, soft_limit=soft_limit, @@ -2662,6 +2836,8 @@ async def count_plan_entitlements( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, with_metered_products: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -2686,6 +2862,12 @@ async def count_plan_entitlements( plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter plan entitlements by multiple plan IDs (starting with plan_) + plan_version_id : typing.Optional[str] + Filter plan entitlements by a single plan version ID (starting with plvr_) + + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -2721,6 +2903,7 @@ async def main() -> None: await client.entitlements.count_plan_entitlements( feature_id="feature_id", plan_id="plan_id", + plan_version_id="plan_version_id", q="q", with_metered_products=True, limit=1, @@ -2736,6 +2919,8 @@ async def main() -> None: ids=ids, plan_id=plan_id, plan_ids=plan_ids, + plan_version_id=plan_version_id, + plan_version_ids=plan_version_ids, q=q, with_metered_products=with_metered_products, limit=limit, diff --git a/src/schematic/entitlements/raw_client.py b/src/schematic/entitlements/raw_client.py index 51f8dff..f8288b6 100644 --- a/src/schematic/entitlements/raw_client.py +++ b/src/schematic/entitlements/raw_client.py @@ -6,6 +6,7 @@ from ..core.api_error import ApiError as core_api_error_ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.datetime_utils import serialize_datetime from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.pydantic_utilities import parse_obj_as @@ -21,6 +22,7 @@ from ..types.create_price_tier_request_body import CreatePriceTierRequestBody from ..types.entitlement_price_behavior import EntitlementPriceBehavior from ..types.entitlement_value_type import EntitlementValueType +from ..types.time_series_granularity import TimeSeriesGranularity from .types.count_company_overrides_response import CountCompanyOverridesResponse from .types.count_feature_companies_response import CountFeatureCompaniesResponse from .types.count_feature_usage_response import CountFeatureUsageResponse @@ -41,6 +43,7 @@ from .types.duplicate_plan_entitlements_response import DuplicatePlanEntitlementsResponse from .types.get_company_override_response import GetCompanyOverrideResponse from .types.get_feature_usage_by_company_response import GetFeatureUsageByCompanyResponse +from .types.get_feature_usage_time_series_response import GetFeatureUsageTimeSeriesResponse from .types.get_plan_entitlement_response import GetPlanEntitlementResponse from .types.list_company_overrides_response import ListCompanyOverridesResponse from .types.list_feature_companies_response import ListFeatureCompaniesResponse @@ -1187,6 +1190,112 @@ def list_feature_usage( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def get_feature_usage_time_series( + self, + *, + company_id: str, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[GetFeatureUsageTimeSeriesResponse]: + """ + Parameters + ---------- + company_id : str + + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetFeatureUsageTimeSeriesResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "feature-usage-timeseries", + method="GET", + params={ + "company_id": company_id, + "end_time": serialize_datetime(end_time), + "feature_id": feature_id, + "granularity": granularity, + "start_time": serialize_datetime(start_time), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetFeatureUsageTimeSeriesResponse, + parse_obj_as( + type_=GetFeatureUsageTimeSeriesResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + def count_feature_usage( self, *, @@ -1557,6 +1666,8 @@ def list_plan_entitlements( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, with_metered_products: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -1581,6 +1692,12 @@ def list_plan_entitlements( plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter plan entitlements by multiple plan IDs (starting with plan_) + plan_version_id : typing.Optional[str] + Filter plan entitlements by a single plan version ID (starting with plvr_) + + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -1610,6 +1727,8 @@ def list_plan_entitlements( "ids": ids, "plan_id": plan_id, "plan_ids": plan_ids, + "plan_version_id": plan_version_id, + "plan_version_ids": plan_version_ids, "q": q, "with_metered_products": with_metered_products, "limit": limit, @@ -1708,6 +1827,7 @@ def create_plan_entitlement( monthly_unit_price: typing.Optional[int] = OMIT, monthly_unit_price_decimal: typing.Optional[str] = OMIT, overage_billing_product_id: typing.Optional[str] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, soft_limit: typing.Optional[int] = OMIT, @@ -1753,6 +1873,8 @@ def create_plan_entitlement( overage_billing_product_id : typing.Optional[str] + plan_version_id : typing.Optional[str] + price_behavior : typing.Optional[EntitlementPriceBehavior] price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] @@ -1807,6 +1929,7 @@ def create_plan_entitlement( "monthly_unit_price_decimal": monthly_unit_price_decimal, "overage_billing_product_id": overage_billing_product_id, "plan_id": plan_id, + "plan_version_id": plan_version_id, "price_behavior": price_behavior, "price_tiers": convert_and_respect_annotation_metadata( object_=price_tiers, annotation=typing.Sequence[CreatePriceTierRequestBody], direction="write" @@ -2308,6 +2431,8 @@ def count_plan_entitlements( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, with_metered_products: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -2332,6 +2457,12 @@ def count_plan_entitlements( plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter plan entitlements by multiple plan IDs (starting with plan_) + plan_version_id : typing.Optional[str] + Filter plan entitlements by a single plan version ID (starting with plvr_) + + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -2361,6 +2492,8 @@ def count_plan_entitlements( "ids": ids, "plan_id": plan_id, "plan_ids": plan_ids, + "plan_version_id": plan_version_id, + "plan_version_ids": plan_version_ids, "q": q, "with_metered_products": with_metered_products, "limit": limit, @@ -3761,6 +3894,112 @@ async def list_feature_usage( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + async def get_feature_usage_time_series( + self, + *, + company_id: str, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[GetFeatureUsageTimeSeriesResponse]: + """ + Parameters + ---------- + company_id : str + + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetFeatureUsageTimeSeriesResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "feature-usage-timeseries", + method="GET", + params={ + "company_id": company_id, + "end_time": serialize_datetime(end_time), + "feature_id": feature_id, + "granularity": granularity, + "start_time": serialize_datetime(start_time), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetFeatureUsageTimeSeriesResponse, + parse_obj_as( + type_=GetFeatureUsageTimeSeriesResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + async def count_feature_usage( self, *, @@ -4131,6 +4370,8 @@ async def list_plan_entitlements( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, with_metered_products: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -4155,6 +4396,12 @@ async def list_plan_entitlements( plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter plan entitlements by multiple plan IDs (starting with plan_) + plan_version_id : typing.Optional[str] + Filter plan entitlements by a single plan version ID (starting with plvr_) + + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -4184,6 +4431,8 @@ async def list_plan_entitlements( "ids": ids, "plan_id": plan_id, "plan_ids": plan_ids, + "plan_version_id": plan_version_id, + "plan_version_ids": plan_version_ids, "q": q, "with_metered_products": with_metered_products, "limit": limit, @@ -4282,6 +4531,7 @@ async def create_plan_entitlement( monthly_unit_price: typing.Optional[int] = OMIT, monthly_unit_price_decimal: typing.Optional[str] = OMIT, overage_billing_product_id: typing.Optional[str] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, soft_limit: typing.Optional[int] = OMIT, @@ -4327,6 +4577,8 @@ async def create_plan_entitlement( overage_billing_product_id : typing.Optional[str] + plan_version_id : typing.Optional[str] + price_behavior : typing.Optional[EntitlementPriceBehavior] price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] @@ -4381,6 +4633,7 @@ async def create_plan_entitlement( "monthly_unit_price_decimal": monthly_unit_price_decimal, "overage_billing_product_id": overage_billing_product_id, "plan_id": plan_id, + "plan_version_id": plan_version_id, "price_behavior": price_behavior, "price_tiers": convert_and_respect_annotation_metadata( object_=price_tiers, annotation=typing.Sequence[CreatePriceTierRequestBody], direction="write" @@ -4882,6 +5135,8 @@ async def count_plan_entitlements( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, with_metered_products: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -4906,6 +5161,12 @@ async def count_plan_entitlements( plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter plan entitlements by multiple plan IDs (starting with plan_) + plan_version_id : typing.Optional[str] + Filter plan entitlements by a single plan version ID (starting with plvr_) + + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -4935,6 +5196,8 @@ async def count_plan_entitlements( "ids": ids, "plan_id": plan_id, "plan_ids": plan_ids, + "plan_version_id": plan_version_id, + "plan_version_ids": plan_version_ids, "q": q, "with_metered_products": with_metered_products, "limit": limit, diff --git a/src/schematic/entitlements/types/__init__.py b/src/schematic/entitlements/types/__init__.py index 424ed0a..c82cf16 100644 --- a/src/schematic/entitlements/types/__init__.py +++ b/src/schematic/entitlements/types/__init__.py @@ -32,6 +32,8 @@ from .get_company_override_response import GetCompanyOverrideResponse from .get_feature_usage_by_company_params import GetFeatureUsageByCompanyParams from .get_feature_usage_by_company_response import GetFeatureUsageByCompanyResponse + from .get_feature_usage_time_series_params import GetFeatureUsageTimeSeriesParams + from .get_feature_usage_time_series_response import GetFeatureUsageTimeSeriesResponse from .get_plan_entitlement_response import GetPlanEntitlementResponse from .list_company_overrides_params import ListCompanyOverridesParams from .list_company_overrides_response import ListCompanyOverridesResponse @@ -76,6 +78,8 @@ "GetCompanyOverrideResponse": ".get_company_override_response", "GetFeatureUsageByCompanyParams": ".get_feature_usage_by_company_params", "GetFeatureUsageByCompanyResponse": ".get_feature_usage_by_company_response", + "GetFeatureUsageTimeSeriesParams": ".get_feature_usage_time_series_params", + "GetFeatureUsageTimeSeriesResponse": ".get_feature_usage_time_series_response", "GetPlanEntitlementResponse": ".get_plan_entitlement_response", "ListCompanyOverridesParams": ".list_company_overrides_params", "ListCompanyOverridesResponse": ".list_company_overrides_response", @@ -140,6 +144,8 @@ def __dir__(): "GetCompanyOverrideResponse", "GetFeatureUsageByCompanyParams", "GetFeatureUsageByCompanyResponse", + "GetFeatureUsageTimeSeriesParams", + "GetFeatureUsageTimeSeriesResponse", "GetPlanEntitlementResponse", "ListCompanyOverridesParams", "ListCompanyOverridesResponse", diff --git a/src/schematic/entitlements/types/count_plan_entitlements_params.py b/src/schematic/entitlements/types/count_plan_entitlements_params.py index c540896..da4aa5f 100644 --- a/src/schematic/entitlements/types/count_plan_entitlements_params.py +++ b/src/schematic/entitlements/types/count_plan_entitlements_params.py @@ -46,6 +46,16 @@ class CountPlanEntitlementsParams(UniversalBaseModel): Filter plan entitlements by multiple plan IDs (starting with plan_) """ + plan_version_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Filter plan entitlements by a single plan version ID (starting with plvr_) + """ + + plan_version_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + """ + q: typing.Optional[str] = pydantic.Field(default=None) """ Search for plan entitlements by feature or company name diff --git a/src/schematic/entitlements/types/get_feature_usage_time_series_params.py b/src/schematic/entitlements/types/get_feature_usage_time_series_params.py new file mode 100644 index 0000000..380fece --- /dev/null +++ b/src/schematic/entitlements/types/get_feature_usage_time_series_params.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.time_series_granularity import TimeSeriesGranularity + + +class GetFeatureUsageTimeSeriesParams(UniversalBaseModel): + """ + Input parameters + """ + + company_id: typing.Optional[str] = None + end_time: typing.Optional[dt.datetime] = None + feature_id: typing.Optional[str] = None + granularity: typing.Optional[TimeSeriesGranularity] = None + start_time: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/entitlements/types/get_feature_usage_time_series_response.py b/src/schematic/entitlements/types/get_feature_usage_time_series_response.py new file mode 100644 index 0000000..f3d61c4 --- /dev/null +++ b/src/schematic/entitlements/types/get_feature_usage_time_series_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.feature_usage_time_series_response_data import FeatureUsageTimeSeriesResponseData +from .get_feature_usage_time_series_params import GetFeatureUsageTimeSeriesParams + + +class GetFeatureUsageTimeSeriesResponse(UniversalBaseModel): + data: FeatureUsageTimeSeriesResponseData + params: GetFeatureUsageTimeSeriesParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/entitlements/types/list_plan_entitlements_params.py b/src/schematic/entitlements/types/list_plan_entitlements_params.py index 94aff73..8e9bc01 100644 --- a/src/schematic/entitlements/types/list_plan_entitlements_params.py +++ b/src/schematic/entitlements/types/list_plan_entitlements_params.py @@ -46,6 +46,16 @@ class ListPlanEntitlementsParams(UniversalBaseModel): Filter plan entitlements by multiple plan IDs (starting with plan_) """ + plan_version_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Filter plan entitlements by a single plan version ID (starting with plvr_) + """ + + plan_version_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Filter plan entitlements by multiple plan version IDs (starting with plvr_) + """ + q: typing.Optional[str] = pydantic.Field(default=None) """ Search for plan entitlements by feature or company name diff --git a/src/schematic/events/client.py b/src/schematic/events/client.py index c3f83cd..f45283a 100644 --- a/src/schematic/events/client.py +++ b/src/schematic/events/client.py @@ -199,6 +199,7 @@ def create_event( Parameters ---------- event_type : EventType + Either 'identify' or 'track' body : typing.Optional[EventBody] @@ -488,6 +489,7 @@ async def create_event( Parameters ---------- event_type : EventType + Either 'identify' or 'track' body : typing.Optional[EventBody] diff --git a/src/schematic/events/raw_client.py b/src/schematic/events/raw_client.py index ebd1d0d..7a57492 100644 --- a/src/schematic/events/raw_client.py +++ b/src/schematic/events/raw_client.py @@ -396,6 +396,7 @@ def create_event( Parameters ---------- event_type : EventType + Either 'identify' or 'track' body : typing.Optional[EventBody] @@ -1031,6 +1032,7 @@ async def create_event( Parameters ---------- event_type : EventType + Either 'identify' or 'track' body : typing.Optional[EventBody] diff --git a/src/schematic/features/client.py b/src/schematic/features/client.py index 700a633..178ea73 100644 --- a/src/schematic/features/client.py +++ b/src/schematic/features/client.py @@ -52,6 +52,7 @@ def list_features( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, + plan_version_id: typing.Optional[str] = None, without_plan_entitlement_for: typing.Optional[str] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, boolean_require_event: typing.Optional[bool] = None, @@ -70,6 +71,9 @@ def list_features( without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID + plan_version_id : typing.Optional[str] + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + without_plan_entitlement_for : typing.Optional[str] Filter out features that already have a plan entitlement for the specified plan ID @@ -103,6 +107,7 @@ def list_features( client.features.list_features( q="q", without_company_override_for="without_company_override_for", + plan_version_id="plan_version_id", without_plan_entitlement_for="without_plan_entitlement_for", boolean_require_event=True, limit=1, @@ -113,6 +118,7 @@ def list_features( ids=ids, q=q, without_company_override_for=without_company_override_for, + plan_version_id=plan_version_id, without_plan_entitlement_for=without_plan_entitlement_for, feature_type=feature_type, boolean_require_event=boolean_require_event, @@ -349,6 +355,7 @@ def count_features( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, + plan_version_id: typing.Optional[str] = None, without_plan_entitlement_for: typing.Optional[str] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, boolean_require_event: typing.Optional[bool] = None, @@ -367,6 +374,9 @@ def count_features( without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID + plan_version_id : typing.Optional[str] + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + without_plan_entitlement_for : typing.Optional[str] Filter out features that already have a plan entitlement for the specified plan ID @@ -400,6 +410,7 @@ def count_features( client.features.count_features( q="q", without_company_override_for="without_company_override_for", + plan_version_id="plan_version_id", without_plan_entitlement_for="without_plan_entitlement_for", boolean_require_event=True, limit=1, @@ -410,6 +421,7 @@ def count_features( ids=ids, q=q, without_company_override_for=without_company_override_for, + plan_version_id=plan_version_id, without_plan_entitlement_for=without_plan_entitlement_for, feature_type=feature_type, boolean_require_event=boolean_require_event, @@ -905,6 +917,7 @@ async def list_features( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, + plan_version_id: typing.Optional[str] = None, without_plan_entitlement_for: typing.Optional[str] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, boolean_require_event: typing.Optional[bool] = None, @@ -923,6 +936,9 @@ async def list_features( without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID + plan_version_id : typing.Optional[str] + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + without_plan_entitlement_for : typing.Optional[str] Filter out features that already have a plan entitlement for the specified plan ID @@ -961,6 +977,7 @@ async def main() -> None: await client.features.list_features( q="q", without_company_override_for="without_company_override_for", + plan_version_id="plan_version_id", without_plan_entitlement_for="without_plan_entitlement_for", boolean_require_event=True, limit=1, @@ -974,6 +991,7 @@ async def main() -> None: ids=ids, q=q, without_company_override_for=without_company_override_for, + plan_version_id=plan_version_id, without_plan_entitlement_for=without_plan_entitlement_for, feature_type=feature_type, boolean_require_event=boolean_require_event, @@ -1242,6 +1260,7 @@ async def count_features( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, + plan_version_id: typing.Optional[str] = None, without_plan_entitlement_for: typing.Optional[str] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, boolean_require_event: typing.Optional[bool] = None, @@ -1260,6 +1279,9 @@ async def count_features( without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID + plan_version_id : typing.Optional[str] + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + without_plan_entitlement_for : typing.Optional[str] Filter out features that already have a plan entitlement for the specified plan ID @@ -1298,6 +1320,7 @@ async def main() -> None: await client.features.count_features( q="q", without_company_override_for="without_company_override_for", + plan_version_id="plan_version_id", without_plan_entitlement_for="without_plan_entitlement_for", boolean_require_event=True, limit=1, @@ -1311,6 +1334,7 @@ async def main() -> None: ids=ids, q=q, without_company_override_for=without_company_override_for, + plan_version_id=plan_version_id, without_plan_entitlement_for=without_plan_entitlement_for, feature_type=feature_type, boolean_require_event=boolean_require_event, diff --git a/src/schematic/features/raw_client.py b/src/schematic/features/raw_client.py index 0c583b9..d537823 100644 --- a/src/schematic/features/raw_client.py +++ b/src/schematic/features/raw_client.py @@ -52,6 +52,7 @@ def list_features( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, + plan_version_id: typing.Optional[str] = None, without_plan_entitlement_for: typing.Optional[str] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, boolean_require_event: typing.Optional[bool] = None, @@ -70,6 +71,9 @@ def list_features( without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID + plan_version_id : typing.Optional[str] + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + without_plan_entitlement_for : typing.Optional[str] Filter out features that already have a plan entitlement for the specified plan ID @@ -100,6 +104,7 @@ def list_features( "ids": ids, "q": q, "without_company_override_for": without_company_override_for, + "plan_version_id": plan_version_id, "without_plan_entitlement_for": without_plan_entitlement_for, "feature_type": feature_type, "boolean_require_event": boolean_require_event, @@ -667,6 +672,7 @@ def count_features( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, + plan_version_id: typing.Optional[str] = None, without_plan_entitlement_for: typing.Optional[str] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, boolean_require_event: typing.Optional[bool] = None, @@ -685,6 +691,9 @@ def count_features( without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID + plan_version_id : typing.Optional[str] + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + without_plan_entitlement_for : typing.Optional[str] Filter out features that already have a plan entitlement for the specified plan ID @@ -715,6 +724,7 @@ def count_features( "ids": ids, "q": q, "without_company_override_for": without_company_override_for, + "plan_version_id": plan_version_id, "without_plan_entitlement_for": without_plan_entitlement_for, "feature_type": feature_type, "boolean_require_event": boolean_require_event, @@ -1925,6 +1935,7 @@ async def list_features( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, + plan_version_id: typing.Optional[str] = None, without_plan_entitlement_for: typing.Optional[str] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, boolean_require_event: typing.Optional[bool] = None, @@ -1943,6 +1954,9 @@ async def list_features( without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID + plan_version_id : typing.Optional[str] + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + without_plan_entitlement_for : typing.Optional[str] Filter out features that already have a plan entitlement for the specified plan ID @@ -1973,6 +1987,7 @@ async def list_features( "ids": ids, "q": q, "without_company_override_for": without_company_override_for, + "plan_version_id": plan_version_id, "without_plan_entitlement_for": without_plan_entitlement_for, "feature_type": feature_type, "boolean_require_event": boolean_require_event, @@ -2540,6 +2555,7 @@ async def count_features( ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, + plan_version_id: typing.Optional[str] = None, without_plan_entitlement_for: typing.Optional[str] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, boolean_require_event: typing.Optional[bool] = None, @@ -2558,6 +2574,9 @@ async def count_features( without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID + plan_version_id : typing.Optional[str] + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + without_plan_entitlement_for : typing.Optional[str] Filter out features that already have a plan entitlement for the specified plan ID @@ -2588,6 +2607,7 @@ async def count_features( "ids": ids, "q": q, "without_company_override_for": without_company_override_for, + "plan_version_id": plan_version_id, "without_plan_entitlement_for": without_plan_entitlement_for, "feature_type": feature_type, "boolean_require_event": boolean_require_event, diff --git a/src/schematic/features/types/count_features_params.py b/src/schematic/features/types/count_features_params.py index 95b2901..2938333 100644 --- a/src/schematic/features/types/count_features_params.py +++ b/src/schematic/features/types/count_features_params.py @@ -33,6 +33,11 @@ class CountFeaturesParams(UniversalBaseModel): Page offset (default 0) """ + plan_version_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + """ + q: typing.Optional[str] = pydantic.Field(default=None) """ Search by feature name or ID diff --git a/src/schematic/features/types/list_features_params.py b/src/schematic/features/types/list_features_params.py index 02fcb5d..1756467 100644 --- a/src/schematic/features/types/list_features_params.py +++ b/src/schematic/features/types/list_features_params.py @@ -33,6 +33,11 @@ class ListFeaturesParams(UniversalBaseModel): Page offset (default 0) """ + plan_version_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + """ + q: typing.Optional[str] = pydantic.Field(default=None) """ Search by feature name or ID diff --git a/src/schematic/planbundle/__init__.py b/src/schematic/planbundle/__init__.py new file mode 100644 index 0000000..e316a0a --- /dev/null +++ b/src/schematic/planbundle/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import CreatePlanBundleResponse, UpdatePlanBundleResponse +_dynamic_imports: typing.Dict[str, str] = {"CreatePlanBundleResponse": ".types", "UpdatePlanBundleResponse": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["CreatePlanBundleResponse", "UpdatePlanBundleResponse"] diff --git a/src/schematic/planbundle/client.py b/src/schematic/planbundle/client.py new file mode 100644 index 0000000..d1d2ca4 --- /dev/null +++ b/src/schematic/planbundle/client.py @@ -0,0 +1,310 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.create_plan_request_body import CreatePlanRequestBody +from ..types.plan_bundle_credit_grant_request_body import PlanBundleCreditGrantRequestBody +from ..types.plan_bundle_entitlement_request_body import PlanBundleEntitlementRequestBody +from ..types.update_plan_request_body import UpdatePlanRequestBody +from ..types.update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody +from ..types.upsert_billing_product_request_body import UpsertBillingProductRequestBody +from .raw_client import AsyncRawPlanbundleClient, RawPlanbundleClient +from .types.create_plan_bundle_response import CreatePlanBundleResponse +from .types.update_plan_bundle_response import UpdatePlanBundleResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class PlanbundleClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawPlanbundleClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawPlanbundleClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawPlanbundleClient + """ + return self._raw_client + + def create_plan_bundle( + self, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + credit_grants: typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] = OMIT, + plan: typing.Optional[CreatePlanRequestBody] = OMIT, + traits: typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CreatePlanBundleResponse: + """ + Parameters + ---------- + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + credit_grants : typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] + + plan : typing.Optional[CreatePlanRequestBody] + + traits : typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CreatePlanBundleResponse + Created + + Examples + -------- + from schematic import PlanBundleEntitlementRequestBody, Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.planbundle.create_plan_bundle( + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) + ], + ) + """ + _response = self._raw_client.create_plan_bundle( + entitlements=entitlements, + billing_product=billing_product, + credit_grants=credit_grants, + plan=plan, + traits=traits, + request_options=request_options, + ) + return _response.data + + def update_plan_bundle( + self, + plan_bundle_id: str, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + credit_grants: typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] = OMIT, + plan: typing.Optional[UpdatePlanRequestBody] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, + traits: typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdatePlanBundleResponse: + """ + Parameters + ---------- + plan_bundle_id : str + plan_bundle_id + + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + credit_grants : typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] + + plan : typing.Optional[UpdatePlanRequestBody] + + plan_version_id : typing.Optional[str] + + traits : typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdatePlanBundleResponse + OK + + Examples + -------- + from schematic import PlanBundleEntitlementRequestBody, Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.planbundle.update_plan_bundle( + plan_bundle_id="plan_bundle_id", + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) + ], + ) + """ + _response = self._raw_client.update_plan_bundle( + plan_bundle_id, + entitlements=entitlements, + billing_product=billing_product, + credit_grants=credit_grants, + plan=plan, + plan_version_id=plan_version_id, + traits=traits, + request_options=request_options, + ) + return _response.data + + +class AsyncPlanbundleClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawPlanbundleClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawPlanbundleClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawPlanbundleClient + """ + return self._raw_client + + async def create_plan_bundle( + self, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + credit_grants: typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] = OMIT, + plan: typing.Optional[CreatePlanRequestBody] = OMIT, + traits: typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CreatePlanBundleResponse: + """ + Parameters + ---------- + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + credit_grants : typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] + + plan : typing.Optional[CreatePlanRequestBody] + + traits : typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CreatePlanBundleResponse + Created + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic, PlanBundleEntitlementRequestBody + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.planbundle.create_plan_bundle( + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create_plan_bundle( + entitlements=entitlements, + billing_product=billing_product, + credit_grants=credit_grants, + plan=plan, + traits=traits, + request_options=request_options, + ) + return _response.data + + async def update_plan_bundle( + self, + plan_bundle_id: str, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + credit_grants: typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] = OMIT, + plan: typing.Optional[UpdatePlanRequestBody] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, + traits: typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdatePlanBundleResponse: + """ + Parameters + ---------- + plan_bundle_id : str + plan_bundle_id + + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + credit_grants : typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] + + plan : typing.Optional[UpdatePlanRequestBody] + + plan_version_id : typing.Optional[str] + + traits : typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdatePlanBundleResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic, PlanBundleEntitlementRequestBody + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.planbundle.update_plan_bundle( + plan_bundle_id="plan_bundle_id", + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.update_plan_bundle( + plan_bundle_id, + entitlements=entitlements, + billing_product=billing_product, + credit_grants=credit_grants, + plan=plan, + plan_version_id=plan_version_id, + traits=traits, + request_options=request_options, + ) + return _response.data diff --git a/src/schematic/planbundle/raw_client.py b/src/schematic/planbundle/raw_client.py new file mode 100644 index 0000000..6ca4b83 --- /dev/null +++ b/src/schematic/planbundle/raw_client.py @@ -0,0 +1,595 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError as core_api_error_ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..core.serialization import convert_and_respect_annotation_metadata +from ..errors.bad_request_error import BadRequestError +from ..errors.forbidden_error import ForbiddenError +from ..errors.internal_server_error import InternalServerError +from ..errors.not_found_error import NotFoundError +from ..errors.unauthorized_error import UnauthorizedError +from ..types.api_error import ApiError as types_api_error_ApiError +from ..types.create_plan_request_body import CreatePlanRequestBody +from ..types.plan_bundle_credit_grant_request_body import PlanBundleCreditGrantRequestBody +from ..types.plan_bundle_entitlement_request_body import PlanBundleEntitlementRequestBody +from ..types.update_plan_request_body import UpdatePlanRequestBody +from ..types.update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody +from ..types.upsert_billing_product_request_body import UpsertBillingProductRequestBody +from .types.create_plan_bundle_response import CreatePlanBundleResponse +from .types.update_plan_bundle_response import UpdatePlanBundleResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawPlanbundleClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def create_plan_bundle( + self, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + credit_grants: typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] = OMIT, + plan: typing.Optional[CreatePlanRequestBody] = OMIT, + traits: typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[CreatePlanBundleResponse]: + """ + Parameters + ---------- + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + credit_grants : typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] + + plan : typing.Optional[CreatePlanRequestBody] + + traits : typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CreatePlanBundleResponse] + Created + """ + _response = self._client_wrapper.httpx_client.request( + "plan-bundles", + method="POST", + json={ + "billing_product": convert_and_respect_annotation_metadata( + object_=billing_product, annotation=UpsertBillingProductRequestBody, direction="write" + ), + "credit_grants": convert_and_respect_annotation_metadata( + object_=credit_grants, + annotation=typing.Sequence[PlanBundleCreditGrantRequestBody], + direction="write", + ), + "entitlements": convert_and_respect_annotation_metadata( + object_=entitlements, + annotation=typing.Sequence[PlanBundleEntitlementRequestBody], + direction="write", + ), + "plan": convert_and_respect_annotation_metadata( + object_=plan, annotation=CreatePlanRequestBody, direction="write" + ), + "traits": convert_and_respect_annotation_metadata( + object_=traits, annotation=typing.Sequence[UpdatePlanTraitTraitRequestBody], direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CreatePlanBundleResponse, + parse_obj_as( + type_=CreatePlanBundleResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def update_plan_bundle( + self, + plan_bundle_id: str, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + credit_grants: typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] = OMIT, + plan: typing.Optional[UpdatePlanRequestBody] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, + traits: typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[UpdatePlanBundleResponse]: + """ + Parameters + ---------- + plan_bundle_id : str + plan_bundle_id + + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + credit_grants : typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] + + plan : typing.Optional[UpdatePlanRequestBody] + + plan_version_id : typing.Optional[str] + + traits : typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[UpdatePlanBundleResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + f"plan-bundles/{jsonable_encoder(plan_bundle_id)}", + method="PUT", + json={ + "billing_product": convert_and_respect_annotation_metadata( + object_=billing_product, annotation=UpsertBillingProductRequestBody, direction="write" + ), + "credit_grants": convert_and_respect_annotation_metadata( + object_=credit_grants, + annotation=typing.Sequence[PlanBundleCreditGrantRequestBody], + direction="write", + ), + "entitlements": convert_and_respect_annotation_metadata( + object_=entitlements, + annotation=typing.Sequence[PlanBundleEntitlementRequestBody], + direction="write", + ), + "plan": convert_and_respect_annotation_metadata( + object_=plan, annotation=UpdatePlanRequestBody, direction="write" + ), + "plan_version_id": plan_version_id, + "traits": convert_and_respect_annotation_metadata( + object_=traits, annotation=typing.Sequence[UpdatePlanTraitTraitRequestBody], direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + UpdatePlanBundleResponse, + parse_obj_as( + type_=UpdatePlanBundleResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + +class AsyncRawPlanbundleClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def create_plan_bundle( + self, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + credit_grants: typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] = OMIT, + plan: typing.Optional[CreatePlanRequestBody] = OMIT, + traits: typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CreatePlanBundleResponse]: + """ + Parameters + ---------- + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + credit_grants : typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] + + plan : typing.Optional[CreatePlanRequestBody] + + traits : typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CreatePlanBundleResponse] + Created + """ + _response = await self._client_wrapper.httpx_client.request( + "plan-bundles", + method="POST", + json={ + "billing_product": convert_and_respect_annotation_metadata( + object_=billing_product, annotation=UpsertBillingProductRequestBody, direction="write" + ), + "credit_grants": convert_and_respect_annotation_metadata( + object_=credit_grants, + annotation=typing.Sequence[PlanBundleCreditGrantRequestBody], + direction="write", + ), + "entitlements": convert_and_respect_annotation_metadata( + object_=entitlements, + annotation=typing.Sequence[PlanBundleEntitlementRequestBody], + direction="write", + ), + "plan": convert_and_respect_annotation_metadata( + object_=plan, annotation=CreatePlanRequestBody, direction="write" + ), + "traits": convert_and_respect_annotation_metadata( + object_=traits, annotation=typing.Sequence[UpdatePlanTraitTraitRequestBody], direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CreatePlanBundleResponse, + parse_obj_as( + type_=CreatePlanBundleResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def update_plan_bundle( + self, + plan_bundle_id: str, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + credit_grants: typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] = OMIT, + plan: typing.Optional[UpdatePlanRequestBody] = OMIT, + plan_version_id: typing.Optional[str] = OMIT, + traits: typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[UpdatePlanBundleResponse]: + """ + Parameters + ---------- + plan_bundle_id : str + plan_bundle_id + + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + credit_grants : typing.Optional[typing.Sequence[PlanBundleCreditGrantRequestBody]] + + plan : typing.Optional[UpdatePlanRequestBody] + + plan_version_id : typing.Optional[str] + + traits : typing.Optional[typing.Sequence[UpdatePlanTraitTraitRequestBody]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[UpdatePlanBundleResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + f"plan-bundles/{jsonable_encoder(plan_bundle_id)}", + method="PUT", + json={ + "billing_product": convert_and_respect_annotation_metadata( + object_=billing_product, annotation=UpsertBillingProductRequestBody, direction="write" + ), + "credit_grants": convert_and_respect_annotation_metadata( + object_=credit_grants, + annotation=typing.Sequence[PlanBundleCreditGrantRequestBody], + direction="write", + ), + "entitlements": convert_and_respect_annotation_metadata( + object_=entitlements, + annotation=typing.Sequence[PlanBundleEntitlementRequestBody], + direction="write", + ), + "plan": convert_and_respect_annotation_metadata( + object_=plan, annotation=UpdatePlanRequestBody, direction="write" + ), + "plan_version_id": plan_version_id, + "traits": convert_and_respect_annotation_metadata( + object_=traits, annotation=typing.Sequence[UpdatePlanTraitTraitRequestBody], direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + UpdatePlanBundleResponse, + parse_obj_as( + type_=UpdatePlanBundleResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) diff --git a/src/schematic/planbundle/types/__init__.py b/src/schematic/planbundle/types/__init__.py new file mode 100644 index 0000000..378e6a4 --- /dev/null +++ b/src/schematic/planbundle/types/__init__.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .create_plan_bundle_response import CreatePlanBundleResponse + from .update_plan_bundle_response import UpdatePlanBundleResponse +_dynamic_imports: typing.Dict[str, str] = { + "CreatePlanBundleResponse": ".create_plan_bundle_response", + "UpdatePlanBundleResponse": ".update_plan_bundle_response", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["CreatePlanBundleResponse", "UpdatePlanBundleResponse"] diff --git a/src/schematic/planbundle/types/create_plan_bundle_response.py b/src/schematic/planbundle/types/create_plan_bundle_response.py new file mode 100644 index 0000000..f1ef913 --- /dev/null +++ b/src/schematic/planbundle/types/create_plan_bundle_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_bundle_response_data import PlanBundleResponseData + + +class CreatePlanBundleResponse(UniversalBaseModel): + data: PlanBundleResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planbundle/types/update_plan_bundle_response.py b/src/schematic/planbundle/types/update_plan_bundle_response.py new file mode 100644 index 0000000..9bddca6 --- /dev/null +++ b/src/schematic/planbundle/types/update_plan_bundle_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_bundle_response_data import PlanBundleResponseData + + +class UpdatePlanBundleResponse(UniversalBaseModel): + data: PlanBundleResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/plangroups/__init__.py b/src/schematic/plangroups/__init__.py index e80605f..6a92007 100644 --- a/src/schematic/plangroups/__init__.py +++ b/src/schematic/plangroups/__init__.py @@ -6,9 +6,10 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .types import CreatePlanGroupResponse, GetPlanGroupResponse, UpdatePlanGroupResponse + from .types import CreatePlanGroupResponse, GetPlanGroupParams, GetPlanGroupResponse, UpdatePlanGroupResponse _dynamic_imports: typing.Dict[str, str] = { "CreatePlanGroupResponse": ".types", + "GetPlanGroupParams": ".types", "GetPlanGroupResponse": ".types", "UpdatePlanGroupResponse": ".types", } @@ -35,4 +36,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["CreatePlanGroupResponse", "GetPlanGroupResponse", "UpdatePlanGroupResponse"] +__all__ = ["CreatePlanGroupResponse", "GetPlanGroupParams", "GetPlanGroupResponse", "UpdatePlanGroupResponse"] diff --git a/src/schematic/plangroups/client.py b/src/schematic/plangroups/client.py index e229a93..2c916b4 100644 --- a/src/schematic/plangroups/client.py +++ b/src/schematic/plangroups/client.py @@ -9,6 +9,7 @@ from ..types.ordered_plans_in_group import OrderedPlansInGroup from ..types.plan_group_bundle_order import PlanGroupBundleOrder from ..types.proration_behavior import ProrationBehavior +from ..types.scheduled_downgrade_config_behavior import ScheduledDowngradeConfigBehavior from .raw_client import AsyncRawPlangroupsClient, RawPlangroupsClient from .types.create_plan_group_response import CreatePlanGroupResponse from .types.get_plan_group_response import GetPlanGroupResponse @@ -33,10 +34,17 @@ def with_raw_response(self) -> RawPlangroupsClient: """ return self._raw_client - def get_plan_group(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetPlanGroupResponse: + def get_plan_group( + self, + *, + include_company_counts: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetPlanGroupResponse: """ Parameters ---------- + include_company_counts : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -52,9 +60,13 @@ def get_plan_group(self, *, request_options: typing.Optional[RequestOptions] = N client = Schematic( api_key="YOUR_API_KEY", ) - client.plangroups.get_plan_group() + client.plangroups.get_plan_group( + include_company_counts=True, + ) """ - _response = self._raw_client.get_plan_group(request_options=request_options) + _response = self._raw_client.get_plan_group( + include_company_counts=include_company_counts, request_options=request_options + ) return _response.data def create_plan_group( @@ -73,6 +85,8 @@ def create_plan_group( proration_behavior: ProrationBehavior, show_as_monthly_prices: bool, show_credits: bool, + show_feature_description: bool, + show_hard_limit: bool, show_period_toggle: bool, show_zero_price_as_free: bool, sync_customer_billing_details: bool, @@ -84,6 +98,8 @@ def create_plan_group( initial_plan_price_id: typing.Optional[str] = OMIT, prevent_self_service_downgrade_button_text: typing.Optional[str] = OMIT, prevent_self_service_downgrade_url: typing.Optional[str] = OMIT, + scheduled_downgrade_behavior: typing.Optional[ScheduledDowngradeConfigBehavior] = OMIT, + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = OMIT, trial_days: typing.Optional[int] = OMIT, trial_expiry_plan_id: typing.Optional[str] = OMIT, trial_expiry_plan_price_id: typing.Optional[str] = OMIT, @@ -120,6 +136,10 @@ def create_plan_group( show_credits : bool + show_feature_description : bool + + show_hard_limit : bool + show_period_toggle : bool show_zero_price_as_free : bool @@ -142,6 +162,10 @@ def create_plan_group( prevent_self_service_downgrade_url : typing.Optional[str] + scheduled_downgrade_behavior : typing.Optional[ScheduledDowngradeConfigBehavior] + + scheduled_downgrade_prevent_when_over_limit : typing.Optional[bool] + trial_days : typing.Optional[int] trial_expiry_plan_id : typing.Optional[str] @@ -191,6 +215,8 @@ def create_plan_group( proration_behavior="create_prorations", show_as_monthly_prices=True, show_credits=True, + show_feature_description=True, + show_hard_limit=True, show_period_toggle=True, show_zero_price_as_free=True, sync_customer_billing_details=True, @@ -210,6 +236,8 @@ def create_plan_group( proration_behavior=proration_behavior, show_as_monthly_prices=show_as_monthly_prices, show_credits=show_credits, + show_feature_description=show_feature_description, + show_hard_limit=show_hard_limit, show_period_toggle=show_period_toggle, show_zero_price_as_free=show_zero_price_as_free, sync_customer_billing_details=sync_customer_billing_details, @@ -221,6 +249,8 @@ def create_plan_group( initial_plan_price_id=initial_plan_price_id, prevent_self_service_downgrade_button_text=prevent_self_service_downgrade_button_text, prevent_self_service_downgrade_url=prevent_self_service_downgrade_url, + scheduled_downgrade_behavior=scheduled_downgrade_behavior, + scheduled_downgrade_prevent_when_over_limit=scheduled_downgrade_prevent_when_over_limit, trial_days=trial_days, trial_expiry_plan_id=trial_expiry_plan_id, trial_expiry_plan_price_id=trial_expiry_plan_price_id, @@ -246,6 +276,8 @@ def update_plan_group( proration_behavior: ProrationBehavior, show_as_monthly_prices: bool, show_credits: bool, + show_feature_description: bool, + show_hard_limit: bool, show_period_toggle: bool, show_zero_price_as_free: bool, sync_customer_billing_details: bool, @@ -257,6 +289,8 @@ def update_plan_group( initial_plan_price_id: typing.Optional[str] = OMIT, prevent_self_service_downgrade_button_text: typing.Optional[str] = OMIT, prevent_self_service_downgrade_url: typing.Optional[str] = OMIT, + scheduled_downgrade_behavior: typing.Optional[ScheduledDowngradeConfigBehavior] = OMIT, + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = OMIT, trial_days: typing.Optional[int] = OMIT, trial_expiry_plan_id: typing.Optional[str] = OMIT, trial_expiry_plan_price_id: typing.Optional[str] = OMIT, @@ -296,6 +330,10 @@ def update_plan_group( show_credits : bool + show_feature_description : bool + + show_hard_limit : bool + show_period_toggle : bool show_zero_price_as_free : bool @@ -318,6 +356,10 @@ def update_plan_group( prevent_self_service_downgrade_url : typing.Optional[str] + scheduled_downgrade_behavior : typing.Optional[ScheduledDowngradeConfigBehavior] + + scheduled_downgrade_prevent_when_over_limit : typing.Optional[bool] + trial_days : typing.Optional[int] trial_expiry_plan_id : typing.Optional[str] @@ -368,6 +410,8 @@ def update_plan_group( proration_behavior="create_prorations", show_as_monthly_prices=True, show_credits=True, + show_feature_description=True, + show_hard_limit=True, show_period_toggle=True, show_zero_price_as_free=True, sync_customer_billing_details=True, @@ -388,6 +432,8 @@ def update_plan_group( proration_behavior=proration_behavior, show_as_monthly_prices=show_as_monthly_prices, show_credits=show_credits, + show_feature_description=show_feature_description, + show_hard_limit=show_hard_limit, show_period_toggle=show_period_toggle, show_zero_price_as_free=show_zero_price_as_free, sync_customer_billing_details=sync_customer_billing_details, @@ -399,6 +445,8 @@ def update_plan_group( initial_plan_price_id=initial_plan_price_id, prevent_self_service_downgrade_button_text=prevent_self_service_downgrade_button_text, prevent_self_service_downgrade_url=prevent_self_service_downgrade_url, + scheduled_downgrade_behavior=scheduled_downgrade_behavior, + scheduled_downgrade_prevent_when_over_limit=scheduled_downgrade_prevent_when_over_limit, trial_days=trial_days, trial_expiry_plan_id=trial_expiry_plan_id, trial_expiry_plan_price_id=trial_expiry_plan_price_id, @@ -423,10 +471,17 @@ def with_raw_response(self) -> AsyncRawPlangroupsClient: """ return self._raw_client - async def get_plan_group(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetPlanGroupResponse: + async def get_plan_group( + self, + *, + include_company_counts: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetPlanGroupResponse: """ Parameters ---------- + include_company_counts : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -447,12 +502,16 @@ async def get_plan_group(self, *, request_options: typing.Optional[RequestOption async def main() -> None: - await client.plangroups.get_plan_group() + await client.plangroups.get_plan_group( + include_company_counts=True, + ) asyncio.run(main()) """ - _response = await self._raw_client.get_plan_group(request_options=request_options) + _response = await self._raw_client.get_plan_group( + include_company_counts=include_company_counts, request_options=request_options + ) return _response.data async def create_plan_group( @@ -471,6 +530,8 @@ async def create_plan_group( proration_behavior: ProrationBehavior, show_as_monthly_prices: bool, show_credits: bool, + show_feature_description: bool, + show_hard_limit: bool, show_period_toggle: bool, show_zero_price_as_free: bool, sync_customer_billing_details: bool, @@ -482,6 +543,8 @@ async def create_plan_group( initial_plan_price_id: typing.Optional[str] = OMIT, prevent_self_service_downgrade_button_text: typing.Optional[str] = OMIT, prevent_self_service_downgrade_url: typing.Optional[str] = OMIT, + scheduled_downgrade_behavior: typing.Optional[ScheduledDowngradeConfigBehavior] = OMIT, + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = OMIT, trial_days: typing.Optional[int] = OMIT, trial_expiry_plan_id: typing.Optional[str] = OMIT, trial_expiry_plan_price_id: typing.Optional[str] = OMIT, @@ -518,6 +581,10 @@ async def create_plan_group( show_credits : bool + show_feature_description : bool + + show_hard_limit : bool + show_period_toggle : bool show_zero_price_as_free : bool @@ -540,6 +607,10 @@ async def create_plan_group( prevent_self_service_downgrade_url : typing.Optional[str] + scheduled_downgrade_behavior : typing.Optional[ScheduledDowngradeConfigBehavior] + + scheduled_downgrade_prevent_when_over_limit : typing.Optional[bool] + trial_days : typing.Optional[int] trial_expiry_plan_id : typing.Optional[str] @@ -594,6 +665,8 @@ async def main() -> None: proration_behavior="create_prorations", show_as_monthly_prices=True, show_credits=True, + show_feature_description=True, + show_hard_limit=True, show_period_toggle=True, show_zero_price_as_free=True, sync_customer_billing_details=True, @@ -616,6 +689,8 @@ async def main() -> None: proration_behavior=proration_behavior, show_as_monthly_prices=show_as_monthly_prices, show_credits=show_credits, + show_feature_description=show_feature_description, + show_hard_limit=show_hard_limit, show_period_toggle=show_period_toggle, show_zero_price_as_free=show_zero_price_as_free, sync_customer_billing_details=sync_customer_billing_details, @@ -627,6 +702,8 @@ async def main() -> None: initial_plan_price_id=initial_plan_price_id, prevent_self_service_downgrade_button_text=prevent_self_service_downgrade_button_text, prevent_self_service_downgrade_url=prevent_self_service_downgrade_url, + scheduled_downgrade_behavior=scheduled_downgrade_behavior, + scheduled_downgrade_prevent_when_over_limit=scheduled_downgrade_prevent_when_over_limit, trial_days=trial_days, trial_expiry_plan_id=trial_expiry_plan_id, trial_expiry_plan_price_id=trial_expiry_plan_price_id, @@ -652,6 +729,8 @@ async def update_plan_group( proration_behavior: ProrationBehavior, show_as_monthly_prices: bool, show_credits: bool, + show_feature_description: bool, + show_hard_limit: bool, show_period_toggle: bool, show_zero_price_as_free: bool, sync_customer_billing_details: bool, @@ -663,6 +742,8 @@ async def update_plan_group( initial_plan_price_id: typing.Optional[str] = OMIT, prevent_self_service_downgrade_button_text: typing.Optional[str] = OMIT, prevent_self_service_downgrade_url: typing.Optional[str] = OMIT, + scheduled_downgrade_behavior: typing.Optional[ScheduledDowngradeConfigBehavior] = OMIT, + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = OMIT, trial_days: typing.Optional[int] = OMIT, trial_expiry_plan_id: typing.Optional[str] = OMIT, trial_expiry_plan_price_id: typing.Optional[str] = OMIT, @@ -702,6 +783,10 @@ async def update_plan_group( show_credits : bool + show_feature_description : bool + + show_hard_limit : bool + show_period_toggle : bool show_zero_price_as_free : bool @@ -724,6 +809,10 @@ async def update_plan_group( prevent_self_service_downgrade_url : typing.Optional[str] + scheduled_downgrade_behavior : typing.Optional[ScheduledDowngradeConfigBehavior] + + scheduled_downgrade_prevent_when_over_limit : typing.Optional[bool] + trial_days : typing.Optional[int] trial_expiry_plan_id : typing.Optional[str] @@ -779,6 +868,8 @@ async def main() -> None: proration_behavior="create_prorations", show_as_monthly_prices=True, show_credits=True, + show_feature_description=True, + show_hard_limit=True, show_period_toggle=True, show_zero_price_as_free=True, sync_customer_billing_details=True, @@ -802,6 +893,8 @@ async def main() -> None: proration_behavior=proration_behavior, show_as_monthly_prices=show_as_monthly_prices, show_credits=show_credits, + show_feature_description=show_feature_description, + show_hard_limit=show_hard_limit, show_period_toggle=show_period_toggle, show_zero_price_as_free=show_zero_price_as_free, sync_customer_billing_details=sync_customer_billing_details, @@ -813,6 +906,8 @@ async def main() -> None: initial_plan_price_id=initial_plan_price_id, prevent_self_service_downgrade_button_text=prevent_self_service_downgrade_button_text, prevent_self_service_downgrade_url=prevent_self_service_downgrade_url, + scheduled_downgrade_behavior=scheduled_downgrade_behavior, + scheduled_downgrade_prevent_when_over_limit=scheduled_downgrade_prevent_when_over_limit, trial_days=trial_days, trial_expiry_plan_id=trial_expiry_plan_id, trial_expiry_plan_price_id=trial_expiry_plan_price_id, diff --git a/src/schematic/plangroups/raw_client.py b/src/schematic/plangroups/raw_client.py index 2ac49a2..4af50a0 100644 --- a/src/schematic/plangroups/raw_client.py +++ b/src/schematic/plangroups/raw_client.py @@ -21,6 +21,7 @@ from ..types.ordered_plans_in_group import OrderedPlansInGroup from ..types.plan_group_bundle_order import PlanGroupBundleOrder from ..types.proration_behavior import ProrationBehavior +from ..types.scheduled_downgrade_config_behavior import ScheduledDowngradeConfigBehavior from .types.create_plan_group_response import CreatePlanGroupResponse from .types.get_plan_group_response import GetPlanGroupResponse from .types.update_plan_group_response import UpdatePlanGroupResponse @@ -34,11 +35,16 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper def get_plan_group( - self, *, request_options: typing.Optional[RequestOptions] = None + self, + *, + include_company_counts: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetPlanGroupResponse]: """ Parameters ---------- + include_company_counts : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -50,6 +56,9 @@ def get_plan_group( _response = self._client_wrapper.httpx_client.request( "plan-groups", method="GET", + params={ + "include_company_counts": include_company_counts, + }, request_options=request_options, ) try: @@ -131,6 +140,8 @@ def create_plan_group( proration_behavior: ProrationBehavior, show_as_monthly_prices: bool, show_credits: bool, + show_feature_description: bool, + show_hard_limit: bool, show_period_toggle: bool, show_zero_price_as_free: bool, sync_customer_billing_details: bool, @@ -142,6 +153,8 @@ def create_plan_group( initial_plan_price_id: typing.Optional[str] = OMIT, prevent_self_service_downgrade_button_text: typing.Optional[str] = OMIT, prevent_self_service_downgrade_url: typing.Optional[str] = OMIT, + scheduled_downgrade_behavior: typing.Optional[ScheduledDowngradeConfigBehavior] = OMIT, + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = OMIT, trial_days: typing.Optional[int] = OMIT, trial_expiry_plan_id: typing.Optional[str] = OMIT, trial_expiry_plan_price_id: typing.Optional[str] = OMIT, @@ -178,6 +191,10 @@ def create_plan_group( show_credits : bool + show_feature_description : bool + + show_hard_limit : bool + show_period_toggle : bool show_zero_price_as_free : bool @@ -200,6 +217,10 @@ def create_plan_group( prevent_self_service_downgrade_url : typing.Optional[str] + scheduled_downgrade_behavior : typing.Optional[ScheduledDowngradeConfigBehavior] + + scheduled_downgrade_prevent_when_over_limit : typing.Optional[bool] + trial_days : typing.Optional[int] trial_expiry_plan_id : typing.Optional[str] @@ -249,8 +270,12 @@ def create_plan_group( "prevent_self_service_downgrade_button_text": prevent_self_service_downgrade_button_text, "prevent_self_service_downgrade_url": prevent_self_service_downgrade_url, "proration_behavior": proration_behavior, + "scheduled_downgrade_behavior": scheduled_downgrade_behavior, + "scheduled_downgrade_prevent_when_over_limit": scheduled_downgrade_prevent_when_over_limit, "show_as_monthly_prices": show_as_monthly_prices, "show_credits": show_credits, + "show_feature_description": show_feature_description, + "show_hard_limit": show_hard_limit, "show_period_toggle": show_period_toggle, "show_zero_price_as_free": show_zero_price_as_free, "sync_customer_billing_details": sync_customer_billing_details, @@ -356,6 +381,8 @@ def update_plan_group( proration_behavior: ProrationBehavior, show_as_monthly_prices: bool, show_credits: bool, + show_feature_description: bool, + show_hard_limit: bool, show_period_toggle: bool, show_zero_price_as_free: bool, sync_customer_billing_details: bool, @@ -367,6 +394,8 @@ def update_plan_group( initial_plan_price_id: typing.Optional[str] = OMIT, prevent_self_service_downgrade_button_text: typing.Optional[str] = OMIT, prevent_self_service_downgrade_url: typing.Optional[str] = OMIT, + scheduled_downgrade_behavior: typing.Optional[ScheduledDowngradeConfigBehavior] = OMIT, + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = OMIT, trial_days: typing.Optional[int] = OMIT, trial_expiry_plan_id: typing.Optional[str] = OMIT, trial_expiry_plan_price_id: typing.Optional[str] = OMIT, @@ -406,6 +435,10 @@ def update_plan_group( show_credits : bool + show_feature_description : bool + + show_hard_limit : bool + show_period_toggle : bool show_zero_price_as_free : bool @@ -428,6 +461,10 @@ def update_plan_group( prevent_self_service_downgrade_url : typing.Optional[str] + scheduled_downgrade_behavior : typing.Optional[ScheduledDowngradeConfigBehavior] + + scheduled_downgrade_prevent_when_over_limit : typing.Optional[bool] + trial_days : typing.Optional[int] trial_expiry_plan_id : typing.Optional[str] @@ -477,8 +514,12 @@ def update_plan_group( "prevent_self_service_downgrade_button_text": prevent_self_service_downgrade_button_text, "prevent_self_service_downgrade_url": prevent_self_service_downgrade_url, "proration_behavior": proration_behavior, + "scheduled_downgrade_behavior": scheduled_downgrade_behavior, + "scheduled_downgrade_prevent_when_over_limit": scheduled_downgrade_prevent_when_over_limit, "show_as_monthly_prices": show_as_monthly_prices, "show_credits": show_credits, + "show_feature_description": show_feature_description, + "show_hard_limit": show_hard_limit, "show_period_toggle": show_period_toggle, "show_zero_price_as_free": show_zero_price_as_free, "sync_customer_billing_details": sync_customer_billing_details, @@ -573,11 +614,16 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper async def get_plan_group( - self, *, request_options: typing.Optional[RequestOptions] = None + self, + *, + include_company_counts: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetPlanGroupResponse]: """ Parameters ---------- + include_company_counts : typing.Optional[bool] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -589,6 +635,9 @@ async def get_plan_group( _response = await self._client_wrapper.httpx_client.request( "plan-groups", method="GET", + params={ + "include_company_counts": include_company_counts, + }, request_options=request_options, ) try: @@ -670,6 +719,8 @@ async def create_plan_group( proration_behavior: ProrationBehavior, show_as_monthly_prices: bool, show_credits: bool, + show_feature_description: bool, + show_hard_limit: bool, show_period_toggle: bool, show_zero_price_as_free: bool, sync_customer_billing_details: bool, @@ -681,6 +732,8 @@ async def create_plan_group( initial_plan_price_id: typing.Optional[str] = OMIT, prevent_self_service_downgrade_button_text: typing.Optional[str] = OMIT, prevent_self_service_downgrade_url: typing.Optional[str] = OMIT, + scheduled_downgrade_behavior: typing.Optional[ScheduledDowngradeConfigBehavior] = OMIT, + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = OMIT, trial_days: typing.Optional[int] = OMIT, trial_expiry_plan_id: typing.Optional[str] = OMIT, trial_expiry_plan_price_id: typing.Optional[str] = OMIT, @@ -717,6 +770,10 @@ async def create_plan_group( show_credits : bool + show_feature_description : bool + + show_hard_limit : bool + show_period_toggle : bool show_zero_price_as_free : bool @@ -739,6 +796,10 @@ async def create_plan_group( prevent_self_service_downgrade_url : typing.Optional[str] + scheduled_downgrade_behavior : typing.Optional[ScheduledDowngradeConfigBehavior] + + scheduled_downgrade_prevent_when_over_limit : typing.Optional[bool] + trial_days : typing.Optional[int] trial_expiry_plan_id : typing.Optional[str] @@ -788,8 +849,12 @@ async def create_plan_group( "prevent_self_service_downgrade_button_text": prevent_self_service_downgrade_button_text, "prevent_self_service_downgrade_url": prevent_self_service_downgrade_url, "proration_behavior": proration_behavior, + "scheduled_downgrade_behavior": scheduled_downgrade_behavior, + "scheduled_downgrade_prevent_when_over_limit": scheduled_downgrade_prevent_when_over_limit, "show_as_monthly_prices": show_as_monthly_prices, "show_credits": show_credits, + "show_feature_description": show_feature_description, + "show_hard_limit": show_hard_limit, "show_period_toggle": show_period_toggle, "show_zero_price_as_free": show_zero_price_as_free, "sync_customer_billing_details": sync_customer_billing_details, @@ -895,6 +960,8 @@ async def update_plan_group( proration_behavior: ProrationBehavior, show_as_monthly_prices: bool, show_credits: bool, + show_feature_description: bool, + show_hard_limit: bool, show_period_toggle: bool, show_zero_price_as_free: bool, sync_customer_billing_details: bool, @@ -906,6 +973,8 @@ async def update_plan_group( initial_plan_price_id: typing.Optional[str] = OMIT, prevent_self_service_downgrade_button_text: typing.Optional[str] = OMIT, prevent_self_service_downgrade_url: typing.Optional[str] = OMIT, + scheduled_downgrade_behavior: typing.Optional[ScheduledDowngradeConfigBehavior] = OMIT, + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = OMIT, trial_days: typing.Optional[int] = OMIT, trial_expiry_plan_id: typing.Optional[str] = OMIT, trial_expiry_plan_price_id: typing.Optional[str] = OMIT, @@ -945,6 +1014,10 @@ async def update_plan_group( show_credits : bool + show_feature_description : bool + + show_hard_limit : bool + show_period_toggle : bool show_zero_price_as_free : bool @@ -967,6 +1040,10 @@ async def update_plan_group( prevent_self_service_downgrade_url : typing.Optional[str] + scheduled_downgrade_behavior : typing.Optional[ScheduledDowngradeConfigBehavior] + + scheduled_downgrade_prevent_when_over_limit : typing.Optional[bool] + trial_days : typing.Optional[int] trial_expiry_plan_id : typing.Optional[str] @@ -1016,8 +1093,12 @@ async def update_plan_group( "prevent_self_service_downgrade_button_text": prevent_self_service_downgrade_button_text, "prevent_self_service_downgrade_url": prevent_self_service_downgrade_url, "proration_behavior": proration_behavior, + "scheduled_downgrade_behavior": scheduled_downgrade_behavior, + "scheduled_downgrade_prevent_when_over_limit": scheduled_downgrade_prevent_when_over_limit, "show_as_monthly_prices": show_as_monthly_prices, "show_credits": show_credits, + "show_feature_description": show_feature_description, + "show_hard_limit": show_hard_limit, "show_period_toggle": show_period_toggle, "show_zero_price_as_free": show_zero_price_as_free, "sync_customer_billing_details": sync_customer_billing_details, diff --git a/src/schematic/plangroups/types/__init__.py b/src/schematic/plangroups/types/__init__.py index 458fd49..0cbb00d 100644 --- a/src/schematic/plangroups/types/__init__.py +++ b/src/schematic/plangroups/types/__init__.py @@ -7,10 +7,12 @@ if typing.TYPE_CHECKING: from .create_plan_group_response import CreatePlanGroupResponse + from .get_plan_group_params import GetPlanGroupParams from .get_plan_group_response import GetPlanGroupResponse from .update_plan_group_response import UpdatePlanGroupResponse _dynamic_imports: typing.Dict[str, str] = { "CreatePlanGroupResponse": ".create_plan_group_response", + "GetPlanGroupParams": ".get_plan_group_params", "GetPlanGroupResponse": ".get_plan_group_response", "UpdatePlanGroupResponse": ".update_plan_group_response", } @@ -37,4 +39,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["CreatePlanGroupResponse", "GetPlanGroupResponse", "UpdatePlanGroupResponse"] +__all__ = ["CreatePlanGroupResponse", "GetPlanGroupParams", "GetPlanGroupResponse", "UpdatePlanGroupResponse"] diff --git a/src/schematic/plangroups/types/get_plan_group_params.py b/src/schematic/plangroups/types/get_plan_group_params.py new file mode 100644 index 0000000..0f1f5e5 --- /dev/null +++ b/src/schematic/plangroups/types/get_plan_group_params.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class GetPlanGroupParams(UniversalBaseModel): + """ + Input parameters + """ + + include_company_counts: typing.Optional[bool] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/plangroups/types/get_plan_group_response.py b/src/schematic/plangroups/types/get_plan_group_response.py index 14fc254..a80fd16 100644 --- a/src/schematic/plangroups/types/get_plan_group_response.py +++ b/src/schematic/plangroups/types/get_plan_group_response.py @@ -5,11 +5,12 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ...types.plan_group_detail_response_data import PlanGroupDetailResponseData +from .get_plan_group_params import GetPlanGroupParams class GetPlanGroupResponse(UniversalBaseModel): data: PlanGroupDetailResponseData - params: typing.Dict[str, typing.Any] = pydantic.Field() + params: GetPlanGroupParams = pydantic.Field() """ Input parameters """ diff --git a/src/schematic/planmigrations/__init__.py b/src/schematic/planmigrations/__init__.py new file mode 100644 index 0000000..d4a051c --- /dev/null +++ b/src/schematic/planmigrations/__init__.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + CountCompanyMigrationsParams, + CountCompanyMigrationsResponse, + CountMigrationsParams, + CountMigrationsResponse, + GetMigrationResponse, + ListCompanyMigrationsParams, + ListCompanyMigrationsResponse, + ListMigrationsParams, + ListMigrationsResponse, + ) +_dynamic_imports: typing.Dict[str, str] = { + "CountCompanyMigrationsParams": ".types", + "CountCompanyMigrationsResponse": ".types", + "CountMigrationsParams": ".types", + "CountMigrationsResponse": ".types", + "GetMigrationResponse": ".types", + "ListCompanyMigrationsParams": ".types", + "ListCompanyMigrationsResponse": ".types", + "ListMigrationsParams": ".types", + "ListMigrationsResponse": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CountCompanyMigrationsParams", + "CountCompanyMigrationsResponse", + "CountMigrationsParams", + "CountMigrationsResponse", + "GetMigrationResponse", + "ListCompanyMigrationsParams", + "ListCompanyMigrationsResponse", + "ListMigrationsParams", + "ListMigrationsResponse", +] diff --git a/src/schematic/planmigrations/client.py b/src/schematic/planmigrations/client.py new file mode 100644 index 0000000..74f868a --- /dev/null +++ b/src/schematic/planmigrations/client.py @@ -0,0 +1,556 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.plan_version_company_migration_status import PlanVersionCompanyMigrationStatus +from ..types.plan_version_migration_status import PlanVersionMigrationStatus +from .raw_client import AsyncRawPlanmigrationsClient, RawPlanmigrationsClient +from .types.count_company_migrations_response import CountCompanyMigrationsResponse +from .types.count_migrations_response import CountMigrationsResponse +from .types.get_migration_response import GetMigrationResponse +from .types.list_company_migrations_response import ListCompanyMigrationsResponse +from .types.list_migrations_response import ListMigrationsResponse + + +class PlanmigrationsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawPlanmigrationsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawPlanmigrationsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawPlanmigrationsClient + """ + return self._raw_client + + def list_company_migrations( + self, + *, + migration_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListCompanyMigrationsResponse: + """ + Parameters + ---------- + migration_id : typing.Optional[str] + + q : typing.Optional[str] + + status : typing.Optional[PlanVersionCompanyMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListCompanyMigrationsResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.planmigrations.list_company_migrations( + migration_id="migration_id", + q="q", + status="completed", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.list_company_migrations( + migration_id=migration_id, q=q, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + + def count_company_migrations( + self, + *, + migration_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountCompanyMigrationsResponse: + """ + Parameters + ---------- + migration_id : typing.Optional[str] + + q : typing.Optional[str] + + status : typing.Optional[PlanVersionCompanyMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CountCompanyMigrationsResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.planmigrations.count_company_migrations( + migration_id="migration_id", + q="q", + status="completed", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.count_company_migrations( + migration_id=migration_id, q=q, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + + def list_migrations( + self, + *, + plan_version_id: typing.Optional[str] = None, + status: typing.Optional[PlanVersionMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListMigrationsResponse: + """ + Parameters + ---------- + plan_version_id : typing.Optional[str] + + status : typing.Optional[PlanVersionMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListMigrationsResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.planmigrations.list_migrations( + plan_version_id="plan_version_id", + status="completed", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.list_migrations( + plan_version_id=plan_version_id, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + + def get_migration( + self, plan_version_migration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetMigrationResponse: + """ + Parameters + ---------- + plan_version_migration_id : str + plan_version_migration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetMigrationResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.planmigrations.get_migration( + plan_version_migration_id="plan_version_migration_id", + ) + """ + _response = self._raw_client.get_migration(plan_version_migration_id, request_options=request_options) + return _response.data + + def count_migrations( + self, + *, + plan_version_id: typing.Optional[str] = None, + status: typing.Optional[PlanVersionMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountMigrationsResponse: + """ + Parameters + ---------- + plan_version_id : typing.Optional[str] + + status : typing.Optional[PlanVersionMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CountMigrationsResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.planmigrations.count_migrations( + plan_version_id="plan_version_id", + status="completed", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.count_migrations( + plan_version_id=plan_version_id, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + + +class AsyncPlanmigrationsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawPlanmigrationsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawPlanmigrationsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawPlanmigrationsClient + """ + return self._raw_client + + async def list_company_migrations( + self, + *, + migration_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListCompanyMigrationsResponse: + """ + Parameters + ---------- + migration_id : typing.Optional[str] + + q : typing.Optional[str] + + status : typing.Optional[PlanVersionCompanyMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListCompanyMigrationsResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.planmigrations.list_company_migrations( + migration_id="migration_id", + q="q", + status="completed", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_company_migrations( + migration_id=migration_id, q=q, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + + async def count_company_migrations( + self, + *, + migration_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountCompanyMigrationsResponse: + """ + Parameters + ---------- + migration_id : typing.Optional[str] + + q : typing.Optional[str] + + status : typing.Optional[PlanVersionCompanyMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CountCompanyMigrationsResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.planmigrations.count_company_migrations( + migration_id="migration_id", + q="q", + status="completed", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.count_company_migrations( + migration_id=migration_id, q=q, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + + async def list_migrations( + self, + *, + plan_version_id: typing.Optional[str] = None, + status: typing.Optional[PlanVersionMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListMigrationsResponse: + """ + Parameters + ---------- + plan_version_id : typing.Optional[str] + + status : typing.Optional[PlanVersionMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListMigrationsResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.planmigrations.list_migrations( + plan_version_id="plan_version_id", + status="completed", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_migrations( + plan_version_id=plan_version_id, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + + async def get_migration( + self, plan_version_migration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetMigrationResponse: + """ + Parameters + ---------- + plan_version_migration_id : str + plan_version_migration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetMigrationResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.planmigrations.get_migration( + plan_version_migration_id="plan_version_migration_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_migration(plan_version_migration_id, request_options=request_options) + return _response.data + + async def count_migrations( + self, + *, + plan_version_id: typing.Optional[str] = None, + status: typing.Optional[PlanVersionMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountMigrationsResponse: + """ + Parameters + ---------- + plan_version_id : typing.Optional[str] + + status : typing.Optional[PlanVersionMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CountMigrationsResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.planmigrations.count_migrations( + plan_version_id="plan_version_id", + status="completed", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.count_migrations( + plan_version_id=plan_version_id, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data diff --git a/src/schematic/planmigrations/raw_client.py b/src/schematic/planmigrations/raw_client.py new file mode 100644 index 0000000..0218d20 --- /dev/null +++ b/src/schematic/planmigrations/raw_client.py @@ -0,0 +1,1140 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError as core_api_error_ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..errors.bad_request_error import BadRequestError +from ..errors.forbidden_error import ForbiddenError +from ..errors.internal_server_error import InternalServerError +from ..errors.not_found_error import NotFoundError +from ..errors.unauthorized_error import UnauthorizedError +from ..types.api_error import ApiError as types_api_error_ApiError +from ..types.plan_version_company_migration_status import PlanVersionCompanyMigrationStatus +from ..types.plan_version_migration_status import PlanVersionMigrationStatus +from .types.count_company_migrations_response import CountCompanyMigrationsResponse +from .types.count_migrations_response import CountMigrationsResponse +from .types.get_migration_response import GetMigrationResponse +from .types.list_company_migrations_response import ListCompanyMigrationsResponse +from .types.list_migrations_response import ListMigrationsResponse + + +class RawPlanmigrationsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list_company_migrations( + self, + *, + migration_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ListCompanyMigrationsResponse]: + """ + Parameters + ---------- + migration_id : typing.Optional[str] + + q : typing.Optional[str] + + status : typing.Optional[PlanVersionCompanyMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ListCompanyMigrationsResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "plan-version-company-migrations", + method="GET", + params={ + "migration_id": migration_id, + "q": q, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListCompanyMigrationsResponse, + parse_obj_as( + type_=ListCompanyMigrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def count_company_migrations( + self, + *, + migration_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[CountCompanyMigrationsResponse]: + """ + Parameters + ---------- + migration_id : typing.Optional[str] + + q : typing.Optional[str] + + status : typing.Optional[PlanVersionCompanyMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CountCompanyMigrationsResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "plan-version-company-migrations/count", + method="GET", + params={ + "migration_id": migration_id, + "q": q, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CountCompanyMigrationsResponse, + parse_obj_as( + type_=CountCompanyMigrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def list_migrations( + self, + *, + plan_version_id: typing.Optional[str] = None, + status: typing.Optional[PlanVersionMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ListMigrationsResponse]: + """ + Parameters + ---------- + plan_version_id : typing.Optional[str] + + status : typing.Optional[PlanVersionMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ListMigrationsResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "plan-version-migrations", + method="GET", + params={ + "plan_version_id": plan_version_id, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListMigrationsResponse, + parse_obj_as( + type_=ListMigrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def get_migration( + self, plan_version_migration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetMigrationResponse]: + """ + Parameters + ---------- + plan_version_migration_id : str + plan_version_migration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetMigrationResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + f"plan-version-migrations/{jsonable_encoder(plan_version_migration_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetMigrationResponse, + parse_obj_as( + type_=GetMigrationResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def count_migrations( + self, + *, + plan_version_id: typing.Optional[str] = None, + status: typing.Optional[PlanVersionMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[CountMigrationsResponse]: + """ + Parameters + ---------- + plan_version_id : typing.Optional[str] + + status : typing.Optional[PlanVersionMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CountMigrationsResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "plan-version-migrations/count", + method="GET", + params={ + "plan_version_id": plan_version_id, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CountMigrationsResponse, + parse_obj_as( + type_=CountMigrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + +class AsyncRawPlanmigrationsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list_company_migrations( + self, + *, + migration_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ListCompanyMigrationsResponse]: + """ + Parameters + ---------- + migration_id : typing.Optional[str] + + q : typing.Optional[str] + + status : typing.Optional[PlanVersionCompanyMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ListCompanyMigrationsResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "plan-version-company-migrations", + method="GET", + params={ + "migration_id": migration_id, + "q": q, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListCompanyMigrationsResponse, + parse_obj_as( + type_=ListCompanyMigrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def count_company_migrations( + self, + *, + migration_id: typing.Optional[str] = None, + q: typing.Optional[str] = None, + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CountCompanyMigrationsResponse]: + """ + Parameters + ---------- + migration_id : typing.Optional[str] + + q : typing.Optional[str] + + status : typing.Optional[PlanVersionCompanyMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CountCompanyMigrationsResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "plan-version-company-migrations/count", + method="GET", + params={ + "migration_id": migration_id, + "q": q, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CountCompanyMigrationsResponse, + parse_obj_as( + type_=CountCompanyMigrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def list_migrations( + self, + *, + plan_version_id: typing.Optional[str] = None, + status: typing.Optional[PlanVersionMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ListMigrationsResponse]: + """ + Parameters + ---------- + plan_version_id : typing.Optional[str] + + status : typing.Optional[PlanVersionMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ListMigrationsResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "plan-version-migrations", + method="GET", + params={ + "plan_version_id": plan_version_id, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListMigrationsResponse, + parse_obj_as( + type_=ListMigrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get_migration( + self, plan_version_migration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetMigrationResponse]: + """ + Parameters + ---------- + plan_version_migration_id : str + plan_version_migration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetMigrationResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + f"plan-version-migrations/{jsonable_encoder(plan_version_migration_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetMigrationResponse, + parse_obj_as( + type_=GetMigrationResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def count_migrations( + self, + *, + plan_version_id: typing.Optional[str] = None, + status: typing.Optional[PlanVersionMigrationStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CountMigrationsResponse]: + """ + Parameters + ---------- + plan_version_id : typing.Optional[str] + + status : typing.Optional[PlanVersionMigrationStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CountMigrationsResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "plan-version-migrations/count", + method="GET", + params={ + "plan_version_id": plan_version_id, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CountMigrationsResponse, + parse_obj_as( + type_=CountMigrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) diff --git a/src/schematic/planmigrations/types/__init__.py b/src/schematic/planmigrations/types/__init__.py new file mode 100644 index 0000000..75332fc --- /dev/null +++ b/src/schematic/planmigrations/types/__init__.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .count_company_migrations_params import CountCompanyMigrationsParams + from .count_company_migrations_response import CountCompanyMigrationsResponse + from .count_migrations_params import CountMigrationsParams + from .count_migrations_response import CountMigrationsResponse + from .get_migration_response import GetMigrationResponse + from .list_company_migrations_params import ListCompanyMigrationsParams + from .list_company_migrations_response import ListCompanyMigrationsResponse + from .list_migrations_params import ListMigrationsParams + from .list_migrations_response import ListMigrationsResponse +_dynamic_imports: typing.Dict[str, str] = { + "CountCompanyMigrationsParams": ".count_company_migrations_params", + "CountCompanyMigrationsResponse": ".count_company_migrations_response", + "CountMigrationsParams": ".count_migrations_params", + "CountMigrationsResponse": ".count_migrations_response", + "GetMigrationResponse": ".get_migration_response", + "ListCompanyMigrationsParams": ".list_company_migrations_params", + "ListCompanyMigrationsResponse": ".list_company_migrations_response", + "ListMigrationsParams": ".list_migrations_params", + "ListMigrationsResponse": ".list_migrations_response", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CountCompanyMigrationsParams", + "CountCompanyMigrationsResponse", + "CountMigrationsParams", + "CountMigrationsResponse", + "GetMigrationResponse", + "ListCompanyMigrationsParams", + "ListCompanyMigrationsResponse", + "ListMigrationsParams", + "ListMigrationsResponse", +] diff --git a/src/schematic/planmigrations/types/count_company_migrations_params.py b/src/schematic/planmigrations/types/count_company_migrations_params.py new file mode 100644 index 0000000..30f7dab --- /dev/null +++ b/src/schematic/planmigrations/types/count_company_migrations_params.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_version_company_migration_status import PlanVersionCompanyMigrationStatus + + +class CountCompanyMigrationsParams(UniversalBaseModel): + """ + Input parameters + """ + + limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Page limit (default 100) + """ + + migration_id: typing.Optional[str] = None + offset: typing.Optional[int] = pydantic.Field(default=None) + """ + Page offset (default 0) + """ + + q: typing.Optional[str] = None + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planmigrations/types/count_company_migrations_response.py b/src/schematic/planmigrations/types/count_company_migrations_response.py new file mode 100644 index 0000000..bf84d49 --- /dev/null +++ b/src/schematic/planmigrations/types/count_company_migrations_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.count_response import CountResponse +from .count_company_migrations_params import CountCompanyMigrationsParams + + +class CountCompanyMigrationsResponse(UniversalBaseModel): + data: CountResponse + params: CountCompanyMigrationsParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planmigrations/types/count_migrations_params.py b/src/schematic/planmigrations/types/count_migrations_params.py new file mode 100644 index 0000000..26dd47e --- /dev/null +++ b/src/schematic/planmigrations/types/count_migrations_params.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_version_migration_status import PlanVersionMigrationStatus + + +class CountMigrationsParams(UniversalBaseModel): + """ + Input parameters + """ + + limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Page limit (default 100) + """ + + offset: typing.Optional[int] = pydantic.Field(default=None) + """ + Page offset (default 0) + """ + + plan_version_id: typing.Optional[str] = None + status: typing.Optional[PlanVersionMigrationStatus] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planmigrations/types/count_migrations_response.py b/src/schematic/planmigrations/types/count_migrations_response.py new file mode 100644 index 0000000..2b7bdae --- /dev/null +++ b/src/schematic/planmigrations/types/count_migrations_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.count_response import CountResponse +from .count_migrations_params import CountMigrationsParams + + +class CountMigrationsResponse(UniversalBaseModel): + data: CountResponse + params: CountMigrationsParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planmigrations/types/get_migration_response.py b/src/schematic/planmigrations/types/get_migration_response.py new file mode 100644 index 0000000..cf6e96c --- /dev/null +++ b/src/schematic/planmigrations/types/get_migration_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_version_migration_response_data import PlanVersionMigrationResponseData + + +class GetMigrationResponse(UniversalBaseModel): + data: PlanVersionMigrationResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planmigrations/types/list_company_migrations_params.py b/src/schematic/planmigrations/types/list_company_migrations_params.py new file mode 100644 index 0000000..911cda2 --- /dev/null +++ b/src/schematic/planmigrations/types/list_company_migrations_params.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_version_company_migration_status import PlanVersionCompanyMigrationStatus + + +class ListCompanyMigrationsParams(UniversalBaseModel): + """ + Input parameters + """ + + limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Page limit (default 100) + """ + + migration_id: typing.Optional[str] = None + offset: typing.Optional[int] = pydantic.Field(default=None) + """ + Page offset (default 0) + """ + + q: typing.Optional[str] = None + status: typing.Optional[PlanVersionCompanyMigrationStatus] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planmigrations/types/list_company_migrations_response.py b/src/schematic/planmigrations/types/list_company_migrations_response.py new file mode 100644 index 0000000..6a384b1 --- /dev/null +++ b/src/schematic/planmigrations/types/list_company_migrations_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_version_company_migration_response_data import PlanVersionCompanyMigrationResponseData +from .list_company_migrations_params import ListCompanyMigrationsParams + + +class ListCompanyMigrationsResponse(UniversalBaseModel): + data: typing.List[PlanVersionCompanyMigrationResponseData] + params: ListCompanyMigrationsParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planmigrations/types/list_migrations_params.py b/src/schematic/planmigrations/types/list_migrations_params.py new file mode 100644 index 0000000..122ff98 --- /dev/null +++ b/src/schematic/planmigrations/types/list_migrations_params.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_version_migration_status import PlanVersionMigrationStatus + + +class ListMigrationsParams(UniversalBaseModel): + """ + Input parameters + """ + + limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Page limit (default 100) + """ + + offset: typing.Optional[int] = pydantic.Field(default=None) + """ + Page offset (default 0) + """ + + plan_version_id: typing.Optional[str] = None + status: typing.Optional[PlanVersionMigrationStatus] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planmigrations/types/list_migrations_response.py b/src/schematic/planmigrations/types/list_migrations_response.py new file mode 100644 index 0000000..4233d7a --- /dev/null +++ b/src/schematic/planmigrations/types/list_migrations_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_version_migration_response_data import PlanVersionMigrationResponseData +from .list_migrations_params import ListMigrationsParams + + +class ListMigrationsResponse(UniversalBaseModel): + data: typing.List[PlanVersionMigrationResponseData] + params: ListMigrationsParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/plans/__init__.py b/src/schematic/plans/__init__.py index 1a6930d..378ddd1 100644 --- a/src/schematic/plans/__init__.py +++ b/src/schematic/plans/__init__.py @@ -11,11 +11,14 @@ CountPlansResponse, CreatePlanResponse, DeletePlanResponse, + DeletePlanVersionResponse, + GetPlanParams, GetPlanResponse, ListPlanIssuesParams, ListPlanIssuesResponse, ListPlansParams, ListPlansResponse, + PublishPlanVersionResponse, UpdateCompanyPlansResponse, UpdatePlanResponse, UpsertBillingProductPlanResponse, @@ -25,11 +28,14 @@ "CountPlansResponse": ".types", "CreatePlanResponse": ".types", "DeletePlanResponse": ".types", + "DeletePlanVersionResponse": ".types", + "GetPlanParams": ".types", "GetPlanResponse": ".types", "ListPlanIssuesParams": ".types", "ListPlanIssuesResponse": ".types", "ListPlansParams": ".types", "ListPlansResponse": ".types", + "PublishPlanVersionResponse": ".types", "UpdateCompanyPlansResponse": ".types", "UpdatePlanResponse": ".types", "UpsertBillingProductPlanResponse": ".types", @@ -62,11 +68,14 @@ def __dir__(): "CountPlansResponse", "CreatePlanResponse", "DeletePlanResponse", + "DeletePlanVersionResponse", + "GetPlanParams", "GetPlanResponse", "ListPlanIssuesParams", "ListPlanIssuesResponse", "ListPlansParams", "ListPlansResponse", + "PublishPlanVersionResponse", "UpdateCompanyPlansResponse", "UpdatePlanResponse", "UpsertBillingProductPlanResponse", diff --git a/src/schematic/plans/client.py b/src/schematic/plans/client.py index 012ba1c..772bf2f 100644 --- a/src/schematic/plans/client.py +++ b/src/schematic/plans/client.py @@ -6,13 +6,16 @@ from ..core.request_options import RequestOptions from ..types.charge_type import ChargeType from ..types.plan_type import PlanType +from ..types.plan_version_migration_strategy import PlanVersionMigrationStrategy from .raw_client import AsyncRawPlansClient, RawPlansClient from .types.count_plans_response import CountPlansResponse from .types.create_plan_response import CreatePlanResponse from .types.delete_plan_response import DeletePlanResponse +from .types.delete_plan_version_response import DeletePlanVersionResponse from .types.get_plan_response import GetPlanResponse from .types.list_plan_issues_response import ListPlanIssuesResponse from .types.list_plans_response import ListPlansResponse +from .types.publish_plan_version_response import PublishPlanVersionResponse from .types.update_company_plans_response import UpdateCompanyPlansResponse from .types.update_plan_response import UpdatePlanResponse from .types.upsert_billing_product_plan_response import UpsertBillingProductPlanResponse @@ -88,6 +91,7 @@ def list_plans( for_trial_expiry_plan: typing.Optional[bool] = None, has_product_id: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + include_draft_versions: typing.Optional[bool] = None, plan_type: typing.Optional[PlanType] = None, q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, @@ -115,6 +119,9 @@ def list_plans( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + include_draft_versions : typing.Optional[bool] + Include billing settings from draft versions for plans which have draft version + plan_type : typing.Optional[PlanType] Filter by plan type @@ -153,6 +160,7 @@ def list_plans( for_initial_plan=True, for_trial_expiry_plan=True, has_product_id=True, + include_draft_versions=True, plan_type="plan", q="q", without_entitlement_for="without_entitlement_for", @@ -168,6 +176,7 @@ def list_plans( for_trial_expiry_plan=for_trial_expiry_plan, has_product_id=has_product_id, ids=ids, + include_draft_versions=include_draft_versions, plan_type=plan_type, q=q, without_entitlement_for=without_entitlement_for, @@ -224,13 +233,22 @@ def create_plan( ) return _response.data - def get_plan(self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> GetPlanResponse: + def get_plan( + self, + plan_id: str, + *, + plan_version_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetPlanResponse: """ Parameters ---------- plan_id : str plan_id + plan_version_id : typing.Optional[str] + Fetch billing settings for a specific plan version + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -248,9 +266,10 @@ def get_plan(self, plan_id: str, *, request_options: typing.Optional[RequestOpti ) client.plans.get_plan( plan_id="plan_id", + plan_version_id="plan_version_id", ) """ - _response = self._raw_client.get_plan(plan_id, request_options=request_options) + _response = self._raw_client.get_plan(plan_id, plan_version_id=plan_version_id, request_options=request_options) return _response.data def update_plan( @@ -422,6 +441,7 @@ def count_plans( for_trial_expiry_plan: typing.Optional[bool] = None, has_product_id: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + include_draft_versions: typing.Optional[bool] = None, plan_type: typing.Optional[PlanType] = None, q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, @@ -449,6 +469,9 @@ def count_plans( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + include_draft_versions : typing.Optional[bool] + Include billing settings from draft versions for plans which have draft version + plan_type : typing.Optional[PlanType] Filter by plan type @@ -487,6 +510,7 @@ def count_plans( for_initial_plan=True, for_trial_expiry_plan=True, has_product_id=True, + include_draft_versions=True, plan_type="plan", q="q", without_entitlement_for="without_entitlement_for", @@ -502,6 +526,7 @@ def count_plans( for_trial_expiry_plan=for_trial_expiry_plan, has_product_id=has_product_id, ids=ids, + include_draft_versions=include_draft_versions, plan_type=plan_type, q=q, without_entitlement_for=without_entitlement_for, @@ -513,13 +538,19 @@ def count_plans( return _response.data def list_plan_issues( - self, *, plan_id: str, request_options: typing.Optional[RequestOptions] = None + self, + *, + plan_id: str, + plan_version_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> ListPlanIssuesResponse: """ Parameters ---------- plan_id : str + plan_version_id : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -537,9 +568,90 @@ def list_plan_issues( ) client.plans.list_plan_issues( plan_id="plan_id", + plan_version_id="plan_version_id", ) """ - _response = self._raw_client.list_plan_issues(plan_id=plan_id, request_options=request_options) + _response = self._raw_client.list_plan_issues( + plan_id=plan_id, plan_version_id=plan_version_id, request_options=request_options + ) + return _response.data + + def delete_plan_version( + self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> DeletePlanVersionResponse: + """ + Parameters + ---------- + plan_id : str + plan_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeletePlanVersionResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.plans.delete_plan_version( + plan_id="plan_id", + ) + """ + _response = self._raw_client.delete_plan_version(plan_id, request_options=request_options) + return _response.data + + def publish_plan_version( + self, + plan_id: str, + *, + excluded_company_ids: typing.Sequence[str], + migration_strategy: PlanVersionMigrationStrategy, + request_options: typing.Optional[RequestOptions] = None, + ) -> PublishPlanVersionResponse: + """ + Parameters + ---------- + plan_id : str + plan_id + + excluded_company_ids : typing.Sequence[str] + + migration_strategy : PlanVersionMigrationStrategy + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PublishPlanVersionResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.plans.publish_plan_version( + plan_id="plan_id", + excluded_company_ids=["excluded_company_ids"], + migration_strategy="immediate", + ) + """ + _response = self._raw_client.publish_plan_version( + plan_id, + excluded_company_ids=excluded_company_ids, + migration_strategy=migration_strategy, + request_options=request_options, + ) return _response.data @@ -618,6 +730,7 @@ async def list_plans( for_trial_expiry_plan: typing.Optional[bool] = None, has_product_id: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + include_draft_versions: typing.Optional[bool] = None, plan_type: typing.Optional[PlanType] = None, q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, @@ -645,6 +758,9 @@ async def list_plans( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + include_draft_versions : typing.Optional[bool] + Include billing settings from draft versions for plans which have draft version + plan_type : typing.Optional[PlanType] Filter by plan type @@ -688,6 +804,7 @@ async def main() -> None: for_initial_plan=True, for_trial_expiry_plan=True, has_product_id=True, + include_draft_versions=True, plan_type="plan", q="q", without_entitlement_for="without_entitlement_for", @@ -706,6 +823,7 @@ async def main() -> None: for_trial_expiry_plan=for_trial_expiry_plan, has_product_id=has_product_id, ids=ids, + include_draft_versions=include_draft_versions, plan_type=plan_type, q=q, without_entitlement_for=without_entitlement_for, @@ -771,7 +889,11 @@ async def main() -> None: return _response.data async def get_plan( - self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + plan_id: str, + *, + plan_version_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> GetPlanResponse: """ Parameters @@ -779,6 +901,9 @@ async def get_plan( plan_id : str plan_id + plan_version_id : typing.Optional[str] + Fetch billing settings for a specific plan version + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -801,12 +926,15 @@ async def get_plan( async def main() -> None: await client.plans.get_plan( plan_id="plan_id", + plan_version_id="plan_version_id", ) asyncio.run(main()) """ - _response = await self._raw_client.get_plan(plan_id, request_options=request_options) + _response = await self._raw_client.get_plan( + plan_id, plan_version_id=plan_version_id, request_options=request_options + ) return _response.data async def update_plan( @@ -1002,6 +1130,7 @@ async def count_plans( for_trial_expiry_plan: typing.Optional[bool] = None, has_product_id: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + include_draft_versions: typing.Optional[bool] = None, plan_type: typing.Optional[PlanType] = None, q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, @@ -1029,6 +1158,9 @@ async def count_plans( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + include_draft_versions : typing.Optional[bool] + Include billing settings from draft versions for plans which have draft version + plan_type : typing.Optional[PlanType] Filter by plan type @@ -1072,6 +1204,7 @@ async def main() -> None: for_initial_plan=True, for_trial_expiry_plan=True, has_product_id=True, + include_draft_versions=True, plan_type="plan", q="q", without_entitlement_for="without_entitlement_for", @@ -1090,6 +1223,7 @@ async def main() -> None: for_trial_expiry_plan=for_trial_expiry_plan, has_product_id=has_product_id, ids=ids, + include_draft_versions=include_draft_versions, plan_type=plan_type, q=q, without_entitlement_for=without_entitlement_for, @@ -1101,13 +1235,19 @@ async def main() -> None: return _response.data async def list_plan_issues( - self, *, plan_id: str, request_options: typing.Optional[RequestOptions] = None + self, + *, + plan_id: str, + plan_version_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> ListPlanIssuesResponse: """ Parameters ---------- plan_id : str + plan_version_id : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1130,10 +1270,107 @@ async def list_plan_issues( async def main() -> None: await client.plans.list_plan_issues( plan_id="plan_id", + plan_version_id="plan_version_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_plan_issues( + plan_id=plan_id, plan_version_id=plan_version_id, request_options=request_options + ) + return _response.data + + async def delete_plan_version( + self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> DeletePlanVersionResponse: + """ + Parameters + ---------- + plan_id : str + plan_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + DeletePlanVersionResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.plans.delete_plan_version( + plan_id="plan_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete_plan_version(plan_id, request_options=request_options) + return _response.data + + async def publish_plan_version( + self, + plan_id: str, + *, + excluded_company_ids: typing.Sequence[str], + migration_strategy: PlanVersionMigrationStrategy, + request_options: typing.Optional[RequestOptions] = None, + ) -> PublishPlanVersionResponse: + """ + Parameters + ---------- + plan_id : str + plan_id + + excluded_company_ids : typing.Sequence[str] + + migration_strategy : PlanVersionMigrationStrategy + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PublishPlanVersionResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.plans.publish_plan_version( + plan_id="plan_id", + excluded_company_ids=["excluded_company_ids"], + migration_strategy="immediate", ) asyncio.run(main()) """ - _response = await self._raw_client.list_plan_issues(plan_id=plan_id, request_options=request_options) + _response = await self._raw_client.publish_plan_version( + plan_id, + excluded_company_ids=excluded_company_ids, + migration_strategy=migration_strategy, + request_options=request_options, + ) return _response.data diff --git a/src/schematic/plans/raw_client.py b/src/schematic/plans/raw_client.py index fde1d2f..7c6f60c 100644 --- a/src/schematic/plans/raw_client.py +++ b/src/schematic/plans/raw_client.py @@ -17,12 +17,15 @@ from ..types.api_error import ApiError as types_api_error_ApiError from ..types.charge_type import ChargeType from ..types.plan_type import PlanType +from ..types.plan_version_migration_strategy import PlanVersionMigrationStrategy from .types.count_plans_response import CountPlansResponse from .types.create_plan_response import CreatePlanResponse from .types.delete_plan_response import DeletePlanResponse +from .types.delete_plan_version_response import DeletePlanVersionResponse from .types.get_plan_response import GetPlanResponse from .types.list_plan_issues_response import ListPlanIssuesResponse from .types.list_plans_response import ListPlansResponse +from .types.publish_plan_version_response import PublishPlanVersionResponse from .types.update_company_plans_response import UpdateCompanyPlansResponse from .types.update_plan_response import UpdatePlanResponse from .types.upsert_billing_product_plan_response import UpsertBillingProductPlanResponse @@ -157,6 +160,7 @@ def list_plans( for_trial_expiry_plan: typing.Optional[bool] = None, has_product_id: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + include_draft_versions: typing.Optional[bool] = None, plan_type: typing.Optional[PlanType] = None, q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, @@ -184,6 +188,9 @@ def list_plans( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + include_draft_versions : typing.Optional[bool] + Include billing settings from draft versions for plans which have draft version + plan_type : typing.Optional[PlanType] Filter by plan type @@ -219,6 +226,7 @@ def list_plans( "for_trial_expiry_plan": for_trial_expiry_plan, "has_product_id": has_product_id, "ids": ids, + "include_draft_versions": include_draft_versions, "plan_type": plan_type, "q": q, "without_entitlement_for": without_entitlement_for, @@ -420,7 +428,11 @@ def create_plan( ) def get_plan( - self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + plan_id: str, + *, + plan_version_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetPlanResponse]: """ Parameters @@ -428,6 +440,9 @@ def get_plan( plan_id : str plan_id + plan_version_id : typing.Optional[str] + Fetch billing settings for a specific plan version + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -439,6 +454,9 @@ def get_plan( _response = self._client_wrapper.httpx_client.request( f"plans/{jsonable_encoder(plan_id)}", method="GET", + params={ + "plan_version_id": plan_version_id, + }, request_options=request_options, ) try: @@ -875,6 +893,7 @@ def count_plans( for_trial_expiry_plan: typing.Optional[bool] = None, has_product_id: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + include_draft_versions: typing.Optional[bool] = None, plan_type: typing.Optional[PlanType] = None, q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, @@ -902,6 +921,9 @@ def count_plans( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + include_draft_versions : typing.Optional[bool] + Include billing settings from draft versions for plans which have draft version + plan_type : typing.Optional[PlanType] Filter by plan type @@ -937,6 +959,7 @@ def count_plans( "for_trial_expiry_plan": for_trial_expiry_plan, "has_product_id": has_product_id, "ids": ids, + "include_draft_versions": include_draft_versions, "plan_type": plan_type, "q": q, "without_entitlement_for": without_entitlement_for, @@ -1021,13 +1044,19 @@ def count_plans( ) def list_plan_issues( - self, *, plan_id: str, request_options: typing.Optional[RequestOptions] = None + self, + *, + plan_id: str, + plan_version_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ListPlanIssuesResponse]: """ Parameters ---------- plan_id : str + plan_version_id : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1041,6 +1070,7 @@ def list_plan_issues( method="GET", params={ "plan_id": plan_id, + "plan_version_id": plan_version_id, }, request_options=request_options, ) @@ -1118,6 +1148,215 @@ def list_plan_issues( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def delete_plan_version( + self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[DeletePlanVersionResponse]: + """ + Parameters + ---------- + plan_id : str + plan_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[DeletePlanVersionResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + f"plans/version/{jsonable_encoder(plan_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + DeletePlanVersionResponse, + parse_obj_as( + type_=DeletePlanVersionResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def publish_plan_version( + self, + plan_id: str, + *, + excluded_company_ids: typing.Sequence[str], + migration_strategy: PlanVersionMigrationStrategy, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PublishPlanVersionResponse]: + """ + Parameters + ---------- + plan_id : str + plan_id + + excluded_company_ids : typing.Sequence[str] + + migration_strategy : PlanVersionMigrationStrategy + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PublishPlanVersionResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + f"plans/version/{jsonable_encoder(plan_id)}/publish", + method="PUT", + json={ + "excluded_company_ids": excluded_company_ids, + "migration_strategy": migration_strategy, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PublishPlanVersionResponse, + parse_obj_as( + type_=PublishPlanVersionResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + class AsyncRawPlansClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -1245,6 +1484,7 @@ async def list_plans( for_trial_expiry_plan: typing.Optional[bool] = None, has_product_id: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + include_draft_versions: typing.Optional[bool] = None, plan_type: typing.Optional[PlanType] = None, q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, @@ -1272,6 +1512,9 @@ async def list_plans( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + include_draft_versions : typing.Optional[bool] + Include billing settings from draft versions for plans which have draft version + plan_type : typing.Optional[PlanType] Filter by plan type @@ -1307,6 +1550,7 @@ async def list_plans( "for_trial_expiry_plan": for_trial_expiry_plan, "has_product_id": has_product_id, "ids": ids, + "include_draft_versions": include_draft_versions, "plan_type": plan_type, "q": q, "without_entitlement_for": without_entitlement_for, @@ -1508,7 +1752,11 @@ async def create_plan( ) async def get_plan( - self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None + self, + plan_id: str, + *, + plan_version_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetPlanResponse]: """ Parameters @@ -1516,6 +1764,9 @@ async def get_plan( plan_id : str plan_id + plan_version_id : typing.Optional[str] + Fetch billing settings for a specific plan version + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1527,6 +1778,9 @@ async def get_plan( _response = await self._client_wrapper.httpx_client.request( f"plans/{jsonable_encoder(plan_id)}", method="GET", + params={ + "plan_version_id": plan_version_id, + }, request_options=request_options, ) try: @@ -1963,6 +2217,7 @@ async def count_plans( for_trial_expiry_plan: typing.Optional[bool] = None, has_product_id: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + include_draft_versions: typing.Optional[bool] = None, plan_type: typing.Optional[PlanType] = None, q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, @@ -1990,6 +2245,9 @@ async def count_plans( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + include_draft_versions : typing.Optional[bool] + Include billing settings from draft versions for plans which have draft version + plan_type : typing.Optional[PlanType] Filter by plan type @@ -2025,6 +2283,7 @@ async def count_plans( "for_trial_expiry_plan": for_trial_expiry_plan, "has_product_id": has_product_id, "ids": ids, + "include_draft_versions": include_draft_versions, "plan_type": plan_type, "q": q, "without_entitlement_for": without_entitlement_for, @@ -2109,13 +2368,19 @@ async def count_plans( ) async def list_plan_issues( - self, *, plan_id: str, request_options: typing.Optional[RequestOptions] = None + self, + *, + plan_id: str, + plan_version_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ListPlanIssuesResponse]: """ Parameters ---------- plan_id : str + plan_version_id : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2129,6 +2394,7 @@ async def list_plan_issues( method="GET", params={ "plan_id": plan_id, + "plan_version_id": plan_version_id, }, request_options=request_options, ) @@ -2205,3 +2471,212 @@ async def list_plan_issues( raise core_api_error_ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + + async def delete_plan_version( + self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[DeletePlanVersionResponse]: + """ + Parameters + ---------- + plan_id : str + plan_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[DeletePlanVersionResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + f"plans/version/{jsonable_encoder(plan_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + DeletePlanVersionResponse, + parse_obj_as( + type_=DeletePlanVersionResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def publish_plan_version( + self, + plan_id: str, + *, + excluded_company_ids: typing.Sequence[str], + migration_strategy: PlanVersionMigrationStrategy, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PublishPlanVersionResponse]: + """ + Parameters + ---------- + plan_id : str + plan_id + + excluded_company_ids : typing.Sequence[str] + + migration_strategy : PlanVersionMigrationStrategy + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PublishPlanVersionResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + f"plans/version/{jsonable_encoder(plan_id)}/publish", + method="PUT", + json={ + "excluded_company_ids": excluded_company_ids, + "migration_strategy": migration_strategy, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PublishPlanVersionResponse, + parse_obj_as( + type_=PublishPlanVersionResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) diff --git a/src/schematic/plans/types/__init__.py b/src/schematic/plans/types/__init__.py index 16c4ede..336334b 100644 --- a/src/schematic/plans/types/__init__.py +++ b/src/schematic/plans/types/__init__.py @@ -10,11 +10,14 @@ from .count_plans_response import CountPlansResponse from .create_plan_response import CreatePlanResponse from .delete_plan_response import DeletePlanResponse + from .delete_plan_version_response import DeletePlanVersionResponse + from .get_plan_params import GetPlanParams from .get_plan_response import GetPlanResponse from .list_plan_issues_params import ListPlanIssuesParams from .list_plan_issues_response import ListPlanIssuesResponse from .list_plans_params import ListPlansParams from .list_plans_response import ListPlansResponse + from .publish_plan_version_response import PublishPlanVersionResponse from .update_company_plans_response import UpdateCompanyPlansResponse from .update_plan_response import UpdatePlanResponse from .upsert_billing_product_plan_response import UpsertBillingProductPlanResponse @@ -23,11 +26,14 @@ "CountPlansResponse": ".count_plans_response", "CreatePlanResponse": ".create_plan_response", "DeletePlanResponse": ".delete_plan_response", + "DeletePlanVersionResponse": ".delete_plan_version_response", + "GetPlanParams": ".get_plan_params", "GetPlanResponse": ".get_plan_response", "ListPlanIssuesParams": ".list_plan_issues_params", "ListPlanIssuesResponse": ".list_plan_issues_response", "ListPlansParams": ".list_plans_params", "ListPlansResponse": ".list_plans_response", + "PublishPlanVersionResponse": ".publish_plan_version_response", "UpdateCompanyPlansResponse": ".update_company_plans_response", "UpdatePlanResponse": ".update_plan_response", "UpsertBillingProductPlanResponse": ".upsert_billing_product_plan_response", @@ -60,11 +66,14 @@ def __dir__(): "CountPlansResponse", "CreatePlanResponse", "DeletePlanResponse", + "DeletePlanVersionResponse", + "GetPlanParams", "GetPlanResponse", "ListPlanIssuesParams", "ListPlanIssuesResponse", "ListPlansParams", "ListPlansResponse", + "PublishPlanVersionResponse", "UpdateCompanyPlansResponse", "UpdatePlanResponse", "UpsertBillingProductPlanResponse", diff --git a/src/schematic/plans/types/count_plans_params.py b/src/schematic/plans/types/count_plans_params.py index 36daeab..6447053 100644 --- a/src/schematic/plans/types/count_plans_params.py +++ b/src/schematic/plans/types/count_plans_params.py @@ -34,6 +34,11 @@ class CountPlansParams(UniversalBaseModel): """ ids: typing.Optional[typing.List[str]] = None + include_draft_versions: typing.Optional[bool] = pydantic.Field(default=None) + """ + Include billing settings from draft versions for plans which have draft version + """ + limit: typing.Optional[int] = pydantic.Field(default=None) """ Page limit (default 100) @@ -44,7 +49,11 @@ class CountPlansParams(UniversalBaseModel): Page offset (default 0) """ - plan_type: typing.Optional[PlanType] = None + plan_type: typing.Optional[PlanType] = pydantic.Field(default=None) + """ + Filter by plan type + """ + q: typing.Optional[str] = None without_entitlement_for: typing.Optional[str] = pydantic.Field(default=None) """ diff --git a/src/schematic/plans/types/delete_plan_version_response.py b/src/schematic/plans/types/delete_plan_version_response.py new file mode 100644 index 0000000..e0f08fa --- /dev/null +++ b/src/schematic/plans/types/delete_plan_version_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.delete_response import DeleteResponse + + +class DeletePlanVersionResponse(UniversalBaseModel): + data: DeleteResponse + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/plans/types/get_plan_params.py b/src/schematic/plans/types/get_plan_params.py new file mode 100644 index 0000000..0d17c19 --- /dev/null +++ b/src/schematic/plans/types/get_plan_params.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class GetPlanParams(UniversalBaseModel): + """ + Input parameters + """ + + plan_version_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Fetch billing settings for a specific plan version + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/plans/types/get_plan_response.py b/src/schematic/plans/types/get_plan_response.py index fc993f7..bc379fc 100644 --- a/src/schematic/plans/types/get_plan_response.py +++ b/src/schematic/plans/types/get_plan_response.py @@ -5,11 +5,12 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from ...types.plan_detail_response_data import PlanDetailResponseData +from .get_plan_params import GetPlanParams class GetPlanResponse(UniversalBaseModel): data: PlanDetailResponseData - params: typing.Dict[str, typing.Any] = pydantic.Field() + params: GetPlanParams = pydantic.Field() """ Input parameters """ diff --git a/src/schematic/plans/types/list_plan_issues_params.py b/src/schematic/plans/types/list_plan_issues_params.py index 5191e45..08df8d8 100644 --- a/src/schematic/plans/types/list_plan_issues_params.py +++ b/src/schematic/plans/types/list_plan_issues_params.py @@ -12,6 +12,7 @@ class ListPlanIssuesParams(UniversalBaseModel): """ plan_id: typing.Optional[str] = None + plan_version_id: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/plans/types/list_plans_params.py b/src/schematic/plans/types/list_plans_params.py index f4a459d..03ff10f 100644 --- a/src/schematic/plans/types/list_plans_params.py +++ b/src/schematic/plans/types/list_plans_params.py @@ -34,6 +34,11 @@ class ListPlansParams(UniversalBaseModel): """ ids: typing.Optional[typing.List[str]] = None + include_draft_versions: typing.Optional[bool] = pydantic.Field(default=None) + """ + Include billing settings from draft versions for plans which have draft version + """ + limit: typing.Optional[int] = pydantic.Field(default=None) """ Page limit (default 100) @@ -44,7 +49,11 @@ class ListPlansParams(UniversalBaseModel): Page offset (default 0) """ - plan_type: typing.Optional[PlanType] = None + plan_type: typing.Optional[PlanType] = pydantic.Field(default=None) + """ + Filter by plan type + """ + q: typing.Optional[str] = None without_entitlement_for: typing.Optional[str] = pydantic.Field(default=None) """ diff --git a/src/schematic/plans/types/publish_plan_version_response.py b/src/schematic/plans/types/publish_plan_version_response.py new file mode 100644 index 0000000..9214626 --- /dev/null +++ b/src/schematic/plans/types/publish_plan_version_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_version_response_data import PlanVersionResponseData + + +class PublishPlanVersionResponse(UniversalBaseModel): + data: PlanVersionResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/scheduledcheckout/__init__.py b/src/schematic/scheduledcheckout/__init__.py new file mode 100644 index 0000000..77bbce9 --- /dev/null +++ b/src/schematic/scheduledcheckout/__init__.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + CreateScheduledCheckoutResponse, + GetScheduledCheckoutResponse, + ListScheduledCheckoutsParams, + ListScheduledCheckoutsResponse, + UpdateScheduledCheckoutResponse, + ) +_dynamic_imports: typing.Dict[str, str] = { + "CreateScheduledCheckoutResponse": ".types", + "GetScheduledCheckoutResponse": ".types", + "ListScheduledCheckoutsParams": ".types", + "ListScheduledCheckoutsResponse": ".types", + "UpdateScheduledCheckoutResponse": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateScheduledCheckoutResponse", + "GetScheduledCheckoutResponse", + "ListScheduledCheckoutsParams", + "ListScheduledCheckoutsResponse", + "UpdateScheduledCheckoutResponse", +] diff --git a/src/schematic/scheduledcheckout/client.py b/src/schematic/scheduledcheckout/client.py new file mode 100644 index 0000000..34f8937 --- /dev/null +++ b/src/schematic/scheduledcheckout/client.py @@ -0,0 +1,435 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.scheduled_checkout_status import ScheduledCheckoutStatus +from .raw_client import AsyncRawScheduledcheckoutClient, RawScheduledcheckoutClient +from .types.create_scheduled_checkout_response import CreateScheduledCheckoutResponse +from .types.get_scheduled_checkout_response import GetScheduledCheckoutResponse +from .types.list_scheduled_checkouts_response import ListScheduledCheckoutsResponse +from .types.update_scheduled_checkout_response import UpdateScheduledCheckoutResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ScheduledcheckoutClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawScheduledcheckoutClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawScheduledcheckoutClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawScheduledcheckoutClient + """ + return self._raw_client + + def list_scheduled_checkouts( + self, + *, + company_id: typing.Optional[str] = None, + status: typing.Optional[ScheduledCheckoutStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListScheduledCheckoutsResponse: + """ + Parameters + ---------- + company_id : typing.Optional[str] + + status : typing.Optional[ScheduledCheckoutStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListScheduledCheckoutsResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.scheduledcheckout.list_scheduled_checkouts( + company_id="company_id", + status="cancelled", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.list_scheduled_checkouts( + company_id=company_id, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + + def create_scheduled_checkout( + self, + *, + company_id: str, + execute_after: dt.datetime, + from_plan_id: str, + to_plan_id: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> CreateScheduledCheckoutResponse: + """ + Parameters + ---------- + company_id : str + + execute_after : dt.datetime + + from_plan_id : str + + to_plan_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CreateScheduledCheckoutResponse + Created + + Examples + -------- + import datetime + + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.scheduledcheckout.create_scheduled_checkout( + company_id="company_id", + execute_after=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + from_plan_id="from_plan_id", + to_plan_id="to_plan_id", + ) + """ + _response = self._raw_client.create_scheduled_checkout( + company_id=company_id, + execute_after=execute_after, + from_plan_id=from_plan_id, + to_plan_id=to_plan_id, + request_options=request_options, + ) + return _response.data + + def get_scheduled_checkout( + self, scheduled_checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetScheduledCheckoutResponse: + """ + Parameters + ---------- + scheduled_checkout_id : str + scheduled_checkout_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetScheduledCheckoutResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.scheduledcheckout.get_scheduled_checkout( + scheduled_checkout_id="scheduled_checkout_id", + ) + """ + _response = self._raw_client.get_scheduled_checkout(scheduled_checkout_id, request_options=request_options) + return _response.data + + def update_scheduled_checkout( + self, + scheduled_checkout_id: str, + *, + execute_after: typing.Optional[dt.datetime] = OMIT, + status: typing.Optional[ScheduledCheckoutStatus] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdateScheduledCheckoutResponse: + """ + Parameters + ---------- + scheduled_checkout_id : str + scheduled_checkout_id + + execute_after : typing.Optional[dt.datetime] + + status : typing.Optional[ScheduledCheckoutStatus] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdateScheduledCheckoutResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.scheduledcheckout.update_scheduled_checkout( + scheduled_checkout_id="scheduled_checkout_id", + ) + """ + _response = self._raw_client.update_scheduled_checkout( + scheduled_checkout_id, execute_after=execute_after, status=status, request_options=request_options + ) + return _response.data + + +class AsyncScheduledcheckoutClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawScheduledcheckoutClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawScheduledcheckoutClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawScheduledcheckoutClient + """ + return self._raw_client + + async def list_scheduled_checkouts( + self, + *, + company_id: typing.Optional[str] = None, + status: typing.Optional[ScheduledCheckoutStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListScheduledCheckoutsResponse: + """ + Parameters + ---------- + company_id : typing.Optional[str] + + status : typing.Optional[ScheduledCheckoutStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListScheduledCheckoutsResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduledcheckout.list_scheduled_checkouts( + company_id="company_id", + status="cancelled", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_scheduled_checkouts( + company_id=company_id, status=status, limit=limit, offset=offset, request_options=request_options + ) + return _response.data + + async def create_scheduled_checkout( + self, + *, + company_id: str, + execute_after: dt.datetime, + from_plan_id: str, + to_plan_id: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> CreateScheduledCheckoutResponse: + """ + Parameters + ---------- + company_id : str + + execute_after : dt.datetime + + from_plan_id : str + + to_plan_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CreateScheduledCheckoutResponse + Created + + Examples + -------- + import asyncio + import datetime + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduledcheckout.create_scheduled_checkout( + company_id="company_id", + execute_after=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + from_plan_id="from_plan_id", + to_plan_id="to_plan_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create_scheduled_checkout( + company_id=company_id, + execute_after=execute_after, + from_plan_id=from_plan_id, + to_plan_id=to_plan_id, + request_options=request_options, + ) + return _response.data + + async def get_scheduled_checkout( + self, scheduled_checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetScheduledCheckoutResponse: + """ + Parameters + ---------- + scheduled_checkout_id : str + scheduled_checkout_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetScheduledCheckoutResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduledcheckout.get_scheduled_checkout( + scheduled_checkout_id="scheduled_checkout_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_scheduled_checkout( + scheduled_checkout_id, request_options=request_options + ) + return _response.data + + async def update_scheduled_checkout( + self, + scheduled_checkout_id: str, + *, + execute_after: typing.Optional[dt.datetime] = OMIT, + status: typing.Optional[ScheduledCheckoutStatus] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdateScheduledCheckoutResponse: + """ + Parameters + ---------- + scheduled_checkout_id : str + scheduled_checkout_id + + execute_after : typing.Optional[dt.datetime] + + status : typing.Optional[ScheduledCheckoutStatus] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdateScheduledCheckoutResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.scheduledcheckout.update_scheduled_checkout( + scheduled_checkout_id="scheduled_checkout_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.update_scheduled_checkout( + scheduled_checkout_id, execute_after=execute_after, status=status, request_options=request_options + ) + return _response.data diff --git a/src/schematic/scheduledcheckout/raw_client.py b/src/schematic/scheduledcheckout/raw_client.py new file mode 100644 index 0000000..5638fd9 --- /dev/null +++ b/src/schematic/scheduledcheckout/raw_client.py @@ -0,0 +1,896 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError as core_api_error_ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..errors.bad_request_error import BadRequestError +from ..errors.forbidden_error import ForbiddenError +from ..errors.internal_server_error import InternalServerError +from ..errors.not_found_error import NotFoundError +from ..errors.unauthorized_error import UnauthorizedError +from ..types.api_error import ApiError as types_api_error_ApiError +from ..types.scheduled_checkout_status import ScheduledCheckoutStatus +from .types.create_scheduled_checkout_response import CreateScheduledCheckoutResponse +from .types.get_scheduled_checkout_response import GetScheduledCheckoutResponse +from .types.list_scheduled_checkouts_response import ListScheduledCheckoutsResponse +from .types.update_scheduled_checkout_response import UpdateScheduledCheckoutResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawScheduledcheckoutClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list_scheduled_checkouts( + self, + *, + company_id: typing.Optional[str] = None, + status: typing.Optional[ScheduledCheckoutStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ListScheduledCheckoutsResponse]: + """ + Parameters + ---------- + company_id : typing.Optional[str] + + status : typing.Optional[ScheduledCheckoutStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ListScheduledCheckoutsResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "scheduled-checkout", + method="GET", + params={ + "company_id": company_id, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListScheduledCheckoutsResponse, + parse_obj_as( + type_=ListScheduledCheckoutsResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def create_scheduled_checkout( + self, + *, + company_id: str, + execute_after: dt.datetime, + from_plan_id: str, + to_plan_id: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[CreateScheduledCheckoutResponse]: + """ + Parameters + ---------- + company_id : str + + execute_after : dt.datetime + + from_plan_id : str + + to_plan_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CreateScheduledCheckoutResponse] + Created + """ + _response = self._client_wrapper.httpx_client.request( + "scheduled-checkout", + method="POST", + json={ + "company_id": company_id, + "execute_after": execute_after, + "from_plan_id": from_plan_id, + "to_plan_id": to_plan_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CreateScheduledCheckoutResponse, + parse_obj_as( + type_=CreateScheduledCheckoutResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def get_scheduled_checkout( + self, scheduled_checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetScheduledCheckoutResponse]: + """ + Parameters + ---------- + scheduled_checkout_id : str + scheduled_checkout_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetScheduledCheckoutResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + f"scheduled-checkout/{jsonable_encoder(scheduled_checkout_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetScheduledCheckoutResponse, + parse_obj_as( + type_=GetScheduledCheckoutResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def update_scheduled_checkout( + self, + scheduled_checkout_id: str, + *, + execute_after: typing.Optional[dt.datetime] = OMIT, + status: typing.Optional[ScheduledCheckoutStatus] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[UpdateScheduledCheckoutResponse]: + """ + Parameters + ---------- + scheduled_checkout_id : str + scheduled_checkout_id + + execute_after : typing.Optional[dt.datetime] + + status : typing.Optional[ScheduledCheckoutStatus] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[UpdateScheduledCheckoutResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + f"scheduled-checkout/{jsonable_encoder(scheduled_checkout_id)}", + method="PUT", + json={ + "execute_after": execute_after, + "status": status, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + UpdateScheduledCheckoutResponse, + parse_obj_as( + type_=UpdateScheduledCheckoutResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + +class AsyncRawScheduledcheckoutClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list_scheduled_checkouts( + self, + *, + company_id: typing.Optional[str] = None, + status: typing.Optional[ScheduledCheckoutStatus] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ListScheduledCheckoutsResponse]: + """ + Parameters + ---------- + company_id : typing.Optional[str] + + status : typing.Optional[ScheduledCheckoutStatus] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ListScheduledCheckoutsResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "scheduled-checkout", + method="GET", + params={ + "company_id": company_id, + "status": status, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListScheduledCheckoutsResponse, + parse_obj_as( + type_=ListScheduledCheckoutsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def create_scheduled_checkout( + self, + *, + company_id: str, + execute_after: dt.datetime, + from_plan_id: str, + to_plan_id: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CreateScheduledCheckoutResponse]: + """ + Parameters + ---------- + company_id : str + + execute_after : dt.datetime + + from_plan_id : str + + to_plan_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CreateScheduledCheckoutResponse] + Created + """ + _response = await self._client_wrapper.httpx_client.request( + "scheduled-checkout", + method="POST", + json={ + "company_id": company_id, + "execute_after": execute_after, + "from_plan_id": from_plan_id, + "to_plan_id": to_plan_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CreateScheduledCheckoutResponse, + parse_obj_as( + type_=CreateScheduledCheckoutResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get_scheduled_checkout( + self, scheduled_checkout_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetScheduledCheckoutResponse]: + """ + Parameters + ---------- + scheduled_checkout_id : str + scheduled_checkout_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetScheduledCheckoutResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + f"scheduled-checkout/{jsonable_encoder(scheduled_checkout_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetScheduledCheckoutResponse, + parse_obj_as( + type_=GetScheduledCheckoutResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def update_scheduled_checkout( + self, + scheduled_checkout_id: str, + *, + execute_after: typing.Optional[dt.datetime] = OMIT, + status: typing.Optional[ScheduledCheckoutStatus] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[UpdateScheduledCheckoutResponse]: + """ + Parameters + ---------- + scheduled_checkout_id : str + scheduled_checkout_id + + execute_after : typing.Optional[dt.datetime] + + status : typing.Optional[ScheduledCheckoutStatus] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[UpdateScheduledCheckoutResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + f"scheduled-checkout/{jsonable_encoder(scheduled_checkout_id)}", + method="PUT", + json={ + "execute_after": execute_after, + "status": status, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + UpdateScheduledCheckoutResponse, + parse_obj_as( + type_=UpdateScheduledCheckoutResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) diff --git a/src/schematic/scheduledcheckout/types/__init__.py b/src/schematic/scheduledcheckout/types/__init__.py new file mode 100644 index 0000000..a07a4d8 --- /dev/null +++ b/src/schematic/scheduledcheckout/types/__init__.py @@ -0,0 +1,50 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .create_scheduled_checkout_response import CreateScheduledCheckoutResponse + from .get_scheduled_checkout_response import GetScheduledCheckoutResponse + from .list_scheduled_checkouts_params import ListScheduledCheckoutsParams + from .list_scheduled_checkouts_response import ListScheduledCheckoutsResponse + from .update_scheduled_checkout_response import UpdateScheduledCheckoutResponse +_dynamic_imports: typing.Dict[str, str] = { + "CreateScheduledCheckoutResponse": ".create_scheduled_checkout_response", + "GetScheduledCheckoutResponse": ".get_scheduled_checkout_response", + "ListScheduledCheckoutsParams": ".list_scheduled_checkouts_params", + "ListScheduledCheckoutsResponse": ".list_scheduled_checkouts_response", + "UpdateScheduledCheckoutResponse": ".update_scheduled_checkout_response", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateScheduledCheckoutResponse", + "GetScheduledCheckoutResponse", + "ListScheduledCheckoutsParams", + "ListScheduledCheckoutsResponse", + "UpdateScheduledCheckoutResponse", +] diff --git a/src/schematic/scheduledcheckout/types/create_scheduled_checkout_response.py b/src/schematic/scheduledcheckout/types/create_scheduled_checkout_response.py new file mode 100644 index 0000000..c0d6cd3 --- /dev/null +++ b/src/schematic/scheduledcheckout/types/create_scheduled_checkout_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.scheduled_checkout_response_data import ScheduledCheckoutResponseData + + +class CreateScheduledCheckoutResponse(UniversalBaseModel): + data: ScheduledCheckoutResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/scheduledcheckout/types/get_scheduled_checkout_response.py b/src/schematic/scheduledcheckout/types/get_scheduled_checkout_response.py new file mode 100644 index 0000000..fa77571 --- /dev/null +++ b/src/schematic/scheduledcheckout/types/get_scheduled_checkout_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.scheduled_checkout_response_data import ScheduledCheckoutResponseData + + +class GetScheduledCheckoutResponse(UniversalBaseModel): + data: ScheduledCheckoutResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/accounts/types/list_api_requests_params.py b/src/schematic/scheduledcheckout/types/list_scheduled_checkouts_params.py similarity index 75% rename from src/schematic/accounts/types/list_api_requests_params.py rename to src/schematic/scheduledcheckout/types/list_scheduled_checkouts_params.py index 97146be..7a0620a 100644 --- a/src/schematic/accounts/types/list_api_requests_params.py +++ b/src/schematic/scheduledcheckout/types/list_scheduled_checkouts_params.py @@ -4,14 +4,15 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.scheduled_checkout_status import ScheduledCheckoutStatus -class ListApiRequestsParams(UniversalBaseModel): +class ListScheduledCheckoutsParams(UniversalBaseModel): """ Input parameters """ - environment_id: typing.Optional[str] = None + company_id: typing.Optional[str] = None limit: typing.Optional[int] = pydantic.Field(default=None) """ Page limit (default 100) @@ -22,8 +23,7 @@ class ListApiRequestsParams(UniversalBaseModel): Page offset (default 0) """ - q: typing.Optional[str] = None - request_type: typing.Optional[str] = None + status: typing.Optional[ScheduledCheckoutStatus] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/scheduledcheckout/types/list_scheduled_checkouts_response.py b/src/schematic/scheduledcheckout/types/list_scheduled_checkouts_response.py new file mode 100644 index 0000000..24d07a3 --- /dev/null +++ b/src/schematic/scheduledcheckout/types/list_scheduled_checkouts_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.scheduled_checkout_response_data import ScheduledCheckoutResponseData +from .list_scheduled_checkouts_params import ListScheduledCheckoutsParams + + +class ListScheduledCheckoutsResponse(UniversalBaseModel): + data: typing.List[ScheduledCheckoutResponseData] + params: ListScheduledCheckoutsParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/scheduledcheckout/types/update_scheduled_checkout_response.py b/src/schematic/scheduledcheckout/types/update_scheduled_checkout_response.py new file mode 100644 index 0000000..825e73e --- /dev/null +++ b/src/schematic/scheduledcheckout/types/update_scheduled_checkout_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.scheduled_checkout_response_data import ScheduledCheckoutResponseData + + +class UpdateScheduledCheckoutResponse(UniversalBaseModel): + data: ScheduledCheckoutResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/__init__.py b/src/schematic/types/__init__.py index 21e5162..7c8de5a 100644 --- a/src/schematic/types/__init__.py +++ b/src/schematic/types/__init__.py @@ -6,12 +6,13 @@ from importlib import import_module if typing.TYPE_CHECKING: + from .actor_type import ActorType from .api_error import ApiError from .api_key_create_response_data import ApiKeyCreateResponseData - from .api_key_request_list_response_data import ApiKeyRequestListResponseData - from .api_key_request_response_data import ApiKeyRequestResponseData from .api_key_response_data import ApiKeyResponseData from .api_key_scope import ApiKeyScope + from .audit_log_list_response_data import AuditLogListResponseData + from .audit_log_response_data import AuditLogResponseData from .billing_coupon_response_data import BillingCouponResponseData from .billing_credit_bundle_response_data import BillingCreditBundleResponseData from .billing_credit_bundle_status import BillingCreditBundleStatus @@ -26,6 +27,7 @@ from .billing_credit_ledger_response_data import BillingCreditLedgerResponseData from .billing_credit_response_data import BillingCreditResponseData from .billing_credit_rollover_policy import BillingCreditRolloverPolicy + from .billing_credit_view import BillingCreditView from .billing_customer_response_data import BillingCustomerResponseData from .billing_customer_subscription import BillingCustomerSubscription from .billing_customer_with_subscriptions_response_data import BillingCustomerWithSubscriptionsResponseData @@ -53,6 +55,8 @@ from .billing_subscription_trial_end_setting import BillingSubscriptionTrialEndSetting from .billing_subscription_view import BillingSubscriptionView from .billing_tiers_mode import BillingTiersMode + from .capture_raw_event import CaptureRawEvent + from .capture_raw_event_batch import CaptureRawEventBatch from .change_subscription_internal_request_body import ChangeSubscriptionInternalRequestBody from .change_subscription_request_body import ChangeSubscriptionRequestBody from .charge_type import ChargeType @@ -75,7 +79,6 @@ from .company_plan_with_billing_sub_view import CompanyPlanWithBillingSubView from .company_response_data import CompanyResponseData from .company_subscription_response_data import CompanySubscriptionResponseData - from .company_view_with_feature_usage_response_data import CompanyViewWithFeatureUsageResponseData from .compatible_plans import CompatiblePlans from .compatible_plans_response_data import CompatiblePlansResponseData from .component_capabilities import ComponentCapabilities @@ -90,12 +93,24 @@ from .condition import Condition from .condition_condition_type import ConditionConditionType from .condition_group import ConditionGroup + from .condition_group_response_data import ConditionGroupResponseData + from .condition_group_view import ConditionGroupView from .condition_metric_period import ConditionMetricPeriod from .condition_metric_period_month_reset import ConditionMetricPeriodMonthReset from .condition_operator import ConditionOperator + from .condition_response_data import ConditionResponseData + from .condition_view import ConditionView from .count_response import CountResponse from .coupon_request_body import CouponRequestBody + from .create_billing_plan_credit_grant_request_body import CreateBillingPlanCreditGrantRequestBody from .create_billing_price_tier_request_body import CreateBillingPriceTierRequestBody + from .create_entitlement_in_bundle_request_body import CreateEntitlementInBundleRequestBody + from .create_entitlement_in_bundle_request_body_metric_period import ( + CreateEntitlementInBundleRequestBodyMetricPeriod, + ) + from .create_entitlement_in_bundle_request_body_metric_period_month_reset import ( + CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset, + ) from .create_entitlement_req_common import CreateEntitlementReqCommon from .create_entitlement_req_common_metric_period import CreateEntitlementReqCommonMetricPeriod from .create_entitlement_req_common_metric_period_month_reset import ( @@ -114,10 +129,13 @@ from .create_or_update_flag_request_body import CreateOrUpdateFlagRequestBody from .create_or_update_rule_request_body import CreateOrUpdateRuleRequestBody from .create_or_update_rule_request_body_rule_type import CreateOrUpdateRuleRequestBodyRuleType + from .create_plan_request_body import CreatePlanRequestBody from .create_price_tier_request_body import CreatePriceTierRequestBody from .credit_auto_topup_amount_type import CreditAutoTopupAmountType from .credit_bundle_purchase_response_data import CreditBundlePurchaseResponseData from .credit_company_grant_view import CreditCompanyGrantView + from .credit_event_ledger_response_data import CreditEventLedgerResponseData + from .credit_event_type import CreditEventType from .credit_grant_detail import CreditGrantDetail from .credit_grant_expiry_request_body import CreditGrantExpiryRequestBody from .credit_grant_sort_order import CreditGrantSortOrder @@ -128,13 +146,19 @@ from .credit_trigger_config import CreditTriggerConfig from .credit_usage import CreditUsage from .credit_usage_aggregation import CreditUsageAggregation - from .credit_usage_response_data import CreditUsageResponseData + from .credits_auto_topup_company_summary import CreditsAutoTopupCompanySummary + from .credits_auto_topup_credit_summary import CreditsAutoTopupCreditSummary + from .credits_auto_topup_hard_failure import CreditsAutoTopupHardFailure + from .credits_auto_topup_retry_failure import CreditsAutoTopupRetryFailure from .custom_plan_config import CustomPlanConfig from .custom_plan_view_config_response_data import CustomPlanViewConfigResponseData + from .data_event_payload import DataEventPayload from .data_export_output_file_type import DataExportOutputFileType from .data_export_response_data import DataExportResponseData from .data_export_status import DataExportStatus from .data_export_type import DataExportType + from .datastream_company_plan import DatastreamCompanyPlan + from .delete_billing_plan_credit_grant_request_body import DeleteBillingPlanCreditGrantRequestBody from .delete_response import DeleteResponse from .duplicate_plan_entitlements_response_response_data import DuplicatePlanEntitlementsResponseResponseData from .entitlement_price_behavior import EntitlementPriceBehavior @@ -166,21 +190,29 @@ from .feature_company_response_data import FeatureCompanyResponseData from .feature_company_user_response_data import FeatureCompanyUserResponseData from .feature_detail_response_data import FeatureDetailResponseData + from .feature_entitlement import FeatureEntitlement + from .feature_entitlement_metric_period import FeatureEntitlementMetricPeriod + from .feature_entitlement_month_reset import FeatureEntitlementMonthReset from .feature_ledger_response_data import FeatureLedgerResponseData from .feature_lifecycle_phase import FeatureLifecyclePhase from .feature_response_data import FeatureResponseData from .feature_type import FeatureType - from .feature_usage_data_response_data import FeatureUsageDataResponseData from .feature_usage_detail_response_data import FeatureUsageDetailResponseData + from .feature_usage_legacy_response_data import FeatureUsageLegacyResponseData from .feature_usage_response_data import FeatureUsageResponseData + from .feature_usage_time_series_response_data import FeatureUsageTimeSeriesResponseData + from .feature_view import FeatureView from .flag_detail_response_data import FlagDetailResponseData from .flag_response_data import FlagResponseData from .flag_type import FlagType + from .flag_view import FlagView from .generic_preview_object import GenericPreviewObject from .invoice_request_body import InvoiceRequestBody from .invoice_response_data import InvoiceResponseData + from .invoice_status import InvoiceStatus from .issue_temporary_access_token_response_data import IssueTemporaryAccessTokenResponseData from .keys_request_body import KeysRequestBody + from .limit_time_series_point_response_data import LimitTimeSeriesPointResponseData from .manage_plan_preview_response_response_data import ManagePlanPreviewResponseResponseData from .manage_plan_request import ManagePlanRequest from .manage_plan_response_response_data import ManagePlanResponseResponseData @@ -188,8 +220,11 @@ from .ordered_plans_in_group import OrderedPlansInGroup from .payment_method_request_body import PaymentMethodRequestBody from .payment_method_response_data import PaymentMethodResponseData + from .plan_bundle_action import PlanBundleAction + from .plan_bundle_credit_grant_request_body import PlanBundleCreditGrantRequestBody + from .plan_bundle_entitlement_request_body import PlanBundleEntitlementRequestBody + from .plan_bundle_response_data import PlanBundleResponseData from .plan_change_action import PlanChangeAction - from .plan_change_actor_type import PlanChangeActorType from .plan_change_base_plan_action import PlanChangeBasePlanAction from .plan_change_response_data import PlanChangeResponseData from .plan_change_subscription_action import PlanChangeSubscriptionAction @@ -209,12 +244,22 @@ from .plan_snapshot_view import PlanSnapshotView from .plan_trait_response_data import PlanTraitResponseData from .plan_type import PlanType + from .plan_version_company_migration_response_data import PlanVersionCompanyMigrationResponseData + from .plan_version_company_migration_status import PlanVersionCompanyMigrationStatus + from .plan_version_migration_response_data import PlanVersionMigrationResponseData + from .plan_version_migration_status import PlanVersionMigrationStatus + from .plan_version_migration_strategy import PlanVersionMigrationStrategy + from .plan_version_response_data import PlanVersionResponseData + from .plan_version_snapshot_view import PlanVersionSnapshotView + from .plan_version_status import PlanVersionStatus + from .plan_view_public_response_data import PlanViewPublicResponseData from .preview_object import PreviewObject from .preview_object_response_data import PreviewObjectResponseData from .preview_subscription_change_response_data import PreviewSubscriptionChangeResponseData from .preview_subscription_finance_response_data import PreviewSubscriptionFinanceResponseData from .preview_subscription_upcoming_invoice_line_items import PreviewSubscriptionUpcomingInvoiceLineItems from .proration_behavior import ProrationBehavior + from .public_plans_response_data import PublicPlansResponseData from .quickstart_resp import QuickstartResp from .raw_event_batch_response_data import RawEventBatchResponseData from .raw_event_response_data import RawEventResponseData @@ -226,6 +271,7 @@ from .rule_detail_response_data import RuleDetailResponseData from .rule_response_data import RuleResponseData from .rule_rule_type import RuleRuleType + from .rule_view import RuleView from .rules_detail_response_data import RulesDetailResponseData from .rules_engine_schema_version import RulesEngineSchemaVersion from .rulesengine_check_flag_result import RulesengineCheckFlagResult @@ -241,7 +287,11 @@ from .rulesengine_condition_metric_period import RulesengineConditionMetricPeriod from .rulesengine_condition_metric_period_month_reset import RulesengineConditionMetricPeriodMonthReset from .rulesengine_condition_operator import RulesengineConditionOperator + from .rulesengine_entitlement_value_type import RulesengineEntitlementValueType from .rulesengine_entity_type import RulesengineEntityType + from .rulesengine_feature_entitlement import RulesengineFeatureEntitlement + from .rulesengine_feature_entitlement_metric_period import RulesengineFeatureEntitlementMetricPeriod + from .rulesengine_feature_entitlement_month_reset import RulesengineFeatureEntitlementMonthReset from .rulesengine_flag import RulesengineFlag from .rulesengine_rule import RulesengineRule from .rulesengine_rule_rule_type import RulesengineRuleRuleType @@ -250,6 +300,10 @@ from .rulesengine_trait_definition import RulesengineTraitDefinition from .rulesengine_trait_definition_comparable_type import RulesengineTraitDefinitionComparableType from .rulesengine_user import RulesengineUser + from .scheduled_checkout_response_data import ScheduledCheckoutResponseData + from .scheduled_checkout_status import ScheduledCheckoutStatus + from .scheduled_downgrade_config_behavior import ScheduledDowngradeConfigBehavior + from .scheduled_downgrade_response_data import ScheduledDowngradeResponseData from .segment_status_resp import SegmentStatusResp from .skipped_entitlement_error_response_data import SkippedEntitlementErrorResponseData from .skipped_entitlement_response_data import SkippedEntitlementResponseData @@ -260,10 +314,12 @@ from .subscription_type import SubscriptionType from .temporary_access_token_resource_type import TemporaryAccessTokenResourceType from .temporary_access_token_response_data import TemporaryAccessTokenResponseData + from .time_series_granularity import TimeSeriesGranularity from .trait_definition import TraitDefinition from .trait_definition_comparable_type import TraitDefinitionComparableType from .trait_type import TraitType from .update_add_on_request_body import UpdateAddOnRequestBody + from .update_billing_plan_credit_grant_request_body import UpdateBillingPlanCreditGrantRequestBody from .update_credit_bundle_request_body import UpdateCreditBundleRequestBody from .update_entitlement_req_common import UpdateEntitlementReqCommon from .update_entitlement_req_common_metric_period import UpdateEntitlementReqCommonMetricPeriod @@ -271,29 +327,35 @@ UpdateEntitlementReqCommonMetricPeriodMonthReset, ) from .update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody + from .update_plan_request_body import UpdatePlanRequestBody from .update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody from .update_rule_request_body import UpdateRuleRequestBody + from .upsert_billing_product_request_body import UpsertBillingProductRequestBody from .upsert_company_request_body import UpsertCompanyRequestBody from .upsert_trait_request_body import UpsertTraitRequestBody from .upsert_user_request_body import UpsertUserRequestBody from .upsert_user_sub_request_body import UpsertUserSubRequestBody from .usage_based_entitlement_request_body import UsageBasedEntitlementRequestBody from .usage_based_entitlement_response_data import UsageBasedEntitlementResponseData + from .usage_time_series_point_response_data import UsageTimeSeriesPointResponseData from .user_detail_response_data import UserDetailResponseData from .user_response_data import UserResponseData + from .web_feature_usage_webhook_output import WebFeatureUsageWebhookOutput from .webhook_event_detail_response_data import WebhookEventDetailResponseData from .webhook_event_response_data import WebhookEventResponseData from .webhook_event_status import WebhookEventStatus from .webhook_request_type import WebhookRequestType from .webhook_response_data import WebhookResponseData from .webhook_status import WebhookStatus + from .who_am_i_response_data import WhoAmIResponseData _dynamic_imports: typing.Dict[str, str] = { + "ActorType": ".actor_type", "ApiError": ".api_error", "ApiKeyCreateResponseData": ".api_key_create_response_data", - "ApiKeyRequestListResponseData": ".api_key_request_list_response_data", - "ApiKeyRequestResponseData": ".api_key_request_response_data", "ApiKeyResponseData": ".api_key_response_data", "ApiKeyScope": ".api_key_scope", + "AuditLogListResponseData": ".audit_log_list_response_data", + "AuditLogResponseData": ".audit_log_response_data", "BillingCouponResponseData": ".billing_coupon_response_data", "BillingCreditBundleResponseData": ".billing_credit_bundle_response_data", "BillingCreditBundleStatus": ".billing_credit_bundle_status", @@ -308,6 +370,7 @@ "BillingCreditLedgerResponseData": ".billing_credit_ledger_response_data", "BillingCreditResponseData": ".billing_credit_response_data", "BillingCreditRolloverPolicy": ".billing_credit_rollover_policy", + "BillingCreditView": ".billing_credit_view", "BillingCustomerResponseData": ".billing_customer_response_data", "BillingCustomerSubscription": ".billing_customer_subscription", "BillingCustomerWithSubscriptionsResponseData": ".billing_customer_with_subscriptions_response_data", @@ -335,6 +398,8 @@ "BillingSubscriptionTrialEndSetting": ".billing_subscription_trial_end_setting", "BillingSubscriptionView": ".billing_subscription_view", "BillingTiersMode": ".billing_tiers_mode", + "CaptureRawEvent": ".capture_raw_event", + "CaptureRawEventBatch": ".capture_raw_event_batch", "ChangeSubscriptionInternalRequestBody": ".change_subscription_internal_request_body", "ChangeSubscriptionRequestBody": ".change_subscription_request_body", "ChargeType": ".charge_type", @@ -357,7 +422,6 @@ "CompanyPlanWithBillingSubView": ".company_plan_with_billing_sub_view", "CompanyResponseData": ".company_response_data", "CompanySubscriptionResponseData": ".company_subscription_response_data", - "CompanyViewWithFeatureUsageResponseData": ".company_view_with_feature_usage_response_data", "CompatiblePlans": ".compatible_plans", "CompatiblePlansResponseData": ".compatible_plans_response_data", "ComponentCapabilities": ".component_capabilities", @@ -372,12 +436,20 @@ "Condition": ".condition", "ConditionConditionType": ".condition_condition_type", "ConditionGroup": ".condition_group", + "ConditionGroupResponseData": ".condition_group_response_data", + "ConditionGroupView": ".condition_group_view", "ConditionMetricPeriod": ".condition_metric_period", "ConditionMetricPeriodMonthReset": ".condition_metric_period_month_reset", "ConditionOperator": ".condition_operator", + "ConditionResponseData": ".condition_response_data", + "ConditionView": ".condition_view", "CountResponse": ".count_response", "CouponRequestBody": ".coupon_request_body", + "CreateBillingPlanCreditGrantRequestBody": ".create_billing_plan_credit_grant_request_body", "CreateBillingPriceTierRequestBody": ".create_billing_price_tier_request_body", + "CreateEntitlementInBundleRequestBody": ".create_entitlement_in_bundle_request_body", + "CreateEntitlementInBundleRequestBodyMetricPeriod": ".create_entitlement_in_bundle_request_body_metric_period", + "CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset": ".create_entitlement_in_bundle_request_body_metric_period_month_reset", "CreateEntitlementReqCommon": ".create_entitlement_req_common", "CreateEntitlementReqCommonMetricPeriod": ".create_entitlement_req_common_metric_period", "CreateEntitlementReqCommonMetricPeriodMonthReset": ".create_entitlement_req_common_metric_period_month_reset", @@ -392,10 +464,13 @@ "CreateOrUpdateFlagRequestBody": ".create_or_update_flag_request_body", "CreateOrUpdateRuleRequestBody": ".create_or_update_rule_request_body", "CreateOrUpdateRuleRequestBodyRuleType": ".create_or_update_rule_request_body_rule_type", + "CreatePlanRequestBody": ".create_plan_request_body", "CreatePriceTierRequestBody": ".create_price_tier_request_body", "CreditAutoTopupAmountType": ".credit_auto_topup_amount_type", "CreditBundlePurchaseResponseData": ".credit_bundle_purchase_response_data", "CreditCompanyGrantView": ".credit_company_grant_view", + "CreditEventLedgerResponseData": ".credit_event_ledger_response_data", + "CreditEventType": ".credit_event_type", "CreditGrantDetail": ".credit_grant_detail", "CreditGrantExpiryRequestBody": ".credit_grant_expiry_request_body", "CreditGrantSortOrder": ".credit_grant_sort_order", @@ -406,13 +481,19 @@ "CreditTriggerConfig": ".credit_trigger_config", "CreditUsage": ".credit_usage", "CreditUsageAggregation": ".credit_usage_aggregation", - "CreditUsageResponseData": ".credit_usage_response_data", + "CreditsAutoTopupCompanySummary": ".credits_auto_topup_company_summary", + "CreditsAutoTopupCreditSummary": ".credits_auto_topup_credit_summary", + "CreditsAutoTopupHardFailure": ".credits_auto_topup_hard_failure", + "CreditsAutoTopupRetryFailure": ".credits_auto_topup_retry_failure", "CustomPlanConfig": ".custom_plan_config", "CustomPlanViewConfigResponseData": ".custom_plan_view_config_response_data", + "DataEventPayload": ".data_event_payload", "DataExportOutputFileType": ".data_export_output_file_type", "DataExportResponseData": ".data_export_response_data", "DataExportStatus": ".data_export_status", "DataExportType": ".data_export_type", + "DatastreamCompanyPlan": ".datastream_company_plan", + "DeleteBillingPlanCreditGrantRequestBody": ".delete_billing_plan_credit_grant_request_body", "DeleteResponse": ".delete_response", "DuplicatePlanEntitlementsResponseResponseData": ".duplicate_plan_entitlements_response_response_data", "EntitlementPriceBehavior": ".entitlement_price_behavior", @@ -444,21 +525,29 @@ "FeatureCompanyResponseData": ".feature_company_response_data", "FeatureCompanyUserResponseData": ".feature_company_user_response_data", "FeatureDetailResponseData": ".feature_detail_response_data", + "FeatureEntitlement": ".feature_entitlement", + "FeatureEntitlementMetricPeriod": ".feature_entitlement_metric_period", + "FeatureEntitlementMonthReset": ".feature_entitlement_month_reset", "FeatureLedgerResponseData": ".feature_ledger_response_data", "FeatureLifecyclePhase": ".feature_lifecycle_phase", "FeatureResponseData": ".feature_response_data", "FeatureType": ".feature_type", - "FeatureUsageDataResponseData": ".feature_usage_data_response_data", "FeatureUsageDetailResponseData": ".feature_usage_detail_response_data", + "FeatureUsageLegacyResponseData": ".feature_usage_legacy_response_data", "FeatureUsageResponseData": ".feature_usage_response_data", + "FeatureUsageTimeSeriesResponseData": ".feature_usage_time_series_response_data", + "FeatureView": ".feature_view", "FlagDetailResponseData": ".flag_detail_response_data", "FlagResponseData": ".flag_response_data", "FlagType": ".flag_type", + "FlagView": ".flag_view", "GenericPreviewObject": ".generic_preview_object", "InvoiceRequestBody": ".invoice_request_body", "InvoiceResponseData": ".invoice_response_data", + "InvoiceStatus": ".invoice_status", "IssueTemporaryAccessTokenResponseData": ".issue_temporary_access_token_response_data", "KeysRequestBody": ".keys_request_body", + "LimitTimeSeriesPointResponseData": ".limit_time_series_point_response_data", "ManagePlanPreviewResponseResponseData": ".manage_plan_preview_response_response_data", "ManagePlanRequest": ".manage_plan_request", "ManagePlanResponseResponseData": ".manage_plan_response_response_data", @@ -466,8 +555,11 @@ "OrderedPlansInGroup": ".ordered_plans_in_group", "PaymentMethodRequestBody": ".payment_method_request_body", "PaymentMethodResponseData": ".payment_method_response_data", + "PlanBundleAction": ".plan_bundle_action", + "PlanBundleCreditGrantRequestBody": ".plan_bundle_credit_grant_request_body", + "PlanBundleEntitlementRequestBody": ".plan_bundle_entitlement_request_body", + "PlanBundleResponseData": ".plan_bundle_response_data", "PlanChangeAction": ".plan_change_action", - "PlanChangeActorType": ".plan_change_actor_type", "PlanChangeBasePlanAction": ".plan_change_base_plan_action", "PlanChangeResponseData": ".plan_change_response_data", "PlanChangeSubscriptionAction": ".plan_change_subscription_action", @@ -487,12 +579,22 @@ "PlanSnapshotView": ".plan_snapshot_view", "PlanTraitResponseData": ".plan_trait_response_data", "PlanType": ".plan_type", + "PlanVersionCompanyMigrationResponseData": ".plan_version_company_migration_response_data", + "PlanVersionCompanyMigrationStatus": ".plan_version_company_migration_status", + "PlanVersionMigrationResponseData": ".plan_version_migration_response_data", + "PlanVersionMigrationStatus": ".plan_version_migration_status", + "PlanVersionMigrationStrategy": ".plan_version_migration_strategy", + "PlanVersionResponseData": ".plan_version_response_data", + "PlanVersionSnapshotView": ".plan_version_snapshot_view", + "PlanVersionStatus": ".plan_version_status", + "PlanViewPublicResponseData": ".plan_view_public_response_data", "PreviewObject": ".preview_object", "PreviewObjectResponseData": ".preview_object_response_data", "PreviewSubscriptionChangeResponseData": ".preview_subscription_change_response_data", "PreviewSubscriptionFinanceResponseData": ".preview_subscription_finance_response_data", "PreviewSubscriptionUpcomingInvoiceLineItems": ".preview_subscription_upcoming_invoice_line_items", "ProrationBehavior": ".proration_behavior", + "PublicPlansResponseData": ".public_plans_response_data", "QuickstartResp": ".quickstart_resp", "RawEventBatchResponseData": ".raw_event_batch_response_data", "RawEventResponseData": ".raw_event_response_data", @@ -504,6 +606,7 @@ "RuleDetailResponseData": ".rule_detail_response_data", "RuleResponseData": ".rule_response_data", "RuleRuleType": ".rule_rule_type", + "RuleView": ".rule_view", "RulesDetailResponseData": ".rules_detail_response_data", "RulesEngineSchemaVersion": ".rules_engine_schema_version", "RulesengineCheckFlagResult": ".rulesengine_check_flag_result", @@ -519,7 +622,11 @@ "RulesengineConditionMetricPeriod": ".rulesengine_condition_metric_period", "RulesengineConditionMetricPeriodMonthReset": ".rulesengine_condition_metric_period_month_reset", "RulesengineConditionOperator": ".rulesengine_condition_operator", + "RulesengineEntitlementValueType": ".rulesengine_entitlement_value_type", "RulesengineEntityType": ".rulesengine_entity_type", + "RulesengineFeatureEntitlement": ".rulesengine_feature_entitlement", + "RulesengineFeatureEntitlementMetricPeriod": ".rulesengine_feature_entitlement_metric_period", + "RulesengineFeatureEntitlementMonthReset": ".rulesengine_feature_entitlement_month_reset", "RulesengineFlag": ".rulesengine_flag", "RulesengineRule": ".rulesengine_rule", "RulesengineRuleRuleType": ".rulesengine_rule_rule_type", @@ -528,6 +635,10 @@ "RulesengineTraitDefinition": ".rulesengine_trait_definition", "RulesengineTraitDefinitionComparableType": ".rulesengine_trait_definition_comparable_type", "RulesengineUser": ".rulesengine_user", + "ScheduledCheckoutResponseData": ".scheduled_checkout_response_data", + "ScheduledCheckoutStatus": ".scheduled_checkout_status", + "ScheduledDowngradeConfigBehavior": ".scheduled_downgrade_config_behavior", + "ScheduledDowngradeResponseData": ".scheduled_downgrade_response_data", "SegmentStatusResp": ".segment_status_resp", "SkippedEntitlementErrorResponseData": ".skipped_entitlement_error_response_data", "SkippedEntitlementResponseData": ".skipped_entitlement_response_data", @@ -538,31 +649,38 @@ "SubscriptionType": ".subscription_type", "TemporaryAccessTokenResourceType": ".temporary_access_token_resource_type", "TemporaryAccessTokenResponseData": ".temporary_access_token_response_data", + "TimeSeriesGranularity": ".time_series_granularity", "TraitDefinition": ".trait_definition", "TraitDefinitionComparableType": ".trait_definition_comparable_type", "TraitType": ".trait_type", "UpdateAddOnRequestBody": ".update_add_on_request_body", + "UpdateBillingPlanCreditGrantRequestBody": ".update_billing_plan_credit_grant_request_body", "UpdateCreditBundleRequestBody": ".update_credit_bundle_request_body", "UpdateEntitlementReqCommon": ".update_entitlement_req_common", "UpdateEntitlementReqCommonMetricPeriod": ".update_entitlement_req_common_metric_period", "UpdateEntitlementReqCommonMetricPeriodMonthReset": ".update_entitlement_req_common_metric_period_month_reset", "UpdatePayInAdvanceRequestBody": ".update_pay_in_advance_request_body", + "UpdatePlanRequestBody": ".update_plan_request_body", "UpdatePlanTraitTraitRequestBody": ".update_plan_trait_trait_request_body", "UpdateRuleRequestBody": ".update_rule_request_body", + "UpsertBillingProductRequestBody": ".upsert_billing_product_request_body", "UpsertCompanyRequestBody": ".upsert_company_request_body", "UpsertTraitRequestBody": ".upsert_trait_request_body", "UpsertUserRequestBody": ".upsert_user_request_body", "UpsertUserSubRequestBody": ".upsert_user_sub_request_body", "UsageBasedEntitlementRequestBody": ".usage_based_entitlement_request_body", "UsageBasedEntitlementResponseData": ".usage_based_entitlement_response_data", + "UsageTimeSeriesPointResponseData": ".usage_time_series_point_response_data", "UserDetailResponseData": ".user_detail_response_data", "UserResponseData": ".user_response_data", + "WebFeatureUsageWebhookOutput": ".web_feature_usage_webhook_output", "WebhookEventDetailResponseData": ".webhook_event_detail_response_data", "WebhookEventResponseData": ".webhook_event_response_data", "WebhookEventStatus": ".webhook_event_status", "WebhookRequestType": ".webhook_request_type", "WebhookResponseData": ".webhook_response_data", "WebhookStatus": ".webhook_status", + "WhoAmIResponseData": ".who_am_i_response_data", } @@ -588,12 +706,13 @@ def __dir__(): __all__ = [ + "ActorType", "ApiError", "ApiKeyCreateResponseData", - "ApiKeyRequestListResponseData", - "ApiKeyRequestResponseData", "ApiKeyResponseData", "ApiKeyScope", + "AuditLogListResponseData", + "AuditLogResponseData", "BillingCouponResponseData", "BillingCreditBundleResponseData", "BillingCreditBundleStatus", @@ -608,6 +727,7 @@ def __dir__(): "BillingCreditLedgerResponseData", "BillingCreditResponseData", "BillingCreditRolloverPolicy", + "BillingCreditView", "BillingCustomerResponseData", "BillingCustomerSubscription", "BillingCustomerWithSubscriptionsResponseData", @@ -635,6 +755,8 @@ def __dir__(): "BillingSubscriptionTrialEndSetting", "BillingSubscriptionView", "BillingTiersMode", + "CaptureRawEvent", + "CaptureRawEventBatch", "ChangeSubscriptionInternalRequestBody", "ChangeSubscriptionRequestBody", "ChargeType", @@ -657,7 +779,6 @@ def __dir__(): "CompanyPlanWithBillingSubView", "CompanyResponseData", "CompanySubscriptionResponseData", - "CompanyViewWithFeatureUsageResponseData", "CompatiblePlans", "CompatiblePlansResponseData", "ComponentCapabilities", @@ -672,12 +793,20 @@ def __dir__(): "Condition", "ConditionConditionType", "ConditionGroup", + "ConditionGroupResponseData", + "ConditionGroupView", "ConditionMetricPeriod", "ConditionMetricPeriodMonthReset", "ConditionOperator", + "ConditionResponseData", + "ConditionView", "CountResponse", "CouponRequestBody", + "CreateBillingPlanCreditGrantRequestBody", "CreateBillingPriceTierRequestBody", + "CreateEntitlementInBundleRequestBody", + "CreateEntitlementInBundleRequestBodyMetricPeriod", + "CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset", "CreateEntitlementReqCommon", "CreateEntitlementReqCommonMetricPeriod", "CreateEntitlementReqCommonMetricPeriodMonthReset", @@ -692,10 +821,13 @@ def __dir__(): "CreateOrUpdateFlagRequestBody", "CreateOrUpdateRuleRequestBody", "CreateOrUpdateRuleRequestBodyRuleType", + "CreatePlanRequestBody", "CreatePriceTierRequestBody", "CreditAutoTopupAmountType", "CreditBundlePurchaseResponseData", "CreditCompanyGrantView", + "CreditEventLedgerResponseData", + "CreditEventType", "CreditGrantDetail", "CreditGrantExpiryRequestBody", "CreditGrantSortOrder", @@ -706,13 +838,19 @@ def __dir__(): "CreditTriggerConfig", "CreditUsage", "CreditUsageAggregation", - "CreditUsageResponseData", + "CreditsAutoTopupCompanySummary", + "CreditsAutoTopupCreditSummary", + "CreditsAutoTopupHardFailure", + "CreditsAutoTopupRetryFailure", "CustomPlanConfig", "CustomPlanViewConfigResponseData", + "DataEventPayload", "DataExportOutputFileType", "DataExportResponseData", "DataExportStatus", "DataExportType", + "DatastreamCompanyPlan", + "DeleteBillingPlanCreditGrantRequestBody", "DeleteResponse", "DuplicatePlanEntitlementsResponseResponseData", "EntitlementPriceBehavior", @@ -744,21 +882,29 @@ def __dir__(): "FeatureCompanyResponseData", "FeatureCompanyUserResponseData", "FeatureDetailResponseData", + "FeatureEntitlement", + "FeatureEntitlementMetricPeriod", + "FeatureEntitlementMonthReset", "FeatureLedgerResponseData", "FeatureLifecyclePhase", "FeatureResponseData", "FeatureType", - "FeatureUsageDataResponseData", "FeatureUsageDetailResponseData", + "FeatureUsageLegacyResponseData", "FeatureUsageResponseData", + "FeatureUsageTimeSeriesResponseData", + "FeatureView", "FlagDetailResponseData", "FlagResponseData", "FlagType", + "FlagView", "GenericPreviewObject", "InvoiceRequestBody", "InvoiceResponseData", + "InvoiceStatus", "IssueTemporaryAccessTokenResponseData", "KeysRequestBody", + "LimitTimeSeriesPointResponseData", "ManagePlanPreviewResponseResponseData", "ManagePlanRequest", "ManagePlanResponseResponseData", @@ -766,8 +912,11 @@ def __dir__(): "OrderedPlansInGroup", "PaymentMethodRequestBody", "PaymentMethodResponseData", + "PlanBundleAction", + "PlanBundleCreditGrantRequestBody", + "PlanBundleEntitlementRequestBody", + "PlanBundleResponseData", "PlanChangeAction", - "PlanChangeActorType", "PlanChangeBasePlanAction", "PlanChangeResponseData", "PlanChangeSubscriptionAction", @@ -787,12 +936,22 @@ def __dir__(): "PlanSnapshotView", "PlanTraitResponseData", "PlanType", + "PlanVersionCompanyMigrationResponseData", + "PlanVersionCompanyMigrationStatus", + "PlanVersionMigrationResponseData", + "PlanVersionMigrationStatus", + "PlanVersionMigrationStrategy", + "PlanVersionResponseData", + "PlanVersionSnapshotView", + "PlanVersionStatus", + "PlanViewPublicResponseData", "PreviewObject", "PreviewObjectResponseData", "PreviewSubscriptionChangeResponseData", "PreviewSubscriptionFinanceResponseData", "PreviewSubscriptionUpcomingInvoiceLineItems", "ProrationBehavior", + "PublicPlansResponseData", "QuickstartResp", "RawEventBatchResponseData", "RawEventResponseData", @@ -804,6 +963,7 @@ def __dir__(): "RuleDetailResponseData", "RuleResponseData", "RuleRuleType", + "RuleView", "RulesDetailResponseData", "RulesEngineSchemaVersion", "RulesengineCheckFlagResult", @@ -819,7 +979,11 @@ def __dir__(): "RulesengineConditionMetricPeriod", "RulesengineConditionMetricPeriodMonthReset", "RulesengineConditionOperator", + "RulesengineEntitlementValueType", "RulesengineEntityType", + "RulesengineFeatureEntitlement", + "RulesengineFeatureEntitlementMetricPeriod", + "RulesengineFeatureEntitlementMonthReset", "RulesengineFlag", "RulesengineRule", "RulesengineRuleRuleType", @@ -828,6 +992,10 @@ def __dir__(): "RulesengineTraitDefinition", "RulesengineTraitDefinitionComparableType", "RulesengineUser", + "ScheduledCheckoutResponseData", + "ScheduledCheckoutStatus", + "ScheduledDowngradeConfigBehavior", + "ScheduledDowngradeResponseData", "SegmentStatusResp", "SkippedEntitlementErrorResponseData", "SkippedEntitlementResponseData", @@ -838,29 +1006,36 @@ def __dir__(): "SubscriptionType", "TemporaryAccessTokenResourceType", "TemporaryAccessTokenResponseData", + "TimeSeriesGranularity", "TraitDefinition", "TraitDefinitionComparableType", "TraitType", "UpdateAddOnRequestBody", + "UpdateBillingPlanCreditGrantRequestBody", "UpdateCreditBundleRequestBody", "UpdateEntitlementReqCommon", "UpdateEntitlementReqCommonMetricPeriod", "UpdateEntitlementReqCommonMetricPeriodMonthReset", "UpdatePayInAdvanceRequestBody", + "UpdatePlanRequestBody", "UpdatePlanTraitTraitRequestBody", "UpdateRuleRequestBody", + "UpsertBillingProductRequestBody", "UpsertCompanyRequestBody", "UpsertTraitRequestBody", "UpsertUserRequestBody", "UpsertUserSubRequestBody", "UsageBasedEntitlementRequestBody", "UsageBasedEntitlementResponseData", + "UsageTimeSeriesPointResponseData", "UserDetailResponseData", "UserResponseData", + "WebFeatureUsageWebhookOutput", "WebhookEventDetailResponseData", "WebhookEventResponseData", "WebhookEventStatus", "WebhookRequestType", "WebhookResponseData", "WebhookStatus", + "WhoAmIResponseData", ] diff --git a/src/schematic/types/actor_type.py b/src/schematic/types/actor_type.py new file mode 100644 index 0000000..43dda1a --- /dev/null +++ b/src/schematic/types/actor_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ActorType = typing.Union[ + typing.Literal["api_key", "app_user", "stripe_app", "system", "temporary_access_token"], typing.Any +] diff --git a/src/schematic/types/api_key_create_response_data.py b/src/schematic/types/api_key_create_response_data.py index 176a58c..e073acb 100644 --- a/src/schematic/types/api_key_create_response_data.py +++ b/src/schematic/types/api_key_create_response_data.py @@ -15,6 +15,7 @@ class ApiKeyCreateResponseData(UniversalBaseModel): id: str last_used_at: typing.Optional[dt.datetime] = None name: str + readonly: bool scopes: typing.List[ApiKeyScope] secret: str updated_at: dt.datetime diff --git a/src/schematic/types/api_key_response_data.py b/src/schematic/types/api_key_response_data.py index fa4c41c..ca58ffb 100644 --- a/src/schematic/types/api_key_response_data.py +++ b/src/schematic/types/api_key_response_data.py @@ -15,6 +15,7 @@ class ApiKeyResponseData(UniversalBaseModel): id: str last_used_at: typing.Optional[dt.datetime] = None name: str + readonly: bool scopes: typing.List[ApiKeyScope] updated_at: dt.datetime diff --git a/src/schematic/types/api_key_request_list_response_data.py b/src/schematic/types/audit_log_list_response_data.py similarity index 85% rename from src/schematic/types/api_key_request_list_response_data.py rename to src/schematic/types/audit_log_list_response_data.py index 6482dad..494180c 100644 --- a/src/schematic/types/api_key_request_list_response_data.py +++ b/src/schematic/types/audit_log_list_response_data.py @@ -5,16 +5,16 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .actor_type import ActorType -class ApiKeyRequestListResponseData(UniversalBaseModel): - api_key_id: str +class AuditLogListResponseData(UniversalBaseModel): + actor_type: ActorType + api_key_id: typing.Optional[str] = None ended_at: typing.Optional[dt.datetime] = None environment_id: typing.Optional[str] = None id: str method: str - req_body: typing.Optional[str] = None - request_type: typing.Optional[str] = None resource_id: typing.Optional[int] = None resource_id_string: typing.Optional[str] = None resource_name: typing.Optional[str] = None diff --git a/src/schematic/types/api_key_request_response_data.py b/src/schematic/types/audit_log_response_data.py similarity index 80% rename from src/schematic/types/api_key_request_response_data.py rename to src/schematic/types/audit_log_response_data.py index 6f05225..618a4b9 100644 --- a/src/schematic/types/api_key_request_response_data.py +++ b/src/schematic/types/audit_log_response_data.py @@ -5,18 +5,17 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .api_key_response_data import ApiKeyResponseData +from .actor_type import ActorType -class ApiKeyRequestResponseData(UniversalBaseModel): - api_key: typing.Optional[ApiKeyResponseData] = None - api_key_id: str +class AuditLogResponseData(UniversalBaseModel): + actor_type: ActorType + api_key_id: typing.Optional[str] = None ended_at: typing.Optional[dt.datetime] = None environment_id: typing.Optional[str] = None id: str method: str req_body: typing.Optional[str] = None - request_type: typing.Optional[str] = None resource_id: typing.Optional[int] = None resource_id_string: typing.Optional[str] = None resource_name: typing.Optional[str] = None @@ -26,7 +25,6 @@ class ApiKeyRequestResponseData(UniversalBaseModel): secondary_resource: typing.Optional[str] = None started_at: dt.datetime url: str - user_agent: typing.Optional[str] = None user_id: typing.Optional[str] = None user_name: typing.Optional[str] = None diff --git a/src/schematic/types/billing_credit_bundle_response_data.py b/src/schematic/types/billing_credit_bundle_response_data.py index 54b7298..63a5ff7 100644 --- a/src/schematic/types/billing_credit_bundle_response_data.py +++ b/src/schematic/types/billing_credit_bundle_response_data.py @@ -13,7 +13,6 @@ class BillingCreditBundleResponseData(UniversalBaseModel): - billing_invoice_id: typing.Optional[str] = None bundle_type: BillingCreditBundleType = "fixed" created_at: dt.datetime credit_description: typing.Optional[str] = None diff --git a/src/schematic/types/billing_credit_bundle_view.py b/src/schematic/types/billing_credit_bundle_view.py index d9c5256..6a0e38d 100644 --- a/src/schematic/types/billing_credit_bundle_view.py +++ b/src/schematic/types/billing_credit_bundle_view.py @@ -13,7 +13,6 @@ class BillingCreditBundleView(UniversalBaseModel): - billing_invoice_id: typing.Optional[str] = None bundle_type: BillingCreditBundleType = "fixed" created_at: dt.datetime credit_description: typing.Optional[str] = None diff --git a/src/schematic/types/billing_credit_grant_response_data.py b/src/schematic/types/billing_credit_grant_response_data.py index 2402d08..123ff08 100644 --- a/src/schematic/types/billing_credit_grant_response_data.py +++ b/src/schematic/types/billing_credit_grant_response_data.py @@ -7,6 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .billing_credit_grant_reason import BillingCreditGrantReason from .billing_credit_grant_zeroed_out_reason import BillingCreditGrantZeroedOutReason +from .billing_plan_credit_grant_reset_cadence import BillingPlanCreditGrantResetCadence from .billing_price_response_data import BillingPriceResponseData from .credit_transfer_response_data import CreditTransferResponseData @@ -27,6 +28,8 @@ class BillingCreditGrantResponseData(UniversalBaseModel): quantity: int quantity_remaining: float quantity_used: float + renewal_enabled: bool + renewal_period: typing.Optional[BillingPlanCreditGrantResetCadence] = None source_label: str transfers: typing.Optional[typing.List[CreditTransferResponseData]] = None updated_at: dt.datetime diff --git a/src/schematic/types/billing_credit_response_data.py b/src/schematic/types/billing_credit_response_data.py index dce1b20..eaa14e4 100644 --- a/src/schematic/types/billing_credit_response_data.py +++ b/src/schematic/types/billing_credit_response_data.py @@ -14,6 +14,7 @@ class BillingCreditResponseData(UniversalBaseModel): burn_strategy: BillingCreditBurnStrategy + cost_editable: bool created_at: dt.datetime default_expiry_unit: BillingCreditExpiryUnit default_expiry_unit_count: typing.Optional[int] = None diff --git a/src/schematic/types/billing_credit_view.py b/src/schematic/types/billing_credit_view.py new file mode 100644 index 0000000..c1be42c --- /dev/null +++ b/src/schematic/types/billing_credit_view.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_credit_burn_strategy import BillingCreditBurnStrategy +from .billing_credit_expiry_unit import BillingCreditExpiryUnit +from .billing_credit_rollover_policy import BillingCreditRolloverPolicy +from .billing_price_view import BillingPriceView +from .billing_product_response_data import BillingProductResponseData + + +class BillingCreditView(UniversalBaseModel): + account_id: str + burn_strategy: BillingCreditBurnStrategy + cost_editable: bool + created_at: dt.datetime + default_expiry_unit: BillingCreditExpiryUnit + default_expiry_unit_count: typing.Optional[int] = None + default_rollover_policy: BillingCreditRolloverPolicy + description: str + environment_id: str + icon: typing.Optional[str] = None + id: str + name: str + plural_name: typing.Optional[str] = None + price: typing.Optional[BillingPriceView] = None + price_per_unit: typing.Optional[int] = None + price_per_unit_decimal: typing.Optional[str] = None + product: typing.Optional[BillingProductResponseData] = None + singular_name: typing.Optional[str] = None + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/billing_customer_response_data.py b/src/schematic/types/billing_customer_response_data.py index 2fb0df8..d723ee8 100644 --- a/src/schematic/types/billing_customer_response_data.py +++ b/src/schematic/types/billing_customer_response_data.py @@ -13,7 +13,6 @@ class BillingCustomerResponseData(UniversalBaseModel): deleted_at: typing.Optional[dt.datetime] = None email: str external_id: str - failed_to_import: bool id: str name: str provider_type: BillingProviderType diff --git a/src/schematic/types/billing_customer_with_subscriptions_response_data.py b/src/schematic/types/billing_customer_with_subscriptions_response_data.py index 07612b9..815239e 100644 --- a/src/schematic/types/billing_customer_with_subscriptions_response_data.py +++ b/src/schematic/types/billing_customer_with_subscriptions_response_data.py @@ -14,7 +14,6 @@ class BillingCustomerWithSubscriptionsResponseData(UniversalBaseModel): deleted_at: typing.Optional[dt.datetime] = None email: str external_id: str - failed_to_import: bool id: str name: str provider_type: BillingProviderType diff --git a/src/schematic/types/billing_plan_credit_grant_response_data.py b/src/schematic/types/billing_plan_credit_grant_response_data.py index 56389bf..6be50d1 100644 --- a/src/schematic/types/billing_plan_credit_grant_response_data.py +++ b/src/schematic/types/billing_plan_credit_grant_response_data.py @@ -7,9 +7,11 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .billing_credit_expiry_type import BillingCreditExpiryType from .billing_credit_expiry_unit import BillingCreditExpiryUnit +from .billing_credit_response_data import BillingCreditResponseData from .billing_plan_credit_grant_reset_cadence import BillingPlanCreditGrantResetCadence from .billing_plan_credit_grant_reset_start import BillingPlanCreditGrantResetStart from .billing_plan_credit_grant_reset_type import BillingPlanCreditGrantResetType +from .preview_object_response_data import PreviewObjectResponseData class BillingPlanCreditGrantResponseData(UniversalBaseModel): @@ -21,19 +23,38 @@ class BillingPlanCreditGrantResponseData(UniversalBaseModel): auto_topup_expiry_unit_count: typing.Optional[int] = None auto_topup_threshold_percent: typing.Optional[int] = None created_at: dt.datetime + credit: typing.Optional[BillingCreditResponseData] = None credit_amount: int credit_id: str - credit_name: str - credit_plural_name: typing.Optional[str] = None - credit_singular_name: typing.Optional[str] = None + credit_name: str = pydantic.Field() + """ + Use credit.name from the nested credit object instead + """ + + credit_plural_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Use plural_name from the nested credit object instead + """ + + credit_singular_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Use singular_name from the nested credit object instead + """ + expiry_type: typing.Optional[BillingCreditExpiryType] = None expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None expiry_unit_count: typing.Optional[int] = None id: str + plan: typing.Optional[PreviewObjectResponseData] = None plan_id: str - plan_name: str - reset_cadence: BillingPlanCreditGrantResetCadence - reset_start: BillingPlanCreditGrantResetStart + plan_name: str = pydantic.Field() + """ + Use plan.name from the nested plan object instead + """ + + plan_version_id: typing.Optional[str] = None + reset_cadence: typing.Optional[BillingPlanCreditGrantResetCadence] = None + reset_start: typing.Optional[BillingPlanCreditGrantResetStart] = None reset_type: typing.Optional[BillingPlanCreditGrantResetType] = None updated_at: dt.datetime diff --git a/src/schematic/types/capture_raw_event.py b/src/schematic/types/capture_raw_event.py new file mode 100644 index 0000000..080df50 --- /dev/null +++ b/src/schematic/types/capture_raw_event.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class CaptureRawEvent(UniversalBaseModel): + captured_at: dt.datetime + event_id: typing.Optional[str] = None + raw_bytes: str + remote_ip: str + user_agent: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/capture_raw_event_batch.py b/src/schematic/types/capture_raw_event_batch.py new file mode 100644 index 0000000..e386404 --- /dev/null +++ b/src/schematic/types/capture_raw_event_batch.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .capture_raw_event import CaptureRawEvent + + +class CaptureRawEventBatch(UniversalBaseModel): + events: typing.List[CaptureRawEvent] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/check_flag_response_data.py b/src/schematic/types/check_flag_response_data.py index 1121c0f..b0e6e4c 100644 --- a/src/schematic/types/check_flag_response_data.py +++ b/src/schematic/types/check_flag_response_data.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .feature_entitlement import FeatureEntitlement class CheckFlagResponseData(UniversalBaseModel): @@ -13,6 +14,11 @@ class CheckFlagResponseData(UniversalBaseModel): If company keys were provided and matched a company, its ID """ + entitlement: typing.Optional[FeatureEntitlement] = pydantic.Field(default=None) + """ + If a feature entitlement rule was matched, its entitlement details + """ + error: typing.Optional[str] = pydantic.Field(default=None) """ If an error occurred while checking the flag, the error message @@ -20,27 +26,27 @@ class CheckFlagResponseData(UniversalBaseModel): feature_allocation: typing.Optional[int] = pydantic.Field(default=None) """ - If a numeric feature entitlement rule was matched, its allocation + Deprecated: Use Entitlement.Allocation instead. """ feature_usage: typing.Optional[int] = pydantic.Field(default=None) """ - If a numeric feature entitlement rule was matched, the company's usage + Deprecated: Use Entitlement.Usage instead. """ feature_usage_event: typing.Optional[str] = pydantic.Field(default=None) """ - If an event-based numeric feature entitlement rule was matched, the event used to track its usage + Deprecated: Use Entitlement.EventName instead. """ feature_usage_period: typing.Optional[str] = pydantic.Field(default=None) """ - For event-based feature entitlement rules, the period over which usage is tracked (current_month, current_day, current_week, all_time) + Deprecated: Use Entitlement.MetricPeriod instead. """ feature_usage_reset_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ - For event-based feature entitlement rules, when the usage period will reset + Deprecated: Use Entitlement.MetricResetAt instead. """ flag: str = pydantic.Field() diff --git a/src/schematic/types/check_flags_response_data.py b/src/schematic/types/check_flags_response_data.py index ba84802..5c84d91 100644 --- a/src/schematic/types/check_flags_response_data.py +++ b/src/schematic/types/check_flags_response_data.py @@ -5,10 +5,12 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .check_flag_response_data import CheckFlagResponseData +from .datastream_company_plan import DatastreamCompanyPlan class CheckFlagsResponseData(UniversalBaseModel): flags: typing.List[CheckFlagResponseData] + plan: typing.Optional[DatastreamCompanyPlan] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/types/company_detail_response_data.py b/src/schematic/types/company_detail_response_data.py index 299a52c..daced5f 100644 --- a/src/schematic/types/company_detail_response_data.py +++ b/src/schematic/types/company_detail_response_data.py @@ -10,9 +10,11 @@ from .company_plan_with_billing_sub_view import CompanyPlanWithBillingSubView from .entity_key_detail_response_data import EntityKeyDetailResponseData from .entity_trait_detail_response_data import EntityTraitDetailResponseData +from .feature_entitlement import FeatureEntitlement from .generic_preview_object import GenericPreviewObject from .payment_method_response_data import PaymentMethodResponseData from .rule import Rule +from .scheduled_downgrade_response_data import ScheduledDowngradeResponseData class CompanyDetailResponseData(UniversalBaseModel): @@ -22,6 +24,7 @@ class CompanyDetailResponseData(UniversalBaseModel): billing_subscriptions: typing.List[BillingSubscriptionView] created_at: dt.datetime default_payment_method: typing.Optional[PaymentMethodResponseData] = None + entitlements: typing.List[FeatureEntitlement] entity_traits: typing.List[EntityTraitDetailResponseData] environment_id: str id: str @@ -34,6 +37,7 @@ class CompanyDetailResponseData(UniversalBaseModel): plan: typing.Optional[CompanyPlanWithBillingSubView] = None plans: typing.List[GenericPreviewObject] rules: typing.List[Rule] + scheduled_downgrade: typing.Optional[ScheduledDowngradeResponseData] = None traits: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ A map of trait names to trait values diff --git a/src/schematic/types/company_plan_detail_response_data.py b/src/schematic/types/company_plan_detail_response_data.py index 7d5d536..e72cb54 100644 --- a/src/schematic/types/company_plan_detail_response_data.py +++ b/src/schematic/types/company_plan_detail_response_data.py @@ -16,9 +16,11 @@ from .plan_credit_grant_view import PlanCreditGrantView from .plan_entitlement_response_data import PlanEntitlementResponseData from .plan_type import PlanType +from .plan_version_response_data import PlanVersionResponseData class CompanyPlanDetailResponseData(UniversalBaseModel): + active_version: typing.Optional[PlanVersionResponseData] = None audience_type: typing.Optional[str] = None billing_product: typing.Optional[BillingProductDetailResponseData] = None charge_type: ChargeType @@ -31,6 +33,7 @@ class CompanyPlanDetailResponseData(UniversalBaseModel): custom: bool custom_plan_config: typing.Optional[CustomPlanConfig] = None description: str + draft_version: typing.Optional[PlanVersionResponseData] = None entitlements: typing.List[PlanEntitlementResponseData] features: typing.List[FeatureDetailResponseData] icon: str @@ -49,6 +52,7 @@ class CompanyPlanDetailResponseData(UniversalBaseModel): updated_at: dt.datetime usage_violations: typing.List[FeatureUsageResponseData] valid: bool + versions: typing.List[PlanVersionResponseData] yearly_price: typing.Optional[BillingPriceResponseData] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/company_plan_with_billing_sub_view.py b/src/schematic/types/company_plan_with_billing_sub_view.py index dafcf34..e849243 100644 --- a/src/schematic/types/company_plan_with_billing_sub_view.py +++ b/src/schematic/types/company_plan_with_billing_sub_view.py @@ -19,6 +19,7 @@ class CompanyPlanWithBillingSubView(UniversalBaseModel): name: str plan_period: typing.Optional[str] = None plan_price: typing.Optional[int] = None + plan_version_id: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/types/company_view_with_feature_usage_response_data.py b/src/schematic/types/company_view_with_feature_usage_response_data.py deleted file mode 100644 index 8b96b8c..0000000 --- a/src/schematic/types/company_view_with_feature_usage_response_data.py +++ /dev/null @@ -1,54 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .billing_subscription_view import BillingSubscriptionView -from .company_event_period_metrics_response_data import CompanyEventPeriodMetricsResponseData -from .company_plan_with_billing_sub_view import CompanyPlanWithBillingSubView -from .entity_key_detail_response_data import EntityKeyDetailResponseData -from .entity_trait_detail_response_data import EntityTraitDetailResponseData -from .feature_usage_data_response_data import FeatureUsageDataResponseData -from .generic_preview_object import GenericPreviewObject -from .payment_method_response_data import PaymentMethodResponseData -from .rule import Rule - - -class CompanyViewWithFeatureUsageResponseData(UniversalBaseModel): - add_ons: typing.List[CompanyPlanWithBillingSubView] - billing_credit_balances: typing.Optional[typing.Dict[str, float]] = None - billing_subscription: typing.Optional[BillingSubscriptionView] = None - billing_subscriptions: typing.List[BillingSubscriptionView] - created_at: dt.datetime - default_payment_method: typing.Optional[PaymentMethodResponseData] = None - entity_traits: typing.List[EntityTraitDetailResponseData] - environment_id: str - feature_usage: typing.List[FeatureUsageDataResponseData] - id: str - keys: typing.List[EntityKeyDetailResponseData] - last_seen_at: typing.Optional[dt.datetime] = None - logo_url: typing.Optional[str] = None - metrics: typing.List[CompanyEventPeriodMetricsResponseData] - name: str - payment_methods: typing.List[PaymentMethodResponseData] - plan: typing.Optional[CompanyPlanWithBillingSubView] = None - plans: typing.List[GenericPreviewObject] - rules: typing.List[Rule] - traits: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) - """ - A map of trait names to trait values - """ - - updated_at: dt.datetime - user_count: int - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/schematic/types/component_display_settings.py b/src/schematic/types/component_display_settings.py index 5f7f221..de2cc4c 100644 --- a/src/schematic/types/component_display_settings.py +++ b/src/schematic/types/component_display_settings.py @@ -9,6 +9,8 @@ class ComponentDisplaySettings(UniversalBaseModel): show_as_monthly_prices: bool show_credits: bool + show_feature_description: bool + show_hard_limit: bool show_period_toggle: bool show_zero_price_as_free: bool diff --git a/src/schematic/types/component_hydrate_response_data.py b/src/schematic/types/component_hydrate_response_data.py index 69d666f..3c679f0 100644 --- a/src/schematic/types/component_hydrate_response_data.py +++ b/src/schematic/types/component_hydrate_response_data.py @@ -17,6 +17,7 @@ from .feature_usage_detail_response_data import FeatureUsageDetailResponseData from .invoice_response_data import InvoiceResponseData from .plan_detail_response_data import PlanDetailResponseData +from .scheduled_downgrade_response_data import ScheduledDowngradeResponseData from .stripe_embed_info import StripeEmbedInfo from .usage_based_entitlement_response_data import UsageBasedEntitlementResponseData @@ -39,6 +40,7 @@ class ComponentHydrateResponseData(UniversalBaseModel): prevent_self_service_downgrade: bool prevent_self_service_downgrade_button_text: typing.Optional[str] = None prevent_self_service_downgrade_url: typing.Optional[str] = None + scheduled_downgrade: typing.Optional[ScheduledDowngradeResponseData] = None show_as_monthly_prices: bool show_credits: bool show_period_toggle: bool diff --git a/src/schematic/types/component_preview_response_data.py b/src/schematic/types/component_preview_response_data.py index 2b84ee4..f81e3be 100644 --- a/src/schematic/types/component_preview_response_data.py +++ b/src/schematic/types/component_preview_response_data.py @@ -17,6 +17,7 @@ from .feature_usage_detail_response_data import FeatureUsageDetailResponseData from .invoice_response_data import InvoiceResponseData from .plan_detail_response_data import PlanDetailResponseData +from .scheduled_downgrade_response_data import ScheduledDowngradeResponseData from .stripe_embed_info import StripeEmbedInfo from .usage_based_entitlement_response_data import UsageBasedEntitlementResponseData @@ -40,6 +41,7 @@ class ComponentPreviewResponseData(UniversalBaseModel): prevent_self_service_downgrade: bool prevent_self_service_downgrade_button_text: typing.Optional[str] = None prevent_self_service_downgrade_url: typing.Optional[str] = None + scheduled_downgrade: typing.Optional[ScheduledDowngradeResponseData] = None show_as_monthly_prices: bool show_credits: bool show_period_toggle: bool diff --git a/src/schematic/types/component_settings_response_data.py b/src/schematic/types/component_settings_response_data.py index 1c213cc..ee54d90 100644 --- a/src/schematic/types/component_settings_response_data.py +++ b/src/schematic/types/component_settings_response_data.py @@ -9,6 +9,8 @@ class ComponentSettingsResponseData(UniversalBaseModel): show_as_monthly_prices: bool show_credits: bool + show_feature_description: bool + show_hard_limit: bool show_period_toggle: bool show_zero_price_as_free: bool diff --git a/src/schematic/types/condition_condition_type.py b/src/schematic/types/condition_condition_type.py index 6297d7c..e915536 100644 --- a/src/schematic/types/condition_condition_type.py +++ b/src/schematic/types/condition_condition_type.py @@ -4,7 +4,7 @@ ConditionConditionType = typing.Union[ typing.Literal[ - "base_plan", "billing_product", "company", "credit", "crm_product", "metric", "plan", "trait", "user" + "base_plan", "billing_product", "company", "credit", "metric", "plan", "plan_version", "trait", "user" ], typing.Any, ] diff --git a/src/schematic/types/condition_group_response_data.py b/src/schematic/types/condition_group_response_data.py new file mode 100644 index 0000000..bf4f2b6 --- /dev/null +++ b/src/schematic/types/condition_group_response_data.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ConditionGroupResponseData(UniversalBaseModel): + account_id: str + created_at: dt.datetime + environment_id: str + flag_id: typing.Optional[str] = None + id: str + plan_version_id: typing.Optional[str] = None + rule_id: str + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/condition_group_view.py b/src/schematic/types/condition_group_view.py new file mode 100644 index 0000000..d515515 --- /dev/null +++ b/src/schematic/types/condition_group_view.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .condition_view import ConditionView + + +class ConditionGroupView(UniversalBaseModel): + account_id: str + conditions: typing.List[ConditionView] + created_at: dt.datetime + environment_id: str + flag_id: typing.Optional[str] = None + id: str + plan_version_id: typing.Optional[str] = None + rule_id: str + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/condition_response_data.py b/src/schematic/types/condition_response_data.py new file mode 100644 index 0000000..91599e8 --- /dev/null +++ b/src/schematic/types/condition_response_data.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .entity_type import EntityType + + +class ConditionResponseData(UniversalBaseModel): + account_id: str + comparison_trait_id: typing.Optional[str] = None + condition_group_id: typing.Optional[str] = None + condition_type: str + consumption_rate: typing.Optional[float] = None + created_at: dt.datetime + credit_id: typing.Optional[str] = None + environment_id: str + event_subtype: typing.Optional[str] = None + flag_id: typing.Optional[str] = None + id: str + metric_period: typing.Optional[str] = None + metric_period_month_reset: typing.Optional[str] = None + metric_value: typing.Optional[int] = None + operator: str + plan_version_id: typing.Optional[str] = None + resource_unspecified_ids: typing.List[str] + rule_id: str + trait_entity_type: typing.Optional[EntityType] = None + trait_id: typing.Optional[str] = None + trait_value: str + trait_value_bool: bool + trait_value_date: typing.Optional[dt.datetime] = None + trait_value_int: int + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/condition_view.py b/src/schematic/types/condition_view.py new file mode 100644 index 0000000..8efeeb1 --- /dev/null +++ b/src/schematic/types/condition_view.py @@ -0,0 +1,54 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .entity_trait_definition_response_data import EntityTraitDefinitionResponseData +from .entity_type import EntityType +from .generic_preview_object import GenericPreviewObject + + +class ConditionView(UniversalBaseModel): + account_id: str + billing_products: typing.List[GenericPreviewObject] + companies: typing.List[GenericPreviewObject] + comparison_trait: typing.Optional[EntityTraitDefinitionResponseData] = None + comparison_trait_id: typing.Optional[str] = None + condition_group_id: typing.Optional[str] = None + condition_type: str + consumption_rate: typing.Optional[float] = None + created_at: dt.datetime + credit_id: typing.Optional[str] = None + environment_id: str + event_subtype: typing.Optional[str] = None + flag_id: typing.Optional[str] = None + id: str + metric_period: typing.Optional[str] = None + metric_period_month_reset: typing.Optional[str] = None + metric_value: typing.Optional[int] = None + operator: str + plan_version_id: typing.Optional[str] = None + plan_versions: typing.List[GenericPreviewObject] + plans: typing.List[GenericPreviewObject] + resource_unspecified_ids: typing.List[str] + rule_id: str + trait: typing.Optional[EntityTraitDefinitionResponseData] = None + trait_entity_type: typing.Optional[EntityType] = None + trait_id: typing.Optional[str] = None + trait_value: str + trait_value_bool: bool + trait_value_date: typing.Optional[dt.datetime] = None + trait_value_int: int + updated_at: dt.datetime + users: typing.List[GenericPreviewObject] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/create_billing_plan_credit_grant_request_body.py b/src/schematic/types/create_billing_plan_credit_grant_request_body.py new file mode 100644 index 0000000..c8997b9 --- /dev/null +++ b/src/schematic/types/create_billing_plan_credit_grant_request_body.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_credit_expiry_type import BillingCreditExpiryType +from .billing_credit_expiry_unit import BillingCreditExpiryUnit +from .billing_plan_credit_grant_reset_cadence import BillingPlanCreditGrantResetCadence +from .billing_plan_credit_grant_reset_start import BillingPlanCreditGrantResetStart +from .billing_plan_credit_grant_reset_type import BillingPlanCreditGrantResetType +from .credit_auto_topup_amount_type import CreditAutoTopupAmountType + + +class CreateBillingPlanCreditGrantRequestBody(UniversalBaseModel): + apply_to_existing: typing.Optional[bool] = None + auto_topup_amount: typing.Optional[int] = None + auto_topup_amount_type: typing.Optional[CreditAutoTopupAmountType] = None + auto_topup_enabled: typing.Optional[bool] = None + auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = None + auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None + auto_topup_expiry_unit_count: typing.Optional[int] = None + auto_topup_threshold_percent: typing.Optional[int] = None + credit_amount: int + credit_id: str + expiry_type: typing.Optional[BillingCreditExpiryType] = None + expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None + expiry_unit_count: typing.Optional[int] = None + plan_id: str + plan_version_id: typing.Optional[str] = None + reset_cadence: BillingPlanCreditGrantResetCadence + reset_start: BillingPlanCreditGrantResetStart + reset_type: typing.Optional[BillingPlanCreditGrantResetType] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/create_entitlement_in_bundle_request_body.py b/src/schematic/types/create_entitlement_in_bundle_request_body.py new file mode 100644 index 0000000..039f22e --- /dev/null +++ b/src/schematic/types/create_entitlement_in_bundle_request_body.py @@ -0,0 +1,57 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_tiers_mode import BillingTiersMode +from .create_entitlement_in_bundle_request_body_metric_period import CreateEntitlementInBundleRequestBodyMetricPeriod +from .create_entitlement_in_bundle_request_body_metric_period_month_reset import ( + CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset, +) +from .create_price_tier_request_body import CreatePriceTierRequestBody +from .entitlement_price_behavior import EntitlementPriceBehavior +from .entitlement_value_type import EntitlementValueType + + +class CreateEntitlementInBundleRequestBody(UniversalBaseModel): + billing_product_id: typing.Optional[str] = None + billing_threshold: typing.Optional[int] = None + credit_consumption_rate: typing.Optional[float] = None + currency: typing.Optional[str] = None + feature_id: str + metric_period: typing.Optional[CreateEntitlementInBundleRequestBodyMetricPeriod] = None + metric_period_month_reset: typing.Optional[CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset] = None + monthly_metered_price_id: typing.Optional[str] = None + monthly_price_tiers: typing.Optional[typing.List[CreatePriceTierRequestBody]] = None + monthly_unit_price: typing.Optional[int] = None + monthly_unit_price_decimal: typing.Optional[str] = None + overage_billing_product_id: typing.Optional[str] = None + plan_id: str + plan_version_id: typing.Optional[str] = None + price_behavior: typing.Optional[EntitlementPriceBehavior] = None + price_tiers: typing.Optional[typing.List[CreatePriceTierRequestBody]] = pydantic.Field(default=None) + """ + Use MonthlyPriceTiers or YearlyPriceTiers instead + """ + + soft_limit: typing.Optional[int] = None + tier_mode: typing.Optional[BillingTiersMode] = None + value_bool: typing.Optional[bool] = None + value_credit_id: typing.Optional[str] = None + value_numeric: typing.Optional[int] = None + value_trait_id: typing.Optional[str] = None + value_type: EntitlementValueType + yearly_metered_price_id: typing.Optional[str] = None + yearly_price_tiers: typing.Optional[typing.List[CreatePriceTierRequestBody]] = None + yearly_unit_price: typing.Optional[int] = None + yearly_unit_price_decimal: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/create_entitlement_in_bundle_request_body_metric_period.py b/src/schematic/types/create_entitlement_in_bundle_request_body_metric_period.py new file mode 100644 index 0000000..275867f --- /dev/null +++ b/src/schematic/types/create_entitlement_in_bundle_request_body_metric_period.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateEntitlementInBundleRequestBodyMetricPeriod = typing.Union[ + typing.Literal["all_time", "current_month", "current_week", "current_day"], typing.Any +] diff --git a/src/schematic/types/create_entitlement_in_bundle_request_body_metric_period_month_reset.py b/src/schematic/types/create_entitlement_in_bundle_request_body_metric_period_month_reset.py new file mode 100644 index 0000000..4c54ab8 --- /dev/null +++ b/src/schematic/types/create_entitlement_in_bundle_request_body_metric_period_month_reset.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset = typing.Union[ + typing.Literal["first_of_month", "billing_cycle"], typing.Any +] diff --git a/src/schematic/types/create_event_request_body.py b/src/schematic/types/create_event_request_body.py index 94248f7..cb1a451 100644 --- a/src/schematic/types/create_event_request_body.py +++ b/src/schematic/types/create_event_request_body.py @@ -11,7 +11,11 @@ class CreateEventRequestBody(UniversalBaseModel): body: typing.Optional[EventBody] = None - event_type: EventType + event_type: EventType = pydantic.Field() + """ + Either 'identify' or 'track' + """ + sent_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ Optionally provide a timestamp at which the event was sent to Schematic diff --git a/src/schematic/types/create_plan_request_body.py b/src/schematic/types/create_plan_request_body.py new file mode 100644 index 0000000..c3df829 --- /dev/null +++ b/src/schematic/types/create_plan_request_body.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .plan_type import PlanType + + +class CreatePlanRequestBody(UniversalBaseModel): + description: str + icon: typing.Optional[str] = None + name: str + plan_type: PlanType + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/credit_company_grant_view.py b/src/schematic/types/credit_company_grant_view.py index c8b2307..fa921b6 100644 --- a/src/schematic/types/credit_company_grant_view.py +++ b/src/schematic/types/credit_company_grant_view.py @@ -9,6 +9,7 @@ from .billing_credit_expiry_unit import BillingCreditExpiryUnit from .billing_credit_grant_reason import BillingCreditGrantReason from .billing_credit_grant_zeroed_out_reason import BillingCreditGrantZeroedOutReason +from .billing_plan_credit_grant_reset_cadence import BillingPlanCreditGrantResetCadence from .billing_product_price_response_data import BillingProductPriceResponseData from .credit_transfer_view import CreditTransferView @@ -36,6 +37,8 @@ class CreditCompanyGrantView(UniversalBaseModel): quantity: int quantity_remaining: float quantity_used: float + renewal_enabled: bool + renewal_period: typing.Optional[BillingPlanCreditGrantResetCadence] = None singular_name: typing.Optional[str] = None source_label: str transfers: typing.Optional[typing.List[CreditTransferView]] = None diff --git a/src/schematic/types/credit_event_ledger_response_data.py b/src/schematic/types/credit_event_ledger_response_data.py new file mode 100644 index 0000000..3e86d6e --- /dev/null +++ b/src/schematic/types/credit_event_ledger_response_data.py @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_credit_expiry_type import BillingCreditExpiryType +from .billing_credit_expiry_unit import BillingCreditExpiryUnit +from .billing_credit_grant_reason import BillingCreditGrantReason +from .billing_credit_grant_zeroed_out_reason import BillingCreditGrantZeroedOutReason +from .billing_credit_ledger_response_data import BillingCreditLedgerResponseData +from .company_ledger_response_data import CompanyLedgerResponseData +from .credit_event_type import CreditEventType +from .feature_ledger_response_data import FeatureLedgerResponseData + + +class CreditEventLedgerResponseData(UniversalBaseModel): + amount: float + auto_topup_log_id: typing.Optional[str] = None + billing_credit_bundle_id: typing.Optional[str] = None + billing_credit_id: str + company: typing.Optional[CompanyLedgerResponseData] = None + company_id: str + credit: typing.Optional[BillingCreditLedgerResponseData] = None + credit_name: str + environment_id: str + event_at: dt.datetime + event_id: str + event_type: CreditEventType + expiry_type: typing.Optional[BillingCreditExpiryType] = None + expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None + expiry_unit_count: typing.Optional[int] = None + feature: typing.Optional[FeatureLedgerResponseData] = None + feature_id: typing.Optional[str] = None + from_grant_id: typing.Optional[str] = None + grant_expires_at: typing.Optional[dt.datetime] = None + grant_id: typing.Optional[str] = None + grant_quantity: typing.Optional[int] = None + grant_quantity_remaining: typing.Optional[float] = None + grant_reason: typing.Optional[BillingCreditGrantReason] = None + grant_valid_from: typing.Optional[dt.datetime] = None + plan_id: typing.Optional[str] = None + quantity_consumed: typing.Optional[float] = None + quantity_remaining_at_zero_out: typing.Optional[float] = None + source_id: int + to_grant_id: typing.Optional[str] = None + usage_event_id: typing.Optional[str] = None + zeroed_out_reason: typing.Optional[BillingCreditGrantZeroedOutReason] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/credit_event_type.py b/src/schematic/types/credit_event_type.py new file mode 100644 index 0000000..3886d63 --- /dev/null +++ b/src/schematic/types/credit_event_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreditEventType = typing.Union[typing.Literal["grant", "transfer", "usage", "zero_out"], typing.Any] diff --git a/src/schematic/types/credit_usage_response_data.py b/src/schematic/types/credit_usage_response_data.py deleted file mode 100644 index 3954e39..0000000 --- a/src/schematic/types/credit_usage_response_data.py +++ /dev/null @@ -1,31 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .credit_grant_detail import CreditGrantDetail - - -class CreditUsageResponseData(UniversalBaseModel): - credit_consumption_rate: typing.Optional[float] = None - credit_grant_counts: typing.Optional[typing.Dict[str, float]] = None - credit_grant_details: typing.List[CreditGrantDetail] - credit_remaining: typing.Optional[float] = None - credit_total: typing.Optional[float] = pydantic.Field(default=None) - """ - Deprecated: Use credit_remaining instead. - """ - - credit_type_icon: typing.Optional[str] = None - credit_type_name: typing.Optional[str] = None - credit_used: typing.Optional[float] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/schematic/types/credits_auto_topup_company_summary.py b/src/schematic/types/credits_auto_topup_company_summary.py new file mode 100644 index 0000000..9e410e6 --- /dev/null +++ b/src/schematic/types/credits_auto_topup_company_summary.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class CreditsAutoTopupCompanySummary(UniversalBaseModel): + id: str + name: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/credits_auto_topup_credit_summary.py b/src/schematic/types/credits_auto_topup_credit_summary.py new file mode 100644 index 0000000..f8601ef --- /dev/null +++ b/src/schematic/types/credits_auto_topup_credit_summary.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class CreditsAutoTopupCreditSummary(UniversalBaseModel): + id: str + name: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/credits_auto_topup_hard_failure.py b/src/schematic/types/credits_auto_topup_hard_failure.py new file mode 100644 index 0000000..42c19d1 --- /dev/null +++ b/src/schematic/types/credits_auto_topup_hard_failure.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .credits_auto_topup_company_summary import CreditsAutoTopupCompanySummary +from .credits_auto_topup_credit_summary import CreditsAutoTopupCreditSummary + + +class CreditsAutoTopupHardFailure(UniversalBaseModel): + company: typing.Optional[CreditsAutoTopupCompanySummary] = None + credit: typing.Optional[CreditsAutoTopupCreditSummary] = None + error_message: typing.Optional[str] = None + stripe_error_code: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/credits_auto_topup_retry_failure.py b/src/schematic/types/credits_auto_topup_retry_failure.py new file mode 100644 index 0000000..d2c36be --- /dev/null +++ b/src/schematic/types/credits_auto_topup_retry_failure.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .credits_auto_topup_company_summary import CreditsAutoTopupCompanySummary +from .credits_auto_topup_credit_summary import CreditsAutoTopupCreditSummary + + +class CreditsAutoTopupRetryFailure(UniversalBaseModel): + company: typing.Optional[CreditsAutoTopupCompanySummary] = None + consecutive_failures: int + credit: typing.Optional[CreditsAutoTopupCreditSummary] = None + last_error_message: typing.Optional[str] = None + stripe_error_code: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/data_event_payload.py b/src/schematic/types/data_event_payload.py new file mode 100644 index 0000000..e57d74c --- /dev/null +++ b/src/schematic/types/data_event_payload.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .event_type import EventType + + +class DataEventPayload(UniversalBaseModel): + api_key: str + body: typing.Optional[typing.Dict[str, typing.Any]] = None + sent_at: typing.Optional[dt.datetime] = None + type: EventType + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/datastream_company_plan.py b/src/schematic/types/datastream_company_plan.py new file mode 100644 index 0000000..ebcf065 --- /dev/null +++ b/src/schematic/types/datastream_company_plan.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DatastreamCompanyPlan(UniversalBaseModel): + id: str + name: str + trial_end_date: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/delete_billing_plan_credit_grant_request_body.py b/src/schematic/types/delete_billing_plan_credit_grant_request_body.py new file mode 100644 index 0000000..aaa39ee --- /dev/null +++ b/src/schematic/types/delete_billing_plan_credit_grant_request_body.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class DeleteBillingPlanCreditGrantRequestBody(UniversalBaseModel): + apply_to_existing: typing.Optional[bool] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/event_detail_response_data.py b/src/schematic/types/event_detail_response_data.py index c33b84f..e33657d 100644 --- a/src/schematic/types/event_detail_response_data.py +++ b/src/schematic/types/event_detail_response_data.py @@ -30,7 +30,7 @@ class EventDetailResponseData(UniversalBaseModel): status: EventStatus subtype: typing.Optional[str] = None type: EventType - updated_at: dt.datetime + updated_at: typing.Optional[dt.datetime] = None user: typing.Optional[PreviewObject] = None user_id: typing.Optional[str] = None diff --git a/src/schematic/types/event_response_data.py b/src/schematic/types/event_response_data.py index 33b6d1c..e0c533c 100644 --- a/src/schematic/types/event_response_data.py +++ b/src/schematic/types/event_response_data.py @@ -27,7 +27,7 @@ class EventResponseData(UniversalBaseModel): status: EventStatus subtype: typing.Optional[str] = None type: EventType - updated_at: dt.datetime + updated_at: typing.Optional[dt.datetime] = None user_id: typing.Optional[str] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/feature_company_response_data.py b/src/schematic/types/feature_company_response_data.py index 51b3da0..c7b97a8 100644 --- a/src/schematic/types/feature_company_response_data.py +++ b/src/schematic/types/feature_company_response_data.py @@ -31,7 +31,11 @@ class FeatureCompanyResponseData(UniversalBaseModel): The maximum amount of usage that is permitted; a null value indicates that unlimited usage is permitted or that this is a credit-based entitlement (use credit_remaining instead). """ - allocation_type: EntitlementValueType + allocation_type: EntitlementValueType = pydantic.Field() + """ + The type of allocation that is being used. + """ + company: typing.Optional[CompanyDetailResponseData] = None company_override: typing.Optional[CompanyOverrideResponseData] = None credit_consumption_rate: typing.Optional[float] = pydantic.Field(default=None) @@ -41,7 +45,11 @@ class FeatureCompanyResponseData(UniversalBaseModel): credit_grant_counts: typing.Optional[typing.Dict[str, float]] = None credit_grant_details: typing.Optional[typing.List[CreditGrantDetail]] = None - credit_grant_reason: typing.Optional[BillingCreditGrantReason] = None + credit_grant_reason: typing.Optional[BillingCreditGrantReason] = pydantic.Field(default=None) + """ + Reason for the credit grant + """ + credit_remaining: typing.Optional[float] = None credit_total: typing.Optional[float] = pydantic.Field(default=None) """ @@ -54,7 +62,11 @@ class FeatureCompanyResponseData(UniversalBaseModel): """ credit_usage: typing.Optional[CreditUsage] = None - credit_usage_aggregation: typing.Optional[CreditUsageAggregation] = None + credit_usage_aggregation: typing.Optional[CreditUsageAggregation] = pydantic.Field(default=None) + """ + Aggregated credit usage by time period (day, week, month, billing period) + """ + credit_used: typing.Optional[float] = None effective_limit: typing.Optional[int] = pydantic.Field(default=None) """ diff --git a/src/schematic/types/feature_company_user_response_data.py b/src/schematic/types/feature_company_user_response_data.py index 5bf9977..1be2f48 100644 --- a/src/schematic/types/feature_company_user_response_data.py +++ b/src/schematic/types/feature_company_user_response_data.py @@ -24,7 +24,11 @@ class FeatureCompanyUserResponseData(UniversalBaseModel): The maximum amount of usage that is permitted; a null value indicates that unlimited usage is permitted. """ - allocation_type: EntitlementValueType + allocation_type: EntitlementValueType = pydantic.Field() + """ + The type of allocation that is being used. + """ + company: typing.Optional[CompanyDetailResponseData] = None entitlement_id: str entitlement_type: EntitlementType diff --git a/src/schematic/types/feature_entitlement.py b/src/schematic/types/feature_entitlement.py new file mode 100644 index 0000000..459b343 --- /dev/null +++ b/src/schematic/types/feature_entitlement.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .entitlement_value_type import EntitlementValueType +from .feature_entitlement_metric_period import FeatureEntitlementMetricPeriod +from .feature_entitlement_month_reset import FeatureEntitlementMonthReset + + +class FeatureEntitlement(UniversalBaseModel): + allocation: typing.Optional[int] = pydantic.Field(default=None) + """ + If the company has a numeric entitlement for this feature, the allocated amount + """ + + credit_id: typing.Optional[str] = pydantic.Field(default=None) + """ + If the company has a credit-based entitlement for this feature, the ID of the credit + """ + + credit_remaining: typing.Optional[float] = pydantic.Field(default=None) + """ + If the company has a credit-based entitlement for this feature, the remaining credit amount + """ + + credit_total: typing.Optional[float] = pydantic.Field(default=None) + """ + If the company has a credit-based entitlement for this feature, the total credit amount + """ + + credit_used: typing.Optional[float] = pydantic.Field(default=None) + """ + If the company has a credit-based entitlement for this feature, the amount of credit used + """ + + event_name: typing.Optional[str] = pydantic.Field(default=None) + """ + If the feature is event-based, the name of the event tracked for usage + """ + + feature_id: str = pydantic.Field() + """ + The ID of the feature + """ + + feature_key: str = pydantic.Field() + """ + The key of the flag associated with the feature + """ + + metric_period: typing.Optional[FeatureEntitlementMetricPeriod] = pydantic.Field(default=None) + """ + For event-based feature entitlements, the period over which usage is tracked + """ + + metric_reset_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + For event-based feature entitlements, when the usage period will reset + """ + + month_reset: typing.Optional[FeatureEntitlementMonthReset] = pydantic.Field(default=None) + """ + For event-based feature entitlements that have a monthly period, whether that monthly reset is based on the calendar month or a billing cycle + """ + + soft_limit: typing.Optional[int] = pydantic.Field(default=None) + """ + For usage-based pricing, the soft limit for overage charges or the next tier boundary + """ + + usage: typing.Optional[int] = pydantic.Field(default=None) + """ + If the company has a numeric entitlement for this feature, the current usage amount + """ + + value_type: EntitlementValueType = pydantic.Field() + """ + The type of the entitlement value + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/feature_entitlement_metric_period.py b/src/schematic/types/feature_entitlement_metric_period.py new file mode 100644 index 0000000..65a0da5 --- /dev/null +++ b/src/schematic/types/feature_entitlement_metric_period.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +FeatureEntitlementMetricPeriod = typing.Union[ + typing.Literal["all_time", "current_day", "current_month", "current_week"], typing.Any +] diff --git a/src/schematic/types/feature_entitlement_month_reset.py b/src/schematic/types/feature_entitlement_month_reset.py new file mode 100644 index 0000000..c93005d --- /dev/null +++ b/src/schematic/types/feature_entitlement_month_reset.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +FeatureEntitlementMonthReset = typing.Union[typing.Literal["first_of_month", "billing_cycle"], typing.Any] diff --git a/src/schematic/types/feature_usage_data_response_data.py b/src/schematic/types/feature_usage_data_response_data.py deleted file mode 100644 index f040a5f..0000000 --- a/src/schematic/types/feature_usage_data_response_data.py +++ /dev/null @@ -1,38 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .billing_price_view import BillingPriceView -from .credit_usage_response_data import CreditUsageResponseData -from .feature_type import FeatureType - - -class FeatureUsageDataResponseData(UniversalBaseModel): - credit_type_id: typing.Optional[str] = None - credit_usage: typing.Optional[CreditUsageResponseData] = None - entitlement_source: str - entitlement_value_type: str - feature_id: str - feature_name: str - feature_type: FeatureType - hard_limit: str - has_access: bool - metric_reset_at: typing.Optional[dt.datetime] = None - monthly_usage_based_price: typing.Optional[BillingPriceView] = None - price_behavior: typing.Optional[str] = None - soft_limit: str - usage: str - value_numeric: typing.Optional[int] = None - yearly_usage_based_price: typing.Optional[BillingPriceView] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/schematic/types/feature_usage_legacy_response_data.py b/src/schematic/types/feature_usage_legacy_response_data.py new file mode 100644 index 0000000..a9853e9 --- /dev/null +++ b/src/schematic/types/feature_usage_legacy_response_data.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata +from .credit_usage import CreditUsage +from .feature_view import FeatureView + + +class FeatureUsageLegacyResponseData(UniversalBaseModel): + allocation: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="Allocation")] = None + credit_usage: typing_extensions.Annotated[typing.Optional[CreditUsage], FieldMetadata(alias="CreditUsage")] = None + entitlement: typing_extensions.Annotated[str, FieldMetadata(alias="Entitlement")] + feature: typing_extensions.Annotated[typing.Optional[FeatureView], FieldMetadata(alias="Feature")] = None + metric_reset_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="MetricResetAt")] = ( + None + ) + usage: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="Usage")] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/feature_usage_response_data.py b/src/schematic/types/feature_usage_response_data.py index c809511..6ffaf69 100644 --- a/src/schematic/types/feature_usage_response_data.py +++ b/src/schematic/types/feature_usage_response_data.py @@ -29,7 +29,11 @@ class FeatureUsageResponseData(UniversalBaseModel): The maximum amount of usage that is permitted; a null value indicates that unlimited usage is permitted or that this is a credit-based entitlement (use credit_remaining instead). """ - allocation_type: EntitlementValueType + allocation_type: EntitlementValueType = pydantic.Field() + """ + The type of allocation that is being used. + """ + company_override: typing.Optional[CompanyOverrideResponseData] = None credit_consumption_rate: typing.Optional[float] = pydantic.Field(default=None) """ @@ -38,7 +42,11 @@ class FeatureUsageResponseData(UniversalBaseModel): credit_grant_counts: typing.Optional[typing.Dict[str, float]] = None credit_grant_details: typing.Optional[typing.List[CreditGrantDetail]] = None - credit_grant_reason: typing.Optional[BillingCreditGrantReason] = None + credit_grant_reason: typing.Optional[BillingCreditGrantReason] = pydantic.Field(default=None) + """ + Reason for the credit grant + """ + credit_remaining: typing.Optional[float] = None credit_total: typing.Optional[float] = pydantic.Field(default=None) """ @@ -50,7 +58,11 @@ class FeatureUsageResponseData(UniversalBaseModel): Icon identifier for the credit type """ - credit_usage_aggregation: typing.Optional[CreditUsageAggregation] = None + credit_usage_aggregation: typing.Optional[CreditUsageAggregation] = pydantic.Field(default=None) + """ + Aggregated credit usage by time period (day, week, month, billing period) + """ + credit_used: typing.Optional[float] = None effective_limit: typing.Optional[int] = pydantic.Field(default=None) """ diff --git a/src/schematic/types/feature_usage_time_series_response_data.py b/src/schematic/types/feature_usage_time_series_response_data.py new file mode 100644 index 0000000..e918668 --- /dev/null +++ b/src/schematic/types/feature_usage_time_series_response_data.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .feature_type import FeatureType +from .limit_time_series_point_response_data import LimitTimeSeriesPointResponseData +from .usage_time_series_point_response_data import UsageTimeSeriesPointResponseData + + +class FeatureUsageTimeSeriesResponseData(UniversalBaseModel): + feature_id: str + feature_type: FeatureType + limits: typing.List[LimitTimeSeriesPointResponseData] + period_type: typing.Optional[str] = None + usage_points: typing.List[UsageTimeSeriesPointResponseData] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/feature_view.py b/src/schematic/types/feature_view.py new file mode 100644 index 0000000..fe7970d --- /dev/null +++ b/src/schematic/types/feature_view.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .entity_trait_definition_response_data import EntityTraitDefinitionResponseData +from .event_summary_response_data import EventSummaryResponseData +from .feature_lifecycle_phase import FeatureLifecyclePhase +from .feature_type import FeatureType +from .flag_view import FlagView +from .preview_object import PreviewObject + + +class FeatureView(UniversalBaseModel): + account_id: str + created_at: dt.datetime + description: str + event_subtype: typing.Optional[str] = None + event_summary: typing.Optional[EventSummaryResponseData] = None + feature_type: FeatureType + flags: typing.List[FlagView] + icon: str + id: str + lifecycle_phase: typing.Optional[FeatureLifecyclePhase] = None + maintainer_id: typing.Optional[str] = None + name: str + plans: typing.List[PreviewObject] + plural_name: typing.Optional[str] = None + singular_name: typing.Optional[str] = None + trait: typing.Optional[EntityTraitDefinitionResponseData] = None + trait_id: typing.Optional[str] = None + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/flag_view.py b/src/schematic/types/flag_view.py new file mode 100644 index 0000000..1d5488f --- /dev/null +++ b/src/schematic/types/flag_view.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .feature_response_data import FeatureResponseData +from .flag_type import FlagType +from .rule_view import RuleView + + +class FlagView(UniversalBaseModel): + account_id: str + created_at: dt.datetime + default_value: bool + description: str + feature: typing.Optional[FeatureResponseData] = None + feature_id: typing.Optional[str] = None + flag_type: FlagType = "boolean" + id: str + key: str + last_checked_at: typing.Optional[dt.datetime] = None + maintainer_id: typing.Optional[str] = None + name: str + rules: typing.List[RuleView] + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/invoice_request_body.py b/src/schematic/types/invoice_request_body.py index a77baf2..4138c65 100644 --- a/src/schematic/types/invoice_request_body.py +++ b/src/schematic/types/invoice_request_body.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .invoice_status import InvoiceStatus class InvoiceRequestBody(UniversalBaseModel): @@ -16,6 +17,7 @@ class InvoiceRequestBody(UniversalBaseModel): customer_external_id: str due_date: typing.Optional[dt.datetime] = None payment_method_external_id: typing.Optional[str] = None + status: typing.Optional[InvoiceStatus] = None subscription_external_id: typing.Optional[str] = None subtotal: int url: typing.Optional[str] = None diff --git a/src/schematic/types/invoice_response_data.py b/src/schematic/types/invoice_response_data.py index e158880..d64dd06 100644 --- a/src/schematic/types/invoice_response_data.py +++ b/src/schematic/types/invoice_response_data.py @@ -6,6 +6,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .billing_provider_type import BillingProviderType +from .invoice_status import InvoiceStatus class InvoiceResponseData(UniversalBaseModel): @@ -23,6 +24,7 @@ class InvoiceResponseData(UniversalBaseModel): id: str payment_method_external_id: typing.Optional[str] = None provider_type: BillingProviderType + status: typing.Optional[InvoiceStatus] = None subscription_external_id: typing.Optional[str] = None subtotal: int updated_at: dt.datetime diff --git a/src/schematic/types/invoice_status.py b/src/schematic/types/invoice_status.py new file mode 100644 index 0000000..922cf22 --- /dev/null +++ b/src/schematic/types/invoice_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +InvoiceStatus = typing.Union[typing.Literal["draft", "open", "paid", "uncollectible", "void"], typing.Any] diff --git a/src/schematic/types/limit_time_series_point_response_data.py b/src/schematic/types/limit_time_series_point_response_data.py new file mode 100644 index 0000000..c4f902f --- /dev/null +++ b/src/schematic/types/limit_time_series_point_response_data.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .entitlement_price_behavior import EntitlementPriceBehavior +from .entitlement_type import EntitlementType + + +class LimitTimeSeriesPointResponseData(UniversalBaseModel): + effective_at: dt.datetime + is_soft_limit: bool + limit_source: EntitlementType + limit_value: typing.Optional[int] = None + plan_id: typing.Optional[str] = None + price_behavior: typing.Optional[EntitlementPriceBehavior] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_bundle_action.py b/src/schematic/types/plan_bundle_action.py new file mode 100644 index 0000000..25c0452 --- /dev/null +++ b/src/schematic/types/plan_bundle_action.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PlanBundleAction = typing.Union[typing.Literal["create", "update", "delete"], typing.Any] diff --git a/src/schematic/types/plan_bundle_credit_grant_request_body.py b/src/schematic/types/plan_bundle_credit_grant_request_body.py new file mode 100644 index 0000000..ff8c68d --- /dev/null +++ b/src/schematic/types/plan_bundle_credit_grant_request_body.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .create_billing_plan_credit_grant_request_body import CreateBillingPlanCreditGrantRequestBody +from .delete_billing_plan_credit_grant_request_body import DeleteBillingPlanCreditGrantRequestBody +from .plan_bundle_action import PlanBundleAction +from .update_billing_plan_credit_grant_request_body import UpdateBillingPlanCreditGrantRequestBody + + +class PlanBundleCreditGrantRequestBody(UniversalBaseModel): + action: PlanBundleAction + create_req: typing.Optional[CreateBillingPlanCreditGrantRequestBody] = None + credit_grant_id: typing.Optional[str] = None + delete_req: typing.Optional[DeleteBillingPlanCreditGrantRequestBody] = None + update_req: typing.Optional[UpdateBillingPlanCreditGrantRequestBody] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_bundle_entitlement_request_body.py b/src/schematic/types/plan_bundle_entitlement_request_body.py new file mode 100644 index 0000000..deca683 --- /dev/null +++ b/src/schematic/types/plan_bundle_entitlement_request_body.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .create_entitlement_in_bundle_request_body import CreateEntitlementInBundleRequestBody +from .plan_bundle_action import PlanBundleAction + + +class PlanBundleEntitlementRequestBody(UniversalBaseModel): + action: PlanBundleAction + entitlement_id: typing.Optional[str] = None + req: typing.Optional[CreateEntitlementInBundleRequestBody] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_bundle_response_data.py b/src/schematic/types/plan_bundle_response_data.py new file mode 100644 index 0000000..1b06e35 --- /dev/null +++ b/src/schematic/types/plan_bundle_response_data.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_plan_credit_grant_response_data import BillingPlanCreditGrantResponseData +from .billing_product_plan_response_data import BillingProductPlanResponseData +from .plan_entitlement_response_data import PlanEntitlementResponseData +from .plan_response_data import PlanResponseData +from .plan_trait_response_data import PlanTraitResponseData + + +class PlanBundleResponseData(UniversalBaseModel): + billing_product: typing.Optional[BillingProductPlanResponseData] = None + credit_grants: typing.Optional[typing.List[BillingPlanCreditGrantResponseData]] = None + entitlements: typing.Optional[typing.List[PlanEntitlementResponseData]] = None + plan: typing.Optional[PlanResponseData] = None + traits: typing.Optional[typing.List[PlanTraitResponseData]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_change_action.py b/src/schematic/types/plan_change_action.py index 838aaa8..8b24aaa 100644 --- a/src/schematic/types/plan_change_action.py +++ b/src/schematic/types/plan_change_action.py @@ -12,6 +12,7 @@ "plan_billing_product_changed", "plan_deleted", "plan_trait_change", + "plan_version_migration", "quickstart", "subscription_change", ], diff --git a/src/schematic/types/plan_change_actor_type.py b/src/schematic/types/plan_change_actor_type.py deleted file mode 100644 index 60b1b31..0000000 --- a/src/schematic/types/plan_change_actor_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -PlanChangeActorType = typing.Union[ - typing.Literal["api_key", "app_user", "system", "temporary_access_token"], typing.Any -] diff --git a/src/schematic/types/plan_change_response_data.py b/src/schematic/types/plan_change_response_data.py index b22683a..b6d65d9 100644 --- a/src/schematic/types/plan_change_response_data.py +++ b/src/schematic/types/plan_change_response_data.py @@ -5,34 +5,53 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .api_key_request_list_response_data import ApiKeyRequestListResponseData +from .actor_type import ActorType from .api_key_response_data import ApiKeyResponseData +from .audit_log_list_response_data import AuditLogListResponseData from .company_response_data import CompanyResponseData from .plan_change_action import PlanChangeAction -from .plan_change_actor_type import PlanChangeActorType from .plan_change_base_plan_action import PlanChangeBasePlanAction from .plan_change_subscription_action import PlanChangeSubscriptionAction from .plan_snapshot_view import PlanSnapshotView +from .plan_version_snapshot_view import PlanVersionSnapshotView from .subscription_trait_update import SubscriptionTraitUpdate class PlanChangeResponseData(UniversalBaseModel): action: PlanChangeAction - actor_type: PlanChangeActorType + actor_type: ActorType add_ons_added: typing.List[PlanSnapshotView] add_ons_removed: typing.List[PlanSnapshotView] api_key: typing.Optional[ApiKeyResponseData] = None - api_key_request: typing.Optional[ApiKeyRequestListResponseData] = None + audit_log: typing.Optional[AuditLogListResponseData] = None base_plan: typing.Optional[PlanSnapshotView] = None - base_plan_action: typing.Optional[PlanChangeBasePlanAction] = None + base_plan_action: typing.Optional[PlanChangeBasePlanAction] = pydantic.Field(default=None) + """ + Any special behavior that affected the assignment of the base plan during this change. + """ + + base_plan_version: typing.Optional[PlanVersionSnapshotView] = pydantic.Field(default=None) + """ + The plan version that was assigned during this change. + """ + company: typing.Optional[CompanyResponseData] = None company_id: str created_at: dt.datetime environment_id: str id: str previous_base_plan: typing.Optional[PlanSnapshotView] = None + previous_base_plan_version: typing.Optional[PlanVersionSnapshotView] = pydantic.Field(default=None) + """ + The plan version of the previous base plan before this change. + """ + request_id: typing.Optional[str] = None - subscription_change_action: typing.Optional[PlanChangeSubscriptionAction] = None + subscription_change_action: typing.Optional[PlanChangeSubscriptionAction] = pydantic.Field(default=None) + """ + If a subscription was changed as a part of this plan change, indicates the type of change that was made. + """ + traits_updated: typing.List[SubscriptionTraitUpdate] = pydantic.Field() """ Any traits were updated as part of this plan change (via pay-in-advance entitlements). diff --git a/src/schematic/types/plan_change_subscription_action.py b/src/schematic/types/plan_change_subscription_action.py index 93376c7..001d9e4 100644 --- a/src/schematic/types/plan_change_subscription_action.py +++ b/src/schematic/types/plan_change_subscription_action.py @@ -3,5 +3,6 @@ import typing PlanChangeSubscriptionAction = typing.Union[ - typing.Literal["downgrade", "invalid", "subscribe", "unsubscribe", "upgrade", "upgrade_trial"], typing.Any + typing.Literal["adjustment", "downgrade", "invalid", "subscribe", "unsubscribe", "upgrade", "upgrade_trial"], + typing.Any, ] diff --git a/src/schematic/types/plan_credit_grant_view.py b/src/schematic/types/plan_credit_grant_view.py index 19b0584..19ce562 100644 --- a/src/schematic/types/plan_credit_grant_view.py +++ b/src/schematic/types/plan_credit_grant_view.py @@ -7,9 +7,11 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .billing_credit_expiry_type import BillingCreditExpiryType from .billing_credit_expiry_unit import BillingCreditExpiryUnit +from .billing_credit_view import BillingCreditView from .billing_plan_credit_grant_reset_cadence import BillingPlanCreditGrantResetCadence from .billing_plan_credit_grant_reset_start import BillingPlanCreditGrantResetStart from .billing_plan_credit_grant_reset_type import BillingPlanCreditGrantResetType +from .generic_preview_object import GenericPreviewObject class PlanCreditGrantView(UniversalBaseModel): @@ -21,22 +23,44 @@ class PlanCreditGrantView(UniversalBaseModel): billing_credit_auto_topup_expiry_unit_count: typing.Optional[int] = None billing_credit_auto_topup_threshold_percent: typing.Optional[int] = None created_at: dt.datetime + credit: typing.Optional[BillingCreditView] = None credit_amount: int - credit_description: str - credit_icon: typing.Optional[str] = None + credit_description: str = pydantic.Field() + """ + Deprecated field, will be removed in the future. Use Credit.Description instead. + """ + + credit_icon: typing.Optional[str] = pydantic.Field(default=None) + """ + Deprecated field, will be removed in the future. Use Credit.Icon instead. + """ + credit_id: str - credit_name: str + credit_name: str = pydantic.Field() + """ + Deprecated field, will be removed in the future. Use Credit.Name instead. + """ + expiry_type: typing.Optional[BillingCreditExpiryType] = None expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None expiry_unit_count: typing.Optional[int] = None id: str + plan: typing.Optional[GenericPreviewObject] = None plan_id: str - plan_name: str - plural_name: typing.Optional[str] = None - reset_cadence: BillingPlanCreditGrantResetCadence - reset_start: BillingPlanCreditGrantResetStart + plan_version_id: typing.Optional[str] = None + plural_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Deprecated field, will be removed in the future. Use Credit.PluralName instead. + """ + + reset_cadence: typing.Optional[BillingPlanCreditGrantResetCadence] = None + reset_start: typing.Optional[BillingPlanCreditGrantResetStart] = None reset_type: BillingPlanCreditGrantResetType - singular_name: typing.Optional[str] = None + singular_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Deprecated field, will be removed in the future. Use Credit.SingularName instead. + """ + updated_at: dt.datetime if IS_PYDANTIC_V2: diff --git a/src/schematic/types/plan_detail_response_data.py b/src/schematic/types/plan_detail_response_data.py index 9524bf8..401e177 100644 --- a/src/schematic/types/plan_detail_response_data.py +++ b/src/schematic/types/plan_detail_response_data.py @@ -12,9 +12,11 @@ from .feature_detail_response_data import FeatureDetailResponseData from .plan_controlled_by_type import PlanControlledByType from .plan_type import PlanType +from .plan_version_response_data import PlanVersionResponseData class PlanDetailResponseData(UniversalBaseModel): + active_version: typing.Optional[PlanVersionResponseData] = None audience_type: typing.Optional[str] = None billing_product: typing.Optional[BillingProductDetailResponseData] = None charge_type: ChargeType @@ -22,6 +24,7 @@ class PlanDetailResponseData(UniversalBaseModel): controlled_by: PlanControlledByType created_at: dt.datetime description: str + draft_version: typing.Optional[PlanVersionResponseData] = None features: typing.List[FeatureDetailResponseData] icon: str id: str @@ -35,6 +38,7 @@ class PlanDetailResponseData(UniversalBaseModel): plan_type: PlanType trial_days: typing.Optional[int] = None updated_at: dt.datetime + versions: typing.List[PlanVersionResponseData] yearly_price: typing.Optional[BillingPriceResponseData] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/plan_group_detail_response_data.py b/src/schematic/types/plan_group_detail_response_data.py index e530a53..bd37fd7 100644 --- a/src/schematic/types/plan_group_detail_response_data.py +++ b/src/schematic/types/plan_group_detail_response_data.py @@ -37,6 +37,8 @@ class PlanGroupDetailResponseData(UniversalBaseModel): prevent_self_service_downgrade_button_text: typing.Optional[str] = None prevent_self_service_downgrade_url: typing.Optional[str] = None proration_behavior: str + scheduled_downgrade_behavior: typing.Optional[str] = None + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = None show_as_monthly_prices: bool show_credits: bool show_period_toggle: bool diff --git a/src/schematic/types/plan_group_plan_detail_response_data.py b/src/schematic/types/plan_group_plan_detail_response_data.py index edda4cd..f17b935 100644 --- a/src/schematic/types/plan_group_plan_detail_response_data.py +++ b/src/schematic/types/plan_group_plan_detail_response_data.py @@ -14,9 +14,11 @@ from .plan_controlled_by_type import PlanControlledByType from .plan_entitlement_response_data import PlanEntitlementResponseData from .plan_type import PlanType +from .plan_version_response_data import PlanVersionResponseData class PlanGroupPlanDetailResponseData(UniversalBaseModel): + active_version: typing.Optional[PlanVersionResponseData] = None audience_type: typing.Optional[str] = None billing_product: typing.Optional[BillingProductDetailResponseData] = None charge_type: ChargeType @@ -26,6 +28,7 @@ class PlanGroupPlanDetailResponseData(UniversalBaseModel): created_at: dt.datetime custom_plan_config: typing.Optional[CustomPlanViewConfigResponseData] = None description: str + draft_version: typing.Optional[PlanVersionResponseData] = None entitlements: typing.List[PlanEntitlementResponseData] features: typing.List[FeatureDetailResponseData] icon: str @@ -41,6 +44,7 @@ class PlanGroupPlanDetailResponseData(UniversalBaseModel): plan_type: PlanType trial_days: typing.Optional[int] = None updated_at: dt.datetime + versions: typing.List[PlanVersionResponseData] yearly_price: typing.Optional[BillingPriceResponseData] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/plan_group_response_data.py b/src/schematic/types/plan_group_response_data.py index d34b508..31ed9c4 100644 --- a/src/schematic/types/plan_group_response_data.py +++ b/src/schematic/types/plan_group_response_data.py @@ -27,6 +27,8 @@ class PlanGroupResponseData(UniversalBaseModel): prevent_self_service_downgrade_button_text: typing.Optional[str] = None prevent_self_service_downgrade_url: typing.Optional[str] = None proration_behavior: str + scheduled_downgrade_behavior: typing.Optional[str] = None + scheduled_downgrade_prevent_when_over_limit: typing.Optional[bool] = None show_as_monthly_prices: bool show_credits: bool show_period_toggle: bool diff --git a/src/schematic/types/plan_version_company_migration_response_data.py b/src/schematic/types/plan_version_company_migration_response_data.py new file mode 100644 index 0000000..be7e8cf --- /dev/null +++ b/src/schematic/types/plan_version_company_migration_response_data.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .plan_version_company_migration_status import PlanVersionCompanyMigrationStatus + + +class PlanVersionCompanyMigrationResponseData(UniversalBaseModel): + company_id: str + company_name: str + completed_at: typing.Optional[dt.datetime] = None + created_at: dt.datetime + error: typing.Optional[str] = None + id: str + migration_id: str + plan_version_id_from: typing.Optional[str] = None + started_at: typing.Optional[dt.datetime] = None + status: PlanVersionCompanyMigrationStatus + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_version_company_migration_status.py b/src/schematic/types/plan_version_company_migration_status.py new file mode 100644 index 0000000..4984db4 --- /dev/null +++ b/src/schematic/types/plan_version_company_migration_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PlanVersionCompanyMigrationStatus = typing.Union[ + typing.Literal["completed", "failed", "in_progress", "pending", "skipped"], typing.Any +] diff --git a/src/schematic/types/plan_version_migration_response_data.py b/src/schematic/types/plan_version_migration_response_data.py new file mode 100644 index 0000000..94a7d93 --- /dev/null +++ b/src/schematic/types/plan_version_migration_response_data.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .plan_version_migration_status import PlanVersionMigrationStatus +from .plan_version_migration_strategy import PlanVersionMigrationStrategy + + +class PlanVersionMigrationResponseData(UniversalBaseModel): + completed_at: typing.Optional[dt.datetime] = None + completed_companies: int + created_at: dt.datetime + error: typing.Optional[str] = None + failed_companies: int + id: str + plan_id: str + plan_version_id_from: typing.Optional[str] = None + plan_version_id_to: str + skipped_companies: int + started_at: typing.Optional[dt.datetime] = None + status: PlanVersionMigrationStatus + strategy: PlanVersionMigrationStrategy + total_companies: int + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_version_migration_status.py b/src/schematic/types/plan_version_migration_status.py new file mode 100644 index 0000000..68d1d3e --- /dev/null +++ b/src/schematic/types/plan_version_migration_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PlanVersionMigrationStatus = typing.Union[typing.Literal["completed", "failed", "in_progress", "pending"], typing.Any] diff --git a/src/schematic/types/plan_version_migration_strategy.py b/src/schematic/types/plan_version_migration_strategy.py new file mode 100644 index 0000000..8d70b32 --- /dev/null +++ b/src/schematic/types/plan_version_migration_strategy.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PlanVersionMigrationStrategy = typing.Union[typing.Literal["immediate", "leave"], typing.Any] diff --git a/src/schematic/types/plan_version_response_data.py b/src/schematic/types/plan_version_response_data.py new file mode 100644 index 0000000..7577d5d --- /dev/null +++ b/src/schematic/types/plan_version_response_data.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .plan_type import PlanType +from .plan_version_status import PlanVersionStatus + + +class PlanVersionResponseData(UniversalBaseModel): + created_at: dt.datetime + description: str + environment_id: str + icon: str + id: str + name: str + original_plan_id: typing.Optional[str] = None + plan_type: PlanType + status: PlanVersionStatus + updated_at: dt.datetime + version: int + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_version_snapshot_view.py b/src/schematic/types/plan_version_snapshot_view.py new file mode 100644 index 0000000..3a81672 --- /dev/null +++ b/src/schematic/types/plan_version_snapshot_view.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class PlanVersionSnapshotView(UniversalBaseModel): + id: str + name: str + version: int + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_version_status.py b/src/schematic/types/plan_version_status.py new file mode 100644 index 0000000..4a514a8 --- /dev/null +++ b/src/schematic/types/plan_version_status.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PlanVersionStatus = typing.Union[typing.Literal["published", "draft", "archived"], typing.Any] diff --git a/src/schematic/types/plan_view_public_response_data.py b/src/schematic/types/plan_view_public_response_data.py new file mode 100644 index 0000000..caaf0a6 --- /dev/null +++ b/src/schematic/types/plan_view_public_response_data.py @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_price_response_data import BillingPriceResponseData +from .billing_product_detail_response_data import BillingProductDetailResponseData +from .charge_type import ChargeType +from .custom_plan_config import CustomPlanConfig +from .feature_detail_response_data import FeatureDetailResponseData +from .plan_controlled_by_type import PlanControlledByType +from .plan_credit_grant_view import PlanCreditGrantView +from .plan_entitlement_response_data import PlanEntitlementResponseData +from .plan_type import PlanType +from .plan_version_response_data import PlanVersionResponseData + + +class PlanViewPublicResponseData(UniversalBaseModel): + active_version: typing.Optional[PlanVersionResponseData] = None + audience_type: typing.Optional[str] = None + billing_product: typing.Optional[BillingProductDetailResponseData] = None + charge_type: ChargeType + company_count: int + compatible_plan_ids: typing.List[str] + controlled_by: PlanControlledByType + created_at: dt.datetime + custom: bool + custom_plan_config: typing.Optional[CustomPlanConfig] = None + description: str + draft_version: typing.Optional[PlanVersionResponseData] = None + entitlements: typing.List[PlanEntitlementResponseData] + features: typing.List[FeatureDetailResponseData] + icon: str + id: str + included_credit_grants: typing.List[PlanCreditGrantView] + is_custom: bool + is_default: bool + is_free: bool + is_trialable: bool + monthly_price: typing.Optional[BillingPriceResponseData] = None + name: str + one_time_price: typing.Optional[BillingPriceResponseData] = None + plan_type: PlanType + trial_days: typing.Optional[int] = None + updated_at: dt.datetime + versions: typing.List[PlanVersionResponseData] + yearly_price: typing.Optional[BillingPriceResponseData] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/preview_subscription_change_response_data.py b/src/schematic/types/preview_subscription_change_response_data.py index 5edee5f..1f596aa 100644 --- a/src/schematic/types/preview_subscription_change_response_data.py +++ b/src/schematic/types/preview_subscription_change_response_data.py @@ -13,12 +13,14 @@ class PreviewSubscriptionChangeResponseData(UniversalBaseModel): amount_off: int due_now: int finance: typing.Optional[PreviewSubscriptionFinanceResponseData] = None + is_scheduled_downgrade: bool new_charges: int payment_method_required: bool percent_off: float period_start: dt.datetime promo_code_applied: bool proration: int + scheduled_change_time: typing.Optional[dt.datetime] = None trial_end: typing.Optional[dt.datetime] = None usage_violations: typing.List[FeatureUsageResponseData] diff --git a/src/schematic/types/public_plans_response_data.py b/src/schematic/types/public_plans_response_data.py new file mode 100644 index 0000000..a783873 --- /dev/null +++ b/src/schematic/types/public_plans_response_data.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .compatible_plans import CompatiblePlans +from .component_capabilities import ComponentCapabilities +from .component_display_settings import ComponentDisplaySettings +from .plan_view_public_response_data import PlanViewPublicResponseData + + +class PublicPlansResponseData(UniversalBaseModel): + active_add_ons: typing.List[PlanViewPublicResponseData] + active_plans: typing.List[PlanViewPublicResponseData] + add_on_compatibilities: typing.List[CompatiblePlans] + capabilities: typing.Optional[ComponentCapabilities] = None + display_settings: ComponentDisplaySettings + show_as_monthly_prices: bool + show_credits: bool + show_period_toggle: bool + show_zero_price_as_free: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/raw_event_response_data.py b/src/schematic/types/raw_event_response_data.py index 4ffb30a..878ac4b 100644 --- a/src/schematic/types/raw_event_response_data.py +++ b/src/schematic/types/raw_event_response_data.py @@ -10,7 +10,7 @@ class RawEventResponseData(UniversalBaseModel): captured_at: dt.datetime event_id: typing.Optional[str] = None - remote_addr: str + remote_addr: typing.Optional[str] = None remote_ip: str user_agent: str diff --git a/src/schematic/types/rule_view.py b/src/schematic/types/rule_view.py new file mode 100644 index 0000000..dc6166d --- /dev/null +++ b/src/schematic/types/rule_view.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .condition_group_view import ConditionGroupView +from .condition_view import ConditionView + + +class RuleView(UniversalBaseModel): + account_id: str + condition_groups: typing.List[ConditionGroupView] + conditions: typing.List[ConditionView] + created_at: dt.datetime + environment_id: str + flag_id: typing.Optional[str] = None + id: str + name: str + plan_version_id: typing.Optional[str] = None + priority: int + rule_type: str + updated_at: dt.datetime + value: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/rules_engine_schema_version.py b/src/schematic/types/rules_engine_schema_version.py index ac884bc..4465a0b 100644 --- a/src/schematic/types/rules_engine_schema_version.py +++ b/src/schematic/types/rules_engine_schema_version.py @@ -2,4 +2,4 @@ import typing -RulesEngineSchemaVersion = typing.Union[typing.Literal["549e6fea", "placeholder-for-fern-compatibility"], typing.Any] +RulesEngineSchemaVersion = typing.Union[typing.Literal["v0f048dd3", "placeholder-for-fern-compatibility"], typing.Any] diff --git a/src/schematic/types/rulesengine_check_flag_result.py b/src/schematic/types/rulesengine_check_flag_result.py index 134ef16..4c14864 100644 --- a/src/schematic/types/rulesengine_check_flag_result.py +++ b/src/schematic/types/rulesengine_check_flag_result.py @@ -7,10 +7,12 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .rulesengine_check_flag_result_feature_usage_period import RulesengineCheckFlagResultFeatureUsagePeriod from .rulesengine_check_flag_result_rule_type import RulesengineCheckFlagResultRuleType +from .rulesengine_feature_entitlement import RulesengineFeatureEntitlement class RulesengineCheckFlagResult(UniversalBaseModel): company_id: typing.Optional[str] = None + entitlement: typing.Optional[RulesengineFeatureEntitlement] = None err: typing.Optional[str] = None feature_allocation: typing.Optional[int] = None feature_usage: typing.Optional[int] = None diff --git a/src/schematic/types/rulesengine_company.py b/src/schematic/types/rulesengine_company.py index e56b20c..44a5366 100644 --- a/src/schematic/types/rulesengine_company.py +++ b/src/schematic/types/rulesengine_company.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .rulesengine_company_metric import RulesengineCompanyMetric +from .rulesengine_feature_entitlement import RulesengineFeatureEntitlement from .rulesengine_rule import RulesengineRule from .rulesengine_subscription import RulesengineSubscription from .rulesengine_trait import RulesengineTrait @@ -15,12 +16,13 @@ class RulesengineCompany(UniversalBaseModel): base_plan_id: typing.Optional[str] = None billing_product_ids: typing.List[str] credit_balances: typing.Dict[str, float] - crm_product_ids: typing.List[str] + entitlements: typing.Optional[typing.List[RulesengineFeatureEntitlement]] = None environment_id: str id: str keys: typing.Dict[str, str] metrics: typing.List[RulesengineCompanyMetric] plan_ids: typing.List[str] + plan_version_ids: typing.List[str] rules: typing.List[RulesengineRule] subscription: typing.Optional[RulesengineSubscription] = None traits: typing.List[RulesengineTrait] diff --git a/src/schematic/types/rulesengine_condition_condition_type.py b/src/schematic/types/rulesengine_condition_condition_type.py index b7db02e..89ecc65 100644 --- a/src/schematic/types/rulesengine_condition_condition_type.py +++ b/src/schematic/types/rulesengine_condition_condition_type.py @@ -4,7 +4,7 @@ RulesengineConditionConditionType = typing.Union[ typing.Literal[ - "base_plan", "billing_product", "company", "credit", "crm_product", "metric", "plan", "trait", "user" + "base_plan", "billing_product", "company", "credit", "metric", "plan", "plan_version", "trait", "user" ], typing.Any, ] diff --git a/src/schematic/types/rulesengine_entitlement_value_type.py b/src/schematic/types/rulesengine_entitlement_value_type.py new file mode 100644 index 0000000..ce0e790 --- /dev/null +++ b/src/schematic/types/rulesengine_entitlement_value_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RulesengineEntitlementValueType = typing.Union[ + typing.Literal["boolean", "credit", "numeric", "trait", "unknown", "unlimited"], typing.Any +] diff --git a/src/schematic/types/rulesengine_feature_entitlement.py b/src/schematic/types/rulesengine_feature_entitlement.py new file mode 100644 index 0000000..04b0b1a --- /dev/null +++ b/src/schematic/types/rulesengine_feature_entitlement.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .rulesengine_entitlement_value_type import RulesengineEntitlementValueType +from .rulesengine_feature_entitlement_metric_period import RulesengineFeatureEntitlementMetricPeriod +from .rulesengine_feature_entitlement_month_reset import RulesengineFeatureEntitlementMonthReset + + +class RulesengineFeatureEntitlement(UniversalBaseModel): + allocation: typing.Optional[int] = pydantic.Field(default=None) + """ + If the company has a numeric entitlement for this feature, the allocated amount + """ + + credit_id: typing.Optional[str] = pydantic.Field(default=None) + """ + If the company has a credit-based entitlement for this feature, the ID of the credit + """ + + credit_remaining: typing.Optional[float] = pydantic.Field(default=None) + """ + If the company has a credit-based entitlement for this feature, the remaining credit amount + """ + + credit_total: typing.Optional[float] = pydantic.Field(default=None) + """ + If the company has a credit-based entitlement for this feature, the total credit amount + """ + + credit_used: typing.Optional[float] = pydantic.Field(default=None) + """ + If the company has a credit-based entitlement for this feature, the amount of credit used + """ + + event_name: typing.Optional[str] = pydantic.Field(default=None) + """ + If the feature is event-based, the name of the event tracked for usage + """ + + feature_id: str = pydantic.Field() + """ + The ID of the feature + """ + + feature_key: str = pydantic.Field() + """ + The key of the flag associated with the feature + """ + + metric_period: typing.Optional[RulesengineFeatureEntitlementMetricPeriod] = pydantic.Field(default=None) + """ + For event-based feature entitlements, the period over which usage is tracked + """ + + metric_reset_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + For event-based feature entitlements, when the usage period will reset + """ + + month_reset: typing.Optional[RulesengineFeatureEntitlementMonthReset] = pydantic.Field(default=None) + """ + For event-based feature entitlements that have a monthly period, whether that monthly reset is based on the calendar month or a billing cycle + """ + + soft_limit: typing.Optional[int] = pydantic.Field(default=None) + """ + For usage-based pricing, the soft limit for overage charges or the next tier boundary + """ + + usage: typing.Optional[int] = pydantic.Field(default=None) + """ + If the company has a numeric entitlement for this feature, the current usage amount + """ + + value_type: RulesengineEntitlementValueType = pydantic.Field() + """ + The type of the entitlement value + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/rulesengine_feature_entitlement_metric_period.py b/src/schematic/types/rulesengine_feature_entitlement_metric_period.py new file mode 100644 index 0000000..2d1cf66 --- /dev/null +++ b/src/schematic/types/rulesengine_feature_entitlement_metric_period.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RulesengineFeatureEntitlementMetricPeriod = typing.Union[ + typing.Literal["all_time", "current_day", "current_month", "current_week"], typing.Any +] diff --git a/src/schematic/types/rulesengine_feature_entitlement_month_reset.py b/src/schematic/types/rulesengine_feature_entitlement_month_reset.py new file mode 100644 index 0000000..63cb499 --- /dev/null +++ b/src/schematic/types/rulesengine_feature_entitlement_month_reset.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RulesengineFeatureEntitlementMonthReset = typing.Union[typing.Literal["first_of_month", "billing_cycle"], typing.Any] diff --git a/src/schematic/types/scheduled_checkout_response_data.py b/src/schematic/types/scheduled_checkout_response_data.py new file mode 100644 index 0000000..6034b41 --- /dev/null +++ b/src/schematic/types/scheduled_checkout_response_data.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .scheduled_checkout_status import ScheduledCheckoutStatus + + +class ScheduledCheckoutResponseData(UniversalBaseModel): + actor_type: str + company_id: str + completed_at: typing.Optional[dt.datetime] = None + created_at: dt.datetime + error_message: typing.Optional[str] = None + execute_after: dt.datetime + from_plan_id: str + id: str + scheduled_interval: typing.Optional[str] = None + scheduled_price: typing.Optional[int] = None + started_at: typing.Optional[dt.datetime] = None + status: ScheduledCheckoutStatus + to_plan_id: str + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/scheduled_checkout_status.py b/src/schematic/types/scheduled_checkout_status.py new file mode 100644 index 0000000..da3d10f --- /dev/null +++ b/src/schematic/types/scheduled_checkout_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ScheduledCheckoutStatus = typing.Union[ + typing.Literal["cancelled", "error", "executing", "pending", "success"], typing.Any +] diff --git a/src/schematic/types/scheduled_downgrade_config_behavior.py b/src/schematic/types/scheduled_downgrade_config_behavior.py new file mode 100644 index 0000000..6b54b33 --- /dev/null +++ b/src/schematic/types/scheduled_downgrade_config_behavior.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ScheduledDowngradeConfigBehavior = typing.Union[typing.Literal["end_of_billing_period", "none"], typing.Any] diff --git a/src/schematic/types/scheduled_downgrade_response_data.py b/src/schematic/types/scheduled_downgrade_response_data.py new file mode 100644 index 0000000..eb5a9ac --- /dev/null +++ b/src/schematic/types/scheduled_downgrade_response_data.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ScheduledDowngradeResponseData(UniversalBaseModel): + currency: str + effective_after: dt.datetime + from_plan_id: str + from_plan_name: str + from_subscription_price: int + id: str + interval: str + scheduled_interval: typing.Optional[str] = None + scheduled_price: typing.Optional[int] = None + to_plan_id: str + to_plan_name: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/time_series_granularity.py b/src/schematic/types/time_series_granularity.py new file mode 100644 index 0000000..bc48ed7 --- /dev/null +++ b/src/schematic/types/time_series_granularity.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TimeSeriesGranularity = typing.Union[typing.Literal["daily", "hourly", "monthly", "weekly"], typing.Any] diff --git a/src/schematic/types/update_billing_plan_credit_grant_request_body.py b/src/schematic/types/update_billing_plan_credit_grant_request_body.py new file mode 100644 index 0000000..5aae4e0 --- /dev/null +++ b/src/schematic/types/update_billing_plan_credit_grant_request_body.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_credit_expiry_type import BillingCreditExpiryType +from .billing_credit_expiry_unit import BillingCreditExpiryUnit +from .billing_plan_credit_grant_reset_cadence import BillingPlanCreditGrantResetCadence +from .billing_plan_credit_grant_reset_start import BillingPlanCreditGrantResetStart +from .billing_plan_credit_grant_reset_type import BillingPlanCreditGrantResetType +from .credit_auto_topup_amount_type import CreditAutoTopupAmountType + + +class UpdateBillingPlanCreditGrantRequestBody(UniversalBaseModel): + apply_to_existing: typing.Optional[bool] = None + auto_topup_amount: typing.Optional[int] = None + auto_topup_amount_type: typing.Optional[CreditAutoTopupAmountType] = None + auto_topup_enabled: typing.Optional[bool] = None + auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = None + auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None + auto_topup_expiry_unit_count: typing.Optional[int] = None + auto_topup_threshold_percent: typing.Optional[int] = None + credit_amount: typing.Optional[int] = None + expiry_type: typing.Optional[BillingCreditExpiryType] = None + expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None + expiry_unit_count: typing.Optional[int] = None + reset_cadence: BillingPlanCreditGrantResetCadence + reset_start: BillingPlanCreditGrantResetStart + reset_type: typing.Optional[BillingPlanCreditGrantResetType] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/update_plan_request_body.py b/src/schematic/types/update_plan_request_body.py new file mode 100644 index 0000000..309c940 --- /dev/null +++ b/src/schematic/types/update_plan_request_body.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class UpdatePlanRequestBody(UniversalBaseModel): + description: typing.Optional[str] = None + icon: typing.Optional[str] = None + name: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/upsert_billing_product_request_body.py b/src/schematic/types/upsert_billing_product_request_body.py new file mode 100644 index 0000000..e6c91fe --- /dev/null +++ b/src/schematic/types/upsert_billing_product_request_body.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .charge_type import ChargeType + + +class UpsertBillingProductRequestBody(UniversalBaseModel): + billing_product_id: typing.Optional[str] = None + charge_type: ChargeType + currency: typing.Optional[str] = None + is_trialable: bool + monthly_price: typing.Optional[int] = None + monthly_price_id: typing.Optional[str] = None + one_time_price: typing.Optional[int] = None + one_time_price_id: typing.Optional[str] = None + trial_days: typing.Optional[int] = None + yearly_price: typing.Optional[int] = None + yearly_price_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/upsert_company_request_body.py b/src/schematic/types/upsert_company_request_body.py index d2b8b06..4bd62aa 100644 --- a/src/schematic/types/upsert_company_request_body.py +++ b/src/schematic/types/upsert_company_request_body.py @@ -20,6 +20,7 @@ class UpsertCompanyRequestBody(UniversalBaseModel): last_seen_at: typing.Optional[dt.datetime] = None name: typing.Optional[str] = None + prevent_key_remap: typing.Optional[bool] = None traits: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ A map of trait names to trait values diff --git a/src/schematic/types/usage_time_series_point_response_data.py b/src/schematic/types/usage_time_series_point_response_data.py new file mode 100644 index 0000000..573d3b6 --- /dev/null +++ b/src/schematic/types/usage_time_series_point_response_data.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class UsageTimeSeriesPointResponseData(UniversalBaseModel): + period_end: typing.Optional[dt.datetime] = None + period_start: typing.Optional[dt.datetime] = None + timestamp: dt.datetime + usage: int + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/web_feature_usage_webhook_output.py b/src/schematic/types/web_feature_usage_webhook_output.py new file mode 100644 index 0000000..1169b00 --- /dev/null +++ b/src/schematic/types/web_feature_usage_webhook_output.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata +from .company_detail_response_data import CompanyDetailResponseData +from .credit_usage import CreditUsage +from .feature_view import FeatureView + + +class WebFeatureUsageWebhookOutput(UniversalBaseModel): + allocation: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="Allocation")] = None + credit_usage: typing_extensions.Annotated[typing.Optional[CreditUsage], FieldMetadata(alias="CreditUsage")] = None + entitlement: typing_extensions.Annotated[str, FieldMetadata(alias="Entitlement")] + feature: typing_extensions.Annotated[typing.Optional[FeatureView], FieldMetadata(alias="Feature")] = None + metric_reset_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="MetricResetAt")] = ( + None + ) + usage: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="Usage")] = None + company: typing.Optional[CompanyDetailResponseData] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/webhook_request_type.py b/src/schematic/types/webhook_request_type.py index 40e81fa..b8ec45e 100644 --- a/src/schematic/types/webhook_request_type.py +++ b/src/schematic/types/webhook_request_type.py @@ -34,11 +34,14 @@ "plan.entitlement.deleted", "plan.entitlement.updated", "plan.updated", + "plan_version.deleted", "rule.deleted", "test.send", "user.created", "user.deleted", "user.updated", + "auto.topup.hard.failure", + "auto.topup.retry.exceeded", ], typing.Any, ] diff --git a/src/schematic/types/who_am_i_response_data.py b/src/schematic/types/who_am_i_response_data.py new file mode 100644 index 0000000..6fc2a83 --- /dev/null +++ b/src/schematic/types/who_am_i_response_data.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .actor_type import ActorType +from .environment_response_data import EnvironmentResponseData + + +class WhoAmIResponseData(UniversalBaseModel): + account_id: str + account_name: str + actor_type: ActorType + api_key_id: typing.Optional[str] = None + environment_id: typing.Optional[str] = None + environments: typing.List[EnvironmentResponseData] + stripe_user_id: typing.Optional[str] = None + user_id: typing.Optional[str] = None + user_name: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow