From 38595f2c8872487e2488989ac1340a323a2fd192 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:22:25 +0000 Subject: [PATCH] SDK regeneration --- poetry.lock | 90 +-- pyproject.toml | 2 +- src/schematic/__init__.py | 92 ++- src/schematic/accounts/client.py | 54 +- .../accounts/types/list_api_keys_response.py | 6 +- .../types/list_api_requests_response.py | 6 +- .../types/list_environments_response.py | 6 +- src/schematic/billing/__init__.py | 4 +- src/schematic/billing/client.py | 262 +++++++- src/schematic/billing/raw_client.py | 86 ++- src/schematic/billing/types/__init__.py | 6 +- ...cription_request_body_trial_end_setting.py | 5 + ...riptions_request_body_trial_end_setting.py | 5 - .../types/list_billing_products_response.py | 6 +- .../billing/types/list_coupons_response.py | 6 +- ...t_customers_with_subscriptions_response.py | 6 +- .../billing/types/list_invoices_response.py | 6 +- .../billing/types/list_meters_response.py | 6 +- .../types/list_payment_methods_response.py | 6 +- .../types/list_product_prices_response.py | 6 +- .../types/search_billing_prices_params.py | 16 + .../types/search_billing_prices_response.py | 6 +- src/schematic/checkout/__init__.py | 4 + src/schematic/checkout/client.py | 379 +++++++++++ src/schematic/checkout/raw_client.py | 583 ++++++++++++++++ src/schematic/checkout/types/__init__.py | 4 + .../types/checkout_internal_response.py | 4 +- .../checkout/types/manage_plan_response.py | 24 + .../types/preview_manage_plan_response.py | 24 + src/schematic/companies/__init__.py | 2 + src/schematic/companies/client.py | 366 ++++++++++- src/schematic/companies/raw_client.py | 253 ++++++- src/schematic/companies/types/__init__.py | 2 + ...nt_companies_for_advanced_filter_params.py | 7 +- ...et_active_company_subscription_response.py | 6 +- .../types/get_active_deals_response.py | 6 +- .../types/get_entity_trait_values_response.py | 6 +- ...st_companies_for_advanced_filter_params.py | 7 +- ..._companies_for_advanced_filter_response.py | 6 +- .../types/list_companies_response.py | 6 +- .../list_company_memberships_response.py | 6 +- .../list_entity_key_definitions_response.py | 6 +- .../list_entity_trait_definitions_response.py | 6 +- .../types/list_plan_traits_response.py | 6 +- .../companies/types/list_users_response.py | 6 +- .../types/update_plan_traits_bulk_response.py | 24 + src/schematic/components/client.py | 34 +- .../types/list_components_response.py | 6 +- src/schematic/core/client_wrapper.py | 4 +- src/schematic/credits/__init__.py | 30 + src/schematic/credits/client.py | 525 ++++++++++++++- src/schematic/credits/raw_client.py | 621 +++++++++++++++++- src/schematic/credits/types/__init__.py | 30 + .../types/count_credit_ledger_params.py | 39 ++ .../count_credit_ledger_request_period.py | 5 + .../types/count_credit_ledger_response.py | 25 + ...nt_credit_ledger_response_params_period.py | 5 + ...n_credit_grant_request_body_expiry_type.py | 8 + ...n_credit_grant_request_body_expiry_unit.py | 5 + ...an_credit_grant_request_body_reset_type.py | 5 + ...create_company_credit_grant_expiry_type.py | 8 + ...create_company_credit_grant_expiry_unit.py | 5 + ..._credit_bundle_request_body_expiry_type.py | 5 +- ..._credit_bundle_request_body_expiry_unit.py | 5 + .../get_enriched_credit_ledger_params.py | 39 ++ ...t_enriched_credit_ledger_request_period.py | 5 + .../get_enriched_credit_ledger_response.py | 25 + ...ed_credit_ledger_response_params_period.py | 7 + .../types/list_billing_credits_response.py | 6 +- ...ist_billing_plan_credit_grants_response.py | 6 +- .../types/list_company_grants_response.py | 6 +- .../types/list_credit_bundles_response.py | 6 +- .../types/list_grants_for_credit_response.py | 6 +- ...bundle_details_request_body_expiry_type.py | 3 +- ...bundle_details_request_body_expiry_unit.py | 5 + .../zero_out_grant_request_body_reason.py | 4 +- src/schematic/crm/client.py | 12 +- .../crm/types/list_crm_products_response.py | 6 +- src/schematic/dataexports/client.py | 30 + src/schematic/entitlements/client.py | 160 ++++- src/schematic/entitlements/raw_client.py | 32 + .../types/list_company_overrides_response.py | 6 +- .../types/list_feature_companies_response.py | 6 +- .../types/list_feature_usage_response.py | 6 +- .../types/list_feature_users_response.py | 6 +- .../types/list_plan_entitlements_response.py | 6 +- src/schematic/events/client.py | 30 +- .../types/get_event_summaries_response.py | 6 +- .../events/types/list_events_response.py | 6 +- src/schematic/features/client.py | 72 +- src/schematic/features/raw_client.py | 8 + .../features/types/count_features_params.py | 6 +- .../features/types/count_flags_params.py | 5 +- .../types/list_audience_companies_response.py | 6 +- .../types/list_audience_users_response.py | 6 +- .../features/types/list_features_params.py | 6 +- .../features/types/list_features_response.py | 6 +- .../features/types/list_flags_params.py | 5 +- .../features/types/list_flags_response.py | 6 +- src/schematic/plangroups/client.py | 240 +++++++ src/schematic/plangroups/raw_client.py | 208 ++++++ src/schematic/plans/__init__.py | 4 + src/schematic/plans/client.py | 213 +++++- src/schematic/plans/raw_client.py | 277 ++++++++ src/schematic/plans/types/__init__.py | 4 + .../plans/types/count_plans_params.py | 20 + .../plans/types/list_plan_issues_params.py | 23 + .../plans/types/list_plan_issues_response.py | 25 + .../plans/types/list_plans_params.py | 20 + .../plans/types/list_plans_response.py | 6 +- src/schematic/types/__init__.py | 48 ++ .../types/api_key_create_response_data.py | 4 - .../types/api_key_request_response_data.py | 4 - src/schematic/types/api_key_response_data.py | 4 - .../billing_credit_bundle_response_data.py | 1 + .../types/billing_credit_bundle_view.py | 1 + .../billing_credit_ledger_response_data.py | 24 + .../types/billing_customer_response_data.py | 4 - ...billing_plan_credit_grant_response_data.py | 7 + .../billing_product_detail_response_data.py | 6 +- ..._product_for_subscription_response_data.py | 2 + .../billing_product_plan_response_data.py | 4 - .../types/billing_product_pricing.py | 2 + .../types/billing_product_response_data.py | 6 +- .../types/billing_subscription_view.py | 4 - .../types/check_flag_response_data.py | 4 - .../types/check_flags_response_data.py | 4 - .../types/checkout_data_response_data.py | 4 - .../types/checkout_settings_response_data.py | 21 + src/schematic/types/checkout_subscription.py | 39 ++ .../types/company_detail_response_data.py | 2 + .../types/company_ledger_response_data.py | 21 + .../company_override_note_response_data.py | 25 + .../types/company_override_response_data.py | 2 + .../company_plan_detail_response_data.py | 2 + ...y_view_with_feature_usage_response_data.py | 2 + .../types/component_checkout_settings.py | 22 + .../types/component_hydrate_response_data.py | 5 + .../types/component_preview_response_data.py | 9 +- .../types/component_response_data.py | 4 - src/schematic/types/condition.py | 34 + src/schematic/types/condition_group.py | 20 + src/schematic/types/count_response.py | 5 +- .../types/credit_company_grant_view.py | 3 + src/schematic/types/credit_grant_detail.py | 24 + .../types/credit_grant_detail_grant_reason.py | 5 + ...dit_ledger_enriched_entry_response_data.py | 43 ++ src/schematic/types/credit_usage.py | 27 + .../types/credit_usage_response_data.py | 27 + src/schematic/types/crm_deal_response_data.py | 4 - .../types/crm_line_item_response_data.py | 4 - .../types/crm_product_response_data.py | 4 - .../types/data_export_response_data.py | 4 - .../types/environment_detail_response_data.py | 4 - .../types/environment_response_data.py | 4 - .../types/feature_company_response_data.py | 75 ++- ...mpany_response_data_credit_grant_reason.py | 5 + ...pany_user_response_data_allocation_type.py | 2 +- .../types/feature_ledger_response_data.py | 22 + .../types/feature_usage_data_response_data.py | 10 + .../types/feature_usage_response_data.py | 57 ++ ...usage_response_data_credit_grant_reason.py | 5 + ...ue_temporary_access_token_response_data.py | 4 - ...age_plan_preview_response_response_data.py | 20 + src/schematic/types/manage_plan_request.py | 30 + .../manage_plan_response_response_data.py | 21 + .../plan_audience_detail_response_data.py | 4 - src/schematic/types/plan_credit_grant_view.py | 4 + .../types/plan_detail_response_data.py | 2 + .../types/plan_entitlement_response_data.py | 1 + .../types/plan_group_detail_response_data.py | 22 +- .../plan_group_plan_detail_response_data.py | 2 + .../types/plan_group_response_data.py | 16 +- .../types/plan_issue_response_data.py | 22 + src/schematic/types/plan_selection.py | 20 + .../types/plan_trait_response_data.py | 4 - ...eview_subscription_change_response_data.py | 4 - ...view_subscription_finance_response_data.py | 3 + .../types/raw_event_batch_response_data.py | 4 - src/schematic/types/rule.py | 30 + .../types/rules_detail_response_data.py | 4 - src/schematic/types/segment_status_resp.py | 4 - src/schematic/types/trait_definition.py | 21 + .../update_plan_trait_trait_request_body.py | 20 + .../usage_based_entitlement_request_body.py | 1 + .../usage_based_entitlement_response_data.py | 1 + src/schematic/webhooks/client.py | 52 +- ...webhook_request_body_request_types_item.py | 2 + .../types/list_webhook_events_response.py | 6 +- .../webhooks/types/list_webhooks_response.py | 6 +- ...webhook_request_body_request_types_item.py | 2 + 191 files changed, 5844 insertions(+), 555 deletions(-) create mode 100644 src/schematic/billing/types/create_billing_subscription_request_body_trial_end_setting.py delete mode 100644 src/schematic/billing/types/create_billing_subscriptions_request_body_trial_end_setting.py create mode 100644 src/schematic/checkout/types/manage_plan_response.py create mode 100644 src/schematic/checkout/types/preview_manage_plan_response.py create mode 100644 src/schematic/companies/types/update_plan_traits_bulk_response.py create mode 100644 src/schematic/credits/types/count_credit_ledger_params.py create mode 100644 src/schematic/credits/types/count_credit_ledger_request_period.py create mode 100644 src/schematic/credits/types/count_credit_ledger_response.py create mode 100644 src/schematic/credits/types/count_credit_ledger_response_params_period.py create mode 100644 src/schematic/credits/types/create_billing_plan_credit_grant_request_body_expiry_type.py create mode 100644 src/schematic/credits/types/create_billing_plan_credit_grant_request_body_expiry_unit.py create mode 100644 src/schematic/credits/types/create_billing_plan_credit_grant_request_body_reset_type.py create mode 100644 src/schematic/credits/types/create_company_credit_grant_expiry_type.py create mode 100644 src/schematic/credits/types/create_company_credit_grant_expiry_unit.py create mode 100644 src/schematic/credits/types/create_credit_bundle_request_body_expiry_unit.py create mode 100644 src/schematic/credits/types/get_enriched_credit_ledger_params.py create mode 100644 src/schematic/credits/types/get_enriched_credit_ledger_request_period.py create mode 100644 src/schematic/credits/types/get_enriched_credit_ledger_response.py create mode 100644 src/schematic/credits/types/get_enriched_credit_ledger_response_params_period.py create mode 100644 src/schematic/credits/types/update_credit_bundle_details_request_body_expiry_unit.py create mode 100644 src/schematic/plans/types/list_plan_issues_params.py create mode 100644 src/schematic/plans/types/list_plan_issues_response.py create mode 100644 src/schematic/types/billing_credit_ledger_response_data.py create mode 100644 src/schematic/types/checkout_settings_response_data.py create mode 100644 src/schematic/types/checkout_subscription.py create mode 100644 src/schematic/types/company_ledger_response_data.py create mode 100644 src/schematic/types/company_override_note_response_data.py create mode 100644 src/schematic/types/component_checkout_settings.py create mode 100644 src/schematic/types/condition.py create mode 100644 src/schematic/types/condition_group.py create mode 100644 src/schematic/types/credit_grant_detail.py create mode 100644 src/schematic/types/credit_grant_detail_grant_reason.py create mode 100644 src/schematic/types/credit_ledger_enriched_entry_response_data.py create mode 100644 src/schematic/types/credit_usage.py create mode 100644 src/schematic/types/credit_usage_response_data.py create mode 100644 src/schematic/types/feature_company_response_data_credit_grant_reason.py create mode 100644 src/schematic/types/feature_ledger_response_data.py create mode 100644 src/schematic/types/feature_usage_response_data_credit_grant_reason.py create mode 100644 src/schematic/types/manage_plan_preview_response_response_data.py create mode 100644 src/schematic/types/manage_plan_request.py create mode 100644 src/schematic/types/manage_plan_response_response_data.py create mode 100644 src/schematic/types/plan_issue_response_data.py create mode 100644 src/schematic/types/plan_selection.py create mode 100644 src/schematic/types/rule.py create mode 100644 src/schematic/types/trait_definition.py create mode 100644 src/schematic/types/update_plan_trait_trait_request_body.py diff --git a/poetry.lock b/poetry.lock index 7f8488f..9747b6b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2025.8.3" +version = "2025.10.5" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ - {file = "certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5"}, - {file = "certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407"}, + {file = "certifi-2025.10.5-py3-none-any.whl", hash = "sha256:0f212c2744a9bb6de0c56639a6f68afe01ecd92d91f14ae897c4fe7bbeeef0de"}, + {file = "certifi-2025.10.5.tar.gz", hash = "sha256:47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43"}, ] [[package]] @@ -133,13 +133,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.10" +version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, + {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, + {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, ] [package.extras] @@ -483,43 +483,53 @@ files = [ [[package]] name = "tomli" -version = "2.2.1" +version = "2.3.0" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, - {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, - {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, - {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, - {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, - {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, - {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, - {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, - {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, - {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, + {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"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 360face..c0d9a81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "schematichq" [tool.poetry] name = "schematichq" -version = "1.1.0" +version = "1.1.1" description = "" readme = "README.md" authors = [] diff --git a/src/schematic/__init__.py b/src/schematic/__init__.py index a88ea6c..9e66e91 100644 --- a/src/schematic/__init__.py +++ b/src/schematic/__init__.py @@ -13,6 +13,7 @@ BillingCreditBundleResponseData, BillingCreditBundleView, BillingCreditGrantResponseData, + BillingCreditLedgerResponseData, BillingCreditResponseData, BillingCustomerResponseData, BillingCustomerSubscription, @@ -39,11 +40,15 @@ CheckFlagResponseData, CheckFlagsResponseData, CheckoutDataResponseData, + CheckoutSettingsResponseData, + CheckoutSubscription, CompanyCrmDealsResponseData, CompanyDetailResponseData, CompanyEventPeriodMetricsResponseData, + CompanyLedgerResponseData, CompanyMembershipDetailResponseData, CompanyMembershipResponseData, + CompanyOverrideNoteResponseData, CompanyOverrideResponseData, CompanyPlanDetailResponseData, CompanyPlanWithBillingSubView, @@ -53,9 +58,12 @@ CompatiblePlans, CompatiblePlansResponseData, ComponentCapabilities, + ComponentCheckoutSettings, ComponentHydrateResponseData, ComponentPreviewResponseData, ComponentResponseData, + Condition, + ConditionGroup, CountResponse, CouponRequestBody, CreateBillingPriceTierRequestBody, @@ -78,7 +86,12 @@ CreatePriceTierRequestBody, CreditBundlePurchaseResponseData, CreditCompanyGrantView, + CreditGrantDetail, + CreditGrantDetailGrantReason, + CreditLedgerEnrichedEntryResponseData, CreditTriggerConfig, + CreditUsage, + CreditUsageResponseData, CrmDealLineItem, CrmDealResponseData, CrmLineItemResponseData, @@ -109,14 +122,17 @@ EventSummaryResponseData, FeatureCompanyResponseData, FeatureCompanyResponseDataAllocationType, + FeatureCompanyResponseDataCreditGrantReason, FeatureCompanyUserResponseData, FeatureCompanyUserResponseDataAllocationType, FeatureDetailResponseData, + FeatureLedgerResponseData, FeatureResponseData, FeatureUsageDataResponseData, FeatureUsageDetailResponseData, FeatureUsageResponseData, FeatureUsageResponseDataAllocationType, + FeatureUsageResponseDataCreditGrantReason, FlagDetailResponseData, FlagResponseData, GenericPreviewObject, @@ -124,6 +140,9 @@ InvoiceResponseData, IssueTemporaryAccessTokenResponseData, KeysRequestBody, + ManagePlanPreviewResponseResponseData, + ManagePlanRequest, + ManagePlanResponseResponseData, MeterRequestBody, OrderedPlansInGroup, PaginationFilter, @@ -140,7 +159,9 @@ PlanGroupPlanDetailResponseData, PlanGroupPlanEntitlementsOrder, PlanGroupResponseData, + PlanIssueResponseData, PlanResponseData, + PlanSelection, PlanTraitResponseData, PreviewObject, PreviewObjectResponseData, @@ -150,6 +171,7 @@ QuickstartResp, RawEventBatchResponseData, RawEventResponseData, + Rule, RuleConditionDetailResponseData, RuleConditionGroupDetailResponseData, RuleConditionGroupResponseData, @@ -160,6 +182,7 @@ SegmentStatusResp, StripeEmbedInfo, TemporaryAccessTokenResponseData, + TraitDefinition, UpdateAddOnRequestBody, UpdateCreditBundleRequestBody, UpdateEntitlementReqCommon, @@ -167,6 +190,7 @@ UpdateEntitlementReqCommonMetricPeriodMonthReset, UpdateEntitlementReqCommonValueType, UpdatePayInAdvanceRequestBody, + UpdatePlanTraitTraitRequestBody, UpdateRuleRequestBody, UpsertCompanyRequestBody, UpsertTraitRequestBody, @@ -234,7 +258,7 @@ CreateBillingPriceRequestBodyBillingScheme, CreateBillingPriceRequestBodyTiersMode, CreateBillingPriceRequestBodyUsageType, - CreateBillingSubscriptionsRequestBodyTrialEndSetting, + CreateBillingSubscriptionRequestBodyTrialEndSetting, DeleteBillingProductResponse, DeleteProductPriceResponse, ListBillingProductsParams, @@ -273,7 +297,9 @@ from .checkout import ( CheckoutInternalResponse, GetCheckoutDataResponse, + ManagePlanResponse, PreviewCheckoutInternalResponse, + PreviewManagePlanResponse, UpdateCustomerSubscriptionTrialEndResponse, ) from .client import AsyncSchematic, AsyncSchematicConfig, LocalCache, Schematic, SchematicConfig @@ -350,6 +376,7 @@ UpdateEntityTraitDefinitionRequestBodyTraitType, UpdateEntityTraitDefinitionResponse, UpdatePlanTraitResponse, + UpdatePlanTraitsBulkResponse, UpsertCompanyResponse, UpsertCompanyTraitResponse, UpsertUserResponse, @@ -381,18 +408,32 @@ CountCreditBundlesRequestStatus, CountCreditBundlesResponse, CountCreditBundlesResponseParamsStatus, + CountCreditLedgerParams, + CountCreditLedgerRequestPeriod, + CountCreditLedgerResponse, + CountCreditLedgerResponseParamsPeriod, CreateBillingCreditRequestBodyBurnStrategy, CreateBillingCreditRequestBodyDefaultRolloverPolicy, CreateBillingCreditResponse, + CreateBillingPlanCreditGrantRequestBodyExpiryType, + CreateBillingPlanCreditGrantRequestBodyExpiryUnit, CreateBillingPlanCreditGrantRequestBodyResetCadence, CreateBillingPlanCreditGrantRequestBodyResetStart, + CreateBillingPlanCreditGrantRequestBodyResetType, CreateBillingPlanCreditGrantResponse, + CreateCompanyCreditGrantExpiryType, + CreateCompanyCreditGrantExpiryUnit, CreateCreditBundleRequestBodyExpiryType, + CreateCreditBundleRequestBodyExpiryUnit, CreateCreditBundleRequestBodyStatus, CreateCreditBundleResponse, DeleteBillingPlanCreditGrantResponse, DeleteCreditBundleResponse, GetCreditBundleResponse, + GetEnrichedCreditLedgerParams, + GetEnrichedCreditLedgerRequestPeriod, + GetEnrichedCreditLedgerResponse, + GetEnrichedCreditLedgerResponseParamsPeriod, GetSingleBillingCreditResponse, GrantBillingCreditsToCompanyResponse, ListBillingCreditsParams, @@ -416,6 +457,7 @@ UpdateBillingCreditRequestBodyDefaultRolloverPolicy, UpdateBillingCreditResponse, UpdateCreditBundleDetailsRequestBodyExpiryType, + UpdateCreditBundleDetailsRequestBodyExpiryUnit, UpdateCreditBundleDetailsRequestBodyStatus, UpdateCreditBundleDetailsResponse, ZeroOutGrantRequestBodyReason, @@ -530,6 +572,8 @@ DeletePlanResponse, GetAudienceResponse, GetPlanResponse, + ListPlanIssuesParams, + ListPlanIssuesResponse, ListPlansParams, ListPlansRequestPlanType, ListPlansResponse, @@ -574,6 +618,7 @@ "BillingCreditBundleResponseData", "BillingCreditBundleView", "BillingCreditGrantResponseData", + "BillingCreditLedgerResponseData", "BillingCreditResponseData", "BillingCustomerResponseData", "BillingCustomerSubscription", @@ -603,11 +648,15 @@ "CheckFlagsResponseData", "CheckoutDataResponseData", "CheckoutInternalResponse", + "CheckoutSettingsResponseData", + "CheckoutSubscription", "CompanyCrmDealsResponseData", "CompanyDetailResponseData", "CompanyEventPeriodMetricsResponseData", + "CompanyLedgerResponseData", "CompanyMembershipDetailResponseData", "CompanyMembershipResponseData", + "CompanyOverrideNoteResponseData", "CompanyOverrideResponseData", "CompanyPlanDetailResponseData", "CompanyPlanWithBillingSubView", @@ -617,9 +666,12 @@ "CompatiblePlans", "CompatiblePlansResponseData", "ComponentCapabilities", + "ComponentCheckoutSettings", "ComponentHydrateResponseData", "ComponentPreviewResponseData", "ComponentResponseData", + "Condition", + "ConditionGroup", "CountApiKeysParams", "CountApiKeysResponse", "CountApiRequestsParams", @@ -650,6 +702,10 @@ "CountCreditBundlesRequestStatus", "CountCreditBundlesResponse", "CountCreditBundlesResponseParamsStatus", + "CountCreditLedgerParams", + "CountCreditLedgerRequestPeriod", + "CountCreditLedgerResponse", + "CountCreditLedgerResponseParamsPeriod", "CountCustomersParams", "CountCustomersResponse", "CountEntityKeyDefinitionsParams", @@ -692,14 +748,19 @@ "CreateBillingCreditRequestBodyBurnStrategy", "CreateBillingCreditRequestBodyDefaultRolloverPolicy", "CreateBillingCreditResponse", + "CreateBillingPlanCreditGrantRequestBodyExpiryType", + "CreateBillingPlanCreditGrantRequestBodyExpiryUnit", "CreateBillingPlanCreditGrantRequestBodyResetCadence", "CreateBillingPlanCreditGrantRequestBodyResetStart", + "CreateBillingPlanCreditGrantRequestBodyResetType", "CreateBillingPlanCreditGrantResponse", "CreateBillingPriceRequestBodyBillingScheme", "CreateBillingPriceRequestBodyTiersMode", "CreateBillingPriceRequestBodyUsageType", "CreateBillingPriceTierRequestBody", - "CreateBillingSubscriptionsRequestBodyTrialEndSetting", + "CreateBillingSubscriptionRequestBodyTrialEndSetting", + "CreateCompanyCreditGrantExpiryType", + "CreateCompanyCreditGrantExpiryUnit", "CreateCompanyOverrideRequestBodyMetricPeriod", "CreateCompanyOverrideRequestBodyMetricPeriodMonthReset", "CreateCompanyOverrideRequestBodyValueType", @@ -708,6 +769,7 @@ "CreateComponentRequestBodyEntityType", "CreateComponentResponse", "CreateCreditBundleRequestBodyExpiryType", + "CreateCreditBundleRequestBodyExpiryUnit", "CreateCreditBundleRequestBodyStatus", "CreateCreditBundleResponse", "CreateDataExportResponse", @@ -752,7 +814,12 @@ "CreateWebhookResponse", "CreditBundlePurchaseResponseData", "CreditCompanyGrantView", + "CreditGrantDetail", + "CreditGrantDetailGrantReason", + "CreditLedgerEnrichedEntryResponseData", "CreditTriggerConfig", + "CreditUsage", + "CreditUsageResponseData", "CrmDealLineItem", "CrmDealResponseData", "CrmLineItemResponseData", @@ -803,14 +870,17 @@ "EventSummaryResponseData", "FeatureCompanyResponseData", "FeatureCompanyResponseDataAllocationType", + "FeatureCompanyResponseDataCreditGrantReason", "FeatureCompanyUserResponseData", "FeatureCompanyUserResponseDataAllocationType", "FeatureDetailResponseData", + "FeatureLedgerResponseData", "FeatureResponseData", "FeatureUsageDataResponseData", "FeatureUsageDetailResponseData", "FeatureUsageResponseData", "FeatureUsageResponseDataAllocationType", + "FeatureUsageResponseDataCreditGrantReason", "FlagDetailResponseData", "FlagResponseData", "ForbiddenError", @@ -827,6 +897,10 @@ "GetCompanyResponse", "GetComponentResponse", "GetCreditBundleResponse", + "GetEnrichedCreditLedgerParams", + "GetEnrichedCreditLedgerRequestPeriod", + "GetEnrichedCreditLedgerResponse", + "GetEnrichedCreditLedgerResponseParamsPeriod", "GetEntityTraitDefinitionResponse", "GetEntityTraitValuesParams", "GetEntityTraitValuesResponse", @@ -934,6 +1008,8 @@ "ListPaymentMethodsResponse", "ListPlanEntitlementsParams", "ListPlanEntitlementsResponse", + "ListPlanIssuesParams", + "ListPlanIssuesResponse", "ListPlanTraitsParams", "ListPlanTraitsResponse", "ListPlansParams", @@ -955,6 +1031,10 @@ "LookupCompanyResponse", "LookupUserParams", "LookupUserResponse", + "ManagePlanPreviewResponseResponseData", + "ManagePlanRequest", + "ManagePlanResponse", + "ManagePlanResponseResponseData", "MeterRequestBody", "NotFoundError", "OrderedPlansInGroup", @@ -972,11 +1052,14 @@ "PlanGroupPlanDetailResponseData", "PlanGroupPlanEntitlementsOrder", "PlanGroupResponseData", + "PlanIssueResponseData", "PlanResponseData", + "PlanSelection", "PlanTraitResponseData", "PreviewCheckoutInternalResponse", "PreviewComponentDataParams", "PreviewComponentDataResponse", + "PreviewManagePlanResponse", "PreviewObject", "PreviewObjectResponseData", "PreviewSubscriptionChangeResponseData", @@ -986,6 +1069,7 @@ "QuickstartResponse", "RawEventBatchResponseData", "RawEventResponseData", + "Rule", "RuleConditionDetailResponseData", "RuleConditionGroupDetailResponseData", "RuleConditionGroupResponseData", @@ -1006,6 +1090,7 @@ "SoftDeleteBillingCreditResponse", "StripeEmbedInfo", "TemporaryAccessTokenResponseData", + "TraitDefinition", "UnauthorizedError", "UpdateAddOnRequestBody", "UpdateApiKeyResponse", @@ -1022,6 +1107,7 @@ "UpdateComponentRequestBodyState", "UpdateComponentResponse", "UpdateCreditBundleDetailsRequestBodyExpiryType", + "UpdateCreditBundleDetailsRequestBodyExpiryUnit", "UpdateCreditBundleDetailsRequestBodyStatus", "UpdateCreditBundleDetailsResponse", "UpdateCreditBundleRequestBody", @@ -1048,6 +1134,8 @@ "UpdatePlanGroupResponse", "UpdatePlanResponse", "UpdatePlanTraitResponse", + "UpdatePlanTraitTraitRequestBody", + "UpdatePlanTraitsBulkResponse", "UpdateRuleRequestBody", "UpdateWebhookRequestBodyRequestTypesItem", "UpdateWebhookRequestBodyStatus", diff --git a/src/schematic/accounts/client.py b/src/schematic/accounts/client.py index cc5dd43..613e9aa 100644 --- a/src/schematic/accounts/client.py +++ b/src/schematic/accounts/client.py @@ -80,7 +80,10 @@ def list_api_keys( api_key="YOUR_API_KEY", ) client.accounts.list_api_keys( + environment_id="environment_id", require_environment=True, + limit=1, + offset=1, ) """ _response = self._raw_client.list_api_keys( @@ -275,7 +278,10 @@ def count_api_keys( api_key="YOUR_API_KEY", ) client.accounts.count_api_keys( + environment_id="environment_id", require_environment=True, + limit=1, + offset=1, ) """ _response = self._raw_client.count_api_keys( @@ -327,7 +333,13 @@ def list_api_requests( client = Schematic( api_key="YOUR_API_KEY", ) - client.accounts.list_api_requests() + client.accounts.list_api_requests( + q="q", + request_type="request_type", + environment_id="environment_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_api_requests( q=q, @@ -410,7 +422,13 @@ def count_api_requests( client = Schematic( api_key="YOUR_API_KEY", ) - client.accounts.count_api_requests() + client.accounts.count_api_requests( + q="q", + request_type="request_type", + environment_id="environment_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_api_requests( q=q, @@ -456,7 +474,10 @@ def list_environments( client = Schematic( api_key="YOUR_API_KEY", ) - client.accounts.list_environments() + client.accounts.list_environments( + limit=1, + offset=1, + ) """ _response = self._raw_client.list_environments( ids=ids, limit=limit, offset=offset, request_options=request_options @@ -689,7 +710,10 @@ async def list_api_keys( async def main() -> None: await client.accounts.list_api_keys( + environment_id="environment_id", require_environment=True, + limit=1, + offset=1, ) @@ -924,7 +948,10 @@ async def count_api_keys( async def main() -> None: await client.accounts.count_api_keys( + environment_id="environment_id", require_environment=True, + limit=1, + offset=1, ) @@ -984,7 +1011,13 @@ async def list_api_requests( async def main() -> None: - await client.accounts.list_api_requests() + await client.accounts.list_api_requests( + q="q", + request_type="request_type", + environment_id="environment_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1083,7 +1116,13 @@ async def count_api_requests( async def main() -> None: - await client.accounts.count_api_requests() + await client.accounts.count_api_requests( + q="q", + request_type="request_type", + environment_id="environment_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1137,7 +1176,10 @@ async def list_environments( async def main() -> None: - await client.accounts.list_environments() + await client.accounts.list_environments( + limit=1, + offset=1, + ) asyncio.run(main()) diff --git a/src/schematic/accounts/types/list_api_keys_response.py b/src/schematic/accounts/types/list_api_keys_response.py index 2e56c2f..bcf9c8e 100644 --- a/src/schematic/accounts/types/list_api_keys_response.py +++ b/src/schematic/accounts/types/list_api_keys_response.py @@ -9,11 +9,7 @@ class ListApiKeysResponse(UniversalBaseModel): - data: typing.List[ApiKeyResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[ApiKeyResponseData] params: ListApiKeysParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/accounts/types/list_api_requests_response.py b/src/schematic/accounts/types/list_api_requests_response.py index a511105..d3cc23a 100644 --- a/src/schematic/accounts/types/list_api_requests_response.py +++ b/src/schematic/accounts/types/list_api_requests_response.py @@ -9,11 +9,7 @@ class ListApiRequestsResponse(UniversalBaseModel): - data: typing.List[ApiKeyRequestListResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[ApiKeyRequestListResponseData] params: ListApiRequestsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/accounts/types/list_environments_response.py b/src/schematic/accounts/types/list_environments_response.py index 916874e..e5b63b2 100644 --- a/src/schematic/accounts/types/list_environments_response.py +++ b/src/schematic/accounts/types/list_environments_response.py @@ -9,11 +9,7 @@ class ListEnvironmentsResponse(UniversalBaseModel): - data: typing.List[EnvironmentResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[EnvironmentResponseData] params: ListEnvironmentsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/billing/__init__.py b/src/schematic/billing/__init__.py index 0b41c97..2686586 100644 --- a/src/schematic/billing/__init__.py +++ b/src/schematic/billing/__init__.py @@ -12,7 +12,7 @@ CreateBillingPriceRequestBodyBillingScheme, CreateBillingPriceRequestBodyTiersMode, CreateBillingPriceRequestBodyUsageType, - CreateBillingSubscriptionsRequestBodyTrialEndSetting, + CreateBillingSubscriptionRequestBodyTrialEndSetting, DeleteBillingProductResponse, DeleteProductPriceResponse, ListBillingProductsParams, @@ -59,7 +59,7 @@ "CreateBillingPriceRequestBodyBillingScheme", "CreateBillingPriceRequestBodyTiersMode", "CreateBillingPriceRequestBodyUsageType", - "CreateBillingSubscriptionsRequestBodyTrialEndSetting", + "CreateBillingSubscriptionRequestBodyTrialEndSetting", "DeleteBillingProductResponse", "DeleteProductPriceResponse", "ListBillingProductsParams", diff --git a/src/schematic/billing/client.py b/src/schematic/billing/client.py index 07ee0b7..c1e3e6d 100644 --- a/src/schematic/billing/client.py +++ b/src/schematic/billing/client.py @@ -15,8 +15,8 @@ from .types.create_billing_price_request_body_billing_scheme import CreateBillingPriceRequestBodyBillingScheme from .types.create_billing_price_request_body_tiers_mode import CreateBillingPriceRequestBodyTiersMode from .types.create_billing_price_request_body_usage_type import CreateBillingPriceRequestBodyUsageType -from .types.create_billing_subscriptions_request_body_trial_end_setting import ( - CreateBillingSubscriptionsRequestBodyTrialEndSetting, +from .types.create_billing_subscription_request_body_trial_end_setting import ( + CreateBillingSubscriptionRequestBodyTrialEndSetting, ) from .types.delete_billing_product_response import DeleteBillingProductResponse from .types.delete_product_price_response import DeleteProductPriceResponse @@ -97,7 +97,12 @@ def list_coupons( client = Schematic( api_key="YOUR_API_KEY", ) - client.billing.list_coupons() + client.billing.list_coupons( + is_active=True, + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_coupons( is_active=is_active, q=q, limit=limit, offset=offset, request_options=request_options @@ -286,7 +291,13 @@ def list_customers_with_subscriptions( client = Schematic( api_key="YOUR_API_KEY", ) - client.billing.list_customers_with_subscriptions() + client.billing.list_customers_with_subscriptions( + name="name", + failed_to_import=True, + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_customers_with_subscriptions( company_ids=company_ids, @@ -342,7 +353,13 @@ def count_customers( client = Schematic( api_key="YOUR_API_KEY", ) - client.billing.count_customers() + client.billing.count_customers( + name="name", + failed_to_import=True, + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_customers( company_ids=company_ids, @@ -396,8 +413,11 @@ def list_invoices( api_key="YOUR_API_KEY", ) client.billing.list_invoices( + company_id="company_id", customer_external_id="customer_external_id", subscription_external_id="subscription_external_id", + limit=1, + offset=1, ) """ _response = self._raw_client.list_invoices( @@ -530,7 +550,11 @@ def list_meters( client = Schematic( api_key="YOUR_API_KEY", ) - client.billing.list_meters() + client.billing.list_meters( + display_name="display_name", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_meters( display_name=display_name, limit=limit, offset=offset, request_options=request_options @@ -626,7 +650,10 @@ def list_payment_methods( api_key="YOUR_API_KEY", ) client.billing.list_payment_methods( + company_id="company_id", customer_external_id="customer_external_id", + limit=1, + offset=1, ) """ _response = self._raw_client.list_payment_methods( @@ -723,12 +750,16 @@ def upsert_payment_method( def search_billing_prices( self, *, + for_initial_plan: typing.Optional[bool] = None, + for_trial_expiry_plan: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - q: typing.Optional[str] = None, + product_id: typing.Optional[str] = None, interval: typing.Optional[str] = None, - usage_type: typing.Optional[SearchBillingPricesRequestUsageType] = None, price: typing.Optional[int] = None, + q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, tiers_mode: typing.Optional[SearchBillingPricesRequestTiersMode] = None, + usage_type: typing.Optional[SearchBillingPricesRequestUsageType] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -736,18 +767,29 @@ def search_billing_prices( """ Parameters ---------- + for_initial_plan : typing.Optional[bool] + Filter for prices valid for initial plans (free prices only) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for prices valid for trial expiry plans (free prices only) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - q : typing.Optional[str] + product_id : typing.Optional[str] interval : typing.Optional[str] - usage_type : typing.Optional[SearchBillingPricesRequestUsageType] - price : typing.Optional[int] + q : typing.Optional[str] + + requires_payment_method : typing.Optional[bool] + Filter for prices that require a payment method (inverse of ForInitialPlan) + tiers_mode : typing.Optional[SearchBillingPricesRequestTiersMode] + usage_type : typing.Optional[SearchBillingPricesRequestUsageType] + limit : typing.Optional[int] Page limit (default 100) @@ -769,15 +811,31 @@ def search_billing_prices( client = Schematic( api_key="YOUR_API_KEY", ) - client.billing.search_billing_prices() + client.billing.search_billing_prices( + for_initial_plan=True, + for_trial_expiry_plan=True, + product_id="product_id", + interval="interval", + price=1, + q="q", + requires_payment_method=True, + tiers_mode="volume", + usage_type="licensed", + limit=1, + offset=1, + ) """ _response = self._raw_client.search_billing_prices( + for_initial_plan=for_initial_plan, + for_trial_expiry_plan=for_trial_expiry_plan, ids=ids, - q=q, + product_id=product_id, interval=interval, - usage_type=usage_type, price=price, + q=q, + requires_payment_method=requires_payment_method, tiers_mode=tiers_mode, + usage_type=usage_type, limit=limit, offset=offset, request_options=request_options, @@ -979,7 +1037,18 @@ def list_product_prices( client = Schematic( api_key="YOUR_API_KEY", ) - client.billing.list_product_prices() + client.billing.list_product_prices( + name="name", + q="q", + price_usage_type="licensed", + without_linked_to_plan=True, + with_one_time_charges=True, + with_zero_price=True, + with_prices_only=True, + is_active=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.list_product_prices( ids=ids, @@ -1137,7 +1206,18 @@ def list_billing_products( client = Schematic( api_key="YOUR_API_KEY", ) - client.billing.list_billing_products() + client.billing.list_billing_products( + name="name", + q="q", + price_usage_type="licensed", + without_linked_to_plan=True, + with_one_time_charges=True, + with_zero_price=True, + with_prices_only=True, + is_active=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.list_billing_products( ids=ids, @@ -1218,7 +1298,18 @@ def count_billing_products( client = Schematic( api_key="YOUR_API_KEY", ) - client.billing.count_billing_products() + client.billing.count_billing_products( + name="name", + q="q", + price_usage_type="licensed", + without_linked_to_plan=True, + with_one_time_charges=True, + with_zero_price=True, + with_prices_only=True, + is_active=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.count_billing_products( ids=ids, @@ -1248,6 +1339,7 @@ def upsert_billing_subscription( subscription_external_id: str, total_price: int, cancel_at: typing.Optional[int] = OMIT, + default_payment_method_external_id: typing.Optional[str] = OMIT, default_payment_method_id: typing.Optional[str] = OMIT, interval: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -1255,7 +1347,7 @@ def upsert_billing_subscription( period_start: typing.Optional[int] = OMIT, status: typing.Optional[str] = OMIT, trial_end: typing.Optional[int] = OMIT, - trial_end_setting: typing.Optional[CreateBillingSubscriptionsRequestBodyTrialEndSetting] = OMIT, + trial_end_setting: typing.Optional[CreateBillingSubscriptionRequestBodyTrialEndSetting] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertBillingSubscriptionResponse: """ @@ -1279,6 +1371,8 @@ def upsert_billing_subscription( cancel_at : typing.Optional[int] + default_payment_method_external_id : typing.Optional[str] + default_payment_method_id : typing.Optional[str] interval : typing.Optional[str] @@ -1293,7 +1387,7 @@ def upsert_billing_subscription( trial_end : typing.Optional[int] - trial_end_setting : typing.Optional[CreateBillingSubscriptionsRequestBodyTrialEndSetting] + trial_end_setting : typing.Optional[CreateBillingSubscriptionRequestBodyTrialEndSetting] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1358,6 +1452,7 @@ def upsert_billing_subscription( subscription_external_id=subscription_external_id, total_price=total_price, cancel_at=cancel_at, + default_payment_method_external_id=default_payment_method_external_id, default_payment_method_id=default_payment_method_id, interval=interval, metadata=metadata, @@ -1428,7 +1523,12 @@ async def list_coupons( async def main() -> None: - await client.billing.list_coupons() + await client.billing.list_coupons( + is_active=True, + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1641,7 +1741,13 @@ async def list_customers_with_subscriptions( async def main() -> None: - await client.billing.list_customers_with_subscriptions() + await client.billing.list_customers_with_subscriptions( + name="name", + failed_to_import=True, + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1705,7 +1811,13 @@ async def count_customers( async def main() -> None: - await client.billing.count_customers() + await client.billing.count_customers( + name="name", + failed_to_import=True, + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1767,8 +1879,11 @@ async def list_invoices( async def main() -> None: await client.billing.list_invoices( + company_id="company_id", customer_external_id="customer_external_id", subscription_external_id="subscription_external_id", + limit=1, + offset=1, ) @@ -1917,7 +2032,11 @@ async def list_meters( async def main() -> None: - await client.billing.list_meters() + await client.billing.list_meters( + display_name="display_name", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2029,7 +2148,10 @@ async def list_payment_methods( async def main() -> None: await client.billing.list_payment_methods( + company_id="company_id", customer_external_id="customer_external_id", + limit=1, + offset=1, ) @@ -2137,12 +2259,16 @@ async def main() -> None: async def search_billing_prices( self, *, + for_initial_plan: typing.Optional[bool] = None, + for_trial_expiry_plan: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - q: typing.Optional[str] = None, + product_id: typing.Optional[str] = None, interval: typing.Optional[str] = None, - usage_type: typing.Optional[SearchBillingPricesRequestUsageType] = None, price: typing.Optional[int] = None, + q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, tiers_mode: typing.Optional[SearchBillingPricesRequestTiersMode] = None, + usage_type: typing.Optional[SearchBillingPricesRequestUsageType] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -2150,18 +2276,29 @@ async def search_billing_prices( """ Parameters ---------- + for_initial_plan : typing.Optional[bool] + Filter for prices valid for initial plans (free prices only) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for prices valid for trial expiry plans (free prices only) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - q : typing.Optional[str] + product_id : typing.Optional[str] interval : typing.Optional[str] - usage_type : typing.Optional[SearchBillingPricesRequestUsageType] - price : typing.Optional[int] + q : typing.Optional[str] + + requires_payment_method : typing.Optional[bool] + Filter for prices that require a payment method (inverse of ForInitialPlan) + tiers_mode : typing.Optional[SearchBillingPricesRequestTiersMode] + usage_type : typing.Optional[SearchBillingPricesRequestUsageType] + limit : typing.Optional[int] Page limit (default 100) @@ -2188,18 +2325,34 @@ async def search_billing_prices( async def main() -> None: - await client.billing.search_billing_prices() + await client.billing.search_billing_prices( + for_initial_plan=True, + for_trial_expiry_plan=True, + product_id="product_id", + interval="interval", + price=1, + q="q", + requires_payment_method=True, + tiers_mode="volume", + usage_type="licensed", + limit=1, + offset=1, + ) asyncio.run(main()) """ _response = await self._raw_client.search_billing_prices( + for_initial_plan=for_initial_plan, + for_trial_expiry_plan=for_trial_expiry_plan, ids=ids, - q=q, + product_id=product_id, interval=interval, - usage_type=usage_type, price=price, + q=q, + requires_payment_method=requires_payment_method, tiers_mode=tiers_mode, + usage_type=usage_type, limit=limit, offset=offset, request_options=request_options, @@ -2422,7 +2575,18 @@ async def list_product_prices( async def main() -> None: - await client.billing.list_product_prices() + await client.billing.list_product_prices( + name="name", + q="q", + price_usage_type="licensed", + without_linked_to_plan=True, + with_one_time_charges=True, + with_zero_price=True, + with_prices_only=True, + is_active=True, + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2604,7 +2768,18 @@ async def list_billing_products( async def main() -> None: - await client.billing.list_billing_products() + await client.billing.list_billing_products( + name="name", + q="q", + price_usage_type="licensed", + without_linked_to_plan=True, + with_one_time_charges=True, + with_zero_price=True, + with_prices_only=True, + is_active=True, + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2693,7 +2868,18 @@ async def count_billing_products( async def main() -> None: - await client.billing.count_billing_products() + await client.billing.count_billing_products( + name="name", + q="q", + price_usage_type="licensed", + without_linked_to_plan=True, + with_one_time_charges=True, + with_zero_price=True, + with_prices_only=True, + is_active=True, + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2726,6 +2912,7 @@ async def upsert_billing_subscription( subscription_external_id: str, total_price: int, cancel_at: typing.Optional[int] = OMIT, + default_payment_method_external_id: typing.Optional[str] = OMIT, default_payment_method_id: typing.Optional[str] = OMIT, interval: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -2733,7 +2920,7 @@ async def upsert_billing_subscription( period_start: typing.Optional[int] = OMIT, status: typing.Optional[str] = OMIT, trial_end: typing.Optional[int] = OMIT, - trial_end_setting: typing.Optional[CreateBillingSubscriptionsRequestBodyTrialEndSetting] = OMIT, + trial_end_setting: typing.Optional[CreateBillingSubscriptionRequestBodyTrialEndSetting] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertBillingSubscriptionResponse: """ @@ -2757,6 +2944,8 @@ async def upsert_billing_subscription( cancel_at : typing.Optional[int] + default_payment_method_external_id : typing.Optional[str] + default_payment_method_id : typing.Optional[str] interval : typing.Optional[str] @@ -2771,7 +2960,7 @@ async def upsert_billing_subscription( trial_end : typing.Optional[int] - trial_end_setting : typing.Optional[CreateBillingSubscriptionsRequestBodyTrialEndSetting] + trial_end_setting : typing.Optional[CreateBillingSubscriptionRequestBodyTrialEndSetting] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2843,6 +3032,7 @@ async def main() -> None: subscription_external_id=subscription_external_id, total_price=total_price, cancel_at=cancel_at, + default_payment_method_external_id=default_payment_method_external_id, default_payment_method_id=default_payment_method_id, interval=interval, metadata=metadata, diff --git a/src/schematic/billing/raw_client.py b/src/schematic/billing/raw_client.py index 485b0e3..50f7abd 100644 --- a/src/schematic/billing/raw_client.py +++ b/src/schematic/billing/raw_client.py @@ -26,8 +26,8 @@ from .types.create_billing_price_request_body_billing_scheme import CreateBillingPriceRequestBodyBillingScheme from .types.create_billing_price_request_body_tiers_mode import CreateBillingPriceRequestBodyTiersMode from .types.create_billing_price_request_body_usage_type import CreateBillingPriceRequestBodyUsageType -from .types.create_billing_subscriptions_request_body_trial_end_setting import ( - CreateBillingSubscriptionsRequestBodyTrialEndSetting, +from .types.create_billing_subscription_request_body_trial_end_setting import ( + CreateBillingSubscriptionRequestBodyTrialEndSetting, ) from .types.delete_billing_product_response import DeleteBillingProductResponse from .types.delete_product_price_response import DeleteProductPriceResponse @@ -1450,12 +1450,16 @@ def upsert_payment_method( def search_billing_prices( self, *, + for_initial_plan: typing.Optional[bool] = None, + for_trial_expiry_plan: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - q: typing.Optional[str] = None, + product_id: typing.Optional[str] = None, interval: typing.Optional[str] = None, - usage_type: typing.Optional[SearchBillingPricesRequestUsageType] = None, price: typing.Optional[int] = None, + q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, tiers_mode: typing.Optional[SearchBillingPricesRequestTiersMode] = None, + usage_type: typing.Optional[SearchBillingPricesRequestUsageType] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -1463,18 +1467,29 @@ def search_billing_prices( """ Parameters ---------- + for_initial_plan : typing.Optional[bool] + Filter for prices valid for initial plans (free prices only) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for prices valid for trial expiry plans (free prices only) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - q : typing.Optional[str] + product_id : typing.Optional[str] interval : typing.Optional[str] - usage_type : typing.Optional[SearchBillingPricesRequestUsageType] - price : typing.Optional[int] + q : typing.Optional[str] + + requires_payment_method : typing.Optional[bool] + Filter for prices that require a payment method (inverse of ForInitialPlan) + tiers_mode : typing.Optional[SearchBillingPricesRequestTiersMode] + usage_type : typing.Optional[SearchBillingPricesRequestUsageType] + limit : typing.Optional[int] Page limit (default 100) @@ -1493,12 +1508,16 @@ def search_billing_prices( "billing/price", method="GET", params={ + "for_initial_plan": for_initial_plan, + "for_trial_expiry_plan": for_trial_expiry_plan, "ids": ids, - "q": q, + "product_id": product_id, "interval": interval, - "usage_type": usage_type, "price": price, + "q": q, + "requires_payment_method": requires_payment_method, "tiers_mode": tiers_mode, + "usage_type": usage_type, "limit": limit, "offset": offset, }, @@ -2504,6 +2523,7 @@ def upsert_billing_subscription( subscription_external_id: str, total_price: int, cancel_at: typing.Optional[int] = OMIT, + default_payment_method_external_id: typing.Optional[str] = OMIT, default_payment_method_id: typing.Optional[str] = OMIT, interval: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -2511,7 +2531,7 @@ def upsert_billing_subscription( period_start: typing.Optional[int] = OMIT, status: typing.Optional[str] = OMIT, trial_end: typing.Optional[int] = OMIT, - trial_end_setting: typing.Optional[CreateBillingSubscriptionsRequestBodyTrialEndSetting] = OMIT, + trial_end_setting: typing.Optional[CreateBillingSubscriptionRequestBodyTrialEndSetting] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpsertBillingSubscriptionResponse]: """ @@ -2535,6 +2555,8 @@ def upsert_billing_subscription( cancel_at : typing.Optional[int] + default_payment_method_external_id : typing.Optional[str] + default_payment_method_id : typing.Optional[str] interval : typing.Optional[str] @@ -2549,7 +2571,7 @@ def upsert_billing_subscription( trial_end : typing.Optional[int] - trial_end_setting : typing.Optional[CreateBillingSubscriptionsRequestBodyTrialEndSetting] + trial_end_setting : typing.Optional[CreateBillingSubscriptionRequestBodyTrialEndSetting] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2567,6 +2589,7 @@ def upsert_billing_subscription( "cancel_at_period_end": cancel_at_period_end, "currency": currency, "customer_external_id": customer_external_id, + "default_payment_method_external_id": default_payment_method_external_id, "default_payment_method_id": default_payment_method_id, "discounts": convert_and_respect_annotation_metadata( object_=discounts, annotation=typing.Sequence[BillingSubscriptionDiscount], direction="write" @@ -4060,12 +4083,16 @@ async def upsert_payment_method( async def search_billing_prices( self, *, + for_initial_plan: typing.Optional[bool] = None, + for_trial_expiry_plan: typing.Optional[bool] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, - q: typing.Optional[str] = None, + product_id: typing.Optional[str] = None, interval: typing.Optional[str] = None, - usage_type: typing.Optional[SearchBillingPricesRequestUsageType] = None, price: typing.Optional[int] = None, + q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, tiers_mode: typing.Optional[SearchBillingPricesRequestTiersMode] = None, + usage_type: typing.Optional[SearchBillingPricesRequestUsageType] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -4073,18 +4100,29 @@ async def search_billing_prices( """ Parameters ---------- + for_initial_plan : typing.Optional[bool] + Filter for prices valid for initial plans (free prices only) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for prices valid for trial expiry plans (free prices only) + ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - q : typing.Optional[str] + product_id : typing.Optional[str] interval : typing.Optional[str] - usage_type : typing.Optional[SearchBillingPricesRequestUsageType] - price : typing.Optional[int] + q : typing.Optional[str] + + requires_payment_method : typing.Optional[bool] + Filter for prices that require a payment method (inverse of ForInitialPlan) + tiers_mode : typing.Optional[SearchBillingPricesRequestTiersMode] + usage_type : typing.Optional[SearchBillingPricesRequestUsageType] + limit : typing.Optional[int] Page limit (default 100) @@ -4103,12 +4141,16 @@ async def search_billing_prices( "billing/price", method="GET", params={ + "for_initial_plan": for_initial_plan, + "for_trial_expiry_plan": for_trial_expiry_plan, "ids": ids, - "q": q, + "product_id": product_id, "interval": interval, - "usage_type": usage_type, "price": price, + "q": q, + "requires_payment_method": requires_payment_method, "tiers_mode": tiers_mode, + "usage_type": usage_type, "limit": limit, "offset": offset, }, @@ -5114,6 +5156,7 @@ async def upsert_billing_subscription( subscription_external_id: str, total_price: int, cancel_at: typing.Optional[int] = OMIT, + default_payment_method_external_id: typing.Optional[str] = OMIT, default_payment_method_id: typing.Optional[str] = OMIT, interval: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, @@ -5121,7 +5164,7 @@ async def upsert_billing_subscription( period_start: typing.Optional[int] = OMIT, status: typing.Optional[str] = OMIT, trial_end: typing.Optional[int] = OMIT, - trial_end_setting: typing.Optional[CreateBillingSubscriptionsRequestBodyTrialEndSetting] = OMIT, + trial_end_setting: typing.Optional[CreateBillingSubscriptionRequestBodyTrialEndSetting] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpsertBillingSubscriptionResponse]: """ @@ -5145,6 +5188,8 @@ async def upsert_billing_subscription( cancel_at : typing.Optional[int] + default_payment_method_external_id : typing.Optional[str] + default_payment_method_id : typing.Optional[str] interval : typing.Optional[str] @@ -5159,7 +5204,7 @@ async def upsert_billing_subscription( trial_end : typing.Optional[int] - trial_end_setting : typing.Optional[CreateBillingSubscriptionsRequestBodyTrialEndSetting] + trial_end_setting : typing.Optional[CreateBillingSubscriptionRequestBodyTrialEndSetting] request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5177,6 +5222,7 @@ async def upsert_billing_subscription( "cancel_at_period_end": cancel_at_period_end, "currency": currency, "customer_external_id": customer_external_id, + "default_payment_method_external_id": default_payment_method_external_id, "default_payment_method_id": default_payment_method_id, "discounts": convert_and_respect_annotation_metadata( object_=discounts, annotation=typing.Sequence[BillingSubscriptionDiscount], direction="write" diff --git a/src/schematic/billing/types/__init__.py b/src/schematic/billing/types/__init__.py index c1b6b89..cb33138 100644 --- a/src/schematic/billing/types/__init__.py +++ b/src/schematic/billing/types/__init__.py @@ -11,8 +11,8 @@ from .create_billing_price_request_body_billing_scheme import CreateBillingPriceRequestBodyBillingScheme from .create_billing_price_request_body_tiers_mode import CreateBillingPriceRequestBodyTiersMode from .create_billing_price_request_body_usage_type import CreateBillingPriceRequestBodyUsageType -from .create_billing_subscriptions_request_body_trial_end_setting import ( - CreateBillingSubscriptionsRequestBodyTrialEndSetting, +from .create_billing_subscription_request_body_trial_end_setting import ( + CreateBillingSubscriptionRequestBodyTrialEndSetting, ) from .delete_billing_product_response import DeleteBillingProductResponse from .delete_product_price_response import DeleteProductPriceResponse @@ -59,7 +59,7 @@ "CreateBillingPriceRequestBodyBillingScheme", "CreateBillingPriceRequestBodyTiersMode", "CreateBillingPriceRequestBodyUsageType", - "CreateBillingSubscriptionsRequestBodyTrialEndSetting", + "CreateBillingSubscriptionRequestBodyTrialEndSetting", "DeleteBillingProductResponse", "DeleteProductPriceResponse", "ListBillingProductsParams", diff --git a/src/schematic/billing/types/create_billing_subscription_request_body_trial_end_setting.py b/src/schematic/billing/types/create_billing_subscription_request_body_trial_end_setting.py new file mode 100644 index 0000000..1626cec --- /dev/null +++ b/src/schematic/billing/types/create_billing_subscription_request_body_trial_end_setting.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateBillingSubscriptionRequestBodyTrialEndSetting = typing.Union[typing.Literal["subscribe", "cancel"], typing.Any] diff --git a/src/schematic/billing/types/create_billing_subscriptions_request_body_trial_end_setting.py b/src/schematic/billing/types/create_billing_subscriptions_request_body_trial_end_setting.py deleted file mode 100644 index 5f1ae49..0000000 --- a/src/schematic/billing/types/create_billing_subscriptions_request_body_trial_end_setting.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -CreateBillingSubscriptionsRequestBodyTrialEndSetting = typing.Union[typing.Literal["subscribe", "cancel"], typing.Any] diff --git a/src/schematic/billing/types/list_billing_products_response.py b/src/schematic/billing/types/list_billing_products_response.py index 2eb6348..78891ca 100644 --- a/src/schematic/billing/types/list_billing_products_response.py +++ b/src/schematic/billing/types/list_billing_products_response.py @@ -9,11 +9,7 @@ class ListBillingProductsResponse(UniversalBaseModel): - data: typing.List[BillingProductDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingProductDetailResponseData] params: ListBillingProductsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/billing/types/list_coupons_response.py b/src/schematic/billing/types/list_coupons_response.py index 1b66e41..9534f99 100644 --- a/src/schematic/billing/types/list_coupons_response.py +++ b/src/schematic/billing/types/list_coupons_response.py @@ -9,11 +9,7 @@ class ListCouponsResponse(UniversalBaseModel): - data: typing.List[BillingCouponResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingCouponResponseData] params: ListCouponsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/billing/types/list_customers_with_subscriptions_response.py b/src/schematic/billing/types/list_customers_with_subscriptions_response.py index e44cb5f..9c987be 100644 --- a/src/schematic/billing/types/list_customers_with_subscriptions_response.py +++ b/src/schematic/billing/types/list_customers_with_subscriptions_response.py @@ -9,11 +9,7 @@ class ListCustomersWithSubscriptionsResponse(UniversalBaseModel): - data: typing.List[BillingCustomerWithSubscriptionsResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingCustomerWithSubscriptionsResponseData] params: ListCustomersWithSubscriptionsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/billing/types/list_invoices_response.py b/src/schematic/billing/types/list_invoices_response.py index 0075197..9a443c8 100644 --- a/src/schematic/billing/types/list_invoices_response.py +++ b/src/schematic/billing/types/list_invoices_response.py @@ -9,11 +9,7 @@ class ListInvoicesResponse(UniversalBaseModel): - data: typing.List[InvoiceResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[InvoiceResponseData] params: ListInvoicesParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/billing/types/list_meters_response.py b/src/schematic/billing/types/list_meters_response.py index 6f23b44..5fe31ed 100644 --- a/src/schematic/billing/types/list_meters_response.py +++ b/src/schematic/billing/types/list_meters_response.py @@ -9,11 +9,7 @@ class ListMetersResponse(UniversalBaseModel): - data: typing.List[BillingMeterResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingMeterResponseData] params: ListMetersParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/billing/types/list_payment_methods_response.py b/src/schematic/billing/types/list_payment_methods_response.py index 0c553f7..739a48b 100644 --- a/src/schematic/billing/types/list_payment_methods_response.py +++ b/src/schematic/billing/types/list_payment_methods_response.py @@ -9,11 +9,7 @@ class ListPaymentMethodsResponse(UniversalBaseModel): - data: typing.List[PaymentMethodResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[PaymentMethodResponseData] params: ListPaymentMethodsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/billing/types/list_product_prices_response.py b/src/schematic/billing/types/list_product_prices_response.py index 101454b..b975e82 100644 --- a/src/schematic/billing/types/list_product_prices_response.py +++ b/src/schematic/billing/types/list_product_prices_response.py @@ -9,11 +9,7 @@ class ListProductPricesResponse(UniversalBaseModel): - data: typing.List[BillingPriceResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingPriceResponseData] params: ListProductPricesParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/billing/types/search_billing_prices_params.py b/src/schematic/billing/types/search_billing_prices_params.py index 1e590aa..b5d6026 100644 --- a/src/schematic/billing/types/search_billing_prices_params.py +++ b/src/schematic/billing/types/search_billing_prices_params.py @@ -13,6 +13,16 @@ class SearchBillingPricesParams(UniversalBaseModel): Input parameters """ + for_initial_plan: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for prices valid for initial plans (free prices only) + """ + + for_trial_expiry_plan: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for prices valid for trial expiry plans (free prices only) + """ + ids: typing.Optional[typing.List[str]] = None interval: typing.Optional[str] = None limit: typing.Optional[int] = pydantic.Field(default=None) @@ -26,7 +36,13 @@ class SearchBillingPricesParams(UniversalBaseModel): """ price: typing.Optional[int] = None + product_id: typing.Optional[str] = None q: typing.Optional[str] = None + requires_payment_method: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for prices that require a payment method (inverse of ForInitialPlan) + """ + tiers_mode: typing.Optional[SearchBillingPricesResponseParamsTiersMode] = None usage_type: typing.Optional[SearchBillingPricesResponseParamsUsageType] = None diff --git a/src/schematic/billing/types/search_billing_prices_response.py b/src/schematic/billing/types/search_billing_prices_response.py index 5a66b55..d0dd886 100644 --- a/src/schematic/billing/types/search_billing_prices_response.py +++ b/src/schematic/billing/types/search_billing_prices_response.py @@ -9,11 +9,7 @@ class SearchBillingPricesResponse(UniversalBaseModel): - data: typing.List[BillingPriceView] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingPriceView] params: SearchBillingPricesParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/checkout/__init__.py b/src/schematic/checkout/__init__.py index 0b7a7a7..ea9f3bb 100644 --- a/src/schematic/checkout/__init__.py +++ b/src/schematic/checkout/__init__.py @@ -5,13 +5,17 @@ from .types import ( CheckoutInternalResponse, GetCheckoutDataResponse, + ManagePlanResponse, PreviewCheckoutInternalResponse, + PreviewManagePlanResponse, UpdateCustomerSubscriptionTrialEndResponse, ) __all__ = [ "CheckoutInternalResponse", "GetCheckoutDataResponse", + "ManagePlanResponse", "PreviewCheckoutInternalResponse", + "PreviewManagePlanResponse", "UpdateCustomerSubscriptionTrialEndResponse", ] diff --git a/src/schematic/checkout/client.py b/src/schematic/checkout/client.py index 859b715..196cef8 100644 --- a/src/schematic/checkout/client.py +++ b/src/schematic/checkout/client.py @@ -5,13 +5,16 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions +from ..types.plan_selection import PlanSelection from ..types.update_add_on_request_body import UpdateAddOnRequestBody from ..types.update_credit_bundle_request_body import UpdateCreditBundleRequestBody from ..types.update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody from .raw_client import AsyncRawCheckoutClient, RawCheckoutClient from .types.checkout_internal_response import CheckoutInternalResponse from .types.get_checkout_data_response import GetCheckoutDataResponse +from .types.manage_plan_response import ManagePlanResponse from .types.preview_checkout_internal_response import PreviewCheckoutInternalResponse +from .types.preview_manage_plan_response import PreviewManagePlanResponse from .types.update_customer_subscription_trial_end_response import UpdateCustomerSubscriptionTrialEndResponse # this is used as the default value for optional parameters @@ -267,6 +270,186 @@ def preview_checkout_internal( ) return _response.data + def manage_plan( + self, + *, + add_on_selections: typing.Sequence[PlanSelection], + company_id: str, + credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], + pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody], + base_plan_id: typing.Optional[str] = OMIT, + base_plan_price_id: typing.Optional[str] = OMIT, + coupon_external_id: typing.Optional[str] = OMIT, + payment_method_external_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ManagePlanResponse: + """ + Parameters + ---------- + add_on_selections : typing.Sequence[PlanSelection] + + company_id : str + + credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] + + pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody] + + base_plan_id : typing.Optional[str] + + base_plan_price_id : typing.Optional[str] + + coupon_external_id : typing.Optional[str] + + payment_method_external_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ManagePlanResponse + OK + + Examples + -------- + from schematic import ( + PlanSelection, + Schematic, + UpdateCreditBundleRequestBody, + UpdatePayInAdvanceRequestBody, + ) + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.checkout.manage_plan( + add_on_selections=[ + PlanSelection( + plan_id="plan_id", + ) + ], + company_id="company_id", + credit_bundles=[ + UpdateCreditBundleRequestBody( + bundle_id="bundle_id", + quantity=1, + ) + ], + pay_in_advance_entitlements=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], + ) + """ + _response = self._raw_client.manage_plan( + add_on_selections=add_on_selections, + company_id=company_id, + credit_bundles=credit_bundles, + pay_in_advance_entitlements=pay_in_advance_entitlements, + base_plan_id=base_plan_id, + base_plan_price_id=base_plan_price_id, + coupon_external_id=coupon_external_id, + payment_method_external_id=payment_method_external_id, + promo_code=promo_code, + request_options=request_options, + ) + return _response.data + + def preview_manage_plan( + self, + *, + add_on_selections: typing.Sequence[PlanSelection], + company_id: str, + credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], + pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody], + base_plan_id: typing.Optional[str] = OMIT, + base_plan_price_id: typing.Optional[str] = OMIT, + coupon_external_id: typing.Optional[str] = OMIT, + payment_method_external_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> PreviewManagePlanResponse: + """ + Parameters + ---------- + add_on_selections : typing.Sequence[PlanSelection] + + company_id : str + + credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] + + pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody] + + base_plan_id : typing.Optional[str] + + base_plan_price_id : typing.Optional[str] + + coupon_external_id : typing.Optional[str] + + payment_method_external_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PreviewManagePlanResponse + OK + + Examples + -------- + from schematic import ( + PlanSelection, + Schematic, + UpdateCreditBundleRequestBody, + UpdatePayInAdvanceRequestBody, + ) + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.checkout.preview_manage_plan( + add_on_selections=[ + PlanSelection( + plan_id="plan_id", + ) + ], + company_id="company_id", + credit_bundles=[ + UpdateCreditBundleRequestBody( + bundle_id="bundle_id", + quantity=1, + ) + ], + pay_in_advance_entitlements=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], + ) + """ + _response = self._raw_client.preview_manage_plan( + add_on_selections=add_on_selections, + company_id=company_id, + credit_bundles=credit_bundles, + pay_in_advance_entitlements=pay_in_advance_entitlements, + base_plan_id=base_plan_id, + base_plan_price_id=base_plan_price_id, + coupon_external_id=coupon_external_id, + payment_method_external_id=payment_method_external_id, + promo_code=promo_code, + request_options=request_options, + ) + return _response.data + def update_customer_subscription_trial_end( self, subscription_id: str, @@ -580,6 +763,202 @@ async def main() -> None: ) return _response.data + async def manage_plan( + self, + *, + add_on_selections: typing.Sequence[PlanSelection], + company_id: str, + credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], + pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody], + base_plan_id: typing.Optional[str] = OMIT, + base_plan_price_id: typing.Optional[str] = OMIT, + coupon_external_id: typing.Optional[str] = OMIT, + payment_method_external_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ManagePlanResponse: + """ + Parameters + ---------- + add_on_selections : typing.Sequence[PlanSelection] + + company_id : str + + credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] + + pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody] + + base_plan_id : typing.Optional[str] + + base_plan_price_id : typing.Optional[str] + + coupon_external_id : typing.Optional[str] + + payment_method_external_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ManagePlanResponse + OK + + Examples + -------- + import asyncio + + from schematic import ( + AsyncSchematic, + PlanSelection, + UpdateCreditBundleRequestBody, + UpdatePayInAdvanceRequestBody, + ) + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.checkout.manage_plan( + add_on_selections=[ + PlanSelection( + plan_id="plan_id", + ) + ], + company_id="company_id", + credit_bundles=[ + UpdateCreditBundleRequestBody( + bundle_id="bundle_id", + quantity=1, + ) + ], + pay_in_advance_entitlements=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.manage_plan( + add_on_selections=add_on_selections, + company_id=company_id, + credit_bundles=credit_bundles, + pay_in_advance_entitlements=pay_in_advance_entitlements, + base_plan_id=base_plan_id, + base_plan_price_id=base_plan_price_id, + coupon_external_id=coupon_external_id, + payment_method_external_id=payment_method_external_id, + promo_code=promo_code, + request_options=request_options, + ) + return _response.data + + async def preview_manage_plan( + self, + *, + add_on_selections: typing.Sequence[PlanSelection], + company_id: str, + credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], + pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody], + base_plan_id: typing.Optional[str] = OMIT, + base_plan_price_id: typing.Optional[str] = OMIT, + coupon_external_id: typing.Optional[str] = OMIT, + payment_method_external_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> PreviewManagePlanResponse: + """ + Parameters + ---------- + add_on_selections : typing.Sequence[PlanSelection] + + company_id : str + + credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] + + pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody] + + base_plan_id : typing.Optional[str] + + base_plan_price_id : typing.Optional[str] + + coupon_external_id : typing.Optional[str] + + payment_method_external_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PreviewManagePlanResponse + OK + + Examples + -------- + import asyncio + + from schematic import ( + AsyncSchematic, + PlanSelection, + UpdateCreditBundleRequestBody, + UpdatePayInAdvanceRequestBody, + ) + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.checkout.preview_manage_plan( + add_on_selections=[ + PlanSelection( + plan_id="plan_id", + ) + ], + company_id="company_id", + credit_bundles=[ + UpdateCreditBundleRequestBody( + bundle_id="bundle_id", + quantity=1, + ) + ], + pay_in_advance_entitlements=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.preview_manage_plan( + add_on_selections=add_on_selections, + company_id=company_id, + credit_bundles=credit_bundles, + pay_in_advance_entitlements=pay_in_advance_entitlements, + base_plan_id=base_plan_id, + base_plan_price_id=base_plan_price_id, + coupon_external_id=coupon_external_id, + payment_method_external_id=payment_method_external_id, + promo_code=promo_code, + request_options=request_options, + ) + return _response.data + async def update_customer_subscription_trial_end( self, subscription_id: str, diff --git a/src/schematic/checkout/raw_client.py b/src/schematic/checkout/raw_client.py index c8244f2..181d39f 100644 --- a/src/schematic/checkout/raw_client.py +++ b/src/schematic/checkout/raw_client.py @@ -17,12 +17,15 @@ 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_selection import PlanSelection from ..types.update_add_on_request_body import UpdateAddOnRequestBody from ..types.update_credit_bundle_request_body import UpdateCreditBundleRequestBody from ..types.update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody from .types.checkout_internal_response import CheckoutInternalResponse from .types.get_checkout_data_response import GetCheckoutDataResponse +from .types.manage_plan_response import ManagePlanResponse from .types.preview_checkout_internal_response import PreviewCheckoutInternalResponse +from .types.preview_manage_plan_response import PreviewManagePlanResponse from .types.update_customer_subscription_trial_end_response import UpdateCustomerSubscriptionTrialEndResponse # this is used as the default value for optional parameters @@ -436,6 +439,296 @@ def preview_checkout_internal( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def manage_plan( + self, + *, + add_on_selections: typing.Sequence[PlanSelection], + company_id: str, + credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], + pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody], + base_plan_id: typing.Optional[str] = OMIT, + base_plan_price_id: typing.Optional[str] = OMIT, + coupon_external_id: typing.Optional[str] = OMIT, + payment_method_external_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ManagePlanResponse]: + """ + Parameters + ---------- + add_on_selections : typing.Sequence[PlanSelection] + + company_id : str + + credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] + + pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody] + + base_plan_id : typing.Optional[str] + + base_plan_price_id : typing.Optional[str] + + coupon_external_id : typing.Optional[str] + + payment_method_external_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ManagePlanResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "manage-plan", + method="POST", + json={ + "add_on_selections": convert_and_respect_annotation_metadata( + object_=add_on_selections, annotation=typing.Sequence[PlanSelection], direction="write" + ), + "base_plan_id": base_plan_id, + "base_plan_price_id": base_plan_price_id, + "company_id": company_id, + "coupon_external_id": coupon_external_id, + "credit_bundles": convert_and_respect_annotation_metadata( + object_=credit_bundles, annotation=typing.Sequence[UpdateCreditBundleRequestBody], direction="write" + ), + "pay_in_advance_entitlements": convert_and_respect_annotation_metadata( + object_=pay_in_advance_entitlements, + annotation=typing.Sequence[UpdatePayInAdvanceRequestBody], + direction="write", + ), + "payment_method_external_id": payment_method_external_id, + "promo_code": promo_code, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ManagePlanResponse, + parse_obj_as( + type_=ManagePlanResponse, # 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 preview_manage_plan( + self, + *, + add_on_selections: typing.Sequence[PlanSelection], + company_id: str, + credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], + pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody], + base_plan_id: typing.Optional[str] = OMIT, + base_plan_price_id: typing.Optional[str] = OMIT, + coupon_external_id: typing.Optional[str] = OMIT, + payment_method_external_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PreviewManagePlanResponse]: + """ + Parameters + ---------- + add_on_selections : typing.Sequence[PlanSelection] + + company_id : str + + credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] + + pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody] + + base_plan_id : typing.Optional[str] + + base_plan_price_id : typing.Optional[str] + + coupon_external_id : typing.Optional[str] + + payment_method_external_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PreviewManagePlanResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "manage-plan/preview", + method="POST", + json={ + "add_on_selections": convert_and_respect_annotation_metadata( + object_=add_on_selections, annotation=typing.Sequence[PlanSelection], direction="write" + ), + "base_plan_id": base_plan_id, + "base_plan_price_id": base_plan_price_id, + "company_id": company_id, + "coupon_external_id": coupon_external_id, + "credit_bundles": convert_and_respect_annotation_metadata( + object_=credit_bundles, annotation=typing.Sequence[UpdateCreditBundleRequestBody], direction="write" + ), + "pay_in_advance_entitlements": convert_and_respect_annotation_metadata( + object_=pay_in_advance_entitlements, + annotation=typing.Sequence[UpdatePayInAdvanceRequestBody], + direction="write", + ), + "payment_method_external_id": payment_method_external_id, + "promo_code": promo_code, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PreviewManagePlanResponse, + parse_obj_as( + type_=PreviewManagePlanResponse, # 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_customer_subscription_trial_end( self, subscription_id: str, @@ -953,6 +1246,296 @@ async def preview_checkout_internal( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + async def manage_plan( + self, + *, + add_on_selections: typing.Sequence[PlanSelection], + company_id: str, + credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], + pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody], + base_plan_id: typing.Optional[str] = OMIT, + base_plan_price_id: typing.Optional[str] = OMIT, + coupon_external_id: typing.Optional[str] = OMIT, + payment_method_external_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ManagePlanResponse]: + """ + Parameters + ---------- + add_on_selections : typing.Sequence[PlanSelection] + + company_id : str + + credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] + + pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody] + + base_plan_id : typing.Optional[str] + + base_plan_price_id : typing.Optional[str] + + coupon_external_id : typing.Optional[str] + + payment_method_external_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ManagePlanResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "manage-plan", + method="POST", + json={ + "add_on_selections": convert_and_respect_annotation_metadata( + object_=add_on_selections, annotation=typing.Sequence[PlanSelection], direction="write" + ), + "base_plan_id": base_plan_id, + "base_plan_price_id": base_plan_price_id, + "company_id": company_id, + "coupon_external_id": coupon_external_id, + "credit_bundles": convert_and_respect_annotation_metadata( + object_=credit_bundles, annotation=typing.Sequence[UpdateCreditBundleRequestBody], direction="write" + ), + "pay_in_advance_entitlements": convert_and_respect_annotation_metadata( + object_=pay_in_advance_entitlements, + annotation=typing.Sequence[UpdatePayInAdvanceRequestBody], + direction="write", + ), + "payment_method_external_id": payment_method_external_id, + "promo_code": promo_code, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ManagePlanResponse, + parse_obj_as( + type_=ManagePlanResponse, # 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 preview_manage_plan( + self, + *, + add_on_selections: typing.Sequence[PlanSelection], + company_id: str, + credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], + pay_in_advance_entitlements: typing.Sequence[UpdatePayInAdvanceRequestBody], + base_plan_id: typing.Optional[str] = OMIT, + base_plan_price_id: typing.Optional[str] = OMIT, + coupon_external_id: typing.Optional[str] = OMIT, + payment_method_external_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PreviewManagePlanResponse]: + """ + Parameters + ---------- + add_on_selections : typing.Sequence[PlanSelection] + + company_id : str + + credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] + + pay_in_advance_entitlements : typing.Sequence[UpdatePayInAdvanceRequestBody] + + base_plan_id : typing.Optional[str] + + base_plan_price_id : typing.Optional[str] + + coupon_external_id : typing.Optional[str] + + payment_method_external_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PreviewManagePlanResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "manage-plan/preview", + method="POST", + json={ + "add_on_selections": convert_and_respect_annotation_metadata( + object_=add_on_selections, annotation=typing.Sequence[PlanSelection], direction="write" + ), + "base_plan_id": base_plan_id, + "base_plan_price_id": base_plan_price_id, + "company_id": company_id, + "coupon_external_id": coupon_external_id, + "credit_bundles": convert_and_respect_annotation_metadata( + object_=credit_bundles, annotation=typing.Sequence[UpdateCreditBundleRequestBody], direction="write" + ), + "pay_in_advance_entitlements": convert_and_respect_annotation_metadata( + object_=pay_in_advance_entitlements, + annotation=typing.Sequence[UpdatePayInAdvanceRequestBody], + direction="write", + ), + "payment_method_external_id": payment_method_external_id, + "promo_code": promo_code, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PreviewManagePlanResponse, + parse_obj_as( + type_=PreviewManagePlanResponse, # 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_customer_subscription_trial_end( self, subscription_id: str, diff --git a/src/schematic/checkout/types/__init__.py b/src/schematic/checkout/types/__init__.py index e21a926..3d2f135 100644 --- a/src/schematic/checkout/types/__init__.py +++ b/src/schematic/checkout/types/__init__.py @@ -4,12 +4,16 @@ from .checkout_internal_response import CheckoutInternalResponse from .get_checkout_data_response import GetCheckoutDataResponse +from .manage_plan_response import ManagePlanResponse from .preview_checkout_internal_response import PreviewCheckoutInternalResponse +from .preview_manage_plan_response import PreviewManagePlanResponse from .update_customer_subscription_trial_end_response import UpdateCustomerSubscriptionTrialEndResponse __all__ = [ "CheckoutInternalResponse", "GetCheckoutDataResponse", + "ManagePlanResponse", "PreviewCheckoutInternalResponse", + "PreviewManagePlanResponse", "UpdateCustomerSubscriptionTrialEndResponse", ] diff --git a/src/schematic/checkout/types/checkout_internal_response.py b/src/schematic/checkout/types/checkout_internal_response.py index 0df0b69..7235c91 100644 --- a/src/schematic/checkout/types/checkout_internal_response.py +++ b/src/schematic/checkout/types/checkout_internal_response.py @@ -4,11 +4,11 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from ...types.billing_subscription_response_data import BillingSubscriptionResponseData +from ...types.checkout_subscription import CheckoutSubscription class CheckoutInternalResponse(UniversalBaseModel): - data: BillingSubscriptionResponseData + data: CheckoutSubscription params: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() """ Input parameters diff --git a/src/schematic/checkout/types/manage_plan_response.py b/src/schematic/checkout/types/manage_plan_response.py new file mode 100644 index 0000000..80a35d5 --- /dev/null +++ b/src/schematic/checkout/types/manage_plan_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.manage_plan_response_response_data import ManagePlanResponseResponseData + + +class ManagePlanResponse(UniversalBaseModel): + data: ManagePlanResponseResponseData + params: typing.Dict[str, typing.Optional[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/checkout/types/preview_manage_plan_response.py b/src/schematic/checkout/types/preview_manage_plan_response.py new file mode 100644 index 0000000..ee4be04 --- /dev/null +++ b/src/schematic/checkout/types/preview_manage_plan_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.manage_plan_preview_response_response_data import ManagePlanPreviewResponseResponseData + + +class PreviewManagePlanResponse(UniversalBaseModel): + data: ManagePlanPreviewResponseResponseData + params: typing.Dict[str, typing.Optional[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/companies/__init__.py b/src/schematic/companies/__init__.py index d74e8a6..4038ece 100644 --- a/src/schematic/companies/__init__.py +++ b/src/schematic/companies/__init__.py @@ -75,6 +75,7 @@ UpdateEntityTraitDefinitionRequestBodyTraitType, UpdateEntityTraitDefinitionResponse, UpdatePlanTraitResponse, + UpdatePlanTraitsBulkResponse, UpsertCompanyResponse, UpsertCompanyTraitResponse, UpsertUserResponse, @@ -154,6 +155,7 @@ "UpdateEntityTraitDefinitionRequestBodyTraitType", "UpdateEntityTraitDefinitionResponse", "UpdatePlanTraitResponse", + "UpdatePlanTraitsBulkResponse", "UpsertCompanyResponse", "UpsertCompanyTraitResponse", "UpsertUserResponse", diff --git a/src/schematic/companies/client.py b/src/schematic/companies/client.py index 226dfdf..71aee75 100644 --- a/src/schematic/companies/client.py +++ b/src/schematic/companies/client.py @@ -5,6 +5,7 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions +from ..types.update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody from .raw_client import AsyncRawCompaniesClient, RawCompaniesClient from .types.count_companies_for_advanced_filter_request_sort_order_direction import ( CountCompaniesForAdvancedFilterRequestSortOrderDirection, @@ -62,6 +63,7 @@ ) from .types.update_entity_trait_definition_response import UpdateEntityTraitDefinitionResponse from .types.update_plan_trait_response import UpdatePlanTraitResponse +from .types.update_plan_traits_bulk_response import UpdatePlanTraitsBulkResponse from .types.upsert_company_response import UpsertCompanyResponse from .types.upsert_company_trait_response import UpsertCompanyTraitResponse from .types.upsert_user_response import UpsertUserResponse @@ -141,7 +143,15 @@ def list_companies( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.list_companies() + client.companies.list_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.list_companies( ids=ids, @@ -332,7 +342,15 @@ def count_companies( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.count_companies() + 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, @@ -353,6 +371,7 @@ def count_companies_for_advanced_filter( 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[str, typing.Sequence[str]]] = None, subscription_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, monetized_subscriptions: typing.Optional[bool] = None, @@ -378,6 +397,9 @@ def 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_) + 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[str, typing.Sequence[str]]] Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) @@ -403,7 +425,7 @@ def count_companies_for_advanced_filter( 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) + Select the display columns to return (e.g. plan, subscription, users, last_seen_at) limit : typing.Optional[int] Page limit (default 100) @@ -426,12 +448,22 @@ def count_companies_for_advanced_filter( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.count_companies_for_advanced_filter() + 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, + ) """ _response = self._raw_client.count_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, @@ -542,6 +574,7 @@ def list_companies_for_advanced_filter( 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[str, typing.Sequence[str]]] = None, subscription_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, monetized_subscriptions: typing.Optional[bool] = None, @@ -567,6 +600,9 @@ def list_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_) + 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[str, typing.Sequence[str]]] Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) @@ -592,7 +628,7 @@ def list_companies_for_advanced_filter( 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) + Select the display columns to return (e.g. plan, subscription, users, last_seen_at) limit : typing.Optional[int] Page limit (default 100) @@ -615,12 +651,22 @@ def list_companies_for_advanced_filter( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.list_companies_for_advanced_filter() + 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, @@ -707,6 +753,8 @@ def get_active_deals( client.companies.get_active_deals( company_id="company_id", deal_stage="deal_stage", + limit=1, + offset=1, ) """ _response = self._raw_client.get_active_deals( @@ -751,7 +799,12 @@ def list_company_memberships( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.list_company_memberships() + client.companies.list_company_memberships( + company_id="company_id", + user_id="user_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_company_memberships( company_id=company_id, user_id=user_id, limit=limit, offset=offset, request_options=request_options @@ -861,7 +914,11 @@ def get_active_company_subscription( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.get_active_company_subscription() + client.companies.get_active_company_subscription( + company_id="company_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.get_active_company_subscription( company_id=company_id, company_ids=company_ids, limit=limit, offset=offset, request_options=request_options @@ -961,7 +1018,12 @@ def list_entity_key_definitions( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.list_entity_key_definitions() + client.companies.list_entity_key_definitions( + entity_type="company", + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_entity_key_definitions( entity_type=entity_type, ids=ids, q=q, limit=limit, offset=offset, request_options=request_options @@ -1008,7 +1070,12 @@ def count_entity_key_definitions( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.count_entity_key_definitions() + client.companies.count_entity_key_definitions( + entity_type="company", + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_entity_key_definitions( entity_type=entity_type, ids=ids, q=q, limit=limit, offset=offset, request_options=request_options @@ -1058,7 +1125,13 @@ def list_entity_trait_definitions( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.list_entity_trait_definitions() + client.companies.list_entity_trait_definitions( + entity_type="company", + q="q", + trait_type="boolean", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_entity_trait_definitions( entity_type=entity_type, @@ -1243,7 +1316,13 @@ def count_entity_trait_definitions( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.count_entity_trait_definitions() + client.companies.count_entity_trait_definitions( + entity_type="company", + q="q", + trait_type="boolean", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_entity_trait_definitions( entity_type=entity_type, @@ -1295,6 +1374,9 @@ def get_entity_trait_values( ) client.companies.get_entity_trait_values( definition_id="definition_id", + q="q", + limit=1, + offset=1, ) """ _response = self._raw_client.get_entity_trait_values( @@ -1345,7 +1427,12 @@ def list_plan_traits( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.list_plan_traits() + client.companies.list_plan_traits( + plan_id="plan_id", + trait_id="trait_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_plan_traits( ids=ids, @@ -1502,6 +1589,50 @@ def delete_plan_trait( _response = self._raw_client.delete_plan_trait(plan_trait_id, request_options=request_options) return _response.data + def update_plan_traits_bulk( + self, + *, + plan_id: str, + traits: typing.Sequence[UpdatePlanTraitTraitRequestBody], + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdatePlanTraitsBulkResponse: + """ + Parameters + ---------- + plan_id : str + + traits : typing.Sequence[UpdatePlanTraitTraitRequestBody] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdatePlanTraitsBulkResponse + OK + + Examples + -------- + from schematic import Schematic, UpdatePlanTraitTraitRequestBody + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.companies.update_plan_traits_bulk( + plan_id="plan_id", + traits=[ + UpdatePlanTraitTraitRequestBody( + trait_id="trait_id", + trait_value="trait_value", + ) + ], + ) + """ + _response = self._raw_client.update_plan_traits_bulk( + plan_id=plan_id, traits=traits, request_options=request_options + ) + return _response.data + def count_plan_traits( self, *, @@ -1545,7 +1676,12 @@ def count_plan_traits( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.count_plan_traits() + client.companies.count_plan_traits( + plan_id="plan_id", + trait_id="trait_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_plan_traits( ids=ids, @@ -1658,7 +1794,13 @@ def list_users( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.list_users() + client.companies.list_users( + company_id="company_id", + plan_id="plan_id", + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_users( company_id=company_id, @@ -1857,7 +1999,13 @@ def count_users( client = Schematic( api_key="YOUR_API_KEY", ) - client.companies.count_users() + client.companies.count_users( + company_id="company_id", + plan_id="plan_id", + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_users( company_id=company_id, @@ -2086,7 +2234,15 @@ async def list_companies( async def main() -> None: - await client.companies.list_companies() + await client.companies.list_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()) @@ -2309,7 +2465,15 @@ async def count_companies( async def main() -> None: - await client.companies.count_companies() + 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()) @@ -2333,6 +2497,7 @@ async def count_companies_for_advanced_filter( 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[str, typing.Sequence[str]]] = None, subscription_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, monetized_subscriptions: typing.Optional[bool] = None, @@ -2358,6 +2523,9 @@ async def 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_) + 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[str, typing.Sequence[str]]] Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) @@ -2383,7 +2551,7 @@ async def count_companies_for_advanced_filter( 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) + Select the display columns to return (e.g. plan, subscription, users, last_seen_at) limit : typing.Optional[int] Page limit (default 100) @@ -2411,7 +2579,16 @@ async def count_companies_for_advanced_filter( async def main() -> None: - await client.companies.count_companies_for_advanced_filter() + await 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, + ) asyncio.run(main()) @@ -2420,6 +2597,7 @@ async def main() -> None: 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, @@ -2546,6 +2724,7 @@ async def list_companies_for_advanced_filter( 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[str, typing.Sequence[str]]] = None, subscription_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, monetized_subscriptions: typing.Optional[bool] = None, @@ -2571,6 +2750,9 @@ async def list_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_) + 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[str, typing.Sequence[str]]] Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) @@ -2596,7 +2778,7 @@ async def list_companies_for_advanced_filter( 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) + Select the display columns to return (e.g. plan, subscription, users, last_seen_at) limit : typing.Optional[int] Page limit (default 100) @@ -2624,7 +2806,16 @@ async def list_companies_for_advanced_filter( async def main() -> None: - await client.companies.list_companies_for_advanced_filter() + 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()) @@ -2633,6 +2824,7 @@ async def main() -> None: 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, @@ -2732,6 +2924,8 @@ async def main() -> None: await client.companies.get_active_deals( company_id="company_id", deal_stage="deal_stage", + limit=1, + offset=1, ) @@ -2784,7 +2978,12 @@ async def list_company_memberships( async def main() -> None: - await client.companies.list_company_memberships() + await client.companies.list_company_memberships( + company_id="company_id", + user_id="user_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2920,7 +3119,11 @@ async def get_active_company_subscription( async def main() -> None: - await client.companies.get_active_company_subscription() + await client.companies.get_active_company_subscription( + company_id="company_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -3036,7 +3239,12 @@ async def list_entity_key_definitions( async def main() -> None: - await client.companies.list_entity_key_definitions() + await client.companies.list_entity_key_definitions( + entity_type="company", + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -3091,7 +3299,12 @@ async def count_entity_key_definitions( async def main() -> None: - await client.companies.count_entity_key_definitions() + await client.companies.count_entity_key_definitions( + entity_type="company", + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -3149,7 +3362,13 @@ async def list_entity_trait_definitions( async def main() -> None: - await client.companies.list_entity_trait_definitions() + await client.companies.list_entity_trait_definitions( + entity_type="company", + q="q", + trait_type="boolean", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -3366,7 +3585,13 @@ async def count_entity_trait_definitions( async def main() -> None: - await client.companies.count_entity_trait_definitions() + await client.companies.count_entity_trait_definitions( + entity_type="company", + q="q", + trait_type="boolean", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -3426,6 +3651,9 @@ async def get_entity_trait_values( async def main() -> None: await client.companies.get_entity_trait_values( definition_id="definition_id", + q="q", + limit=1, + offset=1, ) @@ -3484,7 +3712,12 @@ async def list_plan_traits( async def main() -> None: - await client.companies.list_plan_traits() + await client.companies.list_plan_traits( + plan_id="plan_id", + trait_id="trait_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -3676,6 +3909,58 @@ async def main() -> None: _response = await self._raw_client.delete_plan_trait(plan_trait_id, request_options=request_options) return _response.data + async def update_plan_traits_bulk( + self, + *, + plan_id: str, + traits: typing.Sequence[UpdatePlanTraitTraitRequestBody], + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdatePlanTraitsBulkResponse: + """ + Parameters + ---------- + plan_id : str + + traits : typing.Sequence[UpdatePlanTraitTraitRequestBody] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdatePlanTraitsBulkResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic, UpdatePlanTraitTraitRequestBody + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.companies.update_plan_traits_bulk( + plan_id="plan_id", + traits=[ + UpdatePlanTraitTraitRequestBody( + trait_id="trait_id", + trait_value="trait_value", + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.update_plan_traits_bulk( + plan_id=plan_id, traits=traits, request_options=request_options + ) + return _response.data + async def count_plan_traits( self, *, @@ -3724,7 +4009,12 @@ async def count_plan_traits( async def main() -> None: - await client.companies.count_plan_traits() + await client.companies.count_plan_traits( + plan_id="plan_id", + trait_id="trait_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -3853,7 +4143,13 @@ async def list_users( async def main() -> None: - await client.companies.list_users() + await client.companies.list_users( + company_id="company_id", + plan_id="plan_id", + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -4086,7 +4382,13 @@ async def count_users( async def main() -> None: - await client.companies.count_users() + await client.companies.count_users( + company_id="company_id", + plan_id="plan_id", + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) diff --git a/src/schematic/companies/raw_client.py b/src/schematic/companies/raw_client.py index 58c83b9..884c6ac 100644 --- a/src/schematic/companies/raw_client.py +++ b/src/schematic/companies/raw_client.py @@ -10,12 +10,14 @@ 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.update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody from .types.count_companies_for_advanced_filter_request_sort_order_direction import ( CountCompaniesForAdvancedFilterRequestSortOrderDirection, ) @@ -72,6 +74,7 @@ ) from .types.update_entity_trait_definition_response import UpdateEntityTraitDefinitionResponse from .types.update_plan_trait_response import UpdatePlanTraitResponse +from .types.update_plan_traits_bulk_response import UpdatePlanTraitsBulkResponse from .types.upsert_company_response import UpsertCompanyResponse from .types.upsert_company_trait_response import UpsertCompanyTraitResponse from .types.upsert_user_response import UpsertUserResponse @@ -674,6 +677,7 @@ def count_companies_for_advanced_filter( 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[str, typing.Sequence[str]]] = None, subscription_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, monetized_subscriptions: typing.Optional[bool] = None, @@ -699,6 +703,9 @@ def 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_) + 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[str, typing.Sequence[str]]] Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) @@ -724,7 +731,7 @@ def count_companies_for_advanced_filter( 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) + Select the display columns to return (e.g. plan, subscription, users, last_seen_at) limit : typing.Optional[int] Page limit (default 100) @@ -747,6 +754,7 @@ def count_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, @@ -1071,6 +1079,7 @@ def list_companies_for_advanced_filter( 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[str, typing.Sequence[str]]] = None, subscription_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, monetized_subscriptions: typing.Optional[bool] = None, @@ -1096,6 +1105,9 @@ def list_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_) + 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[str, typing.Sequence[str]]] Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) @@ -1121,7 +1133,7 @@ def list_companies_for_advanced_filter( 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) + Select the display columns to return (e.g. plan, subscription, users, last_seen_at) limit : typing.Optional[int] Page limit (default 100) @@ -1144,6 +1156,7 @@ def 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, @@ -3431,6 +3444,117 @@ def delete_plan_trait( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def update_plan_traits_bulk( + self, + *, + plan_id: str, + traits: typing.Sequence[UpdatePlanTraitTraitRequestBody], + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[UpdatePlanTraitsBulkResponse]: + """ + Parameters + ---------- + plan_id : str + + traits : typing.Sequence[UpdatePlanTraitTraitRequestBody] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[UpdatePlanTraitsBulkResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "plan-traits/bulk", + method="POST", + json={ + "plan_id": plan_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( + UpdatePlanTraitsBulkResponse, + parse_obj_as( + type_=UpdatePlanTraitsBulkResponse, # 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_plan_traits( self, *, @@ -5195,6 +5319,7 @@ async def count_companies_for_advanced_filter( 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[str, typing.Sequence[str]]] = None, subscription_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, monetized_subscriptions: typing.Optional[bool] = None, @@ -5220,6 +5345,9 @@ async def 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_) + 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[str, typing.Sequence[str]]] Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) @@ -5245,7 +5373,7 @@ async def count_companies_for_advanced_filter( 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) + Select the display columns to return (e.g. plan, subscription, users, last_seen_at) limit : typing.Optional[int] Page limit (default 100) @@ -5268,6 +5396,7 @@ async def count_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, @@ -5592,6 +5721,7 @@ async def list_companies_for_advanced_filter( 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[str, typing.Sequence[str]]] = None, subscription_types: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, monetized_subscriptions: typing.Optional[bool] = None, @@ -5617,6 +5747,9 @@ async def list_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_) + 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[str, typing.Sequence[str]]] Filter companies by one or more subscription statuses (active, canceled, expired, incomplete, incomplete_expired, past_due, paused, trialing, unpaid) @@ -5642,7 +5775,7 @@ async def list_companies_for_advanced_filter( 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) + Select the display columns to return (e.g. plan, subscription, users, last_seen_at) limit : typing.Optional[int] Page limit (default 100) @@ -5665,6 +5798,7 @@ async def 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, @@ -7952,6 +8086,117 @@ async def delete_plan_trait( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + async def update_plan_traits_bulk( + self, + *, + plan_id: str, + traits: typing.Sequence[UpdatePlanTraitTraitRequestBody], + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[UpdatePlanTraitsBulkResponse]: + """ + Parameters + ---------- + plan_id : str + + traits : typing.Sequence[UpdatePlanTraitTraitRequestBody] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[UpdatePlanTraitsBulkResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "plan-traits/bulk", + method="POST", + json={ + "plan_id": plan_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( + UpdatePlanTraitsBulkResponse, + parse_obj_as( + type_=UpdatePlanTraitsBulkResponse, # 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_plan_traits( self, *, diff --git a/src/schematic/companies/types/__init__.py b/src/schematic/companies/types/__init__.py index 5a235b8..bf6028d 100644 --- a/src/schematic/companies/types/__init__.py +++ b/src/schematic/companies/types/__init__.py @@ -88,6 +88,7 @@ from .update_entity_trait_definition_request_body_trait_type import UpdateEntityTraitDefinitionRequestBodyTraitType from .update_entity_trait_definition_response import UpdateEntityTraitDefinitionResponse from .update_plan_trait_response import UpdatePlanTraitResponse +from .update_plan_traits_bulk_response import UpdatePlanTraitsBulkResponse from .upsert_company_response import UpsertCompanyResponse from .upsert_company_trait_response import UpsertCompanyTraitResponse from .upsert_user_response import UpsertUserResponse @@ -166,6 +167,7 @@ "UpdateEntityTraitDefinitionRequestBodyTraitType", "UpdateEntityTraitDefinitionResponse", "UpdatePlanTraitResponse", + "UpdatePlanTraitsBulkResponse", "UpsertCompanyResponse", "UpsertCompanyTraitResponse", "UpsertUserResponse", 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 index da32505..1684e24 100644 --- a/src/schematic/companies/types/count_companies_for_advanced_filter_params.py +++ b/src/schematic/companies/types/count_companies_for_advanced_filter_params.py @@ -14,9 +14,14 @@ 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) + 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) diff --git a/src/schematic/companies/types/get_active_company_subscription_response.py b/src/schematic/companies/types/get_active_company_subscription_response.py index 9b7ea95..574d83c 100644 --- a/src/schematic/companies/types/get_active_company_subscription_response.py +++ b/src/schematic/companies/types/get_active_company_subscription_response.py @@ -9,11 +9,7 @@ class GetActiveCompanySubscriptionResponse(UniversalBaseModel): - data: typing.List[CompanySubscriptionResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[CompanySubscriptionResponseData] params: GetActiveCompanySubscriptionParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/companies/types/get_active_deals_response.py b/src/schematic/companies/types/get_active_deals_response.py index ca4484f..1981c86 100644 --- a/src/schematic/companies/types/get_active_deals_response.py +++ b/src/schematic/companies/types/get_active_deals_response.py @@ -9,11 +9,7 @@ class GetActiveDealsResponse(UniversalBaseModel): - data: typing.List[CompanyCrmDealsResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[CompanyCrmDealsResponseData] params: GetActiveDealsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/companies/types/get_entity_trait_values_response.py b/src/schematic/companies/types/get_entity_trait_values_response.py index 5873635..5c12a5c 100644 --- a/src/schematic/companies/types/get_entity_trait_values_response.py +++ b/src/schematic/companies/types/get_entity_trait_values_response.py @@ -9,11 +9,7 @@ class GetEntityTraitValuesResponse(UniversalBaseModel): - data: typing.List[EntityTraitValue] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[EntityTraitValue] params: GetEntityTraitValuesParams = pydantic.Field() """ Input parameters 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 index 653c7b4..21fe8d9 100644 --- a/src/schematic/companies/types/list_companies_for_advanced_filter_params.py +++ b/src/schematic/companies/types/list_companies_for_advanced_filter_params.py @@ -14,9 +14,14 @@ 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) + 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) 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 index 6ad88a8..a1f40ca 100644 --- a/src/schematic/companies/types/list_companies_for_advanced_filter_response.py +++ b/src/schematic/companies/types/list_companies_for_advanced_filter_response.py @@ -9,11 +9,7 @@ class ListCompaniesForAdvancedFilterResponse(UniversalBaseModel): - data: typing.List[CompanyViewWithFeatureUsageResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[CompanyViewWithFeatureUsageResponseData] params: ListCompaniesForAdvancedFilterParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/companies/types/list_companies_response.py b/src/schematic/companies/types/list_companies_response.py index 58f7d3b..ab9c7c2 100644 --- a/src/schematic/companies/types/list_companies_response.py +++ b/src/schematic/companies/types/list_companies_response.py @@ -9,11 +9,7 @@ class ListCompaniesResponse(UniversalBaseModel): - data: typing.List[CompanyDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[CompanyDetailResponseData] params: ListCompaniesParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/companies/types/list_company_memberships_response.py b/src/schematic/companies/types/list_company_memberships_response.py index 8771d44..28aec5f 100644 --- a/src/schematic/companies/types/list_company_memberships_response.py +++ b/src/schematic/companies/types/list_company_memberships_response.py @@ -9,11 +9,7 @@ class ListCompanyMembershipsResponse(UniversalBaseModel): - data: typing.List[CompanyMembershipDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[CompanyMembershipDetailResponseData] params: ListCompanyMembershipsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/companies/types/list_entity_key_definitions_response.py b/src/schematic/companies/types/list_entity_key_definitions_response.py index fd1e9d3..538234c 100644 --- a/src/schematic/companies/types/list_entity_key_definitions_response.py +++ b/src/schematic/companies/types/list_entity_key_definitions_response.py @@ -9,11 +9,7 @@ class ListEntityKeyDefinitionsResponse(UniversalBaseModel): - data: typing.List[EntityKeyDefinitionResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[EntityKeyDefinitionResponseData] params: ListEntityKeyDefinitionsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/companies/types/list_entity_trait_definitions_response.py b/src/schematic/companies/types/list_entity_trait_definitions_response.py index b1af5fe..840592e 100644 --- a/src/schematic/companies/types/list_entity_trait_definitions_response.py +++ b/src/schematic/companies/types/list_entity_trait_definitions_response.py @@ -9,11 +9,7 @@ class ListEntityTraitDefinitionsResponse(UniversalBaseModel): - data: typing.List[EntityTraitDefinitionResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[EntityTraitDefinitionResponseData] params: ListEntityTraitDefinitionsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/companies/types/list_plan_traits_response.py b/src/schematic/companies/types/list_plan_traits_response.py index 9d85e80..f06c732 100644 --- a/src/schematic/companies/types/list_plan_traits_response.py +++ b/src/schematic/companies/types/list_plan_traits_response.py @@ -9,11 +9,7 @@ class ListPlanTraitsResponse(UniversalBaseModel): - data: typing.List[PlanTraitResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[PlanTraitResponseData] params: ListPlanTraitsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/companies/types/list_users_response.py b/src/schematic/companies/types/list_users_response.py index db9cff5..b6ce7e7 100644 --- a/src/schematic/companies/types/list_users_response.py +++ b/src/schematic/companies/types/list_users_response.py @@ -9,11 +9,7 @@ class ListUsersResponse(UniversalBaseModel): - data: typing.List[UserDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[UserDetailResponseData] params: ListUsersParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/companies/types/update_plan_traits_bulk_response.py b/src/schematic/companies/types/update_plan_traits_bulk_response.py new file mode 100644 index 0000000..667186f --- /dev/null +++ b/src/schematic/companies/types/update_plan_traits_bulk_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_trait_response_data import PlanTraitResponseData + + +class UpdatePlanTraitsBulkResponse(UniversalBaseModel): + data: typing.List[PlanTraitResponseData] + params: typing.Dict[str, typing.Optional[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/components/client.py b/src/schematic/components/client.py index 0b6db4a..f5d2928 100644 --- a/src/schematic/components/client.py +++ b/src/schematic/components/client.py @@ -69,7 +69,11 @@ def list_components( client = Schematic( api_key="YOUR_API_KEY", ) - client.components.list_components() + client.components.list_components( + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_components(q=q, limit=limit, offset=offset, request_options=request_options) return _response.data @@ -260,7 +264,11 @@ def count_components( client = Schematic( api_key="YOUR_API_KEY", ) - client.components.count_components() + client.components.count_components( + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_components(q=q, limit=limit, offset=offset, request_options=request_options) return _response.data @@ -294,7 +302,10 @@ def preview_component_data( client = Schematic( api_key="YOUR_API_KEY", ) - client.components.preview_component_data() + client.components.preview_component_data( + company_id="company_id", + component_id="component_id", + ) """ _response = self._raw_client.preview_component_data( company_id=company_id, component_id=component_id, request_options=request_options @@ -356,7 +367,11 @@ async def list_components( async def main() -> None: - await client.components.list_components() + await client.components.list_components( + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -589,7 +604,11 @@ async def count_components( async def main() -> None: - await client.components.count_components() + await client.components.count_components( + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -633,7 +652,10 @@ async def preview_component_data( async def main() -> None: - await client.components.preview_component_data() + await client.components.preview_component_data( + company_id="company_id", + component_id="component_id", + ) asyncio.run(main()) diff --git a/src/schematic/components/types/list_components_response.py b/src/schematic/components/types/list_components_response.py index b7c4ad4..f56599c 100644 --- a/src/schematic/components/types/list_components_response.py +++ b/src/schematic/components/types/list_components_response.py @@ -9,11 +9,7 @@ class ListComponentsResponse(UniversalBaseModel): - data: typing.List[ComponentResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[ComponentResponseData] params: ListComponentsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/core/client_wrapper.py b/src/schematic/core/client_wrapper.py index e6763e6..2619fb9 100644 --- a/src/schematic/core/client_wrapper.py +++ b/src/schematic/core/client_wrapper.py @@ -14,10 +14,10 @@ def __init__(self, *, api_key: str, base_url: str, timeout: typing.Optional[floa def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "schematichq/1.1.0", + "User-Agent": "schematichq/1.1.1", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "schematichq", - "X-Fern-SDK-Version": "1.1.0", + "X-Fern-SDK-Version": "1.1.1", } headers["X-Schematic-Api-Key"] = self.api_key return headers diff --git a/src/schematic/credits/__init__.py b/src/schematic/credits/__init__.py index 97cdc6a..e08fcf4 100644 --- a/src/schematic/credits/__init__.py +++ b/src/schematic/credits/__init__.py @@ -13,18 +13,32 @@ CountCreditBundlesRequestStatus, CountCreditBundlesResponse, CountCreditBundlesResponseParamsStatus, + CountCreditLedgerParams, + CountCreditLedgerRequestPeriod, + CountCreditLedgerResponse, + CountCreditLedgerResponseParamsPeriod, CreateBillingCreditRequestBodyBurnStrategy, CreateBillingCreditRequestBodyDefaultRolloverPolicy, CreateBillingCreditResponse, + CreateBillingPlanCreditGrantRequestBodyExpiryType, + CreateBillingPlanCreditGrantRequestBodyExpiryUnit, CreateBillingPlanCreditGrantRequestBodyResetCadence, CreateBillingPlanCreditGrantRequestBodyResetStart, + CreateBillingPlanCreditGrantRequestBodyResetType, CreateBillingPlanCreditGrantResponse, + CreateCompanyCreditGrantExpiryType, + CreateCompanyCreditGrantExpiryUnit, CreateCreditBundleRequestBodyExpiryType, + CreateCreditBundleRequestBodyExpiryUnit, CreateCreditBundleRequestBodyStatus, CreateCreditBundleResponse, DeleteBillingPlanCreditGrantResponse, DeleteCreditBundleResponse, GetCreditBundleResponse, + GetEnrichedCreditLedgerParams, + GetEnrichedCreditLedgerRequestPeriod, + GetEnrichedCreditLedgerResponse, + GetEnrichedCreditLedgerResponseParamsPeriod, GetSingleBillingCreditResponse, GrantBillingCreditsToCompanyResponse, ListBillingCreditsParams, @@ -48,6 +62,7 @@ UpdateBillingCreditRequestBodyDefaultRolloverPolicy, UpdateBillingCreditResponse, UpdateCreditBundleDetailsRequestBodyExpiryType, + UpdateCreditBundleDetailsRequestBodyExpiryUnit, UpdateCreditBundleDetailsRequestBodyStatus, UpdateCreditBundleDetailsResponse, ZeroOutGrantRequestBodyReason, @@ -65,18 +80,32 @@ "CountCreditBundlesRequestStatus", "CountCreditBundlesResponse", "CountCreditBundlesResponseParamsStatus", + "CountCreditLedgerParams", + "CountCreditLedgerRequestPeriod", + "CountCreditLedgerResponse", + "CountCreditLedgerResponseParamsPeriod", "CreateBillingCreditRequestBodyBurnStrategy", "CreateBillingCreditRequestBodyDefaultRolloverPolicy", "CreateBillingCreditResponse", + "CreateBillingPlanCreditGrantRequestBodyExpiryType", + "CreateBillingPlanCreditGrantRequestBodyExpiryUnit", "CreateBillingPlanCreditGrantRequestBodyResetCadence", "CreateBillingPlanCreditGrantRequestBodyResetStart", + "CreateBillingPlanCreditGrantRequestBodyResetType", "CreateBillingPlanCreditGrantResponse", + "CreateCompanyCreditGrantExpiryType", + "CreateCompanyCreditGrantExpiryUnit", "CreateCreditBundleRequestBodyExpiryType", + "CreateCreditBundleRequestBodyExpiryUnit", "CreateCreditBundleRequestBodyStatus", "CreateCreditBundleResponse", "DeleteBillingPlanCreditGrantResponse", "DeleteCreditBundleResponse", "GetCreditBundleResponse", + "GetEnrichedCreditLedgerParams", + "GetEnrichedCreditLedgerRequestPeriod", + "GetEnrichedCreditLedgerResponse", + "GetEnrichedCreditLedgerResponseParamsPeriod", "GetSingleBillingCreditResponse", "GrantBillingCreditsToCompanyResponse", "ListBillingCreditsParams", @@ -100,6 +129,7 @@ "UpdateBillingCreditRequestBodyDefaultRolloverPolicy", "UpdateBillingCreditResponse", "UpdateCreditBundleDetailsRequestBodyExpiryType", + "UpdateCreditBundleDetailsRequestBodyExpiryUnit", "UpdateCreditBundleDetailsRequestBodyStatus", "UpdateCreditBundleDetailsResponse", "ZeroOutGrantRequestBodyReason", diff --git a/src/schematic/credits/client.py b/src/schematic/credits/client.py index f08f634..e13516a 100644 --- a/src/schematic/credits/client.py +++ b/src/schematic/credits/client.py @@ -11,24 +11,40 @@ from .types.count_billing_plan_credit_grants_response import CountBillingPlanCreditGrantsResponse from .types.count_credit_bundles_request_status import CountCreditBundlesRequestStatus from .types.count_credit_bundles_response import CountCreditBundlesResponse +from .types.count_credit_ledger_request_period import CountCreditLedgerRequestPeriod +from .types.count_credit_ledger_response import CountCreditLedgerResponse from .types.create_billing_credit_request_body_burn_strategy import CreateBillingCreditRequestBodyBurnStrategy from .types.create_billing_credit_request_body_default_rollover_policy import ( CreateBillingCreditRequestBodyDefaultRolloverPolicy, ) from .types.create_billing_credit_response import CreateBillingCreditResponse +from .types.create_billing_plan_credit_grant_request_body_expiry_type import ( + CreateBillingPlanCreditGrantRequestBodyExpiryType, +) +from .types.create_billing_plan_credit_grant_request_body_expiry_unit import ( + CreateBillingPlanCreditGrantRequestBodyExpiryUnit, +) from .types.create_billing_plan_credit_grant_request_body_reset_cadence import ( CreateBillingPlanCreditGrantRequestBodyResetCadence, ) from .types.create_billing_plan_credit_grant_request_body_reset_start import ( CreateBillingPlanCreditGrantRequestBodyResetStart, ) +from .types.create_billing_plan_credit_grant_request_body_reset_type import ( + CreateBillingPlanCreditGrantRequestBodyResetType, +) from .types.create_billing_plan_credit_grant_response import CreateBillingPlanCreditGrantResponse +from .types.create_company_credit_grant_expiry_type import CreateCompanyCreditGrantExpiryType +from .types.create_company_credit_grant_expiry_unit import CreateCompanyCreditGrantExpiryUnit from .types.create_credit_bundle_request_body_expiry_type import CreateCreditBundleRequestBodyExpiryType +from .types.create_credit_bundle_request_body_expiry_unit import CreateCreditBundleRequestBodyExpiryUnit from .types.create_credit_bundle_request_body_status import CreateCreditBundleRequestBodyStatus from .types.create_credit_bundle_response import CreateCreditBundleResponse from .types.delete_billing_plan_credit_grant_response import DeleteBillingPlanCreditGrantResponse from .types.delete_credit_bundle_response import DeleteCreditBundleResponse from .types.get_credit_bundle_response import GetCreditBundleResponse +from .types.get_enriched_credit_ledger_request_period import GetEnrichedCreditLedgerRequestPeriod +from .types.get_enriched_credit_ledger_response import GetEnrichedCreditLedgerResponse from .types.get_single_billing_credit_response import GetSingleBillingCreditResponse from .types.grant_billing_credits_to_company_response import GrantBillingCreditsToCompanyResponse from .types.list_billing_credits_response import ListBillingCreditsResponse @@ -46,6 +62,7 @@ ) from .types.update_billing_credit_response import UpdateBillingCreditResponse from .types.update_credit_bundle_details_request_body_expiry_type import UpdateCreditBundleDetailsRequestBodyExpiryType +from .types.update_credit_bundle_details_request_body_expiry_unit import UpdateCreditBundleDetailsRequestBodyExpiryUnit from .types.update_credit_bundle_details_request_body_status import UpdateCreditBundleDetailsRequestBodyStatus from .types.update_credit_bundle_details_response import UpdateCreditBundleDetailsResponse from .types.zero_out_grant_request_body_reason import ZeroOutGrantRequestBodyReason @@ -107,7 +124,11 @@ def list_billing_credits( client = Schematic( api_key="YOUR_API_KEY", ) - client.credits.list_billing_credits() + client.credits.list_billing_credits( + name="name", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_billing_credits( ids=ids, name=name, limit=limit, offset=offset, request_options=request_options @@ -384,7 +405,12 @@ def list_credit_bundles( client = Schematic( api_key="YOUR_API_KEY", ) - client.credits.list_credit_bundles() + client.credits.list_credit_bundles( + credit_id="credit_id", + status="active", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_credit_bundles( ids=ids, @@ -406,7 +432,7 @@ def create_credit_bundle( price_per_unit: int, bundle_type: typing.Optional[typing.Literal["fixed"]] = OMIT, expiry_type: typing.Optional[CreateCreditBundleRequestBodyExpiryType] = OMIT, - expiry_unit: typing.Optional[typing.Literal["days"]] = OMIT, + expiry_unit: typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, price_per_unit_decimal: typing.Optional[str] = OMIT, quantity: typing.Optional[int] = OMIT, @@ -428,7 +454,7 @@ def create_credit_bundle( expiry_type : typing.Optional[CreateCreditBundleRequestBodyExpiryType] - expiry_unit : typing.Optional[typing.Literal["days"]] + expiry_unit : typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] expiry_unit_count : typing.Optional[int] @@ -514,6 +540,7 @@ def update_credit_bundle_details( bundle_name: str, price_per_unit: int, expiry_type: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] = OMIT, + expiry_unit: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, price_per_unit_decimal: typing.Optional[str] = OMIT, quantity: typing.Optional[int] = OMIT, @@ -532,6 +559,8 @@ def update_credit_bundle_details( expiry_type : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] + expiry_unit : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] + expiry_unit_count : typing.Optional[int] price_per_unit_decimal : typing.Optional[str] @@ -566,6 +595,7 @@ def update_credit_bundle_details( bundle_name=bundle_name, price_per_unit=price_per_unit, expiry_type=expiry_type, + expiry_unit=expiry_unit, expiry_unit_count=expiry_unit_count, price_per_unit_decimal=price_per_unit_decimal, quantity=quantity, @@ -648,7 +678,12 @@ def count_credit_bundles( client = Schematic( api_key="YOUR_API_KEY", ) - client.credits.count_credit_bundles() + client.credits.count_credit_bundles( + credit_id="credit_id", + status="active", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_credit_bundles( ids=ids, @@ -698,7 +733,11 @@ def count_billing_credits( client = Schematic( api_key="YOUR_API_KEY", ) - client.credits.count_billing_credits() + client.credits.count_billing_credits( + name="name", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_billing_credits( ids=ids, name=name, limit=limit, offset=offset, request_options=request_options @@ -749,7 +788,11 @@ def grant_billing_credits_to_company( credit_id: str, quantity: int, reason: str, + billing_periods_count: typing.Optional[int] = OMIT, expires_at: typing.Optional[dt.datetime] = OMIT, + expiry_type: typing.Optional[CreateCompanyCreditGrantExpiryType] = OMIT, + expiry_unit: typing.Optional[CreateCompanyCreditGrantExpiryUnit] = OMIT, + expiry_unit_count: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GrantBillingCreditsToCompanyResponse: """ @@ -763,8 +806,16 @@ def grant_billing_credits_to_company( reason : str + billing_periods_count : typing.Optional[int] + expires_at : typing.Optional[dt.datetime] + expiry_type : typing.Optional[CreateCompanyCreditGrantExpiryType] + + expiry_unit : typing.Optional[CreateCompanyCreditGrantExpiryUnit] + + expiry_unit_count : typing.Optional[int] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -792,7 +843,11 @@ def grant_billing_credits_to_company( credit_id=credit_id, quantity=quantity, reason=reason, + billing_periods_count=billing_periods_count, expires_at=expires_at, + expiry_type=expiry_type, + expiry_unit=expiry_unit, + expiry_unit_count=expiry_unit_count, request_options=request_options, ) return _response.data @@ -837,7 +892,13 @@ def list_company_grants( client = Schematic( api_key="YOUR_API_KEY", ) - client.credits.list_company_grants() + client.credits.list_company_grants( + company_id="company_id", + order="created_at", + dir="asc", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_company_grants( company_id=company_id, order=order, dir=dir, limit=limit, offset=offset, request_options=request_options @@ -881,7 +942,11 @@ def count_billing_credits_grants( client = Schematic( api_key="YOUR_API_KEY", ) - client.credits.count_billing_credits_grants() + client.credits.count_billing_credits_grants( + credit_id="credit_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_billing_credits_grants( credit_id=credit_id, ids=ids, limit=limit, offset=offset, request_options=request_options @@ -925,13 +990,163 @@ def list_grants_for_credit( client = Schematic( api_key="YOUR_API_KEY", ) - client.credits.list_grants_for_credit() + client.credits.list_grants_for_credit( + credit_id="credit_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_grants_for_credit( credit_id=credit_id, ids=ids, limit=limit, offset=offset, request_options=request_options ) return _response.data + def get_enriched_credit_ledger( + self, + *, + company_id: str, + period: GetEnrichedCreditLedgerRequestPeriod, + billing_credit_id: typing.Optional[str] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetEnrichedCreditLedgerResponse: + """ + Parameters + ---------- + company_id : str + + period : GetEnrichedCreditLedgerRequestPeriod + + billing_credit_id : typing.Optional[str] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + end_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 + ------- + GetEnrichedCreditLedgerResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.credits.get_enriched_credit_ledger( + company_id="company_id", + billing_credit_id="billing_credit_id", + feature_id="feature_id", + period="daily", + start_time="start_time", + end_time="end_time", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.get_enriched_credit_ledger( + company_id=company_id, + period=period, + billing_credit_id=billing_credit_id, + feature_id=feature_id, + start_time=start_time, + end_time=end_time, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + + def count_credit_ledger( + self, + *, + company_id: str, + period: CountCreditLedgerRequestPeriod, + billing_credit_id: typing.Optional[str] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountCreditLedgerResponse: + """ + Parameters + ---------- + company_id : str + + period : CountCreditLedgerRequestPeriod + + billing_credit_id : typing.Optional[str] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + end_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 + ------- + CountCreditLedgerResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.credits.count_credit_ledger( + company_id="company_id", + billing_credit_id="billing_credit_id", + feature_id="feature_id", + period="daily", + start_time="start_time", + end_time="end_time", + limit=1, + offset=1, + ) + """ + _response = self._raw_client.count_credit_ledger( + company_id=company_id, + period=period, + billing_credit_id=billing_credit_id, + feature_id=feature_id, + start_time=start_time, + end_time=end_time, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + def list_billing_plan_credit_grants( self, *, @@ -975,7 +1190,12 @@ def list_billing_plan_credit_grants( client = Schematic( api_key="YOUR_API_KEY", ) - client.credits.list_billing_plan_credit_grants() + client.credits.list_billing_plan_credit_grants( + credit_id="credit_id", + plan_id="plan_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_billing_plan_credit_grants( credit_id=credit_id, @@ -996,6 +1216,10 @@ def create_billing_plan_credit_grant( plan_id: str, reset_cadence: CreateBillingPlanCreditGrantRequestBodyResetCadence, reset_start: CreateBillingPlanCreditGrantRequestBodyResetStart, + expiry_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] = OMIT, + expiry_unit: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] = OMIT, + expiry_unit_count: typing.Optional[int] = OMIT, + reset_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateBillingPlanCreditGrantResponse: """ @@ -1011,6 +1235,14 @@ def create_billing_plan_credit_grant( reset_start : CreateBillingPlanCreditGrantRequestBodyResetStart + expiry_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] + + expiry_unit : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] + + expiry_unit_count : typing.Optional[int] + + reset_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1040,6 +1272,10 @@ def create_billing_plan_credit_grant( plan_id=plan_id, reset_cadence=reset_cadence, reset_start=reset_start, + expiry_type=expiry_type, + expiry_unit=expiry_unit, + expiry_unit_count=expiry_unit_count, + reset_type=reset_type, request_options=request_options, ) return _response.data @@ -1118,7 +1354,12 @@ def count_billing_plan_credit_grants( client = Schematic( api_key="YOUR_API_KEY", ) - client.credits.count_billing_plan_credit_grants() + client.credits.count_billing_plan_credit_grants( + credit_id="credit_id", + plan_id="plan_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_billing_plan_credit_grants( credit_id=credit_id, @@ -1189,7 +1430,11 @@ async def list_billing_credits( async def main() -> None: - await client.credits.list_billing_credits() + await client.credits.list_billing_credits( + name="name", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1506,7 +1751,12 @@ async def list_credit_bundles( async def main() -> None: - await client.credits.list_credit_bundles() + await client.credits.list_credit_bundles( + credit_id="credit_id", + status="active", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1531,7 +1781,7 @@ async def create_credit_bundle( price_per_unit: int, bundle_type: typing.Optional[typing.Literal["fixed"]] = OMIT, expiry_type: typing.Optional[CreateCreditBundleRequestBodyExpiryType] = OMIT, - expiry_unit: typing.Optional[typing.Literal["days"]] = OMIT, + expiry_unit: typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, price_per_unit_decimal: typing.Optional[str] = OMIT, quantity: typing.Optional[int] = OMIT, @@ -1553,7 +1803,7 @@ async def create_credit_bundle( expiry_type : typing.Optional[CreateCreditBundleRequestBodyExpiryType] - expiry_unit : typing.Optional[typing.Literal["days"]] + expiry_unit : typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] expiry_unit_count : typing.Optional[int] @@ -1655,6 +1905,7 @@ async def update_credit_bundle_details( bundle_name: str, price_per_unit: int, expiry_type: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] = OMIT, + expiry_unit: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, price_per_unit_decimal: typing.Optional[str] = OMIT, quantity: typing.Optional[int] = OMIT, @@ -1673,6 +1924,8 @@ async def update_credit_bundle_details( expiry_type : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] + expiry_unit : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] + expiry_unit_count : typing.Optional[int] price_per_unit_decimal : typing.Optional[str] @@ -1715,6 +1968,7 @@ async def main() -> None: bundle_name=bundle_name, price_per_unit=price_per_unit, expiry_type=expiry_type, + expiry_unit=expiry_unit, expiry_unit_count=expiry_unit_count, price_per_unit_decimal=price_per_unit_decimal, quantity=quantity, @@ -1810,7 +2064,12 @@ async def count_credit_bundles( async def main() -> None: - await client.credits.count_credit_bundles() + await client.credits.count_credit_bundles( + credit_id="credit_id", + status="active", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1868,7 +2127,11 @@ async def count_billing_credits( async def main() -> None: - await client.credits.count_billing_credits() + await client.credits.count_billing_credits( + name="name", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1930,7 +2193,11 @@ async def grant_billing_credits_to_company( credit_id: str, quantity: int, reason: str, + billing_periods_count: typing.Optional[int] = OMIT, expires_at: typing.Optional[dt.datetime] = OMIT, + expiry_type: typing.Optional[CreateCompanyCreditGrantExpiryType] = OMIT, + expiry_unit: typing.Optional[CreateCompanyCreditGrantExpiryUnit] = OMIT, + expiry_unit_count: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GrantBillingCreditsToCompanyResponse: """ @@ -1944,8 +2211,16 @@ async def grant_billing_credits_to_company( reason : str + billing_periods_count : typing.Optional[int] + expires_at : typing.Optional[dt.datetime] + expiry_type : typing.Optional[CreateCompanyCreditGrantExpiryType] + + expiry_unit : typing.Optional[CreateCompanyCreditGrantExpiryUnit] + + expiry_unit_count : typing.Optional[int] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1981,7 +2256,11 @@ async def main() -> None: credit_id=credit_id, quantity=quantity, reason=reason, + billing_periods_count=billing_periods_count, expires_at=expires_at, + expiry_type=expiry_type, + expiry_unit=expiry_unit, + expiry_unit_count=expiry_unit_count, request_options=request_options, ) return _response.data @@ -2031,7 +2310,13 @@ async def list_company_grants( async def main() -> None: - await client.credits.list_company_grants() + await client.credits.list_company_grants( + company_id="company_id", + order="created_at", + dir="asc", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2083,7 +2368,11 @@ async def count_billing_credits_grants( async def main() -> None: - await client.credits.count_billing_credits_grants() + await client.credits.count_billing_credits_grants( + credit_id="credit_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2135,7 +2424,11 @@ async def list_grants_for_credit( async def main() -> None: - await client.credits.list_grants_for_credit() + await client.credits.list_grants_for_credit( + credit_id="credit_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2145,6 +2438,168 @@ async def main() -> None: ) return _response.data + async def get_enriched_credit_ledger( + self, + *, + company_id: str, + period: GetEnrichedCreditLedgerRequestPeriod, + billing_credit_id: typing.Optional[str] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetEnrichedCreditLedgerResponse: + """ + Parameters + ---------- + company_id : str + + period : GetEnrichedCreditLedgerRequestPeriod + + billing_credit_id : typing.Optional[str] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + end_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 + ------- + GetEnrichedCreditLedgerResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.credits.get_enriched_credit_ledger( + company_id="company_id", + billing_credit_id="billing_credit_id", + feature_id="feature_id", + period="daily", + start_time="start_time", + end_time="end_time", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_enriched_credit_ledger( + company_id=company_id, + period=period, + billing_credit_id=billing_credit_id, + feature_id=feature_id, + start_time=start_time, + end_time=end_time, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + + async def count_credit_ledger( + self, + *, + company_id: str, + period: CountCreditLedgerRequestPeriod, + billing_credit_id: typing.Optional[str] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> CountCreditLedgerResponse: + """ + Parameters + ---------- + company_id : str + + period : CountCreditLedgerRequestPeriod + + billing_credit_id : typing.Optional[str] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + end_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 + ------- + CountCreditLedgerResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.credits.count_credit_ledger( + company_id="company_id", + billing_credit_id="billing_credit_id", + feature_id="feature_id", + period="daily", + start_time="start_time", + end_time="end_time", + limit=1, + offset=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.count_credit_ledger( + company_id=company_id, + period=period, + billing_credit_id=billing_credit_id, + feature_id=feature_id, + start_time=start_time, + end_time=end_time, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + async def list_billing_plan_credit_grants( self, *, @@ -2193,7 +2648,12 @@ async def list_billing_plan_credit_grants( async def main() -> None: - await client.credits.list_billing_plan_credit_grants() + await client.credits.list_billing_plan_credit_grants( + credit_id="credit_id", + plan_id="plan_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2217,6 +2677,10 @@ async def create_billing_plan_credit_grant( plan_id: str, reset_cadence: CreateBillingPlanCreditGrantRequestBodyResetCadence, reset_start: CreateBillingPlanCreditGrantRequestBodyResetStart, + expiry_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] = OMIT, + expiry_unit: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] = OMIT, + expiry_unit_count: typing.Optional[int] = OMIT, + reset_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateBillingPlanCreditGrantResponse: """ @@ -2232,6 +2696,14 @@ async def create_billing_plan_credit_grant( reset_start : CreateBillingPlanCreditGrantRequestBodyResetStart + expiry_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] + + expiry_unit : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] + + expiry_unit_count : typing.Optional[int] + + reset_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2269,6 +2741,10 @@ async def main() -> None: plan_id=plan_id, reset_cadence=reset_cadence, reset_start=reset_start, + expiry_type=expiry_type, + expiry_unit=expiry_unit, + expiry_unit_count=expiry_unit_count, + reset_type=reset_type, request_options=request_options, ) return _response.data @@ -2360,7 +2836,12 @@ async def count_billing_plan_credit_grants( async def main() -> None: - await client.credits.count_billing_plan_credit_grants() + await client.credits.count_billing_plan_credit_grants( + credit_id="credit_id", + plan_id="plan_id", + limit=1, + offset=1, + ) asyncio.run(main()) diff --git a/src/schematic/credits/raw_client.py b/src/schematic/credits/raw_client.py index 4bca2c7..42c3423 100644 --- a/src/schematic/credits/raw_client.py +++ b/src/schematic/credits/raw_client.py @@ -21,24 +21,40 @@ from .types.count_billing_plan_credit_grants_response import CountBillingPlanCreditGrantsResponse from .types.count_credit_bundles_request_status import CountCreditBundlesRequestStatus from .types.count_credit_bundles_response import CountCreditBundlesResponse +from .types.count_credit_ledger_request_period import CountCreditLedgerRequestPeriod +from .types.count_credit_ledger_response import CountCreditLedgerResponse from .types.create_billing_credit_request_body_burn_strategy import CreateBillingCreditRequestBodyBurnStrategy from .types.create_billing_credit_request_body_default_rollover_policy import ( CreateBillingCreditRequestBodyDefaultRolloverPolicy, ) from .types.create_billing_credit_response import CreateBillingCreditResponse +from .types.create_billing_plan_credit_grant_request_body_expiry_type import ( + CreateBillingPlanCreditGrantRequestBodyExpiryType, +) +from .types.create_billing_plan_credit_grant_request_body_expiry_unit import ( + CreateBillingPlanCreditGrantRequestBodyExpiryUnit, +) from .types.create_billing_plan_credit_grant_request_body_reset_cadence import ( CreateBillingPlanCreditGrantRequestBodyResetCadence, ) from .types.create_billing_plan_credit_grant_request_body_reset_start import ( CreateBillingPlanCreditGrantRequestBodyResetStart, ) +from .types.create_billing_plan_credit_grant_request_body_reset_type import ( + CreateBillingPlanCreditGrantRequestBodyResetType, +) from .types.create_billing_plan_credit_grant_response import CreateBillingPlanCreditGrantResponse +from .types.create_company_credit_grant_expiry_type import CreateCompanyCreditGrantExpiryType +from .types.create_company_credit_grant_expiry_unit import CreateCompanyCreditGrantExpiryUnit from .types.create_credit_bundle_request_body_expiry_type import CreateCreditBundleRequestBodyExpiryType +from .types.create_credit_bundle_request_body_expiry_unit import CreateCreditBundleRequestBodyExpiryUnit from .types.create_credit_bundle_request_body_status import CreateCreditBundleRequestBodyStatus from .types.create_credit_bundle_response import CreateCreditBundleResponse from .types.delete_billing_plan_credit_grant_response import DeleteBillingPlanCreditGrantResponse from .types.delete_credit_bundle_response import DeleteCreditBundleResponse from .types.get_credit_bundle_response import GetCreditBundleResponse +from .types.get_enriched_credit_ledger_request_period import GetEnrichedCreditLedgerRequestPeriod +from .types.get_enriched_credit_ledger_response import GetEnrichedCreditLedgerResponse from .types.get_single_billing_credit_response import GetSingleBillingCreditResponse from .types.grant_billing_credits_to_company_response import GrantBillingCreditsToCompanyResponse from .types.list_billing_credits_response import ListBillingCreditsResponse @@ -56,6 +72,7 @@ ) from .types.update_billing_credit_response import UpdateBillingCreditResponse from .types.update_credit_bundle_details_request_body_expiry_type import UpdateCreditBundleDetailsRequestBodyExpiryType +from .types.update_credit_bundle_details_request_body_expiry_unit import UpdateCreditBundleDetailsRequestBodyExpiryUnit from .types.update_credit_bundle_details_request_body_status import UpdateCreditBundleDetailsRequestBodyStatus from .types.update_credit_bundle_details_response import UpdateCreditBundleDetailsResponse from .types.zero_out_grant_request_body_reason import ZeroOutGrantRequestBodyReason @@ -795,7 +812,7 @@ def create_credit_bundle( price_per_unit: int, bundle_type: typing.Optional[typing.Literal["fixed"]] = OMIT, expiry_type: typing.Optional[CreateCreditBundleRequestBodyExpiryType] = OMIT, - expiry_unit: typing.Optional[typing.Literal["days"]] = OMIT, + expiry_unit: typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, price_per_unit_decimal: typing.Optional[str] = OMIT, quantity: typing.Optional[int] = OMIT, @@ -817,7 +834,7 @@ def create_credit_bundle( expiry_type : typing.Optional[CreateCreditBundleRequestBodyExpiryType] - expiry_unit : typing.Optional[typing.Literal["days"]] + expiry_unit : typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] expiry_unit_count : typing.Optional[int] @@ -1023,6 +1040,7 @@ def update_credit_bundle_details( bundle_name: str, price_per_unit: int, expiry_type: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] = OMIT, + expiry_unit: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, price_per_unit_decimal: typing.Optional[str] = OMIT, quantity: typing.Optional[int] = OMIT, @@ -1041,6 +1059,8 @@ def update_credit_bundle_details( expiry_type : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] + expiry_unit : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] + expiry_unit_count : typing.Optional[int] price_per_unit_decimal : typing.Optional[str] @@ -1063,6 +1083,7 @@ def update_credit_bundle_details( json={ "bundle_name": bundle_name, "expiry_type": expiry_type, + "expiry_unit": expiry_unit, "expiry_unit_count": expiry_unit_count, "price_per_unit": price_per_unit, "price_per_unit_decimal": price_per_unit_decimal, @@ -1599,7 +1620,11 @@ def grant_billing_credits_to_company( credit_id: str, quantity: int, reason: str, + billing_periods_count: typing.Optional[int] = OMIT, expires_at: typing.Optional[dt.datetime] = OMIT, + expiry_type: typing.Optional[CreateCompanyCreditGrantExpiryType] = OMIT, + expiry_unit: typing.Optional[CreateCompanyCreditGrantExpiryUnit] = OMIT, + expiry_unit_count: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GrantBillingCreditsToCompanyResponse]: """ @@ -1613,8 +1638,16 @@ def grant_billing_credits_to_company( reason : str + billing_periods_count : typing.Optional[int] + expires_at : typing.Optional[dt.datetime] + expiry_type : typing.Optional[CreateCompanyCreditGrantExpiryType] + + expiry_unit : typing.Optional[CreateCompanyCreditGrantExpiryUnit] + + expiry_unit_count : typing.Optional[int] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1627,9 +1660,13 @@ def grant_billing_credits_to_company( "billing/credits/grants/company", method="POST", json={ + "billing_periods_count": billing_periods_count, "company_id": company_id, "credit_id": credit_id, "expires_at": expires_at, + "expiry_type": expiry_type, + "expiry_unit": expiry_unit, + "expiry_unit_count": expiry_unit_count, "quantity": quantity, "reason": reason, }, @@ -2062,6 +2099,268 @@ def list_grants_for_credit( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def get_enriched_credit_ledger( + self, + *, + company_id: str, + period: GetEnrichedCreditLedgerRequestPeriod, + billing_credit_id: typing.Optional[str] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[GetEnrichedCreditLedgerResponse]: + """ + Parameters + ---------- + company_id : str + + period : GetEnrichedCreditLedgerRequestPeriod + + billing_credit_id : typing.Optional[str] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + end_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 + ------- + HttpResponse[GetEnrichedCreditLedgerResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "billing/credits/ledger", + method="GET", + params={ + "company_id": company_id, + "billing_credit_id": billing_credit_id, + "feature_id": feature_id, + "period": period, + "start_time": start_time, + "end_time": end_time, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetEnrichedCreditLedgerResponse, + parse_obj_as( + type_=GetEnrichedCreditLedgerResponse, # 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_credit_ledger( + self, + *, + company_id: str, + period: CountCreditLedgerRequestPeriod, + billing_credit_id: typing.Optional[str] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[CountCreditLedgerResponse]: + """ + Parameters + ---------- + company_id : str + + period : CountCreditLedgerRequestPeriod + + billing_credit_id : typing.Optional[str] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + end_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 + ------- + HttpResponse[CountCreditLedgerResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "billing/credits/ledger/count", + method="GET", + params={ + "company_id": company_id, + "billing_credit_id": billing_credit_id, + "feature_id": feature_id, + "period": period, + "start_time": start_time, + "end_time": end_time, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CountCreditLedgerResponse, + parse_obj_as( + type_=CountCreditLedgerResponse, # 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_billing_plan_credit_grants( self, *, @@ -2193,6 +2492,10 @@ def create_billing_plan_credit_grant( plan_id: str, reset_cadence: CreateBillingPlanCreditGrantRequestBodyResetCadence, reset_start: CreateBillingPlanCreditGrantRequestBodyResetStart, + expiry_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] = OMIT, + expiry_unit: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] = OMIT, + expiry_unit_count: typing.Optional[int] = OMIT, + reset_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateBillingPlanCreditGrantResponse]: """ @@ -2208,6 +2511,14 @@ def create_billing_plan_credit_grant( reset_start : CreateBillingPlanCreditGrantRequestBodyResetStart + expiry_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] + + expiry_unit : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] + + expiry_unit_count : typing.Optional[int] + + reset_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2222,9 +2533,13 @@ def create_billing_plan_credit_grant( json={ "credit_amount": credit_amount, "credit_id": credit_id, + "expiry_type": expiry_type, + "expiry_unit": expiry_unit, + "expiry_unit_count": expiry_unit_count, "plan_id": plan_id, "reset_cadence": reset_cadence, "reset_start": reset_start, + "reset_type": reset_type, }, headers={ "content-type": "application/json", @@ -3256,7 +3571,7 @@ async def create_credit_bundle( price_per_unit: int, bundle_type: typing.Optional[typing.Literal["fixed"]] = OMIT, expiry_type: typing.Optional[CreateCreditBundleRequestBodyExpiryType] = OMIT, - expiry_unit: typing.Optional[typing.Literal["days"]] = OMIT, + expiry_unit: typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, price_per_unit_decimal: typing.Optional[str] = OMIT, quantity: typing.Optional[int] = OMIT, @@ -3278,7 +3593,7 @@ async def create_credit_bundle( expiry_type : typing.Optional[CreateCreditBundleRequestBodyExpiryType] - expiry_unit : typing.Optional[typing.Literal["days"]] + expiry_unit : typing.Optional[CreateCreditBundleRequestBodyExpiryUnit] expiry_unit_count : typing.Optional[int] @@ -3484,6 +3799,7 @@ async def update_credit_bundle_details( bundle_name: str, price_per_unit: int, expiry_type: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] = OMIT, + expiry_unit: typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] = OMIT, expiry_unit_count: typing.Optional[int] = OMIT, price_per_unit_decimal: typing.Optional[str] = OMIT, quantity: typing.Optional[int] = OMIT, @@ -3502,6 +3818,8 @@ async def update_credit_bundle_details( expiry_type : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryType] + expiry_unit : typing.Optional[UpdateCreditBundleDetailsRequestBodyExpiryUnit] + expiry_unit_count : typing.Optional[int] price_per_unit_decimal : typing.Optional[str] @@ -3524,6 +3842,7 @@ async def update_credit_bundle_details( json={ "bundle_name": bundle_name, "expiry_type": expiry_type, + "expiry_unit": expiry_unit, "expiry_unit_count": expiry_unit_count, "price_per_unit": price_per_unit, "price_per_unit_decimal": price_per_unit_decimal, @@ -4060,7 +4379,11 @@ async def grant_billing_credits_to_company( credit_id: str, quantity: int, reason: str, + billing_periods_count: typing.Optional[int] = OMIT, expires_at: typing.Optional[dt.datetime] = OMIT, + expiry_type: typing.Optional[CreateCompanyCreditGrantExpiryType] = OMIT, + expiry_unit: typing.Optional[CreateCompanyCreditGrantExpiryUnit] = OMIT, + expiry_unit_count: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GrantBillingCreditsToCompanyResponse]: """ @@ -4074,8 +4397,16 @@ async def grant_billing_credits_to_company( reason : str + billing_periods_count : typing.Optional[int] + expires_at : typing.Optional[dt.datetime] + expiry_type : typing.Optional[CreateCompanyCreditGrantExpiryType] + + expiry_unit : typing.Optional[CreateCompanyCreditGrantExpiryUnit] + + expiry_unit_count : typing.Optional[int] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4088,9 +4419,13 @@ async def grant_billing_credits_to_company( "billing/credits/grants/company", method="POST", json={ + "billing_periods_count": billing_periods_count, "company_id": company_id, "credit_id": credit_id, "expires_at": expires_at, + "expiry_type": expiry_type, + "expiry_unit": expiry_unit, + "expiry_unit_count": expiry_unit_count, "quantity": quantity, "reason": reason, }, @@ -4523,6 +4858,268 @@ async def list_grants_for_credit( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + async def get_enriched_credit_ledger( + self, + *, + company_id: str, + period: GetEnrichedCreditLedgerRequestPeriod, + billing_credit_id: typing.Optional[str] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[GetEnrichedCreditLedgerResponse]: + """ + Parameters + ---------- + company_id : str + + period : GetEnrichedCreditLedgerRequestPeriod + + billing_credit_id : typing.Optional[str] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + end_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[GetEnrichedCreditLedgerResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "billing/credits/ledger", + method="GET", + params={ + "company_id": company_id, + "billing_credit_id": billing_credit_id, + "feature_id": feature_id, + "period": period, + "start_time": start_time, + "end_time": end_time, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetEnrichedCreditLedgerResponse, + parse_obj_as( + type_=GetEnrichedCreditLedgerResponse, # 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_ledger( + self, + *, + company_id: str, + period: CountCreditLedgerRequestPeriod, + billing_credit_id: typing.Optional[str] = None, + feature_id: typing.Optional[str] = None, + start_time: typing.Optional[str] = None, + end_time: typing.Optional[str] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CountCreditLedgerResponse]: + """ + Parameters + ---------- + company_id : str + + period : CountCreditLedgerRequestPeriod + + billing_credit_id : typing.Optional[str] + + feature_id : typing.Optional[str] + + start_time : typing.Optional[str] + + end_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[CountCreditLedgerResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "billing/credits/ledger/count", + method="GET", + params={ + "company_id": company_id, + "billing_credit_id": billing_credit_id, + "feature_id": feature_id, + "period": period, + "start_time": start_time, + "end_time": end_time, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CountCreditLedgerResponse, + parse_obj_as( + type_=CountCreditLedgerResponse, # 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_billing_plan_credit_grants( self, *, @@ -4654,6 +5251,10 @@ async def create_billing_plan_credit_grant( plan_id: str, reset_cadence: CreateBillingPlanCreditGrantRequestBodyResetCadence, reset_start: CreateBillingPlanCreditGrantRequestBodyResetStart, + expiry_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] = OMIT, + expiry_unit: typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] = OMIT, + expiry_unit_count: typing.Optional[int] = OMIT, + reset_type: typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateBillingPlanCreditGrantResponse]: """ @@ -4669,6 +5270,14 @@ async def create_billing_plan_credit_grant( reset_start : CreateBillingPlanCreditGrantRequestBodyResetStart + expiry_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryType] + + expiry_unit : typing.Optional[CreateBillingPlanCreditGrantRequestBodyExpiryUnit] + + expiry_unit_count : typing.Optional[int] + + reset_type : typing.Optional[CreateBillingPlanCreditGrantRequestBodyResetType] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4683,9 +5292,13 @@ async def create_billing_plan_credit_grant( json={ "credit_amount": credit_amount, "credit_id": credit_id, + "expiry_type": expiry_type, + "expiry_unit": expiry_unit, + "expiry_unit_count": expiry_unit_count, "plan_id": plan_id, "reset_cadence": reset_cadence, "reset_start": reset_start, + "reset_type": reset_type, }, headers={ "content-type": "application/json", diff --git a/src/schematic/credits/types/__init__.py b/src/schematic/credits/types/__init__.py index c371f6b..23525ee 100644 --- a/src/schematic/credits/types/__init__.py +++ b/src/schematic/credits/types/__init__.py @@ -12,22 +12,36 @@ from .count_credit_bundles_request_status import CountCreditBundlesRequestStatus from .count_credit_bundles_response import CountCreditBundlesResponse from .count_credit_bundles_response_params_status import CountCreditBundlesResponseParamsStatus +from .count_credit_ledger_params import CountCreditLedgerParams +from .count_credit_ledger_request_period import CountCreditLedgerRequestPeriod +from .count_credit_ledger_response import CountCreditLedgerResponse +from .count_credit_ledger_response_params_period import CountCreditLedgerResponseParamsPeriod from .create_billing_credit_request_body_burn_strategy import CreateBillingCreditRequestBodyBurnStrategy from .create_billing_credit_request_body_default_rollover_policy import ( CreateBillingCreditRequestBodyDefaultRolloverPolicy, ) from .create_billing_credit_response import CreateBillingCreditResponse +from .create_billing_plan_credit_grant_request_body_expiry_type import CreateBillingPlanCreditGrantRequestBodyExpiryType +from .create_billing_plan_credit_grant_request_body_expiry_unit import CreateBillingPlanCreditGrantRequestBodyExpiryUnit from .create_billing_plan_credit_grant_request_body_reset_cadence import ( CreateBillingPlanCreditGrantRequestBodyResetCadence, ) from .create_billing_plan_credit_grant_request_body_reset_start import CreateBillingPlanCreditGrantRequestBodyResetStart +from .create_billing_plan_credit_grant_request_body_reset_type import CreateBillingPlanCreditGrantRequestBodyResetType from .create_billing_plan_credit_grant_response import CreateBillingPlanCreditGrantResponse +from .create_company_credit_grant_expiry_type import CreateCompanyCreditGrantExpiryType +from .create_company_credit_grant_expiry_unit import CreateCompanyCreditGrantExpiryUnit from .create_credit_bundle_request_body_expiry_type import CreateCreditBundleRequestBodyExpiryType +from .create_credit_bundle_request_body_expiry_unit import CreateCreditBundleRequestBodyExpiryUnit from .create_credit_bundle_request_body_status import CreateCreditBundleRequestBodyStatus from .create_credit_bundle_response import CreateCreditBundleResponse from .delete_billing_plan_credit_grant_response import DeleteBillingPlanCreditGrantResponse from .delete_credit_bundle_response import DeleteCreditBundleResponse from .get_credit_bundle_response import GetCreditBundleResponse +from .get_enriched_credit_ledger_params import GetEnrichedCreditLedgerParams +from .get_enriched_credit_ledger_request_period import GetEnrichedCreditLedgerRequestPeriod +from .get_enriched_credit_ledger_response import GetEnrichedCreditLedgerResponse +from .get_enriched_credit_ledger_response_params_period import GetEnrichedCreditLedgerResponseParamsPeriod from .get_single_billing_credit_response import GetSingleBillingCreditResponse from .grant_billing_credits_to_company_response import GrantBillingCreditsToCompanyResponse from .list_billing_credits_params import ListBillingCreditsParams @@ -53,6 +67,7 @@ ) from .update_billing_credit_response import UpdateBillingCreditResponse from .update_credit_bundle_details_request_body_expiry_type import UpdateCreditBundleDetailsRequestBodyExpiryType +from .update_credit_bundle_details_request_body_expiry_unit import UpdateCreditBundleDetailsRequestBodyExpiryUnit from .update_credit_bundle_details_request_body_status import UpdateCreditBundleDetailsRequestBodyStatus from .update_credit_bundle_details_response import UpdateCreditBundleDetailsResponse from .zero_out_grant_request_body_reason import ZeroOutGrantRequestBodyReason @@ -69,18 +84,32 @@ "CountCreditBundlesRequestStatus", "CountCreditBundlesResponse", "CountCreditBundlesResponseParamsStatus", + "CountCreditLedgerParams", + "CountCreditLedgerRequestPeriod", + "CountCreditLedgerResponse", + "CountCreditLedgerResponseParamsPeriod", "CreateBillingCreditRequestBodyBurnStrategy", "CreateBillingCreditRequestBodyDefaultRolloverPolicy", "CreateBillingCreditResponse", + "CreateBillingPlanCreditGrantRequestBodyExpiryType", + "CreateBillingPlanCreditGrantRequestBodyExpiryUnit", "CreateBillingPlanCreditGrantRequestBodyResetCadence", "CreateBillingPlanCreditGrantRequestBodyResetStart", + "CreateBillingPlanCreditGrantRequestBodyResetType", "CreateBillingPlanCreditGrantResponse", + "CreateCompanyCreditGrantExpiryType", + "CreateCompanyCreditGrantExpiryUnit", "CreateCreditBundleRequestBodyExpiryType", + "CreateCreditBundleRequestBodyExpiryUnit", "CreateCreditBundleRequestBodyStatus", "CreateCreditBundleResponse", "DeleteBillingPlanCreditGrantResponse", "DeleteCreditBundleResponse", "GetCreditBundleResponse", + "GetEnrichedCreditLedgerParams", + "GetEnrichedCreditLedgerRequestPeriod", + "GetEnrichedCreditLedgerResponse", + "GetEnrichedCreditLedgerResponseParamsPeriod", "GetSingleBillingCreditResponse", "GrantBillingCreditsToCompanyResponse", "ListBillingCreditsParams", @@ -104,6 +133,7 @@ "UpdateBillingCreditRequestBodyDefaultRolloverPolicy", "UpdateBillingCreditResponse", "UpdateCreditBundleDetailsRequestBodyExpiryType", + "UpdateCreditBundleDetailsRequestBodyExpiryUnit", "UpdateCreditBundleDetailsRequestBodyStatus", "UpdateCreditBundleDetailsResponse", "ZeroOutGrantRequestBodyReason", diff --git a/src/schematic/credits/types/count_credit_ledger_params.py b/src/schematic/credits/types/count_credit_ledger_params.py new file mode 100644 index 0000000..3b096f2 --- /dev/null +++ b/src/schematic/credits/types/count_credit_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 .count_credit_ledger_response_params_period import CountCreditLedgerResponseParamsPeriod + + +class CountCreditLedgerParams(UniversalBaseModel): + """ + Input parameters + """ + + billing_credit_id: typing.Optional[str] = None + company_id: typing.Optional[str] = None + end_time: typing.Optional[str] = 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) + """ + + period: typing.Optional[CountCreditLedgerResponseParamsPeriod] = None + 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_ledger_request_period.py b/src/schematic/credits/types/count_credit_ledger_request_period.py new file mode 100644 index 0000000..6e4ef87 --- /dev/null +++ b/src/schematic/credits/types/count_credit_ledger_request_period.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CountCreditLedgerRequestPeriod = typing.Union[typing.Literal["daily", "weekly", "monthly", "raw"], typing.Any] diff --git a/src/schematic/credits/types/count_credit_ledger_response.py b/src/schematic/credits/types/count_credit_ledger_response.py new file mode 100644 index 0000000..5928819 --- /dev/null +++ b/src/schematic/credits/types/count_credit_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_ledger_params import CountCreditLedgerParams + + +class CountCreditLedgerResponse(UniversalBaseModel): + data: CountResponse + params: CountCreditLedgerParams = 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/count_credit_ledger_response_params_period.py b/src/schematic/credits/types/count_credit_ledger_response_params_period.py new file mode 100644 index 0000000..a454022 --- /dev/null +++ b/src/schematic/credits/types/count_credit_ledger_response_params_period.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CountCreditLedgerResponseParamsPeriod = typing.Union[typing.Literal["daily", "weekly", "monthly", "raw"], typing.Any] diff --git a/src/schematic/credits/types/create_billing_plan_credit_grant_request_body_expiry_type.py b/src/schematic/credits/types/create_billing_plan_credit_grant_request_body_expiry_type.py new file mode 100644 index 0000000..29b4a40 --- /dev/null +++ b/src/schematic/credits/types/create_billing_plan_credit_grant_request_body_expiry_type.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateBillingPlanCreditGrantRequestBodyExpiryType = typing.Union[ + typing.Literal["duration", "no_expiry", "end_of_trial", "end_of_billing_period", "end_of_next_billing_period"], + typing.Any, +] diff --git a/src/schematic/credits/types/create_billing_plan_credit_grant_request_body_expiry_unit.py b/src/schematic/credits/types/create_billing_plan_credit_grant_request_body_expiry_unit.py new file mode 100644 index 0000000..02f4f6e --- /dev/null +++ b/src/schematic/credits/types/create_billing_plan_credit_grant_request_body_expiry_unit.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateBillingPlanCreditGrantRequestBodyExpiryUnit = typing.Union[typing.Literal["days", "billing_periods"], typing.Any] diff --git a/src/schematic/credits/types/create_billing_plan_credit_grant_request_body_reset_type.py b/src/schematic/credits/types/create_billing_plan_credit_grant_request_body_reset_type.py new file mode 100644 index 0000000..4ea8578 --- /dev/null +++ b/src/schematic/credits/types/create_billing_plan_credit_grant_request_body_reset_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateBillingPlanCreditGrantRequestBodyResetType = typing.Union[typing.Literal["plan_period", "no_reset"], typing.Any] diff --git a/src/schematic/credits/types/create_company_credit_grant_expiry_type.py b/src/schematic/credits/types/create_company_credit_grant_expiry_type.py new file mode 100644 index 0000000..baca601 --- /dev/null +++ b/src/schematic/credits/types/create_company_credit_grant_expiry_type.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateCompanyCreditGrantExpiryType = typing.Union[ + typing.Literal["duration", "no_expiry", "end_of_trial", "end_of_billing_period", "end_of_next_billing_period"], + typing.Any, +] diff --git a/src/schematic/credits/types/create_company_credit_grant_expiry_unit.py b/src/schematic/credits/types/create_company_credit_grant_expiry_unit.py new file mode 100644 index 0000000..a5909ee --- /dev/null +++ b/src/schematic/credits/types/create_company_credit_grant_expiry_unit.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateCompanyCreditGrantExpiryUnit = typing.Union[typing.Literal["days", "billing_periods"], typing.Any] diff --git a/src/schematic/credits/types/create_credit_bundle_request_body_expiry_type.py b/src/schematic/credits/types/create_credit_bundle_request_body_expiry_type.py index bb22025..f3d88a4 100644 --- a/src/schematic/credits/types/create_credit_bundle_request_body_expiry_type.py +++ b/src/schematic/credits/types/create_credit_bundle_request_body_expiry_type.py @@ -2,4 +2,7 @@ import typing -CreateCreditBundleRequestBodyExpiryType = typing.Union[typing.Literal["days_from_purchase", "no_expiry"], typing.Any] +CreateCreditBundleRequestBodyExpiryType = typing.Union[ + typing.Literal["duration", "no_expiry", "end_of_trial", "end_of_billing_period", "end_of_next_billing_period"], + typing.Any, +] diff --git a/src/schematic/credits/types/create_credit_bundle_request_body_expiry_unit.py b/src/schematic/credits/types/create_credit_bundle_request_body_expiry_unit.py new file mode 100644 index 0000000..e4d1f81 --- /dev/null +++ b/src/schematic/credits/types/create_credit_bundle_request_body_expiry_unit.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreateCreditBundleRequestBodyExpiryUnit = typing.Union[typing.Literal["days", "billing_periods"], typing.Any] diff --git a/src/schematic/credits/types/get_enriched_credit_ledger_params.py b/src/schematic/credits/types/get_enriched_credit_ledger_params.py new file mode 100644 index 0000000..627355f --- /dev/null +++ b/src/schematic/credits/types/get_enriched_credit_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 .get_enriched_credit_ledger_response_params_period import GetEnrichedCreditLedgerResponseParamsPeriod + + +class GetEnrichedCreditLedgerParams(UniversalBaseModel): + """ + Input parameters + """ + + billing_credit_id: typing.Optional[str] = None + company_id: typing.Optional[str] = None + end_time: typing.Optional[str] = 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) + """ + + period: typing.Optional[GetEnrichedCreditLedgerResponseParamsPeriod] = None + 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/get_enriched_credit_ledger_request_period.py b/src/schematic/credits/types/get_enriched_credit_ledger_request_period.py new file mode 100644 index 0000000..339822a --- /dev/null +++ b/src/schematic/credits/types/get_enriched_credit_ledger_request_period.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GetEnrichedCreditLedgerRequestPeriod = typing.Union[typing.Literal["daily", "weekly", "monthly", "raw"], typing.Any] diff --git a/src/schematic/credits/types/get_enriched_credit_ledger_response.py b/src/schematic/credits/types/get_enriched_credit_ledger_response.py new file mode 100644 index 0000000..14e120a --- /dev/null +++ b/src/schematic/credits/types/get_enriched_credit_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_ledger_enriched_entry_response_data import CreditLedgerEnrichedEntryResponseData +from .get_enriched_credit_ledger_params import GetEnrichedCreditLedgerParams + + +class GetEnrichedCreditLedgerResponse(UniversalBaseModel): + data: typing.List[CreditLedgerEnrichedEntryResponseData] + params: GetEnrichedCreditLedgerParams = 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/get_enriched_credit_ledger_response_params_period.py b/src/schematic/credits/types/get_enriched_credit_ledger_response_params_period.py new file mode 100644 index 0000000..222715f --- /dev/null +++ b/src/schematic/credits/types/get_enriched_credit_ledger_response_params_period.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GetEnrichedCreditLedgerResponseParamsPeriod = typing.Union[ + typing.Literal["daily", "weekly", "monthly", "raw"], typing.Any +] diff --git a/src/schematic/credits/types/list_billing_credits_response.py b/src/schematic/credits/types/list_billing_credits_response.py index c87461d..3813dbe 100644 --- a/src/schematic/credits/types/list_billing_credits_response.py +++ b/src/schematic/credits/types/list_billing_credits_response.py @@ -9,11 +9,7 @@ class ListBillingCreditsResponse(UniversalBaseModel): - data: typing.List[BillingCreditResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingCreditResponseData] params: ListBillingCreditsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/credits/types/list_billing_plan_credit_grants_response.py b/src/schematic/credits/types/list_billing_plan_credit_grants_response.py index a81b761..5bcb1bf 100644 --- a/src/schematic/credits/types/list_billing_plan_credit_grants_response.py +++ b/src/schematic/credits/types/list_billing_plan_credit_grants_response.py @@ -9,11 +9,7 @@ class ListBillingPlanCreditGrantsResponse(UniversalBaseModel): - data: typing.List[BillingPlanCreditGrantResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingPlanCreditGrantResponseData] params: ListBillingPlanCreditGrantsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/credits/types/list_company_grants_response.py b/src/schematic/credits/types/list_company_grants_response.py index eeabb2c..b1a4dc0 100644 --- a/src/schematic/credits/types/list_company_grants_response.py +++ b/src/schematic/credits/types/list_company_grants_response.py @@ -9,11 +9,7 @@ class ListCompanyGrantsResponse(UniversalBaseModel): - data: typing.List[BillingCreditGrantResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingCreditGrantResponseData] params: ListCompanyGrantsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/credits/types/list_credit_bundles_response.py b/src/schematic/credits/types/list_credit_bundles_response.py index cfd4f37..1daedf7 100644 --- a/src/schematic/credits/types/list_credit_bundles_response.py +++ b/src/schematic/credits/types/list_credit_bundles_response.py @@ -9,11 +9,7 @@ class ListCreditBundlesResponse(UniversalBaseModel): - data: typing.List[BillingCreditBundleResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingCreditBundleResponseData] params: ListCreditBundlesParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/credits/types/list_grants_for_credit_response.py b/src/schematic/credits/types/list_grants_for_credit_response.py index 6818634..90986fa 100644 --- a/src/schematic/credits/types/list_grants_for_credit_response.py +++ b/src/schematic/credits/types/list_grants_for_credit_response.py @@ -9,11 +9,7 @@ class ListGrantsForCreditResponse(UniversalBaseModel): - data: typing.List[BillingCreditGrantResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[BillingCreditGrantResponseData] params: ListGrantsForCreditParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/credits/types/update_credit_bundle_details_request_body_expiry_type.py b/src/schematic/credits/types/update_credit_bundle_details_request_body_expiry_type.py index 0b71ef1..0363f5d 100644 --- a/src/schematic/credits/types/update_credit_bundle_details_request_body_expiry_type.py +++ b/src/schematic/credits/types/update_credit_bundle_details_request_body_expiry_type.py @@ -3,5 +3,6 @@ import typing UpdateCreditBundleDetailsRequestBodyExpiryType = typing.Union[ - typing.Literal["days_from_purchase", "no_expiry"], typing.Any + typing.Literal["duration", "no_expiry", "end_of_trial", "end_of_billing_period", "end_of_next_billing_period"], + typing.Any, ] diff --git a/src/schematic/credits/types/update_credit_bundle_details_request_body_expiry_unit.py b/src/schematic/credits/types/update_credit_bundle_details_request_body_expiry_unit.py new file mode 100644 index 0000000..0e10711 --- /dev/null +++ b/src/schematic/credits/types/update_credit_bundle_details_request_body_expiry_unit.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +UpdateCreditBundleDetailsRequestBodyExpiryUnit = typing.Union[typing.Literal["days", "billing_periods"], typing.Any] diff --git a/src/schematic/credits/types/zero_out_grant_request_body_reason.py b/src/schematic/credits/types/zero_out_grant_request_body_reason.py index 2f8b489..158e82b 100644 --- a/src/schematic/credits/types/zero_out_grant_request_body_reason.py +++ b/src/schematic/credits/types/zero_out_grant_request_body_reason.py @@ -2,4 +2,6 @@ import typing -ZeroOutGrantRequestBodyReason = typing.Union[typing.Literal["plan_change", "manual", "plan_period_reset"], typing.Any] +ZeroOutGrantRequestBodyReason = typing.Union[ + typing.Literal["plan_change", "manual", "plan_period_reset", "expired"], typing.Any +] diff --git a/src/schematic/crm/client.py b/src/schematic/crm/client.py index 13a037a..d365041 100644 --- a/src/schematic/crm/client.py +++ b/src/schematic/crm/client.py @@ -246,7 +246,11 @@ def list_crm_products( client = Schematic( api_key="YOUR_API_KEY", ) - client.crm.list_crm_products() + client.crm.list_crm_products( + name="name", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_crm_products( ids=ids, name=name, limit=limit, offset=offset, request_options=request_options @@ -585,7 +589,11 @@ async def list_crm_products( async def main() -> None: - await client.crm.list_crm_products() + await client.crm.list_crm_products( + name="name", + limit=1, + offset=1, + ) asyncio.run(main()) diff --git a/src/schematic/crm/types/list_crm_products_response.py b/src/schematic/crm/types/list_crm_products_response.py index 46c7ae2..435f06a 100644 --- a/src/schematic/crm/types/list_crm_products_response.py +++ b/src/schematic/crm/types/list_crm_products_response.py @@ -9,11 +9,7 @@ class ListCrmProductsResponse(UniversalBaseModel): - data: typing.List[CrmProductResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[CrmProductResponseData] params: ListCrmProductsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/dataexports/client.py b/src/schematic/dataexports/client.py index d933c2c..6424cc4 100644 --- a/src/schematic/dataexports/client.py +++ b/src/schematic/dataexports/client.py @@ -72,6 +72,17 @@ def get_data_export_artifact( ------- typing.Iterator[bytes] OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.dataexports.get_data_export_artifact( + data_export_id="data_export_id", + ) """ with self._raw_client.get_data_export_artifact(data_export_id, request_options=request_options) as r: yield from r.data @@ -146,6 +157,25 @@ async def get_data_export_artifact( ------- typing.AsyncIterator[bytes] OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.dataexports.get_data_export_artifact( + data_export_id="data_export_id", + ) + + + asyncio.run(main()) """ async with self._raw_client.get_data_export_artifact(data_export_id, request_options=request_options) as r: async for _chunk in r.data: diff --git a/src/schematic/entitlements/client.py b/src/schematic/entitlements/client.py index d083f05..60f4670 100644 --- a/src/schematic/entitlements/client.py +++ b/src/schematic/entitlements/client.py @@ -127,7 +127,14 @@ def list_company_overrides( client = Schematic( api_key="YOUR_API_KEY", ) - client.entitlements.list_company_overrides() + client.entitlements.list_company_overrides( + company_id="company_id", + feature_id="feature_id", + without_expired=True, + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_company_overrides( company_id=company_id, @@ -153,6 +160,7 @@ def create_company_override( expiration_date: typing.Optional[dt.datetime] = OMIT, metric_period: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, + note: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_credit_id: typing.Optional[str] = OMIT, value_numeric: typing.Optional[int] = OMIT, @@ -176,6 +184,8 @@ def create_company_override( metric_period_month_reset : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] + note : typing.Optional[str] + value_bool : typing.Optional[bool] value_credit_id : typing.Optional[str] @@ -213,6 +223,7 @@ def create_company_override( expiration_date=expiration_date, metric_period=metric_period, metric_period_month_reset=metric_period_month_reset, + note=note, value_bool=value_bool, value_credit_id=value_credit_id, value_numeric=value_numeric, @@ -261,6 +272,7 @@ def update_company_override( expiration_date: typing.Optional[dt.datetime] = OMIT, metric_period: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, + note: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_credit_id: typing.Optional[str] = OMIT, value_numeric: typing.Optional[int] = OMIT, @@ -283,6 +295,8 @@ def update_company_override( metric_period_month_reset : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] + note : typing.Optional[str] + value_bool : typing.Optional[bool] value_credit_id : typing.Optional[str] @@ -318,6 +332,7 @@ def update_company_override( expiration_date=expiration_date, metric_period=metric_period, metric_period_month_reset=metric_period_month_reset, + note=note, value_bool=value_bool, value_credit_id=value_credit_id, value_numeric=value_numeric, @@ -416,7 +431,14 @@ def count_company_overrides( client = Schematic( api_key="YOUR_API_KEY", ) - client.entitlements.count_company_overrides() + client.entitlements.count_company_overrides( + company_id="company_id", + feature_id="feature_id", + without_expired=True, + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_company_overrides( company_id=company_id, @@ -471,6 +493,9 @@ def list_feature_companies( ) client.entitlements.list_feature_companies( feature_id="feature_id", + q="q", + limit=1, + offset=1, ) """ _response = self._raw_client.list_feature_companies( @@ -517,6 +542,9 @@ def count_feature_companies( ) client.entitlements.count_feature_companies( feature_id="feature_id", + q="q", + limit=1, + offset=1, ) """ _response = self._raw_client.count_feature_companies( @@ -570,7 +598,13 @@ def list_feature_usage( client = Schematic( api_key="YOUR_API_KEY", ) - client.entitlements.list_feature_usage() + client.entitlements.list_feature_usage( + company_id="company_id", + q="q", + without_negative_entitlements=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.list_feature_usage( company_id=company_id, @@ -630,7 +664,13 @@ def count_feature_usage( client = Schematic( api_key="YOUR_API_KEY", ) - client.entitlements.count_feature_usage() + client.entitlements.count_feature_usage( + company_id="company_id", + q="q", + without_negative_entitlements=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.count_feature_usage( company_id=company_id, @@ -683,6 +723,9 @@ def list_feature_users( ) client.entitlements.list_feature_users( feature_id="feature_id", + q="q", + limit=1, + offset=1, ) """ _response = self._raw_client.list_feature_users( @@ -729,6 +772,9 @@ def count_feature_users( ) client.entitlements.count_feature_users( feature_id="feature_id", + q="q", + limit=1, + offset=1, ) """ _response = self._raw_client.count_feature_users( @@ -795,7 +841,14 @@ def list_plan_entitlements( client = Schematic( api_key="YOUR_API_KEY", ) - client.entitlements.list_plan_entitlements() + client.entitlements.list_plan_entitlements( + feature_id="feature_id", + plan_id="plan_id", + q="q", + with_metered_products=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.list_plan_entitlements( feature_id=feature_id, @@ -818,6 +871,7 @@ def create_plan_entitlement( plan_id: str, value_type: CreatePlanEntitlementRequestBodyValueType, billing_product_id: typing.Optional[str] = OMIT, + billing_threshold: typing.Optional[int] = OMIT, credit_consumption_rate: typing.Optional[float] = OMIT, currency: typing.Optional[str] = OMIT, metric_period: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] = OMIT, @@ -852,6 +906,8 @@ def create_plan_entitlement( billing_product_id : typing.Optional[str] + billing_threshold : typing.Optional[int] + credit_consumption_rate : typing.Optional[float] currency : typing.Optional[str] @@ -921,6 +977,7 @@ def create_plan_entitlement( plan_id=plan_id, value_type=value_type, billing_product_id=billing_product_id, + billing_threshold=billing_threshold, credit_consumption_rate=credit_consumption_rate, currency=currency, metric_period=metric_period, @@ -983,6 +1040,7 @@ def update_plan_entitlement( *, value_type: UpdatePlanEntitlementRequestBodyValueType, billing_product_id: typing.Optional[str] = OMIT, + billing_threshold: typing.Optional[int] = OMIT, credit_consumption_rate: typing.Optional[float] = OMIT, currency: typing.Optional[str] = OMIT, metric_period: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] = OMIT, @@ -1016,6 +1074,8 @@ def update_plan_entitlement( billing_product_id : typing.Optional[str] + billing_threshold : typing.Optional[int] + credit_consumption_rate : typing.Optional[float] currency : typing.Optional[str] @@ -1083,6 +1143,7 @@ def update_plan_entitlement( plan_entitlement_id, value_type=value_type, billing_product_id=billing_product_id, + billing_threshold=billing_threshold, credit_consumption_rate=credit_consumption_rate, currency=currency, metric_period=metric_period, @@ -1198,7 +1259,14 @@ def count_plan_entitlements( client = Schematic( api_key="YOUR_API_KEY", ) - client.entitlements.count_plan_entitlements() + client.entitlements.count_plan_entitlements( + feature_id="feature_id", + plan_id="plan_id", + q="q", + with_metered_products=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.count_plan_entitlements( feature_id=feature_id, @@ -1325,7 +1393,14 @@ async def list_company_overrides( async def main() -> None: - await client.entitlements.list_company_overrides() + await client.entitlements.list_company_overrides( + company_id="company_id", + feature_id="feature_id", + without_expired=True, + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1354,6 +1429,7 @@ async def create_company_override( expiration_date: typing.Optional[dt.datetime] = OMIT, metric_period: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, + note: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_credit_id: typing.Optional[str] = OMIT, value_numeric: typing.Optional[int] = OMIT, @@ -1377,6 +1453,8 @@ async def create_company_override( metric_period_month_reset : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] + note : typing.Optional[str] + value_bool : typing.Optional[bool] value_credit_id : typing.Optional[str] @@ -1422,6 +1500,7 @@ async def main() -> None: expiration_date=expiration_date, metric_period=metric_period, metric_period_month_reset=metric_period_month_reset, + note=note, value_bool=value_bool, value_credit_id=value_credit_id, value_numeric=value_numeric, @@ -1478,6 +1557,7 @@ async def update_company_override( expiration_date: typing.Optional[dt.datetime] = OMIT, metric_period: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, + note: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_credit_id: typing.Optional[str] = OMIT, value_numeric: typing.Optional[int] = OMIT, @@ -1500,6 +1580,8 @@ async def update_company_override( metric_period_month_reset : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] + note : typing.Optional[str] + value_bool : typing.Optional[bool] value_credit_id : typing.Optional[str] @@ -1543,6 +1625,7 @@ async def main() -> None: expiration_date=expiration_date, metric_period=metric_period, metric_period_month_reset=metric_period_month_reset, + note=note, value_bool=value_bool, value_credit_id=value_credit_id, value_numeric=value_numeric, @@ -1654,7 +1737,14 @@ async def count_company_overrides( async def main() -> None: - await client.entitlements.count_company_overrides() + await client.entitlements.count_company_overrides( + company_id="company_id", + feature_id="feature_id", + without_expired=True, + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1717,6 +1807,9 @@ async def list_feature_companies( async def main() -> None: await client.entitlements.list_feature_companies( feature_id="feature_id", + q="q", + limit=1, + offset=1, ) @@ -1771,6 +1864,9 @@ async def count_feature_companies( async def main() -> None: await client.entitlements.count_feature_companies( feature_id="feature_id", + q="q", + limit=1, + offset=1, ) @@ -1832,7 +1928,13 @@ async def list_feature_usage( async def main() -> None: - await client.entitlements.list_feature_usage() + await client.entitlements.list_feature_usage( + company_id="company_id", + q="q", + without_negative_entitlements=True, + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1900,7 +2002,13 @@ async def count_feature_usage( async def main() -> None: - await client.entitlements.count_feature_usage() + await client.entitlements.count_feature_usage( + company_id="company_id", + q="q", + without_negative_entitlements=True, + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1961,6 +2069,9 @@ async def list_feature_users( async def main() -> None: await client.entitlements.list_feature_users( feature_id="feature_id", + q="q", + limit=1, + offset=1, ) @@ -2015,6 +2126,9 @@ async def count_feature_users( async def main() -> None: await client.entitlements.count_feature_users( feature_id="feature_id", + q="q", + limit=1, + offset=1, ) @@ -2089,7 +2203,14 @@ async def list_plan_entitlements( async def main() -> None: - await client.entitlements.list_plan_entitlements() + await client.entitlements.list_plan_entitlements( + feature_id="feature_id", + plan_id="plan_id", + q="q", + with_metered_products=True, + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2115,6 +2236,7 @@ async def create_plan_entitlement( plan_id: str, value_type: CreatePlanEntitlementRequestBodyValueType, billing_product_id: typing.Optional[str] = OMIT, + billing_threshold: typing.Optional[int] = OMIT, credit_consumption_rate: typing.Optional[float] = OMIT, currency: typing.Optional[str] = OMIT, metric_period: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] = OMIT, @@ -2149,6 +2271,8 @@ async def create_plan_entitlement( billing_product_id : typing.Optional[str] + billing_threshold : typing.Optional[int] + credit_consumption_rate : typing.Optional[float] currency : typing.Optional[str] @@ -2226,6 +2350,7 @@ async def main() -> None: plan_id=plan_id, value_type=value_type, billing_product_id=billing_product_id, + billing_threshold=billing_threshold, credit_consumption_rate=credit_consumption_rate, currency=currency, metric_period=metric_period, @@ -2296,6 +2421,7 @@ async def update_plan_entitlement( *, value_type: UpdatePlanEntitlementRequestBodyValueType, billing_product_id: typing.Optional[str] = OMIT, + billing_threshold: typing.Optional[int] = OMIT, credit_consumption_rate: typing.Optional[float] = OMIT, currency: typing.Optional[str] = OMIT, metric_period: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] = OMIT, @@ -2329,6 +2455,8 @@ async def update_plan_entitlement( billing_product_id : typing.Optional[str] + billing_threshold : typing.Optional[int] + credit_consumption_rate : typing.Optional[float] currency : typing.Optional[str] @@ -2404,6 +2532,7 @@ async def main() -> None: plan_entitlement_id, value_type=value_type, billing_product_id=billing_product_id, + billing_threshold=billing_threshold, credit_consumption_rate=credit_consumption_rate, currency=currency, metric_period=metric_period, @@ -2532,7 +2661,14 @@ async def count_plan_entitlements( async def main() -> None: - await client.entitlements.count_plan_entitlements() + await client.entitlements.count_plan_entitlements( + feature_id="feature_id", + plan_id="plan_id", + q="q", + with_metered_products=True, + limit=1, + offset=1, + ) asyncio.run(main()) diff --git a/src/schematic/entitlements/raw_client.py b/src/schematic/entitlements/raw_client.py index 69899f6..7d8c463 100644 --- a/src/schematic/entitlements/raw_client.py +++ b/src/schematic/entitlements/raw_client.py @@ -220,6 +220,7 @@ def create_company_override( expiration_date: typing.Optional[dt.datetime] = OMIT, metric_period: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, + note: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_credit_id: typing.Optional[str] = OMIT, value_numeric: typing.Optional[int] = OMIT, @@ -243,6 +244,8 @@ def create_company_override( metric_period_month_reset : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] + note : typing.Optional[str] + value_bool : typing.Optional[bool] value_credit_id : typing.Optional[str] @@ -269,6 +272,7 @@ def create_company_override( "feature_id": feature_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, + "note": note, "value_bool": value_bool, "value_credit_id": value_credit_id, "value_numeric": value_numeric, @@ -449,6 +453,7 @@ def update_company_override( expiration_date: typing.Optional[dt.datetime] = OMIT, metric_period: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, + note: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_credit_id: typing.Optional[str] = OMIT, value_numeric: typing.Optional[int] = OMIT, @@ -471,6 +476,8 @@ def update_company_override( metric_period_month_reset : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] + note : typing.Optional[str] + value_bool : typing.Optional[bool] value_credit_id : typing.Optional[str] @@ -495,6 +502,7 @@ def update_company_override( "expiration_date": expiration_date, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, + "note": note, "value_bool": value_bool, "value_credit_id": value_credit_id, "value_numeric": value_numeric, @@ -1682,6 +1690,7 @@ def create_plan_entitlement( plan_id: str, value_type: CreatePlanEntitlementRequestBodyValueType, billing_product_id: typing.Optional[str] = OMIT, + billing_threshold: typing.Optional[int] = OMIT, credit_consumption_rate: typing.Optional[float] = OMIT, currency: typing.Optional[str] = OMIT, metric_period: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] = OMIT, @@ -1716,6 +1725,8 @@ def create_plan_entitlement( billing_product_id : typing.Optional[str] + billing_threshold : typing.Optional[int] + credit_consumption_rate : typing.Optional[float] currency : typing.Optional[str] @@ -1772,6 +1783,7 @@ def create_plan_entitlement( method="POST", json={ "billing_product_id": billing_product_id, + "billing_threshold": billing_threshold, "credit_consumption_rate": credit_consumption_rate, "currency": currency, "feature_id": feature_id, @@ -1978,6 +1990,7 @@ def update_plan_entitlement( *, value_type: UpdatePlanEntitlementRequestBodyValueType, billing_product_id: typing.Optional[str] = OMIT, + billing_threshold: typing.Optional[int] = OMIT, credit_consumption_rate: typing.Optional[float] = OMIT, currency: typing.Optional[str] = OMIT, metric_period: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] = OMIT, @@ -2011,6 +2024,8 @@ def update_plan_entitlement( billing_product_id : typing.Optional[str] + billing_threshold : typing.Optional[int] + credit_consumption_rate : typing.Optional[float] currency : typing.Optional[str] @@ -2067,6 +2082,7 @@ def update_plan_entitlement( method="PUT", json={ "billing_product_id": billing_product_id, + "billing_threshold": billing_threshold, "credit_consumption_rate": credit_consumption_rate, "currency": currency, "metric_period": metric_period, @@ -2663,6 +2679,7 @@ async def create_company_override( expiration_date: typing.Optional[dt.datetime] = OMIT, metric_period: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, + note: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_credit_id: typing.Optional[str] = OMIT, value_numeric: typing.Optional[int] = OMIT, @@ -2686,6 +2703,8 @@ async def create_company_override( metric_period_month_reset : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] + note : typing.Optional[str] + value_bool : typing.Optional[bool] value_credit_id : typing.Optional[str] @@ -2712,6 +2731,7 @@ async def create_company_override( "feature_id": feature_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, + "note": note, "value_bool": value_bool, "value_credit_id": value_credit_id, "value_numeric": value_numeric, @@ -2892,6 +2912,7 @@ async def update_company_override( expiration_date: typing.Optional[dt.datetime] = OMIT, metric_period: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, + note: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_credit_id: typing.Optional[str] = OMIT, value_numeric: typing.Optional[int] = OMIT, @@ -2914,6 +2935,8 @@ async def update_company_override( metric_period_month_reset : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] + note : typing.Optional[str] + value_bool : typing.Optional[bool] value_credit_id : typing.Optional[str] @@ -2938,6 +2961,7 @@ async def update_company_override( "expiration_date": expiration_date, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, + "note": note, "value_bool": value_bool, "value_credit_id": value_credit_id, "value_numeric": value_numeric, @@ -4125,6 +4149,7 @@ async def create_plan_entitlement( plan_id: str, value_type: CreatePlanEntitlementRequestBodyValueType, billing_product_id: typing.Optional[str] = OMIT, + billing_threshold: typing.Optional[int] = OMIT, credit_consumption_rate: typing.Optional[float] = OMIT, currency: typing.Optional[str] = OMIT, metric_period: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] = OMIT, @@ -4159,6 +4184,8 @@ async def create_plan_entitlement( billing_product_id : typing.Optional[str] + billing_threshold : typing.Optional[int] + credit_consumption_rate : typing.Optional[float] currency : typing.Optional[str] @@ -4215,6 +4242,7 @@ async def create_plan_entitlement( method="POST", json={ "billing_product_id": billing_product_id, + "billing_threshold": billing_threshold, "credit_consumption_rate": credit_consumption_rate, "currency": currency, "feature_id": feature_id, @@ -4421,6 +4449,7 @@ async def update_plan_entitlement( *, value_type: UpdatePlanEntitlementRequestBodyValueType, billing_product_id: typing.Optional[str] = OMIT, + billing_threshold: typing.Optional[int] = OMIT, credit_consumption_rate: typing.Optional[float] = OMIT, currency: typing.Optional[str] = OMIT, metric_period: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] = OMIT, @@ -4454,6 +4483,8 @@ async def update_plan_entitlement( billing_product_id : typing.Optional[str] + billing_threshold : typing.Optional[int] + credit_consumption_rate : typing.Optional[float] currency : typing.Optional[str] @@ -4510,6 +4541,7 @@ async def update_plan_entitlement( method="PUT", json={ "billing_product_id": billing_product_id, + "billing_threshold": billing_threshold, "credit_consumption_rate": credit_consumption_rate, "currency": currency, "metric_period": metric_period, diff --git a/src/schematic/entitlements/types/list_company_overrides_response.py b/src/schematic/entitlements/types/list_company_overrides_response.py index 452d705..edee5a6 100644 --- a/src/schematic/entitlements/types/list_company_overrides_response.py +++ b/src/schematic/entitlements/types/list_company_overrides_response.py @@ -9,11 +9,7 @@ class ListCompanyOverridesResponse(UniversalBaseModel): - data: typing.List[CompanyOverrideResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[CompanyOverrideResponseData] params: ListCompanyOverridesParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/entitlements/types/list_feature_companies_response.py b/src/schematic/entitlements/types/list_feature_companies_response.py index 75b35a5..d3c050b 100644 --- a/src/schematic/entitlements/types/list_feature_companies_response.py +++ b/src/schematic/entitlements/types/list_feature_companies_response.py @@ -9,11 +9,7 @@ class ListFeatureCompaniesResponse(UniversalBaseModel): - data: typing.List[FeatureCompanyResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[FeatureCompanyResponseData] params: ListFeatureCompaniesParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/entitlements/types/list_feature_usage_response.py b/src/schematic/entitlements/types/list_feature_usage_response.py index 5161829..ddabc43 100644 --- a/src/schematic/entitlements/types/list_feature_usage_response.py +++ b/src/schematic/entitlements/types/list_feature_usage_response.py @@ -9,11 +9,7 @@ class ListFeatureUsageResponse(UniversalBaseModel): - data: typing.List[FeatureUsageResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[FeatureUsageResponseData] params: ListFeatureUsageParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/entitlements/types/list_feature_users_response.py b/src/schematic/entitlements/types/list_feature_users_response.py index 174bc05..a41415a 100644 --- a/src/schematic/entitlements/types/list_feature_users_response.py +++ b/src/schematic/entitlements/types/list_feature_users_response.py @@ -9,11 +9,7 @@ class ListFeatureUsersResponse(UniversalBaseModel): - data: typing.List[FeatureCompanyUserResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[FeatureCompanyUserResponseData] params: ListFeatureUsersParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/entitlements/types/list_plan_entitlements_response.py b/src/schematic/entitlements/types/list_plan_entitlements_response.py index 0a17f1e..9604005 100644 --- a/src/schematic/entitlements/types/list_plan_entitlements_response.py +++ b/src/schematic/entitlements/types/list_plan_entitlements_response.py @@ -9,11 +9,7 @@ class ListPlanEntitlementsResponse(UniversalBaseModel): - data: typing.List[PlanEntitlementResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[PlanEntitlementResponseData] params: ListPlanEntitlementsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/events/client.py b/src/schematic/events/client.py index 3431424..28e01a6 100644 --- a/src/schematic/events/client.py +++ b/src/schematic/events/client.py @@ -110,7 +110,11 @@ def get_event_summaries( client = Schematic( api_key="YOUR_API_KEY", ) - client.events.get_event_summaries() + client.events.get_event_summaries( + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.get_event_summaries( q=q, event_subtypes=event_subtypes, limit=limit, offset=offset, request_options=request_options @@ -165,7 +169,14 @@ def list_events( client = Schematic( api_key="YOUR_API_KEY", ) - client.events.list_events() + client.events.list_events( + company_id="company_id", + event_subtype="event_subtype", + flag_id="flag_id", + user_id="user_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_events( company_id=company_id, @@ -380,7 +391,11 @@ async def get_event_summaries( async def main() -> None: - await client.events.get_event_summaries() + await client.events.get_event_summaries( + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -443,7 +458,14 @@ async def list_events( async def main() -> None: - await client.events.list_events() + await client.events.list_events( + company_id="company_id", + event_subtype="event_subtype", + flag_id="flag_id", + user_id="user_id", + limit=1, + offset=1, + ) asyncio.run(main()) diff --git a/src/schematic/events/types/get_event_summaries_response.py b/src/schematic/events/types/get_event_summaries_response.py index 45f2237..543cfff 100644 --- a/src/schematic/events/types/get_event_summaries_response.py +++ b/src/schematic/events/types/get_event_summaries_response.py @@ -9,11 +9,7 @@ class GetEventSummariesResponse(UniversalBaseModel): - data: typing.List[EventSummaryResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[EventSummaryResponseData] params: GetEventSummariesParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/events/types/list_events_response.py b/src/schematic/events/types/list_events_response.py index 89bcf10..8c9ce8d 100644 --- a/src/schematic/events/types/list_events_response.py +++ b/src/schematic/events/types/list_events_response.py @@ -9,11 +9,7 @@ class ListEventsResponse(UniversalBaseModel): - data: typing.List[EventDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[EventDetailResponseData] params: ListEventsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/features/client.py b/src/schematic/features/client.py index 5bc24a3..106633a 100644 --- a/src/schematic/features/client.py +++ b/src/schematic/features/client.py @@ -371,6 +371,7 @@ def list_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by feature name or ID without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID @@ -405,7 +406,14 @@ def list_features( client = Schematic( api_key="YOUR_API_KEY", ) - client.features.list_features() + client.features.list_features( + q="q", + without_company_override_for="without_company_override_for", + without_plan_entitlement_for="without_plan_entitlement_for", + boolean_require_event=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.list_features( ids=ids, @@ -660,6 +668,7 @@ def count_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by feature name or ID without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID @@ -694,7 +703,14 @@ def count_features( client = Schematic( api_key="YOUR_API_KEY", ) - client.features.count_features() + client.features.count_features( + q="q", + without_company_override_for="without_company_override_for", + without_plan_entitlement_for="without_plan_entitlement_for", + boolean_require_event=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.count_features( ids=ids, @@ -727,6 +743,7 @@ def list_flags( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by flag name, key, or ID limit : typing.Optional[int] Page limit (default 100) @@ -749,7 +766,12 @@ def list_flags( client = Schematic( api_key="YOUR_API_KEY", ) - client.features.list_flags() + client.features.list_flags( + feature_id="feature_id", + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_flags( feature_id=feature_id, ids=ids, q=q, limit=limit, offset=offset, request_options=request_options @@ -1099,6 +1121,7 @@ def count_flags( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by flag name, key, or ID limit : typing.Optional[int] Page limit (default 100) @@ -1121,7 +1144,12 @@ def count_flags( client = Schematic( api_key="YOUR_API_KEY", ) - client.features.count_flags() + client.features.count_flags( + feature_id="feature_id", + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_flags( feature_id=feature_id, ids=ids, q=q, limit=limit, offset=offset, request_options=request_options @@ -1495,6 +1523,7 @@ async def list_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by feature name or ID without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID @@ -1534,7 +1563,14 @@ async def list_features( async def main() -> None: - await client.features.list_features() + await client.features.list_features( + q="q", + without_company_override_for="without_company_override_for", + without_plan_entitlement_for="without_plan_entitlement_for", + boolean_require_event=True, + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1824,6 +1860,7 @@ async def count_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by feature name or ID without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID @@ -1863,7 +1900,14 @@ async def count_features( async def main() -> None: - await client.features.count_features() + await client.features.count_features( + q="q", + without_company_override_for="without_company_override_for", + without_plan_entitlement_for="without_plan_entitlement_for", + boolean_require_event=True, + limit=1, + offset=1, + ) asyncio.run(main()) @@ -1899,6 +1943,7 @@ async def list_flags( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by flag name, key, or ID limit : typing.Optional[int] Page limit (default 100) @@ -1926,7 +1971,12 @@ async def list_flags( async def main() -> None: - await client.features.list_flags() + await client.features.list_flags( + feature_id="feature_id", + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -2337,6 +2387,7 @@ async def count_flags( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by flag name, key, or ID limit : typing.Optional[int] Page limit (default 100) @@ -2364,7 +2415,12 @@ async def count_flags( async def main() -> None: - await client.features.count_flags() + await client.features.count_flags( + feature_id="feature_id", + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) diff --git a/src/schematic/features/raw_client.py b/src/schematic/features/raw_client.py index 9e1724a..2b23246 100644 --- a/src/schematic/features/raw_client.py +++ b/src/schematic/features/raw_client.py @@ -595,6 +595,7 @@ def list_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by feature name or ID without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID @@ -1209,6 +1210,7 @@ def count_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by feature name or ID without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID @@ -1343,6 +1345,7 @@ def list_flags( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by flag name, key, or ID limit : typing.Optional[int] Page limit (default 100) @@ -2232,6 +2235,7 @@ def count_flags( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by flag name, key, or ID limit : typing.Optional[int] Page limit (default 100) @@ -2881,6 +2885,7 @@ async def list_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by feature name or ID without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID @@ -3495,6 +3500,7 @@ async def count_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by feature name or ID without_company_override_for : typing.Optional[str] Filter out features that already have a company override for the specified company ID @@ -3629,6 +3635,7 @@ async def list_flags( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by flag name, key, or ID limit : typing.Optional[int] Page limit (default 100) @@ -4518,6 +4525,7 @@ async def count_flags( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] q : typing.Optional[str] + Search by flag name, key, or ID limit : typing.Optional[int] Page limit (default 100) diff --git a/src/schematic/features/types/count_features_params.py b/src/schematic/features/types/count_features_params.py index fff0299..572bdb8 100644 --- a/src/schematic/features/types/count_features_params.py +++ b/src/schematic/features/types/count_features_params.py @@ -32,7 +32,11 @@ class CountFeaturesParams(UniversalBaseModel): Page offset (default 0) """ - q: typing.Optional[str] = None + q: typing.Optional[str] = pydantic.Field(default=None) + """ + Search by feature name or ID + """ + without_company_override_for: typing.Optional[str] = pydantic.Field(default=None) """ Filter out features that already have a company override for the specified company ID diff --git a/src/schematic/features/types/count_flags_params.py b/src/schematic/features/types/count_flags_params.py index 4018026..46363d5 100644 --- a/src/schematic/features/types/count_flags_params.py +++ b/src/schematic/features/types/count_flags_params.py @@ -23,7 +23,10 @@ class CountFlagsParams(UniversalBaseModel): Page offset (default 0) """ - q: typing.Optional[str] = None + q: typing.Optional[str] = pydantic.Field(default=None) + """ + Search by flag name, key, or ID + """ 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/features/types/list_audience_companies_response.py b/src/schematic/features/types/list_audience_companies_response.py index dafd417..dcda077 100644 --- a/src/schematic/features/types/list_audience_companies_response.py +++ b/src/schematic/features/types/list_audience_companies_response.py @@ -8,11 +8,7 @@ class ListAudienceCompaniesResponse(UniversalBaseModel): - data: typing.List[CompanyDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[CompanyDetailResponseData] params: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() """ Input parameters diff --git a/src/schematic/features/types/list_audience_users_response.py b/src/schematic/features/types/list_audience_users_response.py index 0a2e333..cee9c84 100644 --- a/src/schematic/features/types/list_audience_users_response.py +++ b/src/schematic/features/types/list_audience_users_response.py @@ -8,11 +8,7 @@ class ListAudienceUsersResponse(UniversalBaseModel): - data: typing.List[UserDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[UserDetailResponseData] params: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() """ Input parameters diff --git a/src/schematic/features/types/list_features_params.py b/src/schematic/features/types/list_features_params.py index 8cc78de..2822f4c 100644 --- a/src/schematic/features/types/list_features_params.py +++ b/src/schematic/features/types/list_features_params.py @@ -32,7 +32,11 @@ class ListFeaturesParams(UniversalBaseModel): Page offset (default 0) """ - q: typing.Optional[str] = None + q: typing.Optional[str] = pydantic.Field(default=None) + """ + Search by feature name or ID + """ + without_company_override_for: typing.Optional[str] = pydantic.Field(default=None) """ Filter out features that already have a company override for the specified company ID diff --git a/src/schematic/features/types/list_features_response.py b/src/schematic/features/types/list_features_response.py index df01b0d..aa31a0b 100644 --- a/src/schematic/features/types/list_features_response.py +++ b/src/schematic/features/types/list_features_response.py @@ -9,11 +9,7 @@ class ListFeaturesResponse(UniversalBaseModel): - data: typing.List[FeatureDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[FeatureDetailResponseData] params: ListFeaturesParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/features/types/list_flags_params.py b/src/schematic/features/types/list_flags_params.py index c3135f1..b1a89cb 100644 --- a/src/schematic/features/types/list_flags_params.py +++ b/src/schematic/features/types/list_flags_params.py @@ -23,7 +23,10 @@ class ListFlagsParams(UniversalBaseModel): Page offset (default 0) """ - q: typing.Optional[str] = None + q: typing.Optional[str] = pydantic.Field(default=None) + """ + Search by flag name, key, or ID + """ 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/features/types/list_flags_response.py b/src/schematic/features/types/list_flags_response.py index 9f519dc..6ed5b35 100644 --- a/src/schematic/features/types/list_flags_response.py +++ b/src/schematic/features/types/list_flags_response.py @@ -9,11 +9,7 @@ class ListFlagsResponse(UniversalBaseModel): - data: typing.List[FlagDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[FlagDetailResponseData] params: ListFlagsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/plangroups/client.py b/src/schematic/plangroups/client.py index ed1701a..908f855 100644 --- a/src/schematic/plangroups/client.py +++ b/src/schematic/plangroups/client.py @@ -60,15 +60,28 @@ def create_plan_group( self, *, add_on_ids: typing.Sequence[str], + 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], + prevent_downgrades_when_over_limit: bool, + show_credits: bool, show_period_toggle: bool, + show_zero_price_as_free: bool, + sync_customer_billing_details_for_tax: bool, add_on_compatibilities: typing.Optional[typing.Sequence[CompatiblePlans]] = OMIT, custom_plan_config: typing.Optional[CustomPlanConfig] = OMIT, custom_plan_id: typing.Optional[str] = OMIT, default_plan_id: typing.Optional[str] = OMIT, + fallback_plan_id: typing.Optional[str] = OMIT, + initial_plan_id: typing.Optional[str] = OMIT, + initial_plan_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, + trial_expiry_plan_id: typing.Optional[str] = OMIT, + trial_expiry_plan_price_id: typing.Optional[str] = OMIT, trial_payment_method_required: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreatePlanGroupResponse: @@ -78,14 +91,30 @@ def create_plan_group( 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] + prevent_downgrades_when_over_limit : bool + + show_credits : bool + show_period_toggle : bool + show_zero_price_as_free : bool + + sync_customer_billing_details_for_tax : bool + add_on_compatibilities : typing.Optional[typing.Sequence[CompatiblePlans]] custom_plan_config : typing.Optional[CustomPlanConfig] @@ -94,8 +123,18 @@ def create_plan_group( default_plan_id : typing.Optional[str] + fallback_plan_id : typing.Optional[str] + + initial_plan_id : typing.Optional[str] + + initial_plan_price_id : typing.Optional[str] + trial_days : typing.Optional[int] + trial_expiry_plan_id : typing.Optional[str] + + trial_expiry_plan_price_id : typing.Optional[str] + trial_payment_method_required : typing.Optional[bool] request_options : typing.Optional[RequestOptions] @@ -115,6 +154,10 @@ def create_plan_group( ) 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", @@ -130,20 +173,37 @@ def create_plan_group( plan_id="plan_id", ) ], + prevent_downgrades_when_over_limit=True, + show_credits=True, show_period_toggle=True, + show_zero_price_as_free=True, + sync_customer_billing_details_for_tax=True, ) """ _response = self._raw_client.create_plan_group( add_on_ids=add_on_ids, + checkout_collect_address=checkout_collect_address, + checkout_collect_email=checkout_collect_email, + checkout_collect_phone=checkout_collect_phone, + enable_tax_collection=enable_tax_collection, ordered_add_ons=ordered_add_ons, ordered_bundle_list=ordered_bundle_list, ordered_plans=ordered_plans, + prevent_downgrades_when_over_limit=prevent_downgrades_when_over_limit, + show_credits=show_credits, show_period_toggle=show_period_toggle, + show_zero_price_as_free=show_zero_price_as_free, + sync_customer_billing_details_for_tax=sync_customer_billing_details_for_tax, add_on_compatibilities=add_on_compatibilities, custom_plan_config=custom_plan_config, custom_plan_id=custom_plan_id, default_plan_id=default_plan_id, + fallback_plan_id=fallback_plan_id, + initial_plan_id=initial_plan_id, + initial_plan_price_id=initial_plan_price_id, trial_days=trial_days, + trial_expiry_plan_id=trial_expiry_plan_id, + trial_expiry_plan_price_id=trial_expiry_plan_price_id, trial_payment_method_required=trial_payment_method_required, request_options=request_options, ) @@ -154,15 +214,28 @@ def update_plan_group( plan_group_id: str, *, add_on_ids: typing.Sequence[str], + 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], + prevent_downgrades_when_over_limit: bool, + show_credits: bool, show_period_toggle: bool, + show_zero_price_as_free: bool, + sync_customer_billing_details_for_tax: bool, add_on_compatibilities: typing.Optional[typing.Sequence[CompatiblePlans]] = OMIT, custom_plan_config: typing.Optional[CustomPlanConfig] = OMIT, custom_plan_id: typing.Optional[str] = OMIT, default_plan_id: typing.Optional[str] = OMIT, + fallback_plan_id: typing.Optional[str] = OMIT, + initial_plan_id: typing.Optional[str] = OMIT, + initial_plan_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, + trial_expiry_plan_id: typing.Optional[str] = OMIT, + trial_expiry_plan_price_id: typing.Optional[str] = OMIT, trial_payment_method_required: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpdatePlanGroupResponse: @@ -175,14 +248,30 @@ def update_plan_group( 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] + prevent_downgrades_when_over_limit : bool + + show_credits : bool + show_period_toggle : bool + show_zero_price_as_free : bool + + sync_customer_billing_details_for_tax : bool + add_on_compatibilities : typing.Optional[typing.Sequence[CompatiblePlans]] custom_plan_config : typing.Optional[CustomPlanConfig] @@ -191,8 +280,18 @@ def update_plan_group( default_plan_id : typing.Optional[str] + fallback_plan_id : typing.Optional[str] + + initial_plan_id : typing.Optional[str] + + initial_plan_price_id : typing.Optional[str] + trial_days : typing.Optional[int] + trial_expiry_plan_id : typing.Optional[str] + + trial_expiry_plan_price_id : typing.Optional[str] + trial_payment_method_required : typing.Optional[bool] request_options : typing.Optional[RequestOptions] @@ -213,6 +312,10 @@ def update_plan_group( client.plangroups.update_plan_group( plan_group_id="plan_group_id", 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", @@ -228,21 +331,38 @@ def update_plan_group( plan_id="plan_id", ) ], + prevent_downgrades_when_over_limit=True, + show_credits=True, show_period_toggle=True, + show_zero_price_as_free=True, + sync_customer_billing_details_for_tax=True, ) """ _response = self._raw_client.update_plan_group( plan_group_id, add_on_ids=add_on_ids, + checkout_collect_address=checkout_collect_address, + checkout_collect_email=checkout_collect_email, + checkout_collect_phone=checkout_collect_phone, + enable_tax_collection=enable_tax_collection, ordered_add_ons=ordered_add_ons, ordered_bundle_list=ordered_bundle_list, ordered_plans=ordered_plans, + prevent_downgrades_when_over_limit=prevent_downgrades_when_over_limit, + show_credits=show_credits, show_period_toggle=show_period_toggle, + show_zero_price_as_free=show_zero_price_as_free, + sync_customer_billing_details_for_tax=sync_customer_billing_details_for_tax, add_on_compatibilities=add_on_compatibilities, custom_plan_config=custom_plan_config, custom_plan_id=custom_plan_id, default_plan_id=default_plan_id, + fallback_plan_id=fallback_plan_id, + initial_plan_id=initial_plan_id, + initial_plan_price_id=initial_plan_price_id, trial_days=trial_days, + trial_expiry_plan_id=trial_expiry_plan_id, + trial_expiry_plan_price_id=trial_expiry_plan_price_id, trial_payment_method_required=trial_payment_method_required, request_options=request_options, ) @@ -300,15 +420,28 @@ async def create_plan_group( self, *, add_on_ids: typing.Sequence[str], + 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], + prevent_downgrades_when_over_limit: bool, + show_credits: bool, show_period_toggle: bool, + show_zero_price_as_free: bool, + sync_customer_billing_details_for_tax: bool, add_on_compatibilities: typing.Optional[typing.Sequence[CompatiblePlans]] = OMIT, custom_plan_config: typing.Optional[CustomPlanConfig] = OMIT, custom_plan_id: typing.Optional[str] = OMIT, default_plan_id: typing.Optional[str] = OMIT, + fallback_plan_id: typing.Optional[str] = OMIT, + initial_plan_id: typing.Optional[str] = OMIT, + initial_plan_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, + trial_expiry_plan_id: typing.Optional[str] = OMIT, + trial_expiry_plan_price_id: typing.Optional[str] = OMIT, trial_payment_method_required: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreatePlanGroupResponse: @@ -318,14 +451,30 @@ async def create_plan_group( 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] + prevent_downgrades_when_over_limit : bool + + show_credits : bool + show_period_toggle : bool + show_zero_price_as_free : bool + + sync_customer_billing_details_for_tax : bool + add_on_compatibilities : typing.Optional[typing.Sequence[CompatiblePlans]] custom_plan_config : typing.Optional[CustomPlanConfig] @@ -334,8 +483,18 @@ async def create_plan_group( default_plan_id : typing.Optional[str] + fallback_plan_id : typing.Optional[str] + + initial_plan_id : typing.Optional[str] + + initial_plan_price_id : typing.Optional[str] + trial_days : typing.Optional[int] + trial_expiry_plan_id : typing.Optional[str] + + trial_expiry_plan_price_id : typing.Optional[str] + trial_payment_method_required : typing.Optional[bool] request_options : typing.Optional[RequestOptions] @@ -360,6 +519,10 @@ async def create_plan_group( async def main() -> None: await 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", @@ -375,7 +538,11 @@ async def main() -> None: plan_id="plan_id", ) ], + prevent_downgrades_when_over_limit=True, + show_credits=True, show_period_toggle=True, + show_zero_price_as_free=True, + sync_customer_billing_details_for_tax=True, ) @@ -383,15 +550,28 @@ async def main() -> None: """ _response = await self._raw_client.create_plan_group( add_on_ids=add_on_ids, + checkout_collect_address=checkout_collect_address, + checkout_collect_email=checkout_collect_email, + checkout_collect_phone=checkout_collect_phone, + enable_tax_collection=enable_tax_collection, ordered_add_ons=ordered_add_ons, ordered_bundle_list=ordered_bundle_list, ordered_plans=ordered_plans, + prevent_downgrades_when_over_limit=prevent_downgrades_when_over_limit, + show_credits=show_credits, show_period_toggle=show_period_toggle, + show_zero_price_as_free=show_zero_price_as_free, + sync_customer_billing_details_for_tax=sync_customer_billing_details_for_tax, add_on_compatibilities=add_on_compatibilities, custom_plan_config=custom_plan_config, custom_plan_id=custom_plan_id, default_plan_id=default_plan_id, + fallback_plan_id=fallback_plan_id, + initial_plan_id=initial_plan_id, + initial_plan_price_id=initial_plan_price_id, trial_days=trial_days, + trial_expiry_plan_id=trial_expiry_plan_id, + trial_expiry_plan_price_id=trial_expiry_plan_price_id, trial_payment_method_required=trial_payment_method_required, request_options=request_options, ) @@ -402,15 +582,28 @@ async def update_plan_group( plan_group_id: str, *, add_on_ids: typing.Sequence[str], + 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], + prevent_downgrades_when_over_limit: bool, + show_credits: bool, show_period_toggle: bool, + show_zero_price_as_free: bool, + sync_customer_billing_details_for_tax: bool, add_on_compatibilities: typing.Optional[typing.Sequence[CompatiblePlans]] = OMIT, custom_plan_config: typing.Optional[CustomPlanConfig] = OMIT, custom_plan_id: typing.Optional[str] = OMIT, default_plan_id: typing.Optional[str] = OMIT, + fallback_plan_id: typing.Optional[str] = OMIT, + initial_plan_id: typing.Optional[str] = OMIT, + initial_plan_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, + trial_expiry_plan_id: typing.Optional[str] = OMIT, + trial_expiry_plan_price_id: typing.Optional[str] = OMIT, trial_payment_method_required: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpdatePlanGroupResponse: @@ -423,14 +616,30 @@ async def update_plan_group( 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] + prevent_downgrades_when_over_limit : bool + + show_credits : bool + show_period_toggle : bool + show_zero_price_as_free : bool + + sync_customer_billing_details_for_tax : bool + add_on_compatibilities : typing.Optional[typing.Sequence[CompatiblePlans]] custom_plan_config : typing.Optional[CustomPlanConfig] @@ -439,8 +648,18 @@ async def update_plan_group( default_plan_id : typing.Optional[str] + fallback_plan_id : typing.Optional[str] + + initial_plan_id : typing.Optional[str] + + initial_plan_price_id : typing.Optional[str] + trial_days : typing.Optional[int] + trial_expiry_plan_id : typing.Optional[str] + + trial_expiry_plan_price_id : typing.Optional[str] + trial_payment_method_required : typing.Optional[bool] request_options : typing.Optional[RequestOptions] @@ -466,6 +685,10 @@ async def main() -> None: await client.plangroups.update_plan_group( plan_group_id="plan_group_id", 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", @@ -481,7 +704,11 @@ async def main() -> None: plan_id="plan_id", ) ], + prevent_downgrades_when_over_limit=True, + show_credits=True, show_period_toggle=True, + show_zero_price_as_free=True, + sync_customer_billing_details_for_tax=True, ) @@ -490,15 +717,28 @@ async def main() -> None: _response = await self._raw_client.update_plan_group( plan_group_id, add_on_ids=add_on_ids, + checkout_collect_address=checkout_collect_address, + checkout_collect_email=checkout_collect_email, + checkout_collect_phone=checkout_collect_phone, + enable_tax_collection=enable_tax_collection, ordered_add_ons=ordered_add_ons, ordered_bundle_list=ordered_bundle_list, ordered_plans=ordered_plans, + prevent_downgrades_when_over_limit=prevent_downgrades_when_over_limit, + show_credits=show_credits, show_period_toggle=show_period_toggle, + show_zero_price_as_free=show_zero_price_as_free, + sync_customer_billing_details_for_tax=sync_customer_billing_details_for_tax, add_on_compatibilities=add_on_compatibilities, custom_plan_config=custom_plan_config, custom_plan_id=custom_plan_id, default_plan_id=default_plan_id, + fallback_plan_id=fallback_plan_id, + initial_plan_id=initial_plan_id, + initial_plan_price_id=initial_plan_price_id, trial_days=trial_days, + trial_expiry_plan_id=trial_expiry_plan_id, + trial_expiry_plan_price_id=trial_expiry_plan_price_id, trial_payment_method_required=trial_payment_method_required, request_options=request_options, ) diff --git a/src/schematic/plangroups/raw_client.py b/src/schematic/plangroups/raw_client.py index 17e45f6..41ab95f 100644 --- a/src/schematic/plangroups/raw_client.py +++ b/src/schematic/plangroups/raw_client.py @@ -118,15 +118,28 @@ def create_plan_group( self, *, add_on_ids: typing.Sequence[str], + 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], + prevent_downgrades_when_over_limit: bool, + show_credits: bool, show_period_toggle: bool, + show_zero_price_as_free: bool, + sync_customer_billing_details_for_tax: bool, add_on_compatibilities: typing.Optional[typing.Sequence[CompatiblePlans]] = OMIT, custom_plan_config: typing.Optional[CustomPlanConfig] = OMIT, custom_plan_id: typing.Optional[str] = OMIT, default_plan_id: typing.Optional[str] = OMIT, + fallback_plan_id: typing.Optional[str] = OMIT, + initial_plan_id: typing.Optional[str] = OMIT, + initial_plan_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, + trial_expiry_plan_id: typing.Optional[str] = OMIT, + trial_expiry_plan_price_id: typing.Optional[str] = OMIT, trial_payment_method_required: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreatePlanGroupResponse]: @@ -136,14 +149,30 @@ def create_plan_group( 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] + prevent_downgrades_when_over_limit : bool + + show_credits : bool + show_period_toggle : bool + show_zero_price_as_free : bool + + sync_customer_billing_details_for_tax : bool + add_on_compatibilities : typing.Optional[typing.Sequence[CompatiblePlans]] custom_plan_config : typing.Optional[CustomPlanConfig] @@ -152,8 +181,18 @@ def create_plan_group( default_plan_id : typing.Optional[str] + fallback_plan_id : typing.Optional[str] + + initial_plan_id : typing.Optional[str] + + initial_plan_price_id : typing.Optional[str] + trial_days : typing.Optional[int] + trial_expiry_plan_id : typing.Optional[str] + + trial_expiry_plan_price_id : typing.Optional[str] + trial_payment_method_required : typing.Optional[bool] request_options : typing.Optional[RequestOptions] @@ -172,11 +211,18 @@ def create_plan_group( object_=add_on_compatibilities, annotation=typing.Sequence[CompatiblePlans], direction="write" ), "add_on_ids": add_on_ids, + "checkout_collect_address": checkout_collect_address, + "checkout_collect_email": checkout_collect_email, + "checkout_collect_phone": checkout_collect_phone, "custom_plan_config": convert_and_respect_annotation_metadata( object_=custom_plan_config, annotation=CustomPlanConfig, direction="write" ), "custom_plan_id": custom_plan_id, "default_plan_id": default_plan_id, + "enable_tax_collection": enable_tax_collection, + "fallback_plan_id": fallback_plan_id, + "initial_plan_id": initial_plan_id, + "initial_plan_price_id": initial_plan_price_id, "ordered_add_ons": convert_and_respect_annotation_metadata( object_=ordered_add_ons, annotation=typing.Sequence[OrderedPlansInGroup], direction="write" ), @@ -186,8 +232,14 @@ def create_plan_group( "ordered_plans": convert_and_respect_annotation_metadata( object_=ordered_plans, annotation=typing.Sequence[OrderedPlansInGroup], direction="write" ), + "prevent_downgrades_when_over_limit": prevent_downgrades_when_over_limit, + "show_credits": show_credits, "show_period_toggle": show_period_toggle, + "show_zero_price_as_free": show_zero_price_as_free, + "sync_customer_billing_details_for_tax": sync_customer_billing_details_for_tax, "trial_days": trial_days, + "trial_expiry_plan_id": trial_expiry_plan_id, + "trial_expiry_plan_price_id": trial_expiry_plan_price_id, "trial_payment_method_required": trial_payment_method_required, }, headers={ @@ -275,15 +327,28 @@ def update_plan_group( plan_group_id: str, *, add_on_ids: typing.Sequence[str], + 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], + prevent_downgrades_when_over_limit: bool, + show_credits: bool, show_period_toggle: bool, + show_zero_price_as_free: bool, + sync_customer_billing_details_for_tax: bool, add_on_compatibilities: typing.Optional[typing.Sequence[CompatiblePlans]] = OMIT, custom_plan_config: typing.Optional[CustomPlanConfig] = OMIT, custom_plan_id: typing.Optional[str] = OMIT, default_plan_id: typing.Optional[str] = OMIT, + fallback_plan_id: typing.Optional[str] = OMIT, + initial_plan_id: typing.Optional[str] = OMIT, + initial_plan_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, + trial_expiry_plan_id: typing.Optional[str] = OMIT, + trial_expiry_plan_price_id: typing.Optional[str] = OMIT, trial_payment_method_required: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpdatePlanGroupResponse]: @@ -296,14 +361,30 @@ def update_plan_group( 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] + prevent_downgrades_when_over_limit : bool + + show_credits : bool + show_period_toggle : bool + show_zero_price_as_free : bool + + sync_customer_billing_details_for_tax : bool + add_on_compatibilities : typing.Optional[typing.Sequence[CompatiblePlans]] custom_plan_config : typing.Optional[CustomPlanConfig] @@ -312,8 +393,18 @@ def update_plan_group( default_plan_id : typing.Optional[str] + fallback_plan_id : typing.Optional[str] + + initial_plan_id : typing.Optional[str] + + initial_plan_price_id : typing.Optional[str] + trial_days : typing.Optional[int] + trial_expiry_plan_id : typing.Optional[str] + + trial_expiry_plan_price_id : typing.Optional[str] + trial_payment_method_required : typing.Optional[bool] request_options : typing.Optional[RequestOptions] @@ -332,11 +423,18 @@ def update_plan_group( object_=add_on_compatibilities, annotation=typing.Sequence[CompatiblePlans], direction="write" ), "add_on_ids": add_on_ids, + "checkout_collect_address": checkout_collect_address, + "checkout_collect_email": checkout_collect_email, + "checkout_collect_phone": checkout_collect_phone, "custom_plan_config": convert_and_respect_annotation_metadata( object_=custom_plan_config, annotation=CustomPlanConfig, direction="write" ), "custom_plan_id": custom_plan_id, "default_plan_id": default_plan_id, + "enable_tax_collection": enable_tax_collection, + "fallback_plan_id": fallback_plan_id, + "initial_plan_id": initial_plan_id, + "initial_plan_price_id": initial_plan_price_id, "ordered_add_ons": convert_and_respect_annotation_metadata( object_=ordered_add_ons, annotation=typing.Sequence[OrderedPlansInGroup], direction="write" ), @@ -346,8 +444,14 @@ def update_plan_group( "ordered_plans": convert_and_respect_annotation_metadata( object_=ordered_plans, annotation=typing.Sequence[OrderedPlansInGroup], direction="write" ), + "prevent_downgrades_when_over_limit": prevent_downgrades_when_over_limit, + "show_credits": show_credits, "show_period_toggle": show_period_toggle, + "show_zero_price_as_free": show_zero_price_as_free, + "sync_customer_billing_details_for_tax": sync_customer_billing_details_for_tax, "trial_days": trial_days, + "trial_expiry_plan_id": trial_expiry_plan_id, + "trial_expiry_plan_price_id": trial_expiry_plan_price_id, "trial_payment_method_required": trial_payment_method_required, }, headers={ @@ -521,15 +625,28 @@ async def create_plan_group( self, *, add_on_ids: typing.Sequence[str], + 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], + prevent_downgrades_when_over_limit: bool, + show_credits: bool, show_period_toggle: bool, + show_zero_price_as_free: bool, + sync_customer_billing_details_for_tax: bool, add_on_compatibilities: typing.Optional[typing.Sequence[CompatiblePlans]] = OMIT, custom_plan_config: typing.Optional[CustomPlanConfig] = OMIT, custom_plan_id: typing.Optional[str] = OMIT, default_plan_id: typing.Optional[str] = OMIT, + fallback_plan_id: typing.Optional[str] = OMIT, + initial_plan_id: typing.Optional[str] = OMIT, + initial_plan_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, + trial_expiry_plan_id: typing.Optional[str] = OMIT, + trial_expiry_plan_price_id: typing.Optional[str] = OMIT, trial_payment_method_required: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreatePlanGroupResponse]: @@ -539,14 +656,30 @@ async def create_plan_group( 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] + prevent_downgrades_when_over_limit : bool + + show_credits : bool + show_period_toggle : bool + show_zero_price_as_free : bool + + sync_customer_billing_details_for_tax : bool + add_on_compatibilities : typing.Optional[typing.Sequence[CompatiblePlans]] custom_plan_config : typing.Optional[CustomPlanConfig] @@ -555,8 +688,18 @@ async def create_plan_group( default_plan_id : typing.Optional[str] + fallback_plan_id : typing.Optional[str] + + initial_plan_id : typing.Optional[str] + + initial_plan_price_id : typing.Optional[str] + trial_days : typing.Optional[int] + trial_expiry_plan_id : typing.Optional[str] + + trial_expiry_plan_price_id : typing.Optional[str] + trial_payment_method_required : typing.Optional[bool] request_options : typing.Optional[RequestOptions] @@ -575,11 +718,18 @@ async def create_plan_group( object_=add_on_compatibilities, annotation=typing.Sequence[CompatiblePlans], direction="write" ), "add_on_ids": add_on_ids, + "checkout_collect_address": checkout_collect_address, + "checkout_collect_email": checkout_collect_email, + "checkout_collect_phone": checkout_collect_phone, "custom_plan_config": convert_and_respect_annotation_metadata( object_=custom_plan_config, annotation=CustomPlanConfig, direction="write" ), "custom_plan_id": custom_plan_id, "default_plan_id": default_plan_id, + "enable_tax_collection": enable_tax_collection, + "fallback_plan_id": fallback_plan_id, + "initial_plan_id": initial_plan_id, + "initial_plan_price_id": initial_plan_price_id, "ordered_add_ons": convert_and_respect_annotation_metadata( object_=ordered_add_ons, annotation=typing.Sequence[OrderedPlansInGroup], direction="write" ), @@ -589,8 +739,14 @@ async def create_plan_group( "ordered_plans": convert_and_respect_annotation_metadata( object_=ordered_plans, annotation=typing.Sequence[OrderedPlansInGroup], direction="write" ), + "prevent_downgrades_when_over_limit": prevent_downgrades_when_over_limit, + "show_credits": show_credits, "show_period_toggle": show_period_toggle, + "show_zero_price_as_free": show_zero_price_as_free, + "sync_customer_billing_details_for_tax": sync_customer_billing_details_for_tax, "trial_days": trial_days, + "trial_expiry_plan_id": trial_expiry_plan_id, + "trial_expiry_plan_price_id": trial_expiry_plan_price_id, "trial_payment_method_required": trial_payment_method_required, }, headers={ @@ -678,15 +834,28 @@ async def update_plan_group( plan_group_id: str, *, add_on_ids: typing.Sequence[str], + 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], + prevent_downgrades_when_over_limit: bool, + show_credits: bool, show_period_toggle: bool, + show_zero_price_as_free: bool, + sync_customer_billing_details_for_tax: bool, add_on_compatibilities: typing.Optional[typing.Sequence[CompatiblePlans]] = OMIT, custom_plan_config: typing.Optional[CustomPlanConfig] = OMIT, custom_plan_id: typing.Optional[str] = OMIT, default_plan_id: typing.Optional[str] = OMIT, + fallback_plan_id: typing.Optional[str] = OMIT, + initial_plan_id: typing.Optional[str] = OMIT, + initial_plan_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, + trial_expiry_plan_id: typing.Optional[str] = OMIT, + trial_expiry_plan_price_id: typing.Optional[str] = OMIT, trial_payment_method_required: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpdatePlanGroupResponse]: @@ -699,14 +868,30 @@ async def update_plan_group( 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] + prevent_downgrades_when_over_limit : bool + + show_credits : bool + show_period_toggle : bool + show_zero_price_as_free : bool + + sync_customer_billing_details_for_tax : bool + add_on_compatibilities : typing.Optional[typing.Sequence[CompatiblePlans]] custom_plan_config : typing.Optional[CustomPlanConfig] @@ -715,8 +900,18 @@ async def update_plan_group( default_plan_id : typing.Optional[str] + fallback_plan_id : typing.Optional[str] + + initial_plan_id : typing.Optional[str] + + initial_plan_price_id : typing.Optional[str] + trial_days : typing.Optional[int] + trial_expiry_plan_id : typing.Optional[str] + + trial_expiry_plan_price_id : typing.Optional[str] + trial_payment_method_required : typing.Optional[bool] request_options : typing.Optional[RequestOptions] @@ -735,11 +930,18 @@ async def update_plan_group( object_=add_on_compatibilities, annotation=typing.Sequence[CompatiblePlans], direction="write" ), "add_on_ids": add_on_ids, + "checkout_collect_address": checkout_collect_address, + "checkout_collect_email": checkout_collect_email, + "checkout_collect_phone": checkout_collect_phone, "custom_plan_config": convert_and_respect_annotation_metadata( object_=custom_plan_config, annotation=CustomPlanConfig, direction="write" ), "custom_plan_id": custom_plan_id, "default_plan_id": default_plan_id, + "enable_tax_collection": enable_tax_collection, + "fallback_plan_id": fallback_plan_id, + "initial_plan_id": initial_plan_id, + "initial_plan_price_id": initial_plan_price_id, "ordered_add_ons": convert_and_respect_annotation_metadata( object_=ordered_add_ons, annotation=typing.Sequence[OrderedPlansInGroup], direction="write" ), @@ -749,8 +951,14 @@ async def update_plan_group( "ordered_plans": convert_and_respect_annotation_metadata( object_=ordered_plans, annotation=typing.Sequence[OrderedPlansInGroup], direction="write" ), + "prevent_downgrades_when_over_limit": prevent_downgrades_when_over_limit, + "show_credits": show_credits, "show_period_toggle": show_period_toggle, + "show_zero_price_as_free": show_zero_price_as_free, + "sync_customer_billing_details_for_tax": sync_customer_billing_details_for_tax, "trial_days": trial_days, + "trial_expiry_plan_id": trial_expiry_plan_id, + "trial_expiry_plan_price_id": trial_expiry_plan_price_id, "trial_payment_method_required": trial_payment_method_required, }, headers={ diff --git a/src/schematic/plans/__init__.py b/src/schematic/plans/__init__.py index 64c8306..3928eda 100644 --- a/src/schematic/plans/__init__.py +++ b/src/schematic/plans/__init__.py @@ -13,6 +13,8 @@ DeletePlanResponse, GetAudienceResponse, GetPlanResponse, + ListPlanIssuesParams, + ListPlanIssuesResponse, ListPlansParams, ListPlansRequestPlanType, ListPlansResponse, @@ -35,6 +37,8 @@ "DeletePlanResponse", "GetAudienceResponse", "GetPlanResponse", + "ListPlanIssuesParams", + "ListPlanIssuesResponse", "ListPlansParams", "ListPlansRequestPlanType", "ListPlansResponse", diff --git a/src/schematic/plans/client.py b/src/schematic/plans/client.py index fab7b6b..885f100 100644 --- a/src/schematic/plans/client.py +++ b/src/schematic/plans/client.py @@ -15,6 +15,7 @@ from .types.delete_plan_response import DeletePlanResponse from .types.get_audience_response import GetAudienceResponse from .types.get_plan_response import GetPlanResponse +from .types.list_plan_issues_response import ListPlanIssuesResponse from .types.list_plans_request_plan_type import ListPlansRequestPlanType from .types.list_plans_response import ListPlansResponse from .types.update_audience_response import UpdateAudienceResponse @@ -215,10 +216,14 @@ def list_plans( self, *, company_id: typing.Optional[str] = None, + for_fallback_plan: typing.Optional[bool] = None, + for_initial_plan: typing.Optional[bool] = None, + 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, plan_type: typing.Optional[ListPlansRequestPlanType] = None, q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, without_paid_product_id: typing.Optional[bool] = None, @@ -231,6 +236,15 @@ def list_plans( ---------- company_id : typing.Optional[str] + for_fallback_plan : typing.Optional[bool] + Filter for plans valid as fallback plans (not linked to billing) + + for_initial_plan : typing.Optional[bool] + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for plans valid as trial expiry plans (not linked to billing or free) + has_product_id : typing.Optional[bool] Filter out plans that do not have a billing product ID @@ -241,6 +255,9 @@ def list_plans( q : typing.Optional[str] + requires_payment_method : typing.Optional[bool] + Filter for plans that require a payment method (inverse of ForInitialPlan) + without_entitlement_for : typing.Optional[str] Filter out plans that already have a plan entitlement for the specified feature ID @@ -271,14 +288,32 @@ def list_plans( client = Schematic( api_key="YOUR_API_KEY", ) - client.plans.list_plans() + client.plans.list_plans( + company_id="company_id", + for_fallback_plan=True, + for_initial_plan=True, + for_trial_expiry_plan=True, + has_product_id=True, + plan_type="plan", + q="q", + requires_payment_method=True, + without_entitlement_for="without_entitlement_for", + without_product_id=True, + without_paid_product_id=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.list_plans( company_id=company_id, + for_fallback_plan=for_fallback_plan, + for_initial_plan=for_initial_plan, + for_trial_expiry_plan=for_trial_expiry_plan, has_product_id=has_product_id, ids=ids, plan_type=plan_type, q=q, + requires_payment_method=requires_payment_method, without_entitlement_for=without_entitlement_for, without_product_id=without_product_id, without_paid_product_id=without_paid_product_id, @@ -527,10 +562,14 @@ def count_plans( self, *, company_id: typing.Optional[str] = None, + for_fallback_plan: typing.Optional[bool] = None, + for_initial_plan: typing.Optional[bool] = None, + 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, plan_type: typing.Optional[CountPlansRequestPlanType] = None, q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, without_paid_product_id: typing.Optional[bool] = None, @@ -543,6 +582,15 @@ def count_plans( ---------- company_id : typing.Optional[str] + for_fallback_plan : typing.Optional[bool] + Filter for plans valid as fallback plans (not linked to billing) + + for_initial_plan : typing.Optional[bool] + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for plans valid as trial expiry plans (not linked to billing or free) + has_product_id : typing.Optional[bool] Filter out plans that do not have a billing product ID @@ -553,6 +601,9 @@ def count_plans( q : typing.Optional[str] + requires_payment_method : typing.Optional[bool] + Filter for plans that require a payment method (inverse of ForInitialPlan) + without_entitlement_for : typing.Optional[str] Filter out plans that already have a plan entitlement for the specified feature ID @@ -583,14 +634,32 @@ def count_plans( client = Schematic( api_key="YOUR_API_KEY", ) - client.plans.count_plans() + client.plans.count_plans( + company_id="company_id", + for_fallback_plan=True, + for_initial_plan=True, + for_trial_expiry_plan=True, + has_product_id=True, + plan_type="plan", + q="q", + requires_payment_method=True, + without_entitlement_for="without_entitlement_for", + without_product_id=True, + without_paid_product_id=True, + limit=1, + offset=1, + ) """ _response = self._raw_client.count_plans( company_id=company_id, + for_fallback_plan=for_fallback_plan, + for_initial_plan=for_initial_plan, + for_trial_expiry_plan=for_trial_expiry_plan, has_product_id=has_product_id, ids=ids, plan_type=plan_type, q=q, + requires_payment_method=requires_payment_method, without_entitlement_for=without_entitlement_for, without_product_id=without_product_id, without_paid_product_id=without_paid_product_id, @@ -600,6 +669,36 @@ def count_plans( ) return _response.data + def list_plan_issues( + self, *, plan_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> ListPlanIssuesResponse: + """ + Parameters + ---------- + plan_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListPlanIssuesResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.plans.list_plan_issues( + plan_id="plan_id", + ) + """ + _response = self._raw_client.list_plan_issues(plan_id=plan_id, request_options=request_options) + return _response.data + class AsyncPlansClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -821,10 +920,14 @@ async def list_plans( self, *, company_id: typing.Optional[str] = None, + for_fallback_plan: typing.Optional[bool] = None, + for_initial_plan: typing.Optional[bool] = None, + 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, plan_type: typing.Optional[ListPlansRequestPlanType] = None, q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, without_paid_product_id: typing.Optional[bool] = None, @@ -837,6 +940,15 @@ async def list_plans( ---------- company_id : typing.Optional[str] + for_fallback_plan : typing.Optional[bool] + Filter for plans valid as fallback plans (not linked to billing) + + for_initial_plan : typing.Optional[bool] + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for plans valid as trial expiry plans (not linked to billing or free) + has_product_id : typing.Optional[bool] Filter out plans that do not have a billing product ID @@ -847,6 +959,9 @@ async def list_plans( q : typing.Optional[str] + requires_payment_method : typing.Optional[bool] + Filter for plans that require a payment method (inverse of ForInitialPlan) + without_entitlement_for : typing.Optional[str] Filter out plans that already have a plan entitlement for the specified feature ID @@ -882,17 +997,35 @@ async def list_plans( async def main() -> None: - await client.plans.list_plans() + await client.plans.list_plans( + company_id="company_id", + for_fallback_plan=True, + for_initial_plan=True, + for_trial_expiry_plan=True, + has_product_id=True, + plan_type="plan", + q="q", + requires_payment_method=True, + without_entitlement_for="without_entitlement_for", + without_product_id=True, + without_paid_product_id=True, + limit=1, + offset=1, + ) asyncio.run(main()) """ _response = await self._raw_client.list_plans( company_id=company_id, + for_fallback_plan=for_fallback_plan, + for_initial_plan=for_initial_plan, + for_trial_expiry_plan=for_trial_expiry_plan, has_product_id=has_product_id, ids=ids, plan_type=plan_type, q=q, + requires_payment_method=requires_payment_method, without_entitlement_for=without_entitlement_for, without_product_id=without_product_id, without_paid_product_id=without_paid_product_id, @@ -1183,10 +1316,14 @@ async def count_plans( self, *, company_id: typing.Optional[str] = None, + for_fallback_plan: typing.Optional[bool] = None, + for_initial_plan: typing.Optional[bool] = None, + 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, plan_type: typing.Optional[CountPlansRequestPlanType] = None, q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, without_paid_product_id: typing.Optional[bool] = None, @@ -1199,6 +1336,15 @@ async def count_plans( ---------- company_id : typing.Optional[str] + for_fallback_plan : typing.Optional[bool] + Filter for plans valid as fallback plans (not linked to billing) + + for_initial_plan : typing.Optional[bool] + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for plans valid as trial expiry plans (not linked to billing or free) + has_product_id : typing.Optional[bool] Filter out plans that do not have a billing product ID @@ -1209,6 +1355,9 @@ async def count_plans( q : typing.Optional[str] + requires_payment_method : typing.Optional[bool] + Filter for plans that require a payment method (inverse of ForInitialPlan) + without_entitlement_for : typing.Optional[str] Filter out plans that already have a plan entitlement for the specified feature ID @@ -1244,17 +1393,35 @@ async def count_plans( async def main() -> None: - await client.plans.count_plans() + await client.plans.count_plans( + company_id="company_id", + for_fallback_plan=True, + for_initial_plan=True, + for_trial_expiry_plan=True, + has_product_id=True, + plan_type="plan", + q="q", + requires_payment_method=True, + without_entitlement_for="without_entitlement_for", + without_product_id=True, + without_paid_product_id=True, + limit=1, + offset=1, + ) asyncio.run(main()) """ _response = await self._raw_client.count_plans( company_id=company_id, + for_fallback_plan=for_fallback_plan, + for_initial_plan=for_initial_plan, + for_trial_expiry_plan=for_trial_expiry_plan, has_product_id=has_product_id, ids=ids, plan_type=plan_type, q=q, + requires_payment_method=requires_payment_method, without_entitlement_for=without_entitlement_for, without_product_id=without_product_id, without_paid_product_id=without_paid_product_id, @@ -1263,3 +1430,41 @@ async def main() -> None: request_options=request_options, ) return _response.data + + async def list_plan_issues( + self, *, plan_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> ListPlanIssuesResponse: + """ + Parameters + ---------- + plan_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListPlanIssuesResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.plans.list_plan_issues( + plan_id="plan_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_plan_issues(plan_id=plan_id, request_options=request_options) + return _response.data diff --git a/src/schematic/plans/raw_client.py b/src/schematic/plans/raw_client.py index d92f1d1..3ec172e 100644 --- a/src/schematic/plans/raw_client.py +++ b/src/schematic/plans/raw_client.py @@ -26,6 +26,7 @@ from .types.delete_plan_response import DeletePlanResponse from .types.get_audience_response import GetAudienceResponse from .types.get_plan_response import GetPlanResponse +from .types.list_plan_issues_response import ListPlanIssuesResponse from .types.list_plans_request_plan_type import ListPlansRequestPlanType from .types.list_plans_response import ListPlansResponse from .types.update_audience_response import UpdateAudienceResponse @@ -461,10 +462,14 @@ def list_plans( self, *, company_id: typing.Optional[str] = None, + for_fallback_plan: typing.Optional[bool] = None, + for_initial_plan: typing.Optional[bool] = None, + 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, plan_type: typing.Optional[ListPlansRequestPlanType] = None, q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, without_paid_product_id: typing.Optional[bool] = None, @@ -477,6 +482,15 @@ def list_plans( ---------- company_id : typing.Optional[str] + for_fallback_plan : typing.Optional[bool] + Filter for plans valid as fallback plans (not linked to billing) + + for_initial_plan : typing.Optional[bool] + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for plans valid as trial expiry plans (not linked to billing or free) + has_product_id : typing.Optional[bool] Filter out plans that do not have a billing product ID @@ -487,6 +501,9 @@ def list_plans( q : typing.Optional[str] + requires_payment_method : typing.Optional[bool] + Filter for plans that require a payment method (inverse of ForInitialPlan) + without_entitlement_for : typing.Optional[str] Filter out plans that already have a plan entitlement for the specified feature ID @@ -515,10 +532,14 @@ def list_plans( method="GET", params={ "company_id": company_id, + "for_fallback_plan": for_fallback_plan, + "for_initial_plan": for_initial_plan, + "for_trial_expiry_plan": for_trial_expiry_plan, "has_product_id": has_product_id, "ids": ids, "plan_type": plan_type, "q": q, + "requires_payment_method": requires_payment_method, "without_entitlement_for": without_entitlement_for, "without_product_id": without_product_id, "without_paid_product_id": without_paid_product_id, @@ -1169,10 +1190,14 @@ def count_plans( self, *, company_id: typing.Optional[str] = None, + for_fallback_plan: typing.Optional[bool] = None, + for_initial_plan: typing.Optional[bool] = None, + 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, plan_type: typing.Optional[CountPlansRequestPlanType] = None, q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, without_paid_product_id: typing.Optional[bool] = None, @@ -1185,6 +1210,15 @@ def count_plans( ---------- company_id : typing.Optional[str] + for_fallback_plan : typing.Optional[bool] + Filter for plans valid as fallback plans (not linked to billing) + + for_initial_plan : typing.Optional[bool] + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for plans valid as trial expiry plans (not linked to billing or free) + has_product_id : typing.Optional[bool] Filter out plans that do not have a billing product ID @@ -1195,6 +1229,9 @@ def count_plans( q : typing.Optional[str] + requires_payment_method : typing.Optional[bool] + Filter for plans that require a payment method (inverse of ForInitialPlan) + without_entitlement_for : typing.Optional[str] Filter out plans that already have a plan entitlement for the specified feature ID @@ -1223,10 +1260,14 @@ def count_plans( method="GET", params={ "company_id": company_id, + "for_fallback_plan": for_fallback_plan, + "for_initial_plan": for_initial_plan, + "for_trial_expiry_plan": for_trial_expiry_plan, "has_product_id": has_product_id, "ids": ids, "plan_type": plan_type, "q": q, + "requires_payment_method": requires_payment_method, "without_entitlement_for": without_entitlement_for, "without_product_id": without_product_id, "without_paid_product_id": without_paid_product_id, @@ -1309,6 +1350,104 @@ def count_plans( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def list_plan_issues( + self, *, plan_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ListPlanIssuesResponse]: + """ + Parameters + ---------- + plan_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ListPlanIssuesResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "plans/issues", + method="GET", + params={ + "plan_id": plan_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListPlanIssuesResponse, + parse_obj_as( + type_=ListPlanIssuesResponse, # 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): @@ -1733,10 +1872,14 @@ async def list_plans( self, *, company_id: typing.Optional[str] = None, + for_fallback_plan: typing.Optional[bool] = None, + for_initial_plan: typing.Optional[bool] = None, + 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, plan_type: typing.Optional[ListPlansRequestPlanType] = None, q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, without_paid_product_id: typing.Optional[bool] = None, @@ -1749,6 +1892,15 @@ async def list_plans( ---------- company_id : typing.Optional[str] + for_fallback_plan : typing.Optional[bool] + Filter for plans valid as fallback plans (not linked to billing) + + for_initial_plan : typing.Optional[bool] + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for plans valid as trial expiry plans (not linked to billing or free) + has_product_id : typing.Optional[bool] Filter out plans that do not have a billing product ID @@ -1759,6 +1911,9 @@ async def list_plans( q : typing.Optional[str] + requires_payment_method : typing.Optional[bool] + Filter for plans that require a payment method (inverse of ForInitialPlan) + without_entitlement_for : typing.Optional[str] Filter out plans that already have a plan entitlement for the specified feature ID @@ -1787,10 +1942,14 @@ async def list_plans( method="GET", params={ "company_id": company_id, + "for_fallback_plan": for_fallback_plan, + "for_initial_plan": for_initial_plan, + "for_trial_expiry_plan": for_trial_expiry_plan, "has_product_id": has_product_id, "ids": ids, "plan_type": plan_type, "q": q, + "requires_payment_method": requires_payment_method, "without_entitlement_for": without_entitlement_for, "without_product_id": without_product_id, "without_paid_product_id": without_paid_product_id, @@ -2441,10 +2600,14 @@ async def count_plans( self, *, company_id: typing.Optional[str] = None, + for_fallback_plan: typing.Optional[bool] = None, + for_initial_plan: typing.Optional[bool] = None, + 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, plan_type: typing.Optional[CountPlansRequestPlanType] = None, q: typing.Optional[str] = None, + requires_payment_method: typing.Optional[bool] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, without_paid_product_id: typing.Optional[bool] = None, @@ -2457,6 +2620,15 @@ async def count_plans( ---------- company_id : typing.Optional[str] + for_fallback_plan : typing.Optional[bool] + Filter for plans valid as fallback plans (not linked to billing) + + for_initial_plan : typing.Optional[bool] + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + + for_trial_expiry_plan : typing.Optional[bool] + Filter for plans valid as trial expiry plans (not linked to billing or free) + has_product_id : typing.Optional[bool] Filter out plans that do not have a billing product ID @@ -2467,6 +2639,9 @@ async def count_plans( q : typing.Optional[str] + requires_payment_method : typing.Optional[bool] + Filter for plans that require a payment method (inverse of ForInitialPlan) + without_entitlement_for : typing.Optional[str] Filter out plans that already have a plan entitlement for the specified feature ID @@ -2495,10 +2670,14 @@ async def count_plans( method="GET", params={ "company_id": company_id, + "for_fallback_plan": for_fallback_plan, + "for_initial_plan": for_initial_plan, + "for_trial_expiry_plan": for_trial_expiry_plan, "has_product_id": has_product_id, "ids": ids, "plan_type": plan_type, "q": q, + "requires_payment_method": requires_payment_method, "without_entitlement_for": without_entitlement_for, "without_product_id": without_product_id, "without_paid_product_id": without_paid_product_id, @@ -2580,3 +2759,101 @@ async def count_plans( raise core_api_error_ApiError( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + + async def list_plan_issues( + self, *, plan_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ListPlanIssuesResponse]: + """ + Parameters + ---------- + plan_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ListPlanIssuesResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "plans/issues", + method="GET", + params={ + "plan_id": plan_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListPlanIssuesResponse, + parse_obj_as( + type_=ListPlanIssuesResponse, # 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 52cb0e7..2da48bf 100644 --- a/src/schematic/plans/types/__init__.py +++ b/src/schematic/plans/types/__init__.py @@ -12,6 +12,8 @@ from .delete_plan_response import DeletePlanResponse from .get_audience_response import GetAudienceResponse 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_request_plan_type import ListPlansRequestPlanType from .list_plans_response import ListPlansResponse @@ -33,6 +35,8 @@ "DeletePlanResponse", "GetAudienceResponse", "GetPlanResponse", + "ListPlanIssuesParams", + "ListPlanIssuesResponse", "ListPlansParams", "ListPlansRequestPlanType", "ListPlansResponse", diff --git a/src/schematic/plans/types/count_plans_params.py b/src/schematic/plans/types/count_plans_params.py index 83f9a3e..fd0ffdc 100644 --- a/src/schematic/plans/types/count_plans_params.py +++ b/src/schematic/plans/types/count_plans_params.py @@ -13,6 +13,21 @@ class CountPlansParams(UniversalBaseModel): """ company_id: typing.Optional[str] = None + for_fallback_plan: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for plans valid as fallback plans (not linked to billing) + """ + + for_initial_plan: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + """ + + for_trial_expiry_plan: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for plans valid as trial expiry plans (not linked to billing or free) + """ + has_product_id: typing.Optional[bool] = pydantic.Field(default=None) """ Filter out plans that do not have a billing product ID @@ -35,6 +50,11 @@ class CountPlansParams(UniversalBaseModel): """ q: typing.Optional[str] = None + requires_payment_method: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for plans that require a payment method (inverse of ForInitialPlan) + """ + without_entitlement_for: typing.Optional[str] = pydantic.Field(default=None) """ Filter out plans that already have a plan entitlement for the specified feature ID diff --git a/src/schematic/plans/types/list_plan_issues_params.py b/src/schematic/plans/types/list_plan_issues_params.py new file mode 100644 index 0000000..5191e45 --- /dev/null +++ b/src/schematic/plans/types/list_plan_issues_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 ListPlanIssuesParams(UniversalBaseModel): + """ + Input parameters + """ + + plan_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/plans/types/list_plan_issues_response.py b/src/schematic/plans/types/list_plan_issues_response.py new file mode 100644 index 0000000..f92fdef --- /dev/null +++ b/src/schematic/plans/types/list_plan_issues_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_issue_response_data import PlanIssueResponseData +from .list_plan_issues_params import ListPlanIssuesParams + + +class ListPlanIssuesResponse(UniversalBaseModel): + data: typing.List[PlanIssueResponseData] + params: ListPlanIssuesParams = 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/list_plans_params.py b/src/schematic/plans/types/list_plans_params.py index 8ccd313..56f9f4f 100644 --- a/src/schematic/plans/types/list_plans_params.py +++ b/src/schematic/plans/types/list_plans_params.py @@ -13,6 +13,21 @@ class ListPlansParams(UniversalBaseModel): """ company_id: typing.Optional[str] = None + for_fallback_plan: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for plans valid as fallback plans (not linked to billing) + """ + + for_initial_plan: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) + """ + + for_trial_expiry_plan: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for plans valid as trial expiry plans (not linked to billing or free) + """ + has_product_id: typing.Optional[bool] = pydantic.Field(default=None) """ Filter out plans that do not have a billing product ID @@ -35,6 +50,11 @@ class ListPlansParams(UniversalBaseModel): """ q: typing.Optional[str] = None + requires_payment_method: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter for plans that require a payment method (inverse of ForInitialPlan) + """ + without_entitlement_for: typing.Optional[str] = pydantic.Field(default=None) """ Filter out plans that already have a plan entitlement for the specified feature ID diff --git a/src/schematic/plans/types/list_plans_response.py b/src/schematic/plans/types/list_plans_response.py index a85add9..541af2e 100644 --- a/src/schematic/plans/types/list_plans_response.py +++ b/src/schematic/plans/types/list_plans_response.py @@ -9,11 +9,7 @@ class ListPlansResponse(UniversalBaseModel): - data: typing.List[PlanDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[PlanDetailResponseData] params: ListPlansParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/types/__init__.py b/src/schematic/types/__init__.py index 4fa0a4e..7144cf8 100644 --- a/src/schematic/types/__init__.py +++ b/src/schematic/types/__init__.py @@ -12,6 +12,7 @@ from .billing_credit_bundle_response_data import BillingCreditBundleResponseData from .billing_credit_bundle_view import BillingCreditBundleView from .billing_credit_grant_response_data import BillingCreditGrantResponseData +from .billing_credit_ledger_response_data import BillingCreditLedgerResponseData from .billing_credit_response_data import BillingCreditResponseData from .billing_customer_response_data import BillingCustomerResponseData from .billing_customer_subscription import BillingCustomerSubscription @@ -38,11 +39,15 @@ from .check_flag_response_data import CheckFlagResponseData from .check_flags_response_data import CheckFlagsResponseData from .checkout_data_response_data import CheckoutDataResponseData +from .checkout_settings_response_data import CheckoutSettingsResponseData +from .checkout_subscription import CheckoutSubscription from .company_crm_deals_response_data import CompanyCrmDealsResponseData from .company_detail_response_data import CompanyDetailResponseData from .company_event_period_metrics_response_data import CompanyEventPeriodMetricsResponseData +from .company_ledger_response_data import CompanyLedgerResponseData from .company_membership_detail_response_data import CompanyMembershipDetailResponseData from .company_membership_response_data import CompanyMembershipResponseData +from .company_override_note_response_data import CompanyOverrideNoteResponseData from .company_override_response_data import CompanyOverrideResponseData from .company_plan_detail_response_data import CompanyPlanDetailResponseData from .company_plan_with_billing_sub_view import CompanyPlanWithBillingSubView @@ -52,9 +57,12 @@ from .compatible_plans import CompatiblePlans from .compatible_plans_response_data import CompatiblePlansResponseData from .component_capabilities import ComponentCapabilities +from .component_checkout_settings import ComponentCheckoutSettings from .component_hydrate_response_data import ComponentHydrateResponseData from .component_preview_response_data import ComponentPreviewResponseData from .component_response_data import ComponentResponseData +from .condition import Condition +from .condition_group import ConditionGroup from .count_response import CountResponse from .coupon_request_body import CouponRequestBody from .create_billing_price_tier_request_body import CreateBillingPriceTierRequestBody @@ -79,7 +87,12 @@ from .create_price_tier_request_body import CreatePriceTierRequestBody from .credit_bundle_purchase_response_data import CreditBundlePurchaseResponseData from .credit_company_grant_view import CreditCompanyGrantView +from .credit_grant_detail import CreditGrantDetail +from .credit_grant_detail_grant_reason import CreditGrantDetailGrantReason +from .credit_ledger_enriched_entry_response_data import CreditLedgerEnrichedEntryResponseData from .credit_trigger_config import CreditTriggerConfig +from .credit_usage import CreditUsage +from .credit_usage_response_data import CreditUsageResponseData from .crm_deal_line_item import CrmDealLineItem from .crm_deal_response_data import CrmDealResponseData from .crm_line_item_response_data import CrmLineItemResponseData @@ -110,14 +123,17 @@ from .event_summary_response_data import EventSummaryResponseData from .feature_company_response_data import FeatureCompanyResponseData from .feature_company_response_data_allocation_type import FeatureCompanyResponseDataAllocationType +from .feature_company_response_data_credit_grant_reason import FeatureCompanyResponseDataCreditGrantReason from .feature_company_user_response_data import FeatureCompanyUserResponseData from .feature_company_user_response_data_allocation_type import FeatureCompanyUserResponseDataAllocationType from .feature_detail_response_data import FeatureDetailResponseData +from .feature_ledger_response_data import FeatureLedgerResponseData from .feature_response_data import FeatureResponseData from .feature_usage_data_response_data import FeatureUsageDataResponseData from .feature_usage_detail_response_data import FeatureUsageDetailResponseData from .feature_usage_response_data import FeatureUsageResponseData from .feature_usage_response_data_allocation_type import FeatureUsageResponseDataAllocationType +from .feature_usage_response_data_credit_grant_reason import FeatureUsageResponseDataCreditGrantReason from .flag_detail_response_data import FlagDetailResponseData from .flag_response_data import FlagResponseData from .generic_preview_object import GenericPreviewObject @@ -125,6 +141,9 @@ from .invoice_response_data import InvoiceResponseData from .issue_temporary_access_token_response_data import IssueTemporaryAccessTokenResponseData from .keys_request_body import KeysRequestBody +from .manage_plan_preview_response_response_data import ManagePlanPreviewResponseResponseData +from .manage_plan_request import ManagePlanRequest +from .manage_plan_response_response_data import ManagePlanResponseResponseData from .meter_request_body import MeterRequestBody from .ordered_plans_in_group import OrderedPlansInGroup from .pagination_filter import PaginationFilter @@ -141,7 +160,9 @@ from .plan_group_plan_detail_response_data import PlanGroupPlanDetailResponseData from .plan_group_plan_entitlements_order import PlanGroupPlanEntitlementsOrder from .plan_group_response_data import PlanGroupResponseData +from .plan_issue_response_data import PlanIssueResponseData from .plan_response_data import PlanResponseData +from .plan_selection import PlanSelection from .plan_trait_response_data import PlanTraitResponseData from .preview_object import PreviewObject from .preview_object_response_data import PreviewObjectResponseData @@ -151,6 +172,7 @@ from .quickstart_resp import QuickstartResp from .raw_event_batch_response_data import RawEventBatchResponseData from .raw_event_response_data import RawEventResponseData +from .rule import Rule from .rule_condition_detail_response_data import RuleConditionDetailResponseData from .rule_condition_group_detail_response_data import RuleConditionGroupDetailResponseData from .rule_condition_group_response_data import RuleConditionGroupResponseData @@ -161,6 +183,7 @@ from .segment_status_resp import SegmentStatusResp from .stripe_embed_info import StripeEmbedInfo from .temporary_access_token_response_data import TemporaryAccessTokenResponseData +from .trait_definition import TraitDefinition from .update_add_on_request_body import UpdateAddOnRequestBody from .update_credit_bundle_request_body import UpdateCreditBundleRequestBody from .update_entitlement_req_common import UpdateEntitlementReqCommon @@ -168,6 +191,7 @@ from .update_entitlement_req_common_metric_period_month_reset import UpdateEntitlementReqCommonMetricPeriodMonthReset from .update_entitlement_req_common_value_type import UpdateEntitlementReqCommonValueType from .update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody +from .update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody from .update_rule_request_body import UpdateRuleRequestBody from .upsert_company_request_body import UpsertCompanyRequestBody from .upsert_trait_request_body import UpsertTraitRequestBody @@ -193,6 +217,7 @@ "BillingCreditBundleResponseData", "BillingCreditBundleView", "BillingCreditGrantResponseData", + "BillingCreditLedgerResponseData", "BillingCreditResponseData", "BillingCustomerResponseData", "BillingCustomerSubscription", @@ -219,11 +244,15 @@ "CheckFlagResponseData", "CheckFlagsResponseData", "CheckoutDataResponseData", + "CheckoutSettingsResponseData", + "CheckoutSubscription", "CompanyCrmDealsResponseData", "CompanyDetailResponseData", "CompanyEventPeriodMetricsResponseData", + "CompanyLedgerResponseData", "CompanyMembershipDetailResponseData", "CompanyMembershipResponseData", + "CompanyOverrideNoteResponseData", "CompanyOverrideResponseData", "CompanyPlanDetailResponseData", "CompanyPlanWithBillingSubView", @@ -233,9 +262,12 @@ "CompatiblePlans", "CompatiblePlansResponseData", "ComponentCapabilities", + "ComponentCheckoutSettings", "ComponentHydrateResponseData", "ComponentPreviewResponseData", "ComponentResponseData", + "Condition", + "ConditionGroup", "CountResponse", "CouponRequestBody", "CreateBillingPriceTierRequestBody", @@ -258,7 +290,12 @@ "CreatePriceTierRequestBody", "CreditBundlePurchaseResponseData", "CreditCompanyGrantView", + "CreditGrantDetail", + "CreditGrantDetailGrantReason", + "CreditLedgerEnrichedEntryResponseData", "CreditTriggerConfig", + "CreditUsage", + "CreditUsageResponseData", "CrmDealLineItem", "CrmDealResponseData", "CrmLineItemResponseData", @@ -289,14 +326,17 @@ "EventSummaryResponseData", "FeatureCompanyResponseData", "FeatureCompanyResponseDataAllocationType", + "FeatureCompanyResponseDataCreditGrantReason", "FeatureCompanyUserResponseData", "FeatureCompanyUserResponseDataAllocationType", "FeatureDetailResponseData", + "FeatureLedgerResponseData", "FeatureResponseData", "FeatureUsageDataResponseData", "FeatureUsageDetailResponseData", "FeatureUsageResponseData", "FeatureUsageResponseDataAllocationType", + "FeatureUsageResponseDataCreditGrantReason", "FlagDetailResponseData", "FlagResponseData", "GenericPreviewObject", @@ -304,6 +344,9 @@ "InvoiceResponseData", "IssueTemporaryAccessTokenResponseData", "KeysRequestBody", + "ManagePlanPreviewResponseResponseData", + "ManagePlanRequest", + "ManagePlanResponseResponseData", "MeterRequestBody", "OrderedPlansInGroup", "PaginationFilter", @@ -320,7 +363,9 @@ "PlanGroupPlanDetailResponseData", "PlanGroupPlanEntitlementsOrder", "PlanGroupResponseData", + "PlanIssueResponseData", "PlanResponseData", + "PlanSelection", "PlanTraitResponseData", "PreviewObject", "PreviewObjectResponseData", @@ -330,6 +375,7 @@ "QuickstartResp", "RawEventBatchResponseData", "RawEventResponseData", + "Rule", "RuleConditionDetailResponseData", "RuleConditionGroupDetailResponseData", "RuleConditionGroupResponseData", @@ -340,6 +386,7 @@ "SegmentStatusResp", "StripeEmbedInfo", "TemporaryAccessTokenResponseData", + "TraitDefinition", "UpdateAddOnRequestBody", "UpdateCreditBundleRequestBody", "UpdateEntitlementReqCommon", @@ -347,6 +394,7 @@ "UpdateEntitlementReqCommonMetricPeriodMonthReset", "UpdateEntitlementReqCommonValueType", "UpdatePayInAdvanceRequestBody", + "UpdatePlanTraitTraitRequestBody", "UpdateRuleRequestBody", "UpsertCompanyRequestBody", "UpsertTraitRequestBody", diff --git a/src/schematic/types/api_key_create_response_data.py b/src/schematic/types/api_key_create_response_data.py index 00e72a1..8b9c15a 100644 --- a/src/schematic/types/api_key_create_response_data.py +++ b/src/schematic/types/api_key_create_response_data.py @@ -8,10 +8,6 @@ class ApiKeyCreateResponseData(UniversalBaseModel): - """ - The created resource - """ - created_at: dt.datetime description: typing.Optional[str] = None environment_id: typing.Optional[str] = None diff --git a/src/schematic/types/api_key_request_response_data.py b/src/schematic/types/api_key_request_response_data.py index e8f20b0..7a675e9 100644 --- a/src/schematic/types/api_key_request_response_data.py +++ b/src/schematic/types/api_key_request_response_data.py @@ -8,10 +8,6 @@ class ApiKeyRequestResponseData(UniversalBaseModel): - """ - The returned resource - """ - api_key_id: str ended_at: typing.Optional[dt.datetime] = None environment_id: typing.Optional[str] = None diff --git a/src/schematic/types/api_key_response_data.py b/src/schematic/types/api_key_response_data.py index dc16cab..636c6ec 100644 --- a/src/schematic/types/api_key_response_data.py +++ b/src/schematic/types/api_key_response_data.py @@ -8,10 +8,6 @@ class ApiKeyResponseData(UniversalBaseModel): - """ - The updated resource - """ - created_at: dt.datetime description: typing.Optional[str] = None environment_id: 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 13c7974..5ea7a8d 100644 --- a/src/schematic/types/billing_credit_bundle_response_data.py +++ b/src/schematic/types/billing_credit_bundle_response_data.py @@ -19,6 +19,7 @@ class BillingCreditBundleResponseData(UniversalBaseModel): expiry_type: str expiry_unit: str expiry_unit_count: typing.Optional[int] = None + has_grants: bool id: str name: str plural_name: 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 add1610..1460e05 100644 --- a/src/schematic/types/billing_credit_bundle_view.py +++ b/src/schematic/types/billing_credit_bundle_view.py @@ -19,6 +19,7 @@ class BillingCreditBundleView(UniversalBaseModel): expiry_type: str expiry_unit: str expiry_unit_count: typing.Optional[int] = None + has_grants: bool id: str name: str plural_name: typing.Optional[str] = None diff --git a/src/schematic/types/billing_credit_ledger_response_data.py b/src/schematic/types/billing_credit_ledger_response_data.py new file mode 100644 index 0000000..90d66e5 --- /dev/null +++ b/src/schematic/types/billing_credit_ledger_response_data.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 + + +class BillingCreditLedgerResponseData(UniversalBaseModel): + description: typing.Optional[str] = None + icon: typing.Optional[str] = None + id: str + name: str + plural_name: typing.Optional[str] = None + singular_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 diff --git a/src/schematic/types/billing_customer_response_data.py b/src/schematic/types/billing_customer_response_data.py index c43b9a1..9c4e03c 100644 --- a/src/schematic/types/billing_customer_response_data.py +++ b/src/schematic/types/billing_customer_response_data.py @@ -8,10 +8,6 @@ class BillingCustomerResponseData(UniversalBaseModel): - """ - The created resource - """ - company_id: typing.Optional[str] = None deleted_at: typing.Optional[dt.datetime] = None email: str 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 93f4916..b6c144c 100644 --- a/src/schematic/types/billing_plan_credit_grant_response_data.py +++ b/src/schematic/types/billing_plan_credit_grant_response_data.py @@ -11,11 +11,18 @@ class BillingPlanCreditGrantResponseData(UniversalBaseModel): created_at: dt.datetime credit_amount: int credit_id: str + credit_name: str + credit_plural_name: typing.Optional[str] = None + credit_singular_name: typing.Optional[str] = None + expiry_type: typing.Optional[str] = None + expiry_unit: typing.Optional[str] = None + expiry_unit_count: typing.Optional[int] = None id: str plan_id: str plan_name: str reset_cadence: str reset_start: str + reset_type: typing.Optional[str] = None updated_at: dt.datetime if IS_PYDANTIC_V2: diff --git a/src/schematic/types/billing_product_detail_response_data.py b/src/schematic/types/billing_product_detail_response_data.py index bbd10b5..7cf1edd 100644 --- a/src/schematic/types/billing_product_detail_response_data.py +++ b/src/schematic/types/billing_product_detail_response_data.py @@ -11,7 +11,11 @@ class BillingProductDetailResponseData(UniversalBaseModel): account_id: str created_at: dt.datetime - currency: str + currency: typing.Optional[str] = pydantic.Field(default=None) + """ + Deprecated; currencies are associated with prices, not products + """ + environment_id: str external_id: str is_active: bool diff --git a/src/schematic/types/billing_product_for_subscription_response_data.py b/src/schematic/types/billing_product_for_subscription_response_data.py index 0aaf20e..14c1ddd 100644 --- a/src/schematic/types/billing_product_for_subscription_response_data.py +++ b/src/schematic/types/billing_product_for_subscription_response_data.py @@ -10,6 +10,7 @@ class BillingProductForSubscriptionResponseData(UniversalBaseModel): billing_scheme: str + billing_threshold: typing.Optional[int] = None created_at: dt.datetime currency: str environment_id: str @@ -26,6 +27,7 @@ class BillingProductForSubscriptionResponseData(UniversalBaseModel): price_tier: typing.List[BillingProductPriceTierResponseData] quantity: float subscription_id: str + subscription_item_external_id: typing.Optional[str] = None updated_at: dt.datetime usage_type: str diff --git a/src/schematic/types/billing_product_plan_response_data.py b/src/schematic/types/billing_product_plan_response_data.py index e8739f1..a3237f0 100644 --- a/src/schematic/types/billing_product_plan_response_data.py +++ b/src/schematic/types/billing_product_plan_response_data.py @@ -7,10 +7,6 @@ class BillingProductPlanResponseData(UniversalBaseModel): - """ - The updated resource - """ - account_id: str billing_product_id: str charge_type: str diff --git a/src/schematic/types/billing_product_pricing.py b/src/schematic/types/billing_product_pricing.py index 02d09a0..26ea22e 100644 --- a/src/schematic/types/billing_product_pricing.py +++ b/src/schematic/types/billing_product_pricing.py @@ -8,6 +8,7 @@ class BillingProductPricing(UniversalBaseModel): + billing_threshold: typing.Optional[int] = None currency: str interval: str meter_id: typing.Optional[str] = None @@ -17,6 +18,7 @@ class BillingProductPricing(UniversalBaseModel): price_external_id: str product_external_id: str quantity: int + subscription_item_external_id: typing.Optional[str] = None usage_type: BillingProductPricingUsageType if IS_PYDANTIC_V2: diff --git a/src/schematic/types/billing_product_response_data.py b/src/schematic/types/billing_product_response_data.py index 390c60c..f22df85 100644 --- a/src/schematic/types/billing_product_response_data.py +++ b/src/schematic/types/billing_product_response_data.py @@ -10,7 +10,11 @@ class BillingProductResponseData(UniversalBaseModel): account_id: str created_at: dt.datetime - currency: str + currency: typing.Optional[str] = pydantic.Field(default=None) + """ + Deprecated; currencies are associated with prices, not products + """ + environment_id: str external_id: str is_active: bool diff --git a/src/schematic/types/billing_subscription_view.py b/src/schematic/types/billing_subscription_view.py index 7d99f37..056efb9 100644 --- a/src/schematic/types/billing_subscription_view.py +++ b/src/schematic/types/billing_subscription_view.py @@ -12,10 +12,6 @@ class BillingSubscriptionView(UniversalBaseModel): - """ - The updated resource - """ - cancel_at: typing.Optional[int] = None cancel_at_period_end: bool company_id: typing.Optional[str] = None diff --git a/src/schematic/types/check_flag_response_data.py b/src/schematic/types/check_flag_response_data.py index 5ba6186..1121c0f 100644 --- a/src/schematic/types/check_flag_response_data.py +++ b/src/schematic/types/check_flag_response_data.py @@ -8,10 +8,6 @@ class CheckFlagResponseData(UniversalBaseModel): - """ - The returned resource - """ - company_id: typing.Optional[str] = pydantic.Field(default=None) """ If company keys were provided and matched a company, its ID diff --git a/src/schematic/types/check_flags_response_data.py b/src/schematic/types/check_flags_response_data.py index 58dbdad..ba84802 100644 --- a/src/schematic/types/check_flags_response_data.py +++ b/src/schematic/types/check_flags_response_data.py @@ -8,10 +8,6 @@ class CheckFlagsResponseData(UniversalBaseModel): - """ - The created resource - """ - flags: typing.List[CheckFlagResponseData] if IS_PYDANTIC_V2: diff --git a/src/schematic/types/checkout_data_response_data.py b/src/schematic/types/checkout_data_response_data.py index d0f25eb..0cb0ab0 100644 --- a/src/schematic/types/checkout_data_response_data.py +++ b/src/schematic/types/checkout_data_response_data.py @@ -14,10 +14,6 @@ class CheckoutDataResponseData(UniversalBaseModel): - """ - The requested resource - """ - active_add_ons: typing.List[PlanDetailResponseData] active_plan: typing.Optional[PlanDetailResponseData] = None active_usage_based_entitlements: typing.List[UsageBasedEntitlementResponseData] diff --git a/src/schematic/types/checkout_settings_response_data.py b/src/schematic/types/checkout_settings_response_data.py new file mode 100644 index 0000000..e7dd0f0 --- /dev/null +++ b/src/schematic/types/checkout_settings_response_data.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 CheckoutSettingsResponseData(UniversalBaseModel): + collect_address: bool + collect_email: bool + collect_phone: 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/checkout_subscription.py b/src/schematic/types/checkout_subscription.py new file mode 100644 index 0000000..daf4032 --- /dev/null +++ b/src/schematic/types/checkout_subscription.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 + + +class CheckoutSubscription(UniversalBaseModel): + cancel_at: typing.Optional[int] = None + cancel_at_period_end: bool + company_id: typing.Optional[str] = None + confirm_payment_intent_client_secret: typing.Optional[str] = None + confirm_payment_intent_id: typing.Optional[str] = None + created_at: dt.datetime + currency: str + customer_external_id: str + default_payment_method_id: typing.Optional[str] = None + expired_at: typing.Optional[dt.datetime] = None + id: str + interval: str + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + period_end: int + period_start: int + status: str + subscription_external_id: str + total_price: int + trial_end: typing.Optional[int] = None + trial_end_setting: 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/company_detail_response_data.py b/src/schematic/types/company_detail_response_data.py index 988124f..48299dc 100644 --- a/src/schematic/types/company_detail_response_data.py +++ b/src/schematic/types/company_detail_response_data.py @@ -12,6 +12,7 @@ from .entity_trait_detail_response_data import EntityTraitDetailResponseData from .generic_preview_object import GenericPreviewObject from .payment_method_response_data import PaymentMethodResponseData +from .rule import Rule class CompanyDetailResponseData(UniversalBaseModel): @@ -32,6 +33,7 @@ class CompanyDetailResponseData(UniversalBaseModel): 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.Optional[typing.Any]]] = pydantic.Field(default=None) """ A map of trait names to trait values diff --git a/src/schematic/types/company_ledger_response_data.py b/src/schematic/types/company_ledger_response_data.py new file mode 100644 index 0000000..21271fa --- /dev/null +++ b/src/schematic/types/company_ledger_response_data.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 CompanyLedgerResponseData(UniversalBaseModel): + id: str + logo_url: 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/company_override_note_response_data.py b/src/schematic/types/company_override_note_response_data.py new file mode 100644 index 0000000..2e5b162 --- /dev/null +++ b/src/schematic/types/company_override_note_response_data.py @@ -0,0 +1,25 @@ +# 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 CompanyOverrideNoteResponseData(UniversalBaseModel): + created_at: dt.datetime + external_user_id: str + external_user_name: str + id: str + note: 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/company_override_response_data.py b/src/schematic/types/company_override_response_data.py index bae3677..cbf056c 100644 --- a/src/schematic/types/company_override_response_data.py +++ b/src/schematic/types/company_override_response_data.py @@ -6,6 +6,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .company_detail_response_data import CompanyDetailResponseData +from .company_override_note_response_data import CompanyOverrideNoteResponseData from .entity_trait_definition_response_data import EntityTraitDefinitionResponseData from .feature_response_data import FeatureResponseData @@ -22,6 +23,7 @@ class CompanyOverrideResponseData(UniversalBaseModel): id: str metric_period: typing.Optional[str] = None metric_period_month_reset: typing.Optional[str] = None + notes: typing.List[CompanyOverrideNoteResponseData] rule_id: typing.Optional[str] = None rule_id_usage_exceeded: typing.Optional[str] = None updated_at: dt.datetime diff --git a/src/schematic/types/company_plan_detail_response_data.py b/src/schematic/types/company_plan_detail_response_data.py index 43a3d65..e7a7b40 100644 --- a/src/schematic/types/company_plan_detail_response_data.py +++ b/src/schematic/types/company_plan_detail_response_data.py @@ -9,6 +9,7 @@ from .billing_product_detail_response_data import BillingProductDetailResponseData from .custom_plan_config import CustomPlanConfig from .feature_detail_response_data import FeatureDetailResponseData +from .feature_usage_response_data import FeatureUsageResponseData from .plan_credit_grant_view import PlanCreditGrantView from .plan_entitlement_response_data import PlanEntitlementResponseData @@ -41,6 +42,7 @@ class CompanyPlanDetailResponseData(UniversalBaseModel): plan_type: str trial_days: typing.Optional[int] = None updated_at: dt.datetime + usage_violations: typing.List[FeatureUsageResponseData] valid: bool yearly_price: typing.Optional[BillingPriceResponseData] = None 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 index a7bad6d..935cbd7 100644 --- a/src/schematic/types/company_view_with_feature_usage_response_data.py +++ b/src/schematic/types/company_view_with_feature_usage_response_data.py @@ -13,6 +13,7 @@ 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): @@ -34,6 +35,7 @@ class CompanyViewWithFeatureUsageResponseData(UniversalBaseModel): 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.Optional[typing.Any]]] = pydantic.Field(default=None) """ A map of trait names to trait values diff --git a/src/schematic/types/component_checkout_settings.py b/src/schematic/types/component_checkout_settings.py new file mode 100644 index 0000000..d63b4ba --- /dev/null +++ b/src/schematic/types/component_checkout_settings.py @@ -0,0 +1,22 @@ +# 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 ComponentCheckoutSettings(UniversalBaseModel): + collect_address: bool + collect_email: bool + collect_phone: bool + tax_collection_enabled: 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/component_hydrate_response_data.py b/src/schematic/types/component_hydrate_response_data.py index 5e24517..8b01344 100644 --- a/src/schematic/types/component_hydrate_response_data.py +++ b/src/schematic/types/component_hydrate_response_data.py @@ -10,6 +10,7 @@ from .company_subscription_response_data import CompanySubscriptionResponseData from .compatible_plans import CompatiblePlans from .component_capabilities import ComponentCapabilities +from .component_checkout_settings import ComponentCheckoutSettings from .component_response_data import ComponentResponseData from .credit_company_grant_view import CreditCompanyGrantView from .feature_usage_detail_response_data import FeatureUsageDetailResponseData @@ -25,13 +26,17 @@ class ComponentHydrateResponseData(UniversalBaseModel): active_usage_based_entitlements: typing.List[UsageBasedEntitlementResponseData] add_on_compatibilities: typing.List[CompatiblePlans] capabilities: typing.Optional[ComponentCapabilities] = None + checkout_settings: ComponentCheckoutSettings company: typing.Optional[CompanyDetailResponseData] = None component: typing.Optional[ComponentResponseData] = None credit_bundles: typing.List[BillingCreditBundleView] credit_grants: typing.List[CreditCompanyGrantView] default_plan: typing.Optional[PlanDetailResponseData] = None feature_usage: typing.Optional[FeatureUsageDetailResponseData] = None + post_trial_plan: typing.Optional[PlanDetailResponseData] = None + show_credits: bool show_period_toggle: bool + show_zero_price_as_free: bool stripe_embed: typing.Optional[StripeEmbedInfo] = None subscription: typing.Optional[CompanySubscriptionResponseData] = None trial_payment_method_required: typing.Optional[bool] = None diff --git a/src/schematic/types/component_preview_response_data.py b/src/schematic/types/component_preview_response_data.py index 68cbb58..7e7bbed 100644 --- a/src/schematic/types/component_preview_response_data.py +++ b/src/schematic/types/component_preview_response_data.py @@ -10,6 +10,7 @@ from .company_subscription_response_data import CompanySubscriptionResponseData from .compatible_plans import CompatiblePlans from .component_capabilities import ComponentCapabilities +from .component_checkout_settings import ComponentCheckoutSettings from .component_response_data import ComponentResponseData from .credit_company_grant_view import CreditCompanyGrantView from .feature_usage_detail_response_data import FeatureUsageDetailResponseData @@ -20,15 +21,12 @@ class ComponentPreviewResponseData(UniversalBaseModel): - """ - The returned resource - """ - active_add_ons: typing.List[CompanyPlanDetailResponseData] active_plans: typing.List[CompanyPlanDetailResponseData] active_usage_based_entitlements: typing.List[UsageBasedEntitlementResponseData] add_on_compatibilities: typing.List[CompatiblePlans] capabilities: typing.Optional[ComponentCapabilities] = None + checkout_settings: ComponentCheckoutSettings company: typing.Optional[CompanyDetailResponseData] = None component: typing.Optional[ComponentResponseData] = None credit_bundles: typing.List[BillingCreditBundleView] @@ -36,7 +34,10 @@ class ComponentPreviewResponseData(UniversalBaseModel): default_plan: typing.Optional[PlanDetailResponseData] = None feature_usage: typing.Optional[FeatureUsageDetailResponseData] = None invoices: typing.List[InvoiceResponseData] + post_trial_plan: typing.Optional[PlanDetailResponseData] = None + show_credits: bool show_period_toggle: bool + show_zero_price_as_free: bool stripe_embed: typing.Optional[StripeEmbedInfo] = None subscription: typing.Optional[CompanySubscriptionResponseData] = None trial_payment_method_required: typing.Optional[bool] = None diff --git a/src/schematic/types/component_response_data.py b/src/schematic/types/component_response_data.py index aa45b56..91dbcad 100644 --- a/src/schematic/types/component_response_data.py +++ b/src/schematic/types/component_response_data.py @@ -8,10 +8,6 @@ class ComponentResponseData(UniversalBaseModel): - """ - The updated resource - """ - ast: typing.Optional[typing.Dict[str, float]] = None created_at: dt.datetime id: str diff --git a/src/schematic/types/condition.py b/src/schematic/types/condition.py new file mode 100644 index 0000000..ebb2e84 --- /dev/null +++ b/src/schematic/types/condition.py @@ -0,0 +1,34 @@ +# 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 .trait_definition import TraitDefinition + + +class Condition(UniversalBaseModel): + account_id: str + comparison_trait_definition: typing.Optional[TraitDefinition] = None + condition_type: str + consumption_rate: typing.Optional[float] = None + credit_id: typing.Optional[str] = None + environment_id: str + event_subtype: 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 + resource_ids: typing.List[str] + trait_definition: typing.Optional[TraitDefinition] = None + trait_value: 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/condition_group.py b/src/schematic/types/condition_group.py new file mode 100644 index 0000000..05a87c3 --- /dev/null +++ b/src/schematic/types/condition_group.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 .condition import Condition + + +class ConditionGroup(UniversalBaseModel): + conditions: typing.List[Condition] + + 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/count_response.py b/src/schematic/types/count_response.py index ba51008..b06aaa1 100644 --- a/src/schematic/types/count_response.py +++ b/src/schematic/types/count_response.py @@ -7,12 +7,11 @@ class CountResponse(UniversalBaseModel): + count: typing.Optional[int] = pydantic.Field(default=None) """ - The created resource + The number of resources """ - count: int - 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/types/credit_company_grant_view.py b/src/schematic/types/credit_company_grant_view.py index 4899429..d4d971b 100644 --- a/src/schematic/types/credit_company_grant_view.py +++ b/src/schematic/types/credit_company_grant_view.py @@ -18,6 +18,9 @@ class CreditCompanyGrantView(UniversalBaseModel): credit_icon: typing.Optional[str] = None credit_name: str expires_at: typing.Optional[dt.datetime] = None + expiry_type: typing.Optional[str] = None + expiry_unit: typing.Optional[str] = None + expiry_unit_count: typing.Optional[int] = None grant_reason: str id: str plan_id: typing.Optional[str] = None diff --git a/src/schematic/types/credit_grant_detail.py b/src/schematic/types/credit_grant_detail.py new file mode 100644 index 0000000..385631b --- /dev/null +++ b/src/schematic/types/credit_grant_detail.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 .credit_grant_detail_grant_reason import CreditGrantDetailGrantReason + + +class CreditGrantDetail(UniversalBaseModel): + credit_type_icon: typing.Optional[str] = None + expires_at: typing.Optional[dt.datetime] = None + grant_reason: CreditGrantDetailGrantReason + quantity: float + + 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_grant_detail_grant_reason.py b/src/schematic/types/credit_grant_detail_grant_reason.py new file mode 100644 index 0000000..ec000f7 --- /dev/null +++ b/src/schematic/types/credit_grant_detail_grant_reason.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CreditGrantDetailGrantReason = typing.Union[typing.Literal["free", "plan", "purchased"], typing.Any] diff --git a/src/schematic/types/credit_ledger_enriched_entry_response_data.py b/src/schematic/types/credit_ledger_enriched_entry_response_data.py new file mode 100644 index 0000000..bb78461 --- /dev/null +++ b/src/schematic/types/credit_ledger_enriched_entry_response_data.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_ledger_response_data import BillingCreditLedgerResponseData +from .company_ledger_response_data import CompanyLedgerResponseData +from .feature_ledger_response_data import FeatureLedgerResponseData + + +class CreditLedgerEnrichedEntryResponseData(UniversalBaseModel): + billing_credit_id: str + company: typing.Optional[CompanyLedgerResponseData] = None + company_id: str + credit: typing.Optional[BillingCreditLedgerResponseData] = None + expired_grant_count: int + feature: typing.Optional[FeatureLedgerResponseData] = None + feature_id: typing.Optional[str] = None + first_transaction_at: dt.datetime + free_grant_count: int + grant_count: int + last_transaction_at: dt.datetime + manually_zeroed_count: int + net_change: float + plan_grant_count: int + purchased_grant_count: int + time_bucket: dt.datetime + total_consumed: float + total_granted: float + transaction_count: int + usage_count: int + zeroed_out_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/credit_usage.py b/src/schematic/types/credit_usage.py new file mode 100644 index 0000000..8bdaca3 --- /dev/null +++ b/src/schematic/types/credit_usage.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 .credit_grant_detail import CreditGrantDetail + + +class CreditUsage(UniversalBaseModel): + credit_consumption_rate: typing.Optional[float] = None + credit_grant_counts: typing.Optional[typing.Dict[str, float]] = None + credit_grant_details: typing.Optional[typing.List[CreditGrantDetail]] = None + credit_remaining: typing.Optional[float] = None + credit_total: typing.Optional[float] = None + 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/credit_usage_response_data.py b/src/schematic/types/credit_usage_response_data.py new file mode 100644 index 0000000..d859cf7 --- /dev/null +++ b/src/schematic/types/credit_usage_response_data.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 .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] = None + 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/crm_deal_response_data.py b/src/schematic/types/crm_deal_response_data.py index 92647ac..986427a 100644 --- a/src/schematic/types/crm_deal_response_data.py +++ b/src/schematic/types/crm_deal_response_data.py @@ -8,10 +8,6 @@ class CrmDealResponseData(UniversalBaseModel): - """ - The created resource - """ - account_id: str arr: str company_external_id: typing.Optional[str] = None diff --git a/src/schematic/types/crm_line_item_response_data.py b/src/schematic/types/crm_line_item_response_data.py index 3283eb0..86054fc 100644 --- a/src/schematic/types/crm_line_item_response_data.py +++ b/src/schematic/types/crm_line_item_response_data.py @@ -8,10 +8,6 @@ class CrmLineItemResponseData(UniversalBaseModel): - """ - The created resource - """ - account_id: str created_at: dt.datetime deal_id: typing.Optional[str] = None diff --git a/src/schematic/types/crm_product_response_data.py b/src/schematic/types/crm_product_response_data.py index 6daa882..910147c 100644 --- a/src/schematic/types/crm_product_response_data.py +++ b/src/schematic/types/crm_product_response_data.py @@ -8,10 +8,6 @@ class CrmProductResponseData(UniversalBaseModel): - """ - The created resource - """ - account_id: str created_at: dt.datetime currency: str diff --git a/src/schematic/types/data_export_response_data.py b/src/schematic/types/data_export_response_data.py index 087b069..947792a 100644 --- a/src/schematic/types/data_export_response_data.py +++ b/src/schematic/types/data_export_response_data.py @@ -8,10 +8,6 @@ class DataExportResponseData(UniversalBaseModel): - """ - The created resource - """ - account_id: str created_at: dt.datetime environment_id: str diff --git a/src/schematic/types/environment_detail_response_data.py b/src/schematic/types/environment_detail_response_data.py index 54e11bd..c5f19dc 100644 --- a/src/schematic/types/environment_detail_response_data.py +++ b/src/schematic/types/environment_detail_response_data.py @@ -9,10 +9,6 @@ class EnvironmentDetailResponseData(UniversalBaseModel): - """ - The created resource - """ - api_keys: typing.List[ApiKeyResponseData] created_at: dt.datetime environment_type: str diff --git a/src/schematic/types/environment_response_data.py b/src/schematic/types/environment_response_data.py index d68f37d..395a1d7 100644 --- a/src/schematic/types/environment_response_data.py +++ b/src/schematic/types/environment_response_data.py @@ -8,10 +8,6 @@ class EnvironmentResponseData(UniversalBaseModel): - """ - The updated resource - """ - created_at: dt.datetime environment_type: str id: str diff --git a/src/schematic/types/feature_company_response_data.py b/src/schematic/types/feature_company_response_data.py index 0d5cf4e..b0056bc 100644 --- a/src/schematic/types/feature_company_response_data.py +++ b/src/schematic/types/feature_company_response_data.py @@ -5,9 +5,15 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_price_view import BillingPriceView from .company_detail_response_data import CompanyDetailResponseData +from .company_override_response_data import CompanyOverrideResponseData +from .credit_grant_detail import CreditGrantDetail +from .credit_usage import CreditUsage from .feature_company_response_data_allocation_type import FeatureCompanyResponseDataAllocationType +from .feature_company_response_data_credit_grant_reason import FeatureCompanyResponseDataCreditGrantReason from .feature_detail_response_data import FeatureDetailResponseData +from .plan_entitlement_response_data import PlanEntitlementResponseData from .plan_response_data import PlanResponseData @@ -28,13 +34,60 @@ class FeatureCompanyResponseData(UniversalBaseModel): """ company: typing.Optional[CompanyDetailResponseData] = None + company_override: typing.Optional[CompanyOverrideResponseData] = None + credit_consumption_rate: typing.Optional[float] = pydantic.Field(default=None) + """ + The rate at which credits are consumed per unit of usage + """ + + credit_grant_counts: typing.Optional[typing.Dict[str, float]] = None + credit_grant_details: typing.Optional[typing.List[CreditGrantDetail]] = None + credit_grant_reason: typing.Optional[FeatureCompanyResponseDataCreditGrantReason] = pydantic.Field(default=None) + """ + Reason for the credit grant + """ + + credit_remaining: typing.Optional[float] = None + credit_total: typing.Optional[float] = None + credit_type_icon: typing.Optional[str] = pydantic.Field(default=None) + """ + Icon identifier for the credit type + """ + + credit_usage: typing.Optional[CreditUsage] = None + credit_used: typing.Optional[float] = None + effective_limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Effective limit for usage calculations. For overage pricing, this is the soft limit where overage charges begin. For tiered pricing, this is the first tier boundary. For other pricing models, this is the base allocation. Used to calculate usage percentages and determine access thresholds. + """ + + effective_price: typing.Optional[float] = pydantic.Field(default=None) + """ + Per-unit price for current usage scenario + """ + entitlement_expiration_date: typing.Optional[dt.datetime] = None entitlement_id: str + entitlement_source: typing.Optional[str] = pydantic.Field(default=None) + """ + Source of the entitlement (plan or company_override) + """ + entitlement_type: str feature: typing.Optional[FeatureDetailResponseData] = None + has_valid_allocation: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether a valid allocation exists + """ + + is_unlimited: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether this is an unlimited allocation + """ + metric_reset_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ - The time at which the metric will resets. + The time at which the metric will reset. """ month_reset: typing.Optional[str] = pydantic.Field(default=None) @@ -42,17 +95,37 @@ class FeatureCompanyResponseData(UniversalBaseModel): If the period is current_month, when the month resets. """ + monthly_usage_based_price: typing.Optional[BillingPriceView] = None + overuse: typing.Optional[int] = pydantic.Field(default=None) + """ + Amount of usage exceeding soft limit (overage pricing only) + """ + + percent_used: typing.Optional[float] = pydantic.Field(default=None) + """ + Percentage of allocation consumed (0-100+) + """ + period: typing.Optional[str] = pydantic.Field(default=None) """ The period over which usage is measured. """ plan: typing.Optional[PlanResponseData] = None + plan_entitlement: typing.Optional[PlanEntitlementResponseData] = None + price_behavior: typing.Optional[str] = None + soft_limit: typing.Optional[int] = pydantic.Field(default=None) + """ + The soft limit for the feature usage. Available only for overage price behavior + """ + usage: typing.Optional[int] = pydantic.Field(default=None) """ The amount of usage that has been consumed; a null value indicates that usage is not being measured. """ + 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: diff --git a/src/schematic/types/feature_company_response_data_credit_grant_reason.py b/src/schematic/types/feature_company_response_data_credit_grant_reason.py new file mode 100644 index 0000000..7ff7fe8 --- /dev/null +++ b/src/schematic/types/feature_company_response_data_credit_grant_reason.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +FeatureCompanyResponseDataCreditGrantReason = typing.Union[typing.Literal["free", "plan", "purchased"], typing.Any] diff --git a/src/schematic/types/feature_company_user_response_data_allocation_type.py b/src/schematic/types/feature_company_user_response_data_allocation_type.py index 1dd789d..649ed5f 100644 --- a/src/schematic/types/feature_company_user_response_data_allocation_type.py +++ b/src/schematic/types/feature_company_user_response_data_allocation_type.py @@ -3,5 +3,5 @@ import typing FeatureCompanyUserResponseDataAllocationType = typing.Union[ - typing.Literal["boolean", "numeric", "trait", "unlimited"], typing.Any + typing.Literal["boolean", "numeric", "trait", "unlimited", "unknown"], typing.Any ] diff --git a/src/schematic/types/feature_ledger_response_data.py b/src/schematic/types/feature_ledger_response_data.py new file mode 100644 index 0000000..81eb336 --- /dev/null +++ b/src/schematic/types/feature_ledger_response_data.py @@ -0,0 +1,22 @@ +# 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 FeatureLedgerResponseData(UniversalBaseModel): + description: typing.Optional[str] = None + icon: typing.Optional[str] = None + 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/feature_usage_data_response_data.py b/src/schematic/types/feature_usage_data_response_data.py index dfde309..befa8b3 100644 --- a/src/schematic/types/feature_usage_data_response_data.py +++ b/src/schematic/types/feature_usage_data_response_data.py @@ -1,12 +1,17 @@ # 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 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 @@ -14,8 +19,13 @@ class FeatureUsageDataResponseData(UniversalBaseModel): feature_type: str 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 diff --git a/src/schematic/types/feature_usage_response_data.py b/src/schematic/types/feature_usage_response_data.py index d63866e..5bd7f65 100644 --- a/src/schematic/types/feature_usage_response_data.py +++ b/src/schematic/types/feature_usage_response_data.py @@ -7,8 +7,10 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .billing_price_view import BillingPriceView from .company_override_response_data import CompanyOverrideResponseData +from .credit_grant_detail import CreditGrantDetail from .feature_detail_response_data import FeatureDetailResponseData from .feature_usage_response_data_allocation_type import FeatureUsageResponseDataAllocationType +from .feature_usage_response_data_credit_grant_reason import FeatureUsageResponseDataCreditGrantReason from .plan_entitlement_response_data import PlanEntitlementResponseData from .plan_response_data import PlanResponseData @@ -30,10 +32,55 @@ class FeatureUsageResponseData(UniversalBaseModel): """ company_override: typing.Optional[CompanyOverrideResponseData] = None + credit_consumption_rate: typing.Optional[float] = pydantic.Field(default=None) + """ + The rate at which credits are consumed per unit of usage + """ + + credit_grant_counts: typing.Optional[typing.Dict[str, float]] = None + credit_grant_details: typing.Optional[typing.List[CreditGrantDetail]] = None + credit_grant_reason: typing.Optional[FeatureUsageResponseDataCreditGrantReason] = pydantic.Field(default=None) + """ + Reason for the credit grant + """ + + credit_remaining: typing.Optional[float] = None + credit_total: typing.Optional[float] = None + credit_type_icon: typing.Optional[str] = pydantic.Field(default=None) + """ + Icon identifier for the credit type + """ + + credit_used: typing.Optional[float] = None + effective_limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Effective limit for usage calculations. For overage pricing, this is the soft limit where overage charges begin. For tiered pricing, this is the first tier boundary. For other pricing models, this is the base allocation. Used to calculate usage percentages and determine access thresholds. + """ + + effective_price: typing.Optional[float] = pydantic.Field(default=None) + """ + Per-unit price for current usage scenario + """ + entitlement_expiration_date: typing.Optional[dt.datetime] = None entitlement_id: str + entitlement_source: typing.Optional[str] = pydantic.Field(default=None) + """ + Source of the entitlement (plan or company_override) + """ + entitlement_type: str feature: typing.Optional[FeatureDetailResponseData] = None + has_valid_allocation: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether a valid allocation exists + """ + + is_unlimited: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether this is an unlimited allocation + """ + metric_reset_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ The time at which the metric will reset. @@ -45,6 +92,16 @@ class FeatureUsageResponseData(UniversalBaseModel): """ monthly_usage_based_price: typing.Optional[BillingPriceView] = None + overuse: typing.Optional[int] = pydantic.Field(default=None) + """ + Amount of usage exceeding soft limit (overage pricing only) + """ + + percent_used: typing.Optional[float] = pydantic.Field(default=None) + """ + Percentage of allocation consumed (0-100+) + """ + period: typing.Optional[str] = pydantic.Field(default=None) """ The period over which usage is measured. diff --git a/src/schematic/types/feature_usage_response_data_credit_grant_reason.py b/src/schematic/types/feature_usage_response_data_credit_grant_reason.py new file mode 100644 index 0000000..9abbc79 --- /dev/null +++ b/src/schematic/types/feature_usage_response_data_credit_grant_reason.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +FeatureUsageResponseDataCreditGrantReason = typing.Union[typing.Literal["free", "plan", "purchased"], typing.Any] diff --git a/src/schematic/types/issue_temporary_access_token_response_data.py b/src/schematic/types/issue_temporary_access_token_response_data.py index f508257..4b11605 100644 --- a/src/schematic/types/issue_temporary_access_token_response_data.py +++ b/src/schematic/types/issue_temporary_access_token_response_data.py @@ -8,10 +8,6 @@ class IssueTemporaryAccessTokenResponseData(UniversalBaseModel): - """ - The created resource - """ - api_key_id: str created_at: dt.datetime environment_id: str diff --git a/src/schematic/types/manage_plan_preview_response_response_data.py b/src/schematic/types/manage_plan_preview_response_response_data.py new file mode 100644 index 0000000..e124d3b --- /dev/null +++ b/src/schematic/types/manage_plan_preview_response_response_data.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 .preview_subscription_change_response_data import PreviewSubscriptionChangeResponseData + + +class ManagePlanPreviewResponseResponseData(UniversalBaseModel): + subscription_change_preview: typing.Optional[PreviewSubscriptionChangeResponseData] = 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/manage_plan_request.py b/src/schematic/types/manage_plan_request.py new file mode 100644 index 0000000..109da6f --- /dev/null +++ b/src/schematic/types/manage_plan_request.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 .plan_selection import PlanSelection +from .update_credit_bundle_request_body import UpdateCreditBundleRequestBody +from .update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody + + +class ManagePlanRequest(UniversalBaseModel): + add_on_selections: typing.List[PlanSelection] + base_plan_id: typing.Optional[str] = None + base_plan_price_id: typing.Optional[str] = None + company_id: str + coupon_external_id: typing.Optional[str] = None + credit_bundles: typing.List[UpdateCreditBundleRequestBody] + pay_in_advance_entitlements: typing.List[UpdatePayInAdvanceRequestBody] + payment_method_external_id: typing.Optional[str] = None + promo_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/manage_plan_response_response_data.py b/src/schematic/types/manage_plan_response_response_data.py new file mode 100644 index 0000000..eeedbbe --- /dev/null +++ b/src/schematic/types/manage_plan_response_response_data.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 +from .company_detail_response_data import CompanyDetailResponseData + + +class ManagePlanResponseResponseData(UniversalBaseModel): + company: typing.Optional[CompanyDetailResponseData] = None + success: 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/plan_audience_detail_response_data.py b/src/schematic/types/plan_audience_detail_response_data.py index 84d6714..5e14370 100644 --- a/src/schematic/types/plan_audience_detail_response_data.py +++ b/src/schematic/types/plan_audience_detail_response_data.py @@ -10,10 +10,6 @@ class PlanAudienceDetailResponseData(UniversalBaseModel): - """ - The updated resource - """ - condition_groups: typing.List[RuleConditionGroupDetailResponseData] conditions: typing.List[RuleConditionDetailResponseData] created_at: dt.datetime diff --git a/src/schematic/types/plan_credit_grant_view.py b/src/schematic/types/plan_credit_grant_view.py index f36f24b..83b6014 100644 --- a/src/schematic/types/plan_credit_grant_view.py +++ b/src/schematic/types/plan_credit_grant_view.py @@ -14,12 +14,16 @@ class PlanCreditGrantView(UniversalBaseModel): credit_icon: typing.Optional[str] = None credit_id: str credit_name: str + expiry_type: typing.Optional[str] = None + expiry_unit: typing.Optional[str] = None + expiry_unit_count: typing.Optional[int] = None id: str plan_id: str plan_name: str plural_name: typing.Optional[str] = None reset_cadence: str reset_start: str + reset_type: str singular_name: typing.Optional[str] = None updated_at: dt.datetime diff --git a/src/schematic/types/plan_detail_response_data.py b/src/schematic/types/plan_detail_response_data.py index 19f4786..f34d1c7 100644 --- a/src/schematic/types/plan_detail_response_data.py +++ b/src/schematic/types/plan_detail_response_data.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_plan_credit_grant_response_data import BillingPlanCreditGrantResponseData from .billing_price_response_data import BillingPriceResponseData from .billing_product_detail_response_data import BillingProductDetailResponseData from .feature_detail_response_data import FeatureDetailResponseData @@ -21,6 +22,7 @@ class PlanDetailResponseData(UniversalBaseModel): features: typing.List[FeatureDetailResponseData] icon: str id: str + included_credit_grants: typing.Optional[typing.List[BillingPlanCreditGrantResponseData]] = None is_default: bool is_free: bool is_trialable: bool diff --git a/src/schematic/types/plan_entitlement_response_data.py b/src/schematic/types/plan_entitlement_response_data.py index 2fe0ca0..676e01a 100644 --- a/src/schematic/types/plan_entitlement_response_data.py +++ b/src/schematic/types/plan_entitlement_response_data.py @@ -14,6 +14,7 @@ class PlanEntitlementResponseData(UniversalBaseModel): + billing_threshold: typing.Optional[int] = None consumption_rate: typing.Optional[float] = None created_at: dt.datetime environment_id: str diff --git a/src/schematic/types/plan_group_detail_response_data.py b/src/schematic/types/plan_group_detail_response_data.py index 276d1b6..b26f228 100644 --- a/src/schematic/types/plan_group_detail_response_data.py +++ b/src/schematic/types/plan_group_detail_response_data.py @@ -4,6 +4,8 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_price_response_data import BillingPriceResponseData +from .checkout_settings_response_data import CheckoutSettingsResponseData from .custom_plan_view_config_response_data import CustomPlanViewConfigResponseData from .plan_group_bundle_order import PlanGroupBundleOrder from .plan_group_plan_detail_response_data import PlanGroupPlanDetailResponseData @@ -11,22 +13,34 @@ class PlanGroupDetailResponseData(UniversalBaseModel): - """ - The returned resource - """ - add_ons: typing.List[PlanGroupPlanDetailResponseData] + checkout_settings: CheckoutSettingsResponseData custom_plan_config: typing.Optional[CustomPlanViewConfigResponseData] = None custom_plan_id: typing.Optional[str] = None default_plan: typing.Optional[PlanGroupPlanDetailResponseData] = None default_plan_id: typing.Optional[str] = None + fallback_plan: typing.Optional[PlanGroupPlanDetailResponseData] = None + fallback_plan_id: typing.Optional[str] = None id: str + initial_plan: typing.Optional[PlanGroupPlanDetailResponseData] = None + initial_plan_id: typing.Optional[str] = None + initial_plan_price: typing.Optional[BillingPriceResponseData] = None + initial_plan_price_id: typing.Optional[str] = None ordered_add_on_list: typing.List[PlanGroupPlanEntitlementsOrder] ordered_bundle_list: typing.List[PlanGroupBundleOrder] ordered_plan_list: typing.List[PlanGroupPlanEntitlementsOrder] plans: typing.List[PlanGroupPlanDetailResponseData] + prevent_downgrades_when_over_limit: bool + show_credits: bool show_period_toggle: bool + show_zero_price_as_free: bool + sync_customer_billing_details_for_tax: bool + tax_collection_enabled: bool trial_days: typing.Optional[int] = None + trial_expiry_plan: typing.Optional[PlanGroupPlanDetailResponseData] = None + trial_expiry_plan_id: typing.Optional[str] = None + trial_expiry_plan_price: typing.Optional[BillingPriceResponseData] = None + trial_expiry_plan_price_id: typing.Optional[str] = None trial_payment_method_required: typing.Optional[bool] = None if IS_PYDANTIC_V2: 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 bf869a8..14c3999 100644 --- a/src/schematic/types/plan_group_plan_detail_response_data.py +++ b/src/schematic/types/plan_group_plan_detail_response_data.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_plan_credit_grant_response_data import BillingPlanCreditGrantResponseData from .billing_price_response_data import BillingPriceResponseData from .billing_product_detail_response_data import BillingProductDetailResponseData from .custom_plan_view_config_response_data import CustomPlanViewConfigResponseData @@ -26,6 +27,7 @@ class PlanGroupPlanDetailResponseData(UniversalBaseModel): features: typing.List[FeatureDetailResponseData] icon: str id: str + included_credit_grants: typing.Optional[typing.List[BillingPlanCreditGrantResponseData]] = None is_custom: bool is_default: bool is_free: bool diff --git a/src/schematic/types/plan_group_response_data.py b/src/schematic/types/plan_group_response_data.py index 58f2166..673e726 100644 --- a/src/schematic/types/plan_group_response_data.py +++ b/src/schematic/types/plan_group_response_data.py @@ -4,23 +4,31 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .checkout_settings_response_data import CheckoutSettingsResponseData from .compatible_plans_response_data import CompatiblePlansResponseData from .ordered_plans_in_group import OrderedPlansInGroup class PlanGroupResponseData(UniversalBaseModel): - """ - The updated resource - """ - add_on_compatibilities: typing.List[CompatiblePlansResponseData] add_on_ids: typing.List[str] + checkout_settings: CheckoutSettingsResponseData default_plan_id: typing.Optional[str] = None + fallback_plan_id: typing.Optional[str] = None id: str + initial_plan_id: typing.Optional[str] = None + initial_plan_price_id: typing.Optional[str] = None ordered_add_on_ids: typing.List[OrderedPlansInGroup] plan_ids: typing.List[OrderedPlansInGroup] + prevent_downgrades_when_over_limit: bool + show_credits: bool show_period_toggle: bool + show_zero_price_as_free: bool + sync_customer_billing_details_for_tax: bool + tax_collection_enabled: bool trial_days: typing.Optional[int] = None + trial_expiry_plan_id: typing.Optional[str] = None + trial_expiry_plan_price_id: typing.Optional[str] = None trial_payment_method_required: typing.Optional[bool] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/plan_issue_response_data.py b/src/schematic/types/plan_issue_response_data.py new file mode 100644 index 0000000..3adfc76 --- /dev/null +++ b/src/schematic/types/plan_issue_response_data.py @@ -0,0 +1,22 @@ +# 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 PlanIssueResponseData(UniversalBaseModel): + code: str + description: str + detail: typing.Optional[str] = None + 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/plan_selection.py b/src/schematic/types/plan_selection.py new file mode 100644 index 0000000..e7c13e6 --- /dev/null +++ b/src/schematic/types/plan_selection.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 PlanSelection(UniversalBaseModel): + plan_id: str + 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/plan_trait_response_data.py b/src/schematic/types/plan_trait_response_data.py index df4bf58..034c29e 100644 --- a/src/schematic/types/plan_trait_response_data.py +++ b/src/schematic/types/plan_trait_response_data.py @@ -8,10 +8,6 @@ class PlanTraitResponseData(UniversalBaseModel): - """ - The updated resource - """ - account_id: str created_at: dt.datetime environment_id: str diff --git a/src/schematic/types/preview_subscription_change_response_data.py b/src/schematic/types/preview_subscription_change_response_data.py index f8801f4..5edee5f 100644 --- a/src/schematic/types/preview_subscription_change_response_data.py +++ b/src/schematic/types/preview_subscription_change_response_data.py @@ -10,10 +10,6 @@ class PreviewSubscriptionChangeResponseData(UniversalBaseModel): - """ - The requested resource - """ - amount_off: int due_now: int finance: typing.Optional[PreviewSubscriptionFinanceResponseData] = None diff --git a/src/schematic/types/preview_subscription_finance_response_data.py b/src/schematic/types/preview_subscription_finance_response_data.py index 53608ad..16d3960 100644 --- a/src/schematic/types/preview_subscription_finance_response_data.py +++ b/src/schematic/types/preview_subscription_finance_response_data.py @@ -16,6 +16,9 @@ class PreviewSubscriptionFinanceResponseData(UniversalBaseModel): period_start: dt.datetime promo_code_applied: bool proration: int + tax_amount: typing.Optional[int] = None + tax_display_name: typing.Optional[str] = None + tax_require_billing_details: bool trial_end: typing.Optional[dt.datetime] = None upcoming_invoice_line_items: typing.List[PreviewSubscriptionUpcomingInvoiceLineItems] diff --git a/src/schematic/types/raw_event_batch_response_data.py b/src/schematic/types/raw_event_batch_response_data.py index af0a8e0..a3fd42d 100644 --- a/src/schematic/types/raw_event_batch_response_data.py +++ b/src/schematic/types/raw_event_batch_response_data.py @@ -8,10 +8,6 @@ class RawEventBatchResponseData(UniversalBaseModel): - """ - The created resource - """ - events: typing.List[RawEventResponseData] if IS_PYDANTIC_V2: diff --git a/src/schematic/types/rule.py b/src/schematic/types/rule.py new file mode 100644 index 0000000..1a245cc --- /dev/null +++ b/src/schematic/types/rule.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 .condition import Condition +from .condition_group import ConditionGroup + + +class Rule(UniversalBaseModel): + account_id: str + condition_groups: typing.List[ConditionGroup] + conditions: typing.List[Condition] + environment_id: str + flag_id: typing.Optional[str] = None + id: str + name: str + priority: int + rule_type: str + 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_detail_response_data.py b/src/schematic/types/rules_detail_response_data.py index 6be620d..0fa1f94 100644 --- a/src/schematic/types/rules_detail_response_data.py +++ b/src/schematic/types/rules_detail_response_data.py @@ -9,10 +9,6 @@ class RulesDetailResponseData(UniversalBaseModel): - """ - The updated resource - """ - flag: typing.Optional[FlagResponseData] = None rules: typing.List[RuleDetailResponseData] diff --git a/src/schematic/types/segment_status_resp.py b/src/schematic/types/segment_status_resp.py index 26240dc..d13662c 100644 --- a/src/schematic/types/segment_status_resp.py +++ b/src/schematic/types/segment_status_resp.py @@ -8,10 +8,6 @@ class SegmentStatusResp(UniversalBaseModel): - """ - The returned resource - """ - connected: bool environment_id: str last_event_at: typing.Optional[dt.datetime] = None diff --git a/src/schematic/types/trait_definition.py b/src/schematic/types/trait_definition.py new file mode 100644 index 0000000..3eb3f11 --- /dev/null +++ b/src/schematic/types/trait_definition.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 TraitDefinition(UniversalBaseModel): + comparable_type: str + entity_type: str + id: 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/update_plan_trait_trait_request_body.py b/src/schematic/types/update_plan_trait_trait_request_body.py new file mode 100644 index 0000000..e780158 --- /dev/null +++ b/src/schematic/types/update_plan_trait_trait_request_body.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 UpdatePlanTraitTraitRequestBody(UniversalBaseModel): + trait_id: str + trait_value: 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/usage_based_entitlement_request_body.py b/src/schematic/types/usage_based_entitlement_request_body.py index 46805e7..d932b05 100644 --- a/src/schematic/types/usage_based_entitlement_request_body.py +++ b/src/schematic/types/usage_based_entitlement_request_body.py @@ -10,6 +10,7 @@ class UsageBasedEntitlementRequestBody(UniversalBaseModel): billing_product_id: typing.Optional[str] = None + billing_threshold: typing.Optional[int] = None currency: typing.Optional[str] = None monthly_metered_price_id: typing.Optional[str] = None monthly_price_tiers: typing.Optional[typing.List[CreatePriceTierRequestBody]] = None diff --git a/src/schematic/types/usage_based_entitlement_response_data.py b/src/schematic/types/usage_based_entitlement_response_data.py index a53e2e7..d055418 100644 --- a/src/schematic/types/usage_based_entitlement_response_data.py +++ b/src/schematic/types/usage_based_entitlement_response_data.py @@ -8,6 +8,7 @@ class UsageBasedEntitlementResponseData(UniversalBaseModel): + billing_threshold: typing.Optional[int] = None consumption_rate: typing.Optional[float] = None feature_id: str metered_price: typing.Optional[BillingPriceView] = None diff --git a/src/schematic/webhooks/client.py b/src/schematic/webhooks/client.py index e2326cf..427fd77 100644 --- a/src/schematic/webhooks/client.py +++ b/src/schematic/webhooks/client.py @@ -79,7 +79,12 @@ def list_webhook_events( client = Schematic( api_key="YOUR_API_KEY", ) - client.webhooks.list_webhook_events() + client.webhooks.list_webhook_events( + q="q", + webhook_id="webhook_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_webhook_events( ids=ids, q=q, webhook_id=webhook_id, limit=limit, offset=offset, request_options=request_options @@ -157,7 +162,12 @@ def count_webhook_events( client = Schematic( api_key="YOUR_API_KEY", ) - client.webhooks.count_webhook_events() + client.webhooks.count_webhook_events( + q="q", + webhook_id="webhook_id", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_webhook_events( ids=ids, q=q, webhook_id=webhook_id, limit=limit, offset=offset, request_options=request_options @@ -198,7 +208,11 @@ def list_webhooks( client = Schematic( api_key="YOUR_API_KEY", ) - client.webhooks.list_webhooks() + client.webhooks.list_webhooks( + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.list_webhooks(q=q, limit=limit, offset=offset, request_options=request_options) return _response.data @@ -414,7 +428,11 @@ def count_webhooks( client = Schematic( api_key="YOUR_API_KEY", ) - client.webhooks.count_webhooks() + client.webhooks.count_webhooks( + q="q", + limit=1, + offset=1, + ) """ _response = self._raw_client.count_webhooks(q=q, limit=limit, offset=offset, request_options=request_options) return _response.data @@ -480,7 +498,12 @@ async def list_webhook_events( async def main() -> None: - await client.webhooks.list_webhook_events() + await client.webhooks.list_webhook_events( + q="q", + webhook_id="webhook_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -574,7 +597,12 @@ async def count_webhook_events( async def main() -> None: - await client.webhooks.count_webhook_events() + await client.webhooks.count_webhook_events( + q="q", + webhook_id="webhook_id", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -623,7 +651,11 @@ async def list_webhooks( async def main() -> None: - await client.webhooks.list_webhooks() + await client.webhooks.list_webhooks( + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) @@ -881,7 +913,11 @@ async def count_webhooks( async def main() -> None: - await client.webhooks.count_webhooks() + await client.webhooks.count_webhooks( + q="q", + limit=1, + offset=1, + ) asyncio.run(main()) diff --git a/src/schematic/webhooks/types/create_webhook_request_body_request_types_item.py b/src/schematic/webhooks/types/create_webhook_request_body_request_types_item.py index cd75015..9302fb7 100644 --- a/src/schematic/webhooks/types/create_webhook_request_body_request_types_item.py +++ b/src/schematic/webhooks/types/create_webhook_request_body_request_types_item.py @@ -32,6 +32,8 @@ "entitlement.limit.reached", "entitlement.soft_limit.warning", "entitlement.soft_limit.reached", + "entitlement.tier_limit.warning", + "entitlement.tier_limit.reached", "credit.limit.warning", "credit.limit.reached", ], diff --git a/src/schematic/webhooks/types/list_webhook_events_response.py b/src/schematic/webhooks/types/list_webhook_events_response.py index c14a0d2..c3f6101 100644 --- a/src/schematic/webhooks/types/list_webhook_events_response.py +++ b/src/schematic/webhooks/types/list_webhook_events_response.py @@ -9,11 +9,7 @@ class ListWebhookEventsResponse(UniversalBaseModel): - data: typing.List[WebhookEventDetailResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[WebhookEventDetailResponseData] params: ListWebhookEventsParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/webhooks/types/list_webhooks_response.py b/src/schematic/webhooks/types/list_webhooks_response.py index b89281f..fe9049b 100644 --- a/src/schematic/webhooks/types/list_webhooks_response.py +++ b/src/schematic/webhooks/types/list_webhooks_response.py @@ -9,11 +9,7 @@ class ListWebhooksResponse(UniversalBaseModel): - data: typing.List[WebhookResponseData] = pydantic.Field() - """ - The returned resources - """ - + data: typing.List[WebhookResponseData] params: ListWebhooksParams = pydantic.Field() """ Input parameters diff --git a/src/schematic/webhooks/types/update_webhook_request_body_request_types_item.py b/src/schematic/webhooks/types/update_webhook_request_body_request_types_item.py index 341db10..3983ac0 100644 --- a/src/schematic/webhooks/types/update_webhook_request_body_request_types_item.py +++ b/src/schematic/webhooks/types/update_webhook_request_body_request_types_item.py @@ -32,6 +32,8 @@ "entitlement.limit.reached", "entitlement.soft_limit.warning", "entitlement.soft_limit.reached", + "entitlement.tier_limit.warning", + "entitlement.tier_limit.reached", "credit.limit.warning", "credit.limit.reached", ],