From cccd6692204f84e3c060e07ba6e1a27f20a577a2 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 21:40:05 +0000 Subject: [PATCH] SDK regeneration --- poetry.lock | 275 ++- pyproject.toml | 5 +- reference.md | 2024 ++++++++++------- src/schematic/__init__.py | 44 +- src/schematic/base_client.py | 89 +- src/schematic/billing/__init__.py | 2 + src/schematic/billing/client.py | 344 ++- src/schematic/billing/types/__init__.py | 2 + .../types/upsert_billing_coupon_response.py | 24 + src/schematic/checkout/__init__.py | 15 + src/schematic/checkout/client.py | 1019 +++++++++ src/schematic/checkout/types/__init__.py | 13 + .../types/checkout_internal_response.py | 24 + .../types/get_checkout_data_response.py} | 6 +- .../preview_checkout_internal_response.py | 24 + ...ustomer_subscription_trial_end_response.py | 24 + src/schematic/companies/client.py | 40 +- .../companies/types/count_companies_params.py | 4 +- .../companies/types/count_users_params.py | 6 +- .../companies/types/list_companies_params.py | 4 +- .../companies/types/list_users_params.py | 6 +- src/schematic/core/client_wrapper.py | 2 +- src/schematic/entitlements/client.py | 188 +- .../types/count_company_overrides_params.py | 15 +- .../types/count_plan_entitlements_params.py | 10 +- ...any_override_request_body_metric_period.py | 2 +- ..._entitlement_request_body_metric_period.py | 2 +- .../types/list_company_overrides_params.py | 15 +- .../types/list_plan_entitlements_params.py | 10 +- ...any_override_request_body_metric_period.py | 2 +- ..._entitlement_request_body_metric_period.py | 2 +- src/schematic/events/__init__.py | 2 - src/schematic/events/client.py | 187 +- src/schematic/events/types/__init__.py | 2 - src/schematic/plans/__init__.py | 2 + src/schematic/plans/client.py | 265 ++- src/schematic/plans/types/__init__.py | 2 + .../plans/types/count_plans_params.py | 5 + .../plans/types/list_plans_params.py | 5 + .../types/update_company_plans_response.py | 24 + src/schematic/types/__init__.py | 26 +- .../types/billing_coupon_response_data.py | 39 + src/schematic/types/billing_price_view.py | 1 + ..._product_for_subscription_response_data.py | 1 + .../billing_product_price_response_data.py | 1 + .../types/billing_subscription_discount.py | 26 + .../billing_subscription_discount_view.py | 33 + .../billing_subscription_response_data.py | 1 + .../types/billing_subscription_view.py | 7 + ...ange_subscription_internal_request_body.py | 27 + .../types/change_subscription_request_body.py | 26 + .../types/check_flag_response_data.py | 74 +- .../types/check_flags_response_data.py | 4 +- .../types/checkout_data_response_data.py | 33 + .../types/company_detail_response_data.py | 2 + ...pany_event_period_metrics_response_data.py | 30 + .../types/company_override_response_data.py | 1 + .../company_subscription_response_data.py | 3 + .../types/component_hydrate_response_data.py | 3 + .../types/component_preview_response_data.py | 3 + ...ith_flag_key.py => coupon_request_body.py} | 18 +- .../types/create_entitlement_req_common.py | 2 - ...te_entitlement_req_common_metric_period.py | 2 +- ...te_condition_request_body_metric_period.py | 2 +- src/schematic/types/event_body_flag_check.py | 8 +- src/schematic/types/event_body_track.py | 5 + .../types/event_detail_response_data.py | 1 + src/schematic/types/event_response_data.py | 1 + .../types/feature_company_response_data.py | 3 +- .../types/feature_usage_response_data.py | 10 +- .../types/plan_entitlement_response_data.py | 1 + ...eview_subscription_change_response_data.py | 31 + .../types/update_add_on_request_body.py | 20 + .../types/update_entitlement_req_common.py | 2 - ...te_entitlement_req_common_metric_period.py | 2 +- .../update_pay_in_advance_request_body.py | 20 + .../usage_based_entitlement_request_body.py | 21 + .../usage_based_entitlement_response_data.py | 2 + ...webhook_request_body_request_types_item.py | 1 + ...webhook_request_body_request_types_item.py | 1 + 80 files changed, 3864 insertions(+), 1366 deletions(-) create mode 100644 src/schematic/billing/types/upsert_billing_coupon_response.py create mode 100644 src/schematic/checkout/__init__.py create mode 100644 src/schematic/checkout/client.py create mode 100644 src/schematic/checkout/types/__init__.py create mode 100644 src/schematic/checkout/types/checkout_internal_response.py rename src/schematic/{events/types/get_event_summary_by_subtype_response.py => checkout/types/get_checkout_data_response.py} (79%) create mode 100644 src/schematic/checkout/types/preview_checkout_internal_response.py create mode 100644 src/schematic/checkout/types/update_customer_subscription_trial_end_response.py create mode 100644 src/schematic/plans/types/update_company_plans_response.py create mode 100644 src/schematic/types/billing_coupon_response_data.py create mode 100644 src/schematic/types/billing_subscription_discount.py create mode 100644 src/schematic/types/billing_subscription_discount_view.py create mode 100644 src/schematic/types/change_subscription_internal_request_body.py create mode 100644 src/schematic/types/change_subscription_request_body.py create mode 100644 src/schematic/types/checkout_data_response_data.py create mode 100644 src/schematic/types/company_event_period_metrics_response_data.py rename src/schematic/types/{check_flag_output_with_flag_key.py => coupon_request_body.py} (62%) create mode 100644 src/schematic/types/preview_subscription_change_response_data.py create mode 100644 src/schematic/types/update_add_on_request_body.py create mode 100644 src/schematic/types/update_pay_in_advance_request_body.py create mode 100644 src/schematic/types/usage_based_entitlement_request_body.py diff --git a/poetry.lock b/poetry.lock index e7d6e6a..12b0f2c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. [[package]] name = "annotated-types" @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2024.8.30" +version = "2025.1.31" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, - {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, + {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, + {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, ] [[package]] @@ -106,13 +106,13 @@ trio = ["trio (>=0.22.0,<1.0)"] [[package]] name = "httpx" -version = "0.27.2" +version = "0.28.1" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" files = [ - {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, - {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, + {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, + {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, ] [package.dependencies] @@ -120,7 +120,6 @@ anyio = "*" certifi = "*" httpcore = "==1.*" idna = "*" -sniffio = "*" [package.extras] brotli = ["brotli", "brotlicffi"] @@ -239,18 +238,18 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pydantic" -version = "2.10.2" +version = "2.10.6" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.10.2-py3-none-any.whl", hash = "sha256:cfb96e45951117c3024e6b67b25cdc33a3cb7b2fa62e239f7af1378358a1d99e"}, - {file = "pydantic-2.10.2.tar.gz", hash = "sha256:2bc2d7f17232e0841cbba4641e65ba1eb6fafb3a08de3a091ff3ce14a197c4fa"}, + {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, + {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, ] [package.dependencies] annotated-types = ">=0.6.0" -pydantic-core = "2.27.1" +pydantic-core = "2.27.2" typing-extensions = ">=4.12.2" [package.extras] @@ -259,111 +258,111 @@ timezone = ["tzdata"] [[package]] name = "pydantic-core" -version = "2.27.1" +version = "2.27.2" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.27.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:71a5e35c75c021aaf400ac048dacc855f000bdfed91614b4a726f7432f1f3d6a"}, - {file = "pydantic_core-2.27.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f82d068a2d6ecfc6e054726080af69a6764a10015467d7d7b9f66d6ed5afa23b"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:121ceb0e822f79163dd4699e4c54f5ad38b157084d97b34de8b232bcaad70278"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4603137322c18eaf2e06a4495f426aa8d8388940f3c457e7548145011bb68e05"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a33cd6ad9017bbeaa9ed78a2e0752c5e250eafb9534f308e7a5f7849b0b1bfb4"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15cc53a3179ba0fcefe1e3ae50beb2784dede4003ad2dfd24f81bba4b23a454f"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45d9c5eb9273aa50999ad6adc6be5e0ecea7e09dbd0d31bd0c65a55a2592ca08"}, - {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8bf7b66ce12a2ac52d16f776b31d16d91033150266eb796967a7e4621707e4f6"}, - {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:655d7dd86f26cb15ce8a431036f66ce0318648f8853d709b4167786ec2fa4807"}, - {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:5556470f1a2157031e676f776c2bc20acd34c1990ca5f7e56f1ebf938b9ab57c"}, - {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f69ed81ab24d5a3bd93861c8c4436f54afdf8e8cc421562b0c7504cf3be58206"}, - {file = "pydantic_core-2.27.1-cp310-none-win32.whl", hash = "sha256:f5a823165e6d04ccea61a9f0576f345f8ce40ed533013580e087bd4d7442b52c"}, - {file = "pydantic_core-2.27.1-cp310-none-win_amd64.whl", hash = "sha256:57866a76e0b3823e0b56692d1a0bf722bffb324839bb5b7226a7dbd6c9a40b17"}, - {file = "pydantic_core-2.27.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:ac3b20653bdbe160febbea8aa6c079d3df19310d50ac314911ed8cc4eb7f8cb8"}, - {file = "pydantic_core-2.27.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a5a8e19d7c707c4cadb8c18f5f60c843052ae83c20fa7d44f41594c644a1d330"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f7059ca8d64fea7f238994c97d91f75965216bcbe5f695bb44f354893f11d52"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bed0f8a0eeea9fb72937ba118f9db0cb7e90773462af7962d382445f3005e5a4"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3cb37038123447cf0f3ea4c74751f6a9d7afef0eb71aa07bf5f652b5e6a132c"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:84286494f6c5d05243456e04223d5a9417d7f443c3b76065e75001beb26f88de"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acc07b2cfc5b835444b44a9956846b578d27beeacd4b52e45489e93276241025"}, - {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4fefee876e07a6e9aad7a8c8c9f85b0cdbe7df52b8a9552307b09050f7512c7e"}, - {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:258c57abf1188926c774a4c94dd29237e77eda19462e5bb901d88adcab6af919"}, - {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:35c14ac45fcfdf7167ca76cc80b2001205a8d5d16d80524e13508371fb8cdd9c"}, - {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d1b26e1dff225c31897696cab7d4f0a315d4c0d9e8666dbffdb28216f3b17fdc"}, - {file = "pydantic_core-2.27.1-cp311-none-win32.whl", hash = "sha256:2cdf7d86886bc6982354862204ae3b2f7f96f21a3eb0ba5ca0ac42c7b38598b9"}, - {file = "pydantic_core-2.27.1-cp311-none-win_amd64.whl", hash = "sha256:3af385b0cee8df3746c3f406f38bcbfdc9041b5c2d5ce3e5fc6637256e60bbc5"}, - {file = "pydantic_core-2.27.1-cp311-none-win_arm64.whl", hash = "sha256:81f2ec23ddc1b476ff96563f2e8d723830b06dceae348ce02914a37cb4e74b89"}, - {file = "pydantic_core-2.27.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9cbd94fc661d2bab2bc702cddd2d3370bbdcc4cd0f8f57488a81bcce90c7a54f"}, - {file = "pydantic_core-2.27.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5f8c4718cd44ec1580e180cb739713ecda2bdee1341084c1467802a417fe0f02"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:15aae984e46de8d376df515f00450d1522077254ef6b7ce189b38ecee7c9677c"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1ba5e3963344ff25fc8c40da90f44b0afca8cfd89d12964feb79ac1411a260ac"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:992cea5f4f3b29d6b4f7f1726ed8ee46c8331c6b4eed6db5b40134c6fe1768bb"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0325336f348dbee6550d129b1627cb8f5351a9dc91aad141ffb96d4937bd9529"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7597c07fbd11515f654d6ece3d0e4e5093edc30a436c63142d9a4b8e22f19c35"}, - {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3bbd5d8cc692616d5ef6fbbbd50dbec142c7e6ad9beb66b78a96e9c16729b089"}, - {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:dc61505e73298a84a2f317255fcc72b710b72980f3a1f670447a21efc88f8381"}, - {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:e1f735dc43da318cad19b4173dd1ffce1d84aafd6c9b782b3abc04a0d5a6f5bb"}, - {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f4e5658dbffe8843a0f12366a4c2d1c316dbe09bb4dfbdc9d2d9cd6031de8aae"}, - {file = "pydantic_core-2.27.1-cp312-none-win32.whl", hash = "sha256:672ebbe820bb37988c4d136eca2652ee114992d5d41c7e4858cdd90ea94ffe5c"}, - {file = "pydantic_core-2.27.1-cp312-none-win_amd64.whl", hash = "sha256:66ff044fd0bb1768688aecbe28b6190f6e799349221fb0de0e6f4048eca14c16"}, - {file = "pydantic_core-2.27.1-cp312-none-win_arm64.whl", hash = "sha256:9a3b0793b1bbfd4146304e23d90045f2a9b5fd5823aa682665fbdaf2a6c28f3e"}, - {file = "pydantic_core-2.27.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:f216dbce0e60e4d03e0c4353c7023b202d95cbaeff12e5fd2e82ea0a66905073"}, - {file = "pydantic_core-2.27.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a2e02889071850bbfd36b56fd6bc98945e23670773bc7a76657e90e6b6603c08"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42b0e23f119b2b456d07ca91b307ae167cc3f6c846a7b169fca5326e32fdc6cf"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:764be71193f87d460a03f1f7385a82e226639732214b402f9aa61f0d025f0737"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1c00666a3bd2f84920a4e94434f5974d7bbc57e461318d6bb34ce9cdbbc1f6b2"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ccaa88b24eebc0f849ce0a4d09e8a408ec5a94afff395eb69baf868f5183107"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c65af9088ac534313e1963443d0ec360bb2b9cba6c2909478d22c2e363d98a51"}, - {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:206b5cf6f0c513baffaeae7bd817717140770c74528f3e4c3e1cec7871ddd61a"}, - {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:062f60e512fc7fff8b8a9d680ff0ddaaef0193dba9fa83e679c0c5f5fbd018bc"}, - {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:a0697803ed7d4af5e4c1adf1670af078f8fcab7a86350e969f454daf598c4960"}, - {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:58ca98a950171f3151c603aeea9303ef6c235f692fe555e883591103da709b23"}, - {file = "pydantic_core-2.27.1-cp313-none-win32.whl", hash = "sha256:8065914ff79f7eab1599bd80406681f0ad08f8e47c880f17b416c9f8f7a26d05"}, - {file = "pydantic_core-2.27.1-cp313-none-win_amd64.whl", hash = "sha256:ba630d5e3db74c79300d9a5bdaaf6200172b107f263c98a0539eeecb857b2337"}, - {file = "pydantic_core-2.27.1-cp313-none-win_arm64.whl", hash = "sha256:45cf8588c066860b623cd11c4ba687f8d7175d5f7ef65f7129df8a394c502de5"}, - {file = "pydantic_core-2.27.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:5897bec80a09b4084aee23f9b73a9477a46c3304ad1d2d07acca19723fb1de62"}, - {file = "pydantic_core-2.27.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d0165ab2914379bd56908c02294ed8405c252250668ebcb438a55494c69f44ab"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b9af86e1d8e4cfc82c2022bfaa6f459381a50b94a29e95dcdda8442d6d83864"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f6c8a66741c5f5447e047ab0ba7a1c61d1e95580d64bce852e3df1f895c4067"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9a42d6a8156ff78981f8aa56eb6394114e0dedb217cf8b729f438f643608cbcd"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:64c65f40b4cd8b0e049a8edde07e38b476da7e3aaebe63287c899d2cff253fa5"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdcf339322a3fae5cbd504edcefddd5a50d9ee00d968696846f089b4432cf78"}, - {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bf99c8404f008750c846cb4ac4667b798a9f7de673ff719d705d9b2d6de49c5f"}, - {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:8f1edcea27918d748c7e5e4d917297b2a0ab80cad10f86631e488b7cddf76a36"}, - {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:159cac0a3d096f79ab6a44d77a961917219707e2a130739c64d4dd46281f5c2a"}, - {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:029d9757eb621cc6e1848fa0b0310310de7301057f623985698ed7ebb014391b"}, - {file = "pydantic_core-2.27.1-cp38-none-win32.whl", hash = "sha256:a28af0695a45f7060e6f9b7092558a928a28553366519f64083c63a44f70e618"}, - {file = "pydantic_core-2.27.1-cp38-none-win_amd64.whl", hash = "sha256:2d4567c850905d5eaaed2f7a404e61012a51caf288292e016360aa2b96ff38d4"}, - {file = "pydantic_core-2.27.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e9386266798d64eeb19dd3677051f5705bf873e98e15897ddb7d76f477131967"}, - {file = "pydantic_core-2.27.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4228b5b646caa73f119b1ae756216b59cc6e2267201c27d3912b592c5e323b60"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b3dfe500de26c52abe0477dde16192ac39c98f05bf2d80e76102d394bd13854"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aee66be87825cdf72ac64cb03ad4c15ffef4143dbf5c113f64a5ff4f81477bf9"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b748c44bb9f53031c8cbc99a8a061bc181c1000c60a30f55393b6e9c45cc5bd"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ca038c7f6a0afd0b2448941b6ef9d5e1949e999f9e5517692eb6da58e9d44be"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e0bd57539da59a3e4671b90a502da9a28c72322a4f17866ba3ac63a82c4498e"}, - {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ac6c2c45c847bbf8f91930d88716a0fb924b51e0c6dad329b793d670ec5db792"}, - {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b94d4ba43739bbe8b0ce4262bcc3b7b9f31459ad120fb595627eaeb7f9b9ca01"}, - {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:00e6424f4b26fe82d44577b4c842d7df97c20be6439e8e685d0d715feceb9fb9"}, - {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:38de0a70160dd97540335b7ad3a74571b24f1dc3ed33f815f0880682e6880131"}, - {file = "pydantic_core-2.27.1-cp39-none-win32.whl", hash = "sha256:7ccebf51efc61634f6c2344da73e366c75e735960b5654b63d7e6f69a5885fa3"}, - {file = "pydantic_core-2.27.1-cp39-none-win_amd64.whl", hash = "sha256:a57847b090d7892f123726202b7daa20df6694cbd583b67a592e856bff603d6c"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3fa80ac2bd5856580e242dbc202db873c60a01b20309c8319b5c5986fbe53ce6"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d950caa237bb1954f1b8c9227b5065ba6875ac9771bb8ec790d956a699b78676"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e4216e64d203e39c62df627aa882f02a2438d18a5f21d7f721621f7a5d3611d"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:02a3d637bd387c41d46b002f0e49c52642281edacd2740e5a42f7017feea3f2c"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:161c27ccce13b6b0c8689418da3885d3220ed2eae2ea5e9b2f7f3d48f1d52c27"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:19910754e4cc9c63bc1c7f6d73aa1cfee82f42007e407c0f413695c2f7ed777f"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:e173486019cc283dc9778315fa29a363579372fe67045e971e89b6365cc035ed"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:af52d26579b308921b73b956153066481f064875140ccd1dfd4e77db89dbb12f"}, - {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:981fb88516bd1ae8b0cbbd2034678a39dedc98752f264ac9bc5839d3923fa04c"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5fde892e6c697ce3e30c61b239330fc5d569a71fefd4eb6512fc6caec9dd9e2f"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:816f5aa087094099fff7edabb5e01cc370eb21aa1a1d44fe2d2aefdfb5599b31"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c10c309e18e443ddb108f0ef64e8729363adbfd92d6d57beec680f6261556f3"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98476c98b02c8e9b2eec76ac4156fd006628b1b2d0ef27e548ffa978393fd154"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c3027001c28434e7ca5a6e1e527487051136aa81803ac812be51802150d880dd"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:7699b1df36a48169cdebda7ab5a2bac265204003f153b4bd17276153d997670a"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1c39b07d90be6b48968ddc8c19e7585052088fd7ec8d568bb31ff64c70ae3c97"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:46ccfe3032b3915586e469d4972973f893c0a2bb65669194a5bdea9bacc088c2"}, - {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:62ba45e21cf6571d7f716d903b5b7b6d2617e2d5d67c0923dc47b9d41369f840"}, - {file = "pydantic_core-2.27.1.tar.gz", hash = "sha256:62a763352879b84aa31058fc931884055fd75089cccbd9d58bb6afd01141b235"}, + {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, + {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, + {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, + {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, + {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, + {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, + {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, + {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, + {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, + {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, + {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, + {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, + {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, + {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, + {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, + {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, + {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, + {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, ] [package.dependencies] @@ -452,13 +451,13 @@ files = [ [[package]] name = "six" -version = "1.16.0" +version = "1.17.0" description = "Python 2 and 3 compatibility utilities" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, ] [[package]] @@ -474,24 +473,54 @@ files = [ [[package]] name = "tomli" -version = "2.1.0" +version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.1.0-py3-none-any.whl", hash = "sha256:a5c57c3d1c56f5ccdf89f6523458f60ef716e210fc47c4cfb188c5ba473e0391"}, - {file = "tomli-2.1.0.tar.gz", hash = "sha256:3f646cae2aec94e17d04973e4249548320197cfabdf130015d023de4b74d8ab8"}, + {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"}, ] [[package]] name = "types-python-dateutil" -version = "2.9.0.20241003" +version = "2.9.0.20241206" description = "Typing stubs for python-dateutil" optional = false python-versions = ">=3.8" files = [ - {file = "types-python-dateutil-2.9.0.20241003.tar.gz", hash = "sha256:58cb85449b2a56d6684e41aeefb4c4280631246a0da1a719bdbe6f3fb0317446"}, - {file = "types_python_dateutil-2.9.0.20241003-py3-none-any.whl", hash = "sha256:250e1d8e80e7bbc3a6c99b907762711d1a1cdd00e978ad39cb5940f6f0a87f3d"}, + {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"}, + {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index fc34594..bc46ea3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,9 @@ +[project] +name = "schematichq" + [tool.poetry] name = "schematichq" -version = "1.0.5" +version = "1.0.6" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index a27fa71..0edd785 100644 --- a/reference.md +++ b/reference.md @@ -1,50 +1,4 @@ # Reference -
client.get_company_plans() -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from schematic import Schematic - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.get_company_plans() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- ## accounts
client.accounts.list_api_keys(...)
@@ -2734,6 +2688,133 @@ client.features.count_flags()
## billing +
client.billing.upsert_billing_coupon(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.billing.upsert_billing_coupon( + amount_off=1, + duration="duration", + duration_in_months=1, + external_id="external_id", + max_redemptions=1, + name="name", + percent_off=1.1, + times_redeemed=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**amount_off:** `int` + +
+
+ +
+
+ +**duration:** `str` + +
+
+ +
+
+ +**duration_in_months:** `int` + +
+
+ +
+
+ +**external_id:** `str` + +
+
+ +
+
+ +**max_redemptions:** `int` + +
+
+ +
+
+ +**name:** `str` + +
+
+ +
+
+ +**percent_off:** `float` + +
+
+ +
+
+ +**times_redeemed:** `int` + +
+
+ +
+
+ +**currency:** `typing.Optional[str]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+
client.billing.upsert_billing_customer(...)
@@ -3754,6 +3835,7 @@ client = Schematic( client.billing.upsert_billing_price( currency="currency", interval="interval", + is_active=True, price=1, price_external_id="price_external_id", product_external_id="product_external_id", @@ -3790,6 +3872,14 @@ client.billing.upsert_billing_price(
+**is_active:** `bool` + +
+
+ +
+
+ **price:** `int`
@@ -4359,7 +4449,11 @@ client.billing.count_billing_products() ```python import datetime -from schematic import BillingProductPricing, Schematic +from schematic import ( + BillingProductPricing, + BillingSubscriptionDiscount, + Schematic, +) client = Schematic( api_key="YOUR_API_KEY", @@ -4367,6 +4461,16 @@ client = Schematic( client.billing.upsert_billing_subscription( currency="currency", customer_external_id="customer_external_id", + discounts=[ + BillingSubscriptionDiscount( + coupon_external_id="coupon_external_id", + external_id="external_id", + is_active=True, + started_at=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + ], expired_at=datetime.datetime.fromisoformat( "2024-01-15 09:30:00+00:00", ), @@ -4415,6 +4519,14 @@ client.billing.upsert_billing_subscription(
+**discounts:** `typing.Sequence[BillingSubscriptionDiscount]` + +
+
+ +
+
+ **expired_at:** `dt.datetime`
@@ -4495,6 +4607,14 @@ client.billing.upsert_billing_subscription(
+**trial_end_setting:** `typing.Optional[str]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -4507,8 +4627,8 @@ client.billing.upsert_billing_subscription(
-## companies -
client.companies.list_companies(...) +## checkout +
client.checkout.internal(...)
@@ -4521,12 +4641,32 @@ client.billing.upsert_billing_subscription(
```python -from schematic import Schematic +from schematic import ( + Schematic, + UpdateAddOnRequestBody, + UpdatePayInAdvanceRequestBody, +) client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.list_companies() +client.checkout.internal( + add_on_ids=[ + UpdateAddOnRequestBody( + add_on_id="add_on_id", + price_id="price_id", + ) + ], + company_id="company_id", + new_plan_id="new_plan_id", + new_price_id="new_price_id", + pay_in_advance=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], +) ```
@@ -4542,7 +4682,7 @@ client.companies.list_companies()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp\_) +**add_on_ids:** `typing.Sequence[UpdateAddOnRequestBody]`
@@ -4550,7 +4690,7 @@ client.companies.list_companies()
-**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan\_) +**company_id:** `str`
@@ -4558,7 +4698,7 @@ client.companies.list_companies()
-**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits +**new_plan_id:** `str`
@@ -4566,7 +4706,7 @@ client.companies.list_companies()
-**without_feature_override_for:** `typing.Optional[str]` — Filter out companies that already have a company override for the specified feature ID +**new_price_id:** `str`
@@ -4574,7 +4714,7 @@ client.companies.list_companies()
-**without_plan:** `typing.Optional[bool]` — Filter out companies that have a plan +**pay_in_advance:** `typing.Sequence[UpdatePayInAdvanceRequestBody]`
@@ -4582,7 +4722,7 @@ client.companies.list_companies()
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**payment_method_id:** `typing.Optional[str]`
@@ -4590,7 +4730,7 @@ client.companies.list_companies()
-**offset:** `typing.Optional[int]` — Page offset (default 0) +**promo_code:** `typing.Optional[str]`
@@ -4610,7 +4750,7 @@ client.companies.list_companies()
-
client.companies.upsert_company(...) +
client.checkout.get_checkout_data(...)
@@ -4628,8 +4768,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.upsert_company( - keys={"key": "value"}, +client.checkout.get_checkout_data( + checkout_internal_id="checkout_internal_id", ) ``` @@ -4646,7 +4786,7 @@ client.companies.upsert_company(
-**keys:** `typing.Dict[str, str]` +**checkout_internal_id:** `str` — checkout_internal_id
@@ -4654,23 +4794,73 @@ client.companies.upsert_company(
-**id:** `typing.Optional[str]` — If you know the Schematic ID, you can use that here instead of keys +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+ + + + +
+
client.checkout.preview_checkout_internal(...)
-**last_seen_at:** `typing.Optional[dt.datetime]` - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import ( + Schematic, + UpdateAddOnRequestBody, + UpdatePayInAdvanceRequestBody, +) + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.checkout.preview_checkout_internal( + add_on_ids=[ + UpdateAddOnRequestBody( + add_on_id="add_on_id", + price_id="price_id", + ) + ], + company_id="company_id", + new_plan_id="new_plan_id", + new_price_id="new_price_id", + pay_in_advance=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], +) + +``` +
+
+#### ⚙️ Parameters +
-**name:** `typing.Optional[str]` +
+
+ +**add_on_ids:** `typing.Sequence[UpdateAddOnRequestBody]`
@@ -4678,7 +4868,7 @@ client.companies.upsert_company(
-**traits:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A map of trait names to trait values +**company_id:** `str`
@@ -4686,7 +4876,7 @@ client.companies.upsert_company(
-**update_only:** `typing.Optional[bool]` +**new_plan_id:** `str`
@@ -4694,55 +4884,31 @@ client.companies.upsert_company(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**new_price_id:** `str`
-
-
- -
-
-
- -
client.companies.get_company(...)
-#### 🔌 Usage - -
-
+**pay_in_advance:** `typing.Sequence[UpdatePayInAdvanceRequestBody]` + +
+
-```python -from schematic import Schematic - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.companies.get_company( - company_id="company_id", -) - -``` -
-
+**payment_method_id:** `typing.Optional[str]` +
-#### ⚙️ Parameters - -
-
-
-**company_id:** `str` — company_id +**promo_code:** `typing.Optional[str]`
@@ -4762,7 +4928,7 @@ client.companies.get_company(
-
client.companies.delete_company(...) +
client.checkout.update_customer_subscription_trial_end(...)
@@ -4780,8 +4946,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.delete_company( - company_id="company_id", +client.checkout.update_customer_subscription_trial_end( + subscription_id="subscription_id", ) ``` @@ -4798,7 +4964,15 @@ client.companies.delete_company(
-**company_id:** `str` — company_id +**subscription_id:** `str` — subscription_id + +
+
+ +
+
+ +**trial_end:** `typing.Optional[dt.datetime]`
@@ -4818,7 +4992,8 @@ client.companies.delete_company(
-
client.companies.count_companies(...) +## companies +
client.companies.list_companies(...)
@@ -4836,7 +5011,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.count_companies() +client.companies.list_companies() ```
@@ -4852,7 +5027,7 @@ client.companies.count_companies()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp\_) +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_)
@@ -4860,7 +5035,7 @@ client.companies.count_companies()
-**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan\_) +**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan_)
@@ -4920,7 +5095,7 @@ client.companies.count_companies()
-
client.companies.create_company(...) +
client.companies.upsert_company(...)
@@ -4938,7 +5113,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.create_company( +client.companies.upsert_company( keys={"key": "value"}, ) @@ -5016,7 +5191,7 @@ client.companies.create_company(
-
client.companies.delete_company_by_keys(...) +
client.companies.get_company(...)
@@ -5034,8 +5209,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.delete_company_by_keys( - keys={"key": "value"}, +client.companies.get_company( + company_id="company_id", ) ``` @@ -5052,7 +5227,7 @@ client.companies.delete_company_by_keys(
-**keys:** `typing.Dict[str, str]` +**company_id:** `str` — company_id
@@ -5072,7 +5247,7 @@ client.companies.delete_company_by_keys(
-
client.companies.lookup_company(...) +
client.companies.delete_company(...)
@@ -5090,8 +5265,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.lookup_company( - keys={"keys": {"key": "value"}}, +client.companies.delete_company( + company_id="company_id", ) ``` @@ -5108,7 +5283,7 @@ client.companies.lookup_company(
-**keys:** `typing.Dict[str, typing.Optional[typing.Any]]` — Key/value pairs +**company_id:** `str` — company_id
@@ -5128,7 +5303,7 @@ client.companies.lookup_company(
-
client.companies.get_active_deals(...) +
client.companies.count_companies(...)
@@ -5146,10 +5321,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.get_active_deals( - company_id="company_id", - deal_stage="deal_stage", -) +client.companies.count_companies() ```
@@ -5165,7 +5337,7 @@ client.companies.get_active_deals(
-**company_id:** `str` +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter companies by multiple company IDs (starts with comp_)
@@ -5173,7 +5345,31 @@ client.companies.get_active_deals(
-**deal_stage:** `str` +**plan_id:** `typing.Optional[str]` — Filter companies by plan ID (starts with plan_) + +
+
+ +
+
+ +**q:** `typing.Optional[str]` — Search for companies by name, keys or string traits + +
+
+ +
+
+ +**without_feature_override_for:** `typing.Optional[str]` — Filter out companies that already have a company override for the specified feature ID + +
+
+ +
+
+ +**without_plan:** `typing.Optional[bool]` — Filter out companies that have a plan
@@ -5209,7 +5405,7 @@ client.companies.get_active_deals(
-
client.companies.list_company_memberships(...) +
client.companies.create_company(...)
@@ -5227,7 +5423,9 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.list_company_memberships() +client.companies.create_company( + keys={"key": "value"}, +) ```
@@ -5243,7 +5441,7 @@ client.companies.list_company_memberships()
-**company_id:** `typing.Optional[str]` +**keys:** `typing.Dict[str, str]`
@@ -5251,7 +5449,7 @@ client.companies.list_company_memberships()
-**user_id:** `typing.Optional[str]` +**id:** `typing.Optional[str]` — If you know the Schematic ID, you can use that here instead of keys
@@ -5259,7 +5457,7 @@ client.companies.list_company_memberships()
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**last_seen_at:** `typing.Optional[dt.datetime]`
@@ -5267,7 +5465,23 @@ client.companies.list_company_memberships()
-**offset:** `typing.Optional[int]` — Page offset (default 0) +**name:** `typing.Optional[str]` + +
+
+ +
+
+ +**traits:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A map of trait names to trait values + +
+
+ +
+
+ +**update_only:** `typing.Optional[bool]`
@@ -5287,7 +5501,7 @@ client.companies.list_company_memberships()
-
client.companies.get_or_create_company_membership(...) +
client.companies.delete_company_by_keys(...)
@@ -5305,9 +5519,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.get_or_create_company_membership( - company_id="company_id", - user_id="user_id", +client.companies.delete_company_by_keys( + keys={"key": "value"}, ) ``` @@ -5324,15 +5537,7 @@ client.companies.get_or_create_company_membership(
-**company_id:** `str` - -
-
- -
-
- -**user_id:** `str` +**keys:** `typing.Dict[str, str]`
@@ -5352,7 +5557,7 @@ client.companies.get_or_create_company_membership(
-
client.companies.delete_company_membership(...) +
client.companies.lookup_company(...)
@@ -5370,8 +5575,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.delete_company_membership( - company_membership_id="company_membership_id", +client.companies.lookup_company( + keys={"keys": {"key": "value"}}, ) ``` @@ -5388,7 +5593,7 @@ client.companies.delete_company_membership(
-**company_membership_id:** `str` — company_membership_id +**keys:** `typing.Dict[str, typing.Optional[typing.Any]]` — Key/value pairs
@@ -5408,7 +5613,7 @@ client.companies.delete_company_membership(
-
client.companies.get_active_company_subscription(...) +
client.companies.get_active_deals(...)
@@ -5426,7 +5631,10 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.get_active_company_subscription() +client.companies.get_active_deals( + company_id="company_id", + deal_stage="deal_stage", +) ```
@@ -5442,7 +5650,7 @@ client.companies.get_active_company_subscription()
-**company_id:** `typing.Optional[str]` +**company_id:** `str`
@@ -5450,7 +5658,7 @@ client.companies.get_active_company_subscription()
-**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**deal_stage:** `str`
@@ -5486,7 +5694,7 @@ client.companies.get_active_company_subscription()
-
client.companies.upsert_company_trait(...) +
client.companies.list_company_memberships(...)
@@ -5504,10 +5712,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.upsert_company_trait( - keys={"key": "value"}, - trait="trait", -) +client.companies.list_company_memberships() ```
@@ -5523,15 +5728,7 @@ client.companies.upsert_company_trait(
-**keys:** `typing.Dict[str, str]` — Key/value pairs too identify a company or user - -
-
- -
-
- -**trait:** `str` — Name of the trait to update +**company_id:** `typing.Optional[str]`
@@ -5539,7 +5736,7 @@ client.companies.upsert_company_trait(
-**incr:** `typing.Optional[int]` — Amount to increment the trait by (positive or negative) +**user_id:** `typing.Optional[str]`
@@ -5547,7 +5744,7 @@ client.companies.upsert_company_trait(
-**set_:** `typing.Optional[str]` — Value to set the trait to +**limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -5555,7 +5752,7 @@ client.companies.upsert_company_trait(
-**update_only:** `typing.Optional[bool]` — Unless this is set, the company or user will be created if it does not already exist +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -5575,7 +5772,7 @@ client.companies.upsert_company_trait(
-
client.companies.list_entity_key_definitions(...) +
client.companies.get_or_create_company_membership(...)
@@ -5593,7 +5790,10 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.list_entity_key_definitions() +client.companies.get_or_create_company_membership( + company_id="company_id", + user_id="user_id", +) ```
@@ -5609,7 +5809,7 @@ client.companies.list_entity_key_definitions()
-**entity_type:** `typing.Optional[ListEntityKeyDefinitionsRequestEntityType]` +**company_id:** `str`
@@ -5617,7 +5817,7 @@ client.companies.list_entity_key_definitions()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**user_id:** `str`
@@ -5625,23 +5825,55 @@ client.companies.list_entity_key_definitions()
-**q:** `typing.Optional[str]` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.companies.delete_company_membership(...)
-**limit:** `typing.Optional[int]` — Page limit (default 100) - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.companies.delete_company_membership( + company_membership_id="company_membership_id", +) + +``` +
+
+#### ⚙️ Parameters +
-**offset:** `typing.Optional[int]` — Page offset (default 0) +
+
+ +**company_membership_id:** `str` — company_membership_id
@@ -5661,7 +5893,7 @@ client.companies.list_entity_key_definitions()
-
client.companies.count_entity_key_definitions(...) +
client.companies.get_active_company_subscription(...)
@@ -5679,7 +5911,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.companies.count_entity_key_definitions() +client.companies.get_active_company_subscription() ```
@@ -5695,7 +5927,7 @@ client.companies.count_entity_key_definitions()
-**entity_type:** `typing.Optional[CountEntityKeyDefinitionsRequestEntityType]` +**company_id:** `typing.Optional[str]`
@@ -5703,7 +5935,7 @@ client.companies.count_entity_key_definitions()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
@@ -5711,7 +5943,7 @@ client.companies.count_entity_key_definitions()
-**q:** `typing.Optional[str]` +**limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -5719,7 +5951,7 @@ client.companies.count_entity_key_definitions()
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -5727,7 +5959,260 @@ client.companies.count_entity_key_definitions()
-**offset:** `typing.Optional[int]` — Page offset (default 0) +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+ +
+ + + + +
+ +
client.companies.upsert_company_trait(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.companies.upsert_company_trait( + keys={"key": "value"}, + trait="trait", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**keys:** `typing.Dict[str, str]` — Key/value pairs too identify a company or user + +
+
+ +
+
+ +**trait:** `str` — Name of the trait to update + +
+
+ +
+
+ +**incr:** `typing.Optional[int]` — Amount to increment the trait by (positive or negative) + +
+
+ +
+
+ +**set_:** `typing.Optional[str]` — Value to set the trait to + +
+
+ +
+
+ +**update_only:** `typing.Optional[bool]` — Unless this is set, the company or user will be created if it does not already exist + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.companies.list_entity_key_definitions(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.companies.list_entity_key_definitions() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**entity_type:** `typing.Optional[ListEntityKeyDefinitionsRequestEntityType]` + +
+
+ +
+
+ +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` + +
+
+ +
+
+ +**q:** `typing.Optional[str]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.companies.count_entity_key_definitions(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.companies.count_entity_key_definitions() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**entity_type:** `typing.Optional[CountEntityKeyDefinitionsRequestEntityType]` + +
+
+ +
+
+ +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` + +
+
+ +
+
+ +**q:** `typing.Optional[str]` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -6349,7 +6834,7 @@ client.companies.list_users()
-**company_id:** `typing.Optional[str]` — Filter users by company ID (starts with comp\_) +**company_id:** `typing.Optional[str]` — Filter users by company ID (starts with comp_)
@@ -6357,7 +6842,7 @@ client.companies.list_users()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter users by multiple user IDs (starts with user\_) +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter users by multiple user IDs (starts with user_)
@@ -6365,7 +6850,7 @@ client.companies.list_users()
-**plan_id:** `typing.Optional[str]` — Filter users by plan ID (starts with plan\_) +**plan_id:** `typing.Optional[str]` — Filter users by plan ID (starts with plan_)
@@ -6668,7 +7153,7 @@ client.companies.count_users()
-**company_id:** `typing.Optional[str]` — Filter users by company ID (starts with comp\_) +**company_id:** `typing.Optional[str]` — Filter users by company ID (starts with comp_)
@@ -6676,7 +7161,7 @@ client.companies.count_users()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter users by multiple user IDs (starts with user\_) +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter users by multiple user IDs (starts with user_)
@@ -6684,7 +7169,7 @@ client.companies.count_users()
-**plan_id:** `typing.Optional[str]` — Filter users by plan ID (starts with plan\_) +**plan_id:** `typing.Optional[str]` — Filter users by plan ID (starts with plan_)
@@ -6988,7 +7473,7 @@ client.entitlements.list_company_overrides()
-**company_id:** `typing.Optional[str]` — Filter company overrides by a single company ID (starting with comp\_) +**company_id:** `typing.Optional[str]` — Filter company overrides by a single company ID (starting with comp_)
@@ -6996,7 +7481,7 @@ client.entitlements.list_company_overrides()
-**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company IDs (starting with comp\_) +**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company IDs (starting with comp_)
@@ -7004,7 +7489,7 @@ client.entitlements.list_company_overrides()
-**feature_id:** `typing.Optional[str]` — Filter company overrides by a single feature ID (starting with feat\_) +**feature_id:** `typing.Optional[str]` — Filter company overrides by a single feature ID (starting with feat_)
@@ -7012,7 +7497,7 @@ client.entitlements.list_company_overrides()
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple feature IDs (starting with feat\_) +**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple feature IDs (starting with feat_)
@@ -7020,7 +7505,7 @@ client.entitlements.list_company_overrides()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company override IDs (starting with cmov\_) +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company override IDs (starting with cmov_)
@@ -7028,7 +7513,7 @@ client.entitlements.list_company_overrides()
-**q:** `typing.Optional[str]` — Search for company overrides by feature or company name +**without_expired:** `typing.Optional[bool]` — Filter company overrides by whether they have not expired
@@ -7036,7 +7521,15 @@ client.entitlements.list_company_overrides()
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**q:** `typing.Optional[str]` — Search for company overrides by feature or company name + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -7134,22 +7627,6 @@ client.entitlements.create_company_override(
-**metered_monthly_price_id:** `typing.Optional[str]` - -
-
- -
-
- -**metered_yearly_price_id:** `typing.Optional[str]` - -
-
- -
-
- **metric_period:** `typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod]`
@@ -7319,22 +7796,6 @@ client.entitlements.update_company_override(
-**metered_monthly_price_id:** `typing.Optional[str]` - -
-
- -
-
- -**metered_yearly_price_id:** `typing.Optional[str]` - -
-
- -
-
- **metric_period:** `typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod]`
@@ -7477,7 +7938,15 @@ client.entitlements.count_company_overrides()
-**company_id:** `typing.Optional[str]` — Filter company overrides by a single company ID (starting with comp\_) +**company_id:** `typing.Optional[str]` — Filter company overrides by a single company ID (starting with comp_) + +
+
+ +
+
+ +**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company IDs (starting with comp_)
@@ -7485,7 +7954,7 @@ client.entitlements.count_company_overrides()
-**company_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company IDs (starting with comp\_) +**feature_id:** `typing.Optional[str]` — Filter company overrides by a single feature ID (starting with feat_)
@@ -7493,7 +7962,7 @@ client.entitlements.count_company_overrides()
-**feature_id:** `typing.Optional[str]` — Filter company overrides by a single feature ID (starting with feat\_) +**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple feature IDs (starting with feat_)
@@ -7501,7 +7970,7 @@ client.entitlements.count_company_overrides()
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple feature IDs (starting with feat\_) +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company override IDs (starting with cmov_)
@@ -7509,7 +7978,7 @@ client.entitlements.count_company_overrides()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter company overrides by multiple company override IDs (starting with cmov\_) +**without_expired:** `typing.Optional[bool]` — Filter company overrides by whether they have not expired
@@ -8111,7 +8580,7 @@ client.entitlements.list_plan_entitlements()
-**feature_id:** `typing.Optional[str]` — Filter plan entitlements by a single feature ID (starting with feat\_) +**feature_id:** `typing.Optional[str]` — Filter plan entitlements by a single feature ID (starting with feat_)
@@ -8119,7 +8588,7 @@ client.entitlements.list_plan_entitlements()
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple feature IDs (starting with feat\_) +**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple feature IDs (starting with feat_)
@@ -8127,7 +8596,7 @@ client.entitlements.list_plan_entitlements()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan entitlement IDs (starting with pltl\_) +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)
@@ -8135,7 +8604,7 @@ client.entitlements.list_plan_entitlements()
-**plan_id:** `typing.Optional[str]` — Filter plan entitlements by a single plan ID (starting with plan\_) +**plan_id:** `typing.Optional[str]` — Filter plan entitlements by a single plan ID (starting with plan_)
@@ -8143,7 +8612,7 @@ client.entitlements.list_plan_entitlements()
-**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan IDs (starting with plan\_) +**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan IDs (starting with plan_)
@@ -8257,22 +8726,6 @@ client.entitlements.create_plan_entitlement(
-**metered_monthly_price_id:** `typing.Optional[str]` - -
-
- -
-
- -**metered_yearly_price_id:** `typing.Optional[str]` - -
-
- -
-
- **metric_period:** `typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod]`
@@ -8458,7 +8911,7 @@ client.entitlements.update_plan_entitlement(
-**metered_monthly_price_id:** `typing.Optional[str]` +**metric_period:** `typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod]`
@@ -8466,7 +8919,7 @@ client.entitlements.update_plan_entitlement(
-**metered_yearly_price_id:** `typing.Optional[str]` +**metric_period_month_reset:** `typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset]`
@@ -8474,7 +8927,7 @@ client.entitlements.update_plan_entitlement(
-**metric_period:** `typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod]` +**monthly_metered_price_id:** `typing.Optional[str]`
@@ -8482,7 +8935,7 @@ client.entitlements.update_plan_entitlement(
-**metric_period_month_reset:** `typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset]` +**price_behavior:** `typing.Optional[str]`
@@ -8514,6 +8967,14 @@ client.entitlements.update_plan_entitlement(
+**yearly_metered_price_id:** `typing.Optional[str]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -8616,7 +9077,7 @@ client.entitlements.count_plan_entitlements()
-**feature_id:** `typing.Optional[str]` — Filter plan entitlements by a single feature ID (starting with feat\_) +**feature_id:** `typing.Optional[str]` — Filter plan entitlements by a single feature ID (starting with feat_)
@@ -8624,7 +9085,7 @@ client.entitlements.count_plan_entitlements()
-**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple feature IDs (starting with feat\_) +**feature_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple feature IDs (starting with feat_)
@@ -8632,7 +9093,7 @@ client.entitlements.count_plan_entitlements()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan entitlement IDs (starting with pltl\_) +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_)
@@ -8640,7 +9101,7 @@ client.entitlements.count_plan_entitlements()
-**plan_id:** `typing.Optional[str]` — Filter plan entitlements by a single plan ID (starting with plan\_) +**plan_id:** `typing.Optional[str]` — Filter plan entitlements by a single plan ID (starting with plan_)
@@ -8648,7 +9109,7 @@ client.entitlements.count_plan_entitlements()
-**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan IDs (starting with plan\_) +**plan_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter plan entitlements by multiple plan IDs (starting with plan_)
@@ -8756,8 +9217,8 @@ client.entitlements.get_feature_usage_by_company(
-## components -
client.components.list_components(...) +## plans +
client.plans.update_company_plans(...)
@@ -8775,7 +9236,10 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.components.list_components() +client.plans.update_company_plans( + company_plan_id="company_plan_id", + add_on_ids=["add_on_ids"], +) ```
@@ -8791,7 +9255,7 @@ client.components.list_components()
-**q:** `typing.Optional[str]` +**company_plan_id:** `str` — company_plan_id
@@ -8799,7 +9263,7 @@ client.components.list_components()
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**add_on_ids:** `typing.Sequence[str]`
@@ -8807,7 +9271,7 @@ client.components.list_components()
-**offset:** `typing.Optional[int]` — Page offset (default 0) +**base_plan_id:** `typing.Optional[str]`
@@ -8827,7 +9291,7 @@ client.components.list_components()
-
client.components.create_component(...) +
client.plans.get_audience(...)
@@ -8845,9 +9309,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.components.create_component( - entity_type="entitlement", - name="name", +client.plans.get_audience( + plan_audience_id="plan_audience_id", ) ``` @@ -8864,23 +9327,7 @@ client.components.create_component(
-**entity_type:** `CreateComponentRequestBodyEntityType` - -
-
- -
-
- -**name:** `str` - -
-
- -
-
- -**ast:** `typing.Optional[typing.Dict[str, float]]` +**plan_audience_id:** `str` — plan_audience_id
@@ -8900,7 +9347,7 @@ client.components.create_component(
-
client.components.get_component(...) +
client.plans.update_audience(...)
@@ -8913,13 +9360,35 @@ client.components.create_component(
```python -from schematic import Schematic +from schematic import ( + CreateOrUpdateConditionGroupRequestBody, + CreateOrUpdateConditionRequestBody, + Schematic, +) client = Schematic( api_key="YOUR_API_KEY", ) -client.components.get_component( - component_id="component_id", +client.plans.update_audience( + plan_audience_id="plan_audience_id", + condition_groups=[ + CreateOrUpdateConditionGroupRequestBody( + conditions=[ + CreateOrUpdateConditionRequestBody( + condition_type="company", + operator="eq", + resource_ids=["resource_ids"], + ) + ], + ) + ], + conditions=[ + CreateOrUpdateConditionRequestBody( + condition_type="company", + operator="eq", + resource_ids=["resource_ids"], + ) + ], ) ``` @@ -8936,7 +9405,23 @@ client.components.get_component(
-**component_id:** `str` — component_id +**plan_audience_id:** `str` — plan_audience_id + +
+
+ +
+
+ +**condition_groups:** `typing.Sequence[CreateOrUpdateConditionGroupRequestBody]` + +
+
+ +
+
+ +**conditions:** `typing.Sequence[CreateOrUpdateConditionRequestBody]`
@@ -8956,7 +9441,7 @@ client.components.get_component(
-
client.components.update_component(...) +
client.plans.delete_audience(...)
@@ -8974,8 +9459,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.components.update_component( - component_id="component_id", +client.plans.delete_audience( + plan_audience_id="plan_audience_id", ) ``` @@ -8992,39 +9477,7 @@ client.components.update_component(
-**component_id:** `str` — component_id - -
-
- -
-
- -**ast:** `typing.Optional[typing.Dict[str, float]]` - -
-
- -
-
- -**entity_type:** `typing.Optional[UpdateComponentRequestBodyEntityType]` - -
-
- -
-
- -**name:** `typing.Optional[str]` - -
-
- -
-
- -**state:** `typing.Optional[UpdateComponentRequestBodyState]` +**plan_audience_id:** `str` — plan_audience_id
@@ -9044,7 +9497,7 @@ client.components.update_component(
-
client.components.delete_component(...) +
client.plans.list_plans(...)
@@ -9062,9 +9515,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.components.delete_component( - component_id="component_id", -) +client.plans.list_plans() ```
@@ -9080,7 +9531,7 @@ client.components.delete_component(
-**component_id:** `str` — component_id +**company_id:** `typing.Optional[str]`
@@ -9088,53 +9539,55 @@ client.components.delete_component(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**has_product_id:** `typing.Optional[bool]` — Filter out plans that do not have a billing product ID
- -
+
+
+**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +
-
-
client.components.count_components(...)
-#### 🔌 Usage +**plan_type:** `typing.Optional[ListPlansRequestPlanType]` — Filter by plan type + +
+
+**q:** `typing.Optional[str]` + +
+
+
-```python -from schematic import Schematic - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.components.count_components() - -``` -
-
+**without_entitlement_for:** `typing.Optional[str]` — Filter out plans that already have a plan entitlement for the specified feature ID + -#### ⚙️ Parameters -
+**without_product_id:** `typing.Optional[bool]` — Filter out plans that have a billing product ID + +
+
+
-**q:** `typing.Optional[str]` +**without_paid_product_id:** `typing.Optional[bool]` — Filter out plans that have a paid billing product ID
@@ -9170,7 +9623,7 @@ client.components.count_components()
-
client.components.preview_component_data(...) +
client.plans.create_plan(...)
@@ -9188,7 +9641,11 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.components.preview_component_data() +client.plans.create_plan( + description="description", + name="name", + plan_type="plan", +) ```
@@ -9204,7 +9661,7 @@ client.components.preview_component_data()
-**company_id:** `typing.Optional[str]` +**description:** `str`
@@ -9212,7 +9669,7 @@ client.components.preview_component_data()
-**component_id:** `typing.Optional[str]` +**name:** `str`
@@ -9220,7 +9677,23 @@ client.components.preview_component_data()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**plan_type:** `CreatePlanRequestBodyPlanType` + +
+
+ +
+
+ +**icon:** `typing.Optional[str]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -9232,8 +9705,7 @@ client.components.preview_component_data()
-## crm -
client.crm.upsert_deal_line_item_association(...) +
client.plans.get_plan(...)
@@ -9251,9 +9723,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.crm.upsert_deal_line_item_association( - deal_external_id="deal_external_id", - line_item_external_id="line_item_external_id", +client.plans.get_plan( + plan_id="plan_id", ) ``` @@ -9270,15 +9741,7 @@ client.crm.upsert_deal_line_item_association(
-**deal_external_id:** `str` - -
-
- -
-
- -**line_item_external_id:** `str` +**plan_id:** `str` — plan_id
@@ -9298,7 +9761,7 @@ client.crm.upsert_deal_line_item_association(
-
client.crm.upsert_line_item(...) +
client.plans.update_plan(...)
@@ -9316,12 +9779,9 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.crm.upsert_line_item( - amount="amount", - interval="interval", - line_item_external_id="line_item_external_id", - product_external_id="product_external_id", - quantity=1, +client.plans.update_plan( + plan_id="plan_id", + name="name", ) ``` @@ -9338,7 +9798,7 @@ client.crm.upsert_line_item(
-**amount:** `str` +**plan_id:** `str` — plan_id
@@ -9346,7 +9806,7 @@ client.crm.upsert_line_item(
-**interval:** `str` +**name:** `str`
@@ -9354,7 +9814,7 @@ client.crm.upsert_line_item(
-**line_item_external_id:** `str` +**description:** `typing.Optional[str]`
@@ -9362,7 +9822,7 @@ client.crm.upsert_line_item(
-**product_external_id:** `str` +**icon:** `typing.Optional[str]`
@@ -9370,31 +9830,55 @@ client.crm.upsert_line_item(
-**quantity:** `int` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**discount_percentage:** `typing.Optional[str]` -
+
+ +
client.plans.delete_plan(...) +
+
+ +#### 🔌 Usage
-**term_month:** `typing.Optional[int]` - +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.plans.delete_plan( + plan_id="plan_id", +) + +``` +
+
+#### ⚙️ Parameters +
-**total_discount:** `typing.Optional[str]` +
+
+ +**plan_id:** `str` — plan_id
@@ -9414,7 +9898,7 @@ client.crm.upsert_line_item(
-
client.crm.upsert_crm_deal(...) +
client.plans.upsert_billing_product_plan(...)
@@ -9432,10 +9916,10 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.crm.upsert_crm_deal( - crm_company_key="crm_company_key", - crm_type="crm_type", - deal_external_id="deal_external_id", +client.plans.upsert_billing_product_plan( + plan_id="plan_id", + is_free_plan=True, + is_trialable=True, ) ``` @@ -9452,23 +9936,7 @@ client.crm.upsert_crm_deal(
-**crm_company_key:** `str` - -
-
- -
-
- -**crm_type:** `str` - -
-
- -
-
- -**deal_external_id:** `str` +**plan_id:** `str` — plan_id
@@ -9476,7 +9944,7 @@ client.crm.upsert_crm_deal(
-**arr:** `typing.Optional[str]` +**is_free_plan:** `bool`
@@ -9484,7 +9952,7 @@ client.crm.upsert_crm_deal(
-**crm_company_id:** `typing.Optional[str]` +**is_trialable:** `bool`
@@ -9492,7 +9960,7 @@ client.crm.upsert_crm_deal(
-**crm_product_id:** `typing.Optional[str]` +**billing_product_id:** `typing.Optional[str]`
@@ -9500,7 +9968,7 @@ client.crm.upsert_crm_deal(
-**deal_name:** `typing.Optional[str]` +**monthly_price_id:** `typing.Optional[str]`
@@ -9508,7 +9976,7 @@ client.crm.upsert_crm_deal(
-**deal_stage:** `typing.Optional[str]` +**trial_days:** `typing.Optional[int]`
@@ -9516,7 +9984,7 @@ client.crm.upsert_crm_deal(
-**mrr:** `typing.Optional[str]` +**yearly_price_id:** `typing.Optional[str]`
@@ -9536,7 +10004,7 @@ client.crm.upsert_crm_deal(
-
client.crm.list_crm_products(...) +
client.plans.count_plans(...)
@@ -9554,7 +10022,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.crm.list_crm_products() +client.plans.count_plans() ```
@@ -9570,7 +10038,7 @@ client.crm.list_crm_products()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**company_id:** `typing.Optional[str]`
@@ -9578,7 +10046,7 @@ client.crm.list_crm_products()
-**name:** `typing.Optional[str]` +**has_product_id:** `typing.Optional[bool]` — Filter out plans that do not have a billing product ID
@@ -9586,7 +10054,7 @@ client.crm.list_crm_products()
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
@@ -9594,7 +10062,7 @@ client.crm.list_crm_products()
-**offset:** `typing.Optional[int]` — Page offset (default 0) +**plan_type:** `typing.Optional[CountPlansRequestPlanType]` — Filter by plan type
@@ -9602,62 +10070,39 @@ client.crm.list_crm_products()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**q:** `typing.Optional[str]`
- -
+
+
+**without_entitlement_for:** `typing.Optional[str]` — Filter out plans that already have a plan entitlement for the specified feature ID +
-
-
client.crm.upsert_crm_product(...)
-#### 🔌 Usage - -
-
+**without_product_id:** `typing.Optional[bool]` — Filter out plans that have a billing product ID + +
+
-```python -from schematic import Schematic - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.crm.upsert_crm_product( - currency="currency", - description="description", - external_id="external_id", - interval="interval", - name="name", - price="price", - quantity=1, - sku="sku", -) - -``` -
-
+**without_paid_product_id:** `typing.Optional[bool]` — Filter out plans that have a paid billing product ID +
-#### ⚙️ Parameters - -
-
-
-**currency:** `str` +**limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -9665,7 +10110,7 @@ client.crm.upsert_crm_product(
-**description:** `str` +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -9673,31 +10118,54 @@ client.crm.upsert_crm_product(
-**external_id:** `str` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**interval:** `str` -
+
+## components +
client.components.list_components(...)
-**name:** `str` - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.components.list_components() + +```
+
+
+ +#### ⚙️ Parameters
-**price:** `str` +
+
+ +**q:** `typing.Optional[str]`
@@ -9705,7 +10173,7 @@ client.crm.upsert_crm_product(
-**quantity:** `int` +**limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -9713,7 +10181,7 @@ client.crm.upsert_crm_product(
-**sku:** `str` +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -9733,8 +10201,7 @@ client.crm.upsert_crm_product(
-## events -
client.events.create_event_batch(...) +
client.components.create_component(...)
@@ -9747,17 +10214,14 @@ client.crm.upsert_crm_product(
```python -from schematic import CreateEventRequestBody, Schematic +from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.events.create_event_batch( - events=[ - CreateEventRequestBody( - event_type="identify", - ) - ], +client.components.create_component( + entity_type="entitlement", + name="name", ) ``` @@ -9774,7 +10238,7 @@ client.events.create_event_batch(
-**events:** `typing.Sequence[CreateEventRequestBody]` +**entity_type:** `CreateComponentRequestBodyEntityType`
@@ -9782,77 +10246,15 @@ client.events.create_event_batch(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**name:** `str`
-
-
- - - - -
- -
client.events.get_event_summaries(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from schematic import Schematic - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.events.get_event_summaries() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
-**q:** `typing.Optional[str]` - -
-
- -
-
- -**event_subtypes:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` - -
-
- -
-
- -**limit:** `typing.Optional[int]` — Page limit (default 100) - -
-
- -
-
- -**offset:** `typing.Optional[int]` — Page offset (default 0) +**ast:** `typing.Optional[typing.Dict[str, float]]`
@@ -9872,7 +10274,7 @@ client.events.get_event_summaries()
-
client.events.get_event_summary_by_subtype(...) +
client.components.get_component(...)
@@ -9890,8 +10292,8 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.events.get_event_summary_by_subtype( - key="key", +client.components.get_component( + component_id="component_id", ) ``` @@ -9908,7 +10310,7 @@ client.events.get_event_summary_by_subtype(
-**key:** `str` — key +**component_id:** `str` — component_id
@@ -9928,7 +10330,7 @@ client.events.get_event_summary_by_subtype(
-
client.events.list_events(...) +
client.components.update_component(...)
@@ -9946,7 +10348,9 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.events.list_events() +client.components.update_component( + component_id="component_id", +) ```
@@ -9962,7 +10366,7 @@ client.events.list_events()
-**company_id:** `typing.Optional[str]` +**component_id:** `str` — component_id
@@ -9970,7 +10374,7 @@ client.events.list_events()
-**event_subtype:** `typing.Optional[str]` +**ast:** `typing.Optional[typing.Dict[str, float]]`
@@ -9978,7 +10382,7 @@ client.events.list_events()
-**event_types:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**entity_type:** `typing.Optional[UpdateComponentRequestBodyEntityType]`
@@ -9986,7 +10390,7 @@ client.events.list_events()
-**flag_id:** `typing.Optional[str]` +**name:** `typing.Optional[str]`
@@ -9994,7 +10398,7 @@ client.events.list_events()
-**user_id:** `typing.Optional[str]` +**state:** `typing.Optional[UpdateComponentRequestBodyState]`
@@ -10002,15 +10406,55 @@ client.events.list_events()
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.components.delete_component(...)
-**offset:** `typing.Optional[int]` — Page offset (default 0) +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.components.delete_component( + component_id="component_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**component_id:** `str` — component_id
@@ -10030,7 +10474,7 @@ client.events.list_events()
-
client.events.create_event(...) +
client.components.count_components(...)
@@ -10048,9 +10492,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.events.create_event( - event_type="identify", -) +client.components.count_components() ```
@@ -10066,7 +10508,7 @@ client.events.create_event(
-**event_type:** `CreateEventRequestBodyEventType` — Either 'identify' or 'track' +**q:** `typing.Optional[str]`
@@ -10074,7 +10516,7 @@ client.events.create_event(
-**body:** `typing.Optional[EventBody]` +**limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -10082,7 +10524,7 @@ client.events.create_event(
-**sent_at:** `typing.Optional[dt.datetime]` — Optionally provide a timestamp at which the event was sent to Schematic +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -10102,7 +10544,7 @@ client.events.create_event(
-
client.events.get_event(...) +
client.components.preview_component_data(...)
@@ -10120,9 +10562,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.events.get_event( - event_id="event_id", -) +client.components.preview_component_data() ```
@@ -10138,7 +10578,15 @@ client.events.get_event(
-**event_id:** `str` — event_id +**company_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**component_id:** `typing.Optional[str]`
@@ -10158,7 +10606,8 @@ client.events.get_event(
-
client.events.get_segment_integration_status() +## crm +
client.crm.upsert_deal_line_item_association(...)
@@ -10176,7 +10625,10 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.events.get_segment_integration_status() +client.crm.upsert_deal_line_item_association( + deal_external_id="deal_external_id", + line_item_external_id="line_item_external_id", +) ```
@@ -10192,6 +10644,22 @@ client.events.get_segment_integration_status()
+**deal_external_id:** `str` + +
+
+ +
+
+ +**line_item_external_id:** `str` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -10204,8 +10672,7 @@ client.events.get_segment_integration_status()
-## plans -
client.plans.get_audience(...) +
client.crm.upsert_line_item(...)
@@ -10223,8 +10690,12 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.plans.get_audience( - plan_audience_id="plan_audience_id", +client.crm.upsert_line_item( + amount="amount", + interval="interval", + line_item_external_id="line_item_external_id", + product_external_id="product_external_id", + quantity=1, ) ``` @@ -10241,7 +10712,7 @@ client.plans.get_audience(
-**plan_audience_id:** `str` — plan_audience_id +**amount:** `str`
@@ -10249,77 +10720,39 @@ client.plans.get_audience(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**interval:** `str`
-
-
+
+
+**line_item_external_id:** `str` +
-
-
client.plans.update_audience(...)
-#### 🔌 Usage - -
-
+**product_external_id:** `str` + +
+
-```python -from schematic import ( - CreateOrUpdateConditionGroupRequestBody, - CreateOrUpdateConditionRequestBody, - Schematic, -) - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.plans.update_audience( - plan_audience_id="plan_audience_id", - condition_groups=[ - CreateOrUpdateConditionGroupRequestBody( - conditions=[ - CreateOrUpdateConditionRequestBody( - condition_type="company", - operator="eq", - resource_ids=["resource_ids"], - ) - ], - ) - ], - conditions=[ - CreateOrUpdateConditionRequestBody( - condition_type="company", - operator="eq", - resource_ids=["resource_ids"], - ) - ], -) - -``` -
-
+**quantity:** `int` +
-#### ⚙️ Parameters -
-
-
- -**plan_audience_id:** `str` — plan_audience_id +**discount_percentage:** `typing.Optional[str]`
@@ -10327,7 +10760,7 @@ client.plans.update_audience(
-**condition_groups:** `typing.Sequence[CreateOrUpdateConditionGroupRequestBody]` +**term_month:** `typing.Optional[int]`
@@ -10335,7 +10768,7 @@ client.plans.update_audience(
-**conditions:** `typing.Sequence[CreateOrUpdateConditionRequestBody]` +**total_discount:** `typing.Optional[str]`
@@ -10355,7 +10788,7 @@ client.plans.update_audience(
-
client.plans.delete_audience(...) +
client.crm.upsert_crm_deal(...)
@@ -10373,8 +10806,10 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.plans.delete_audience( - plan_audience_id="plan_audience_id", +client.crm.upsert_crm_deal( + crm_company_key="crm_company_key", + crm_type="crm_type", + deal_external_id="deal_external_id", ) ``` @@ -10391,7 +10826,7 @@ client.plans.delete_audience(
-**plan_audience_id:** `str` — plan_audience_id +**crm_company_key:** `str`
@@ -10399,53 +10834,55 @@ client.plans.delete_audience(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**crm_type:** `str`
-
-
+
+
+**deal_external_id:** `str` +
-
-
client.plans.list_plans(...)
-#### 🔌 Usage +**arr:** `typing.Optional[str]` + +
+
+**crm_company_id:** `typing.Optional[str]` + +
+
+
-```python -from schematic import Schematic - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.plans.list_plans() - -``` -
-
+**crm_product_id:** `typing.Optional[str]` + -#### ⚙️ Parameters -
+**deal_name:** `typing.Optional[str]` + +
+
+
-**company_id:** `typing.Optional[str]` +**deal_stage:** `typing.Optional[str]`
@@ -10453,7 +10890,7 @@ client.plans.list_plans()
-**has_product_id:** `typing.Optional[bool]` — Filter out plans that do not have a billing product ID +**mrr:** `typing.Optional[str]`
@@ -10461,31 +10898,53 @@ client.plans.list_plans()
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ + + + + + +
+ +
client.crm.list_crm_products(...) +
+
+ +#### 🔌 Usage
-**plan_type:** `typing.Optional[ListPlansRequestPlanType]` — Filter by plan type - -
-
-
-**q:** `typing.Optional[str]` - +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.crm.list_crm_products() + +```
+
+
+ +#### ⚙️ Parameters
-**without_entitlement_for:** `typing.Optional[str]` — Filter out plans that already have a plan entitlement for the specified feature ID +
+
+ +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
@@ -10493,7 +10952,7 @@ client.plans.list_plans()
-**without_product_id:** `typing.Optional[bool]` — Filter out plans that have a billing product ID +**name:** `typing.Optional[str]`
@@ -10529,7 +10988,7 @@ client.plans.list_plans()
-
client.plans.create_plan(...) +
client.crm.upsert_crm_product(...)
@@ -10547,10 +11006,15 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.plans.create_plan( +client.crm.upsert_crm_product( + currency="currency", description="description", + external_id="external_id", + interval="interval", name="name", - plan_type="plan", + price="price", + quantity=1, + sku="sku", ) ``` @@ -10567,6 +11031,14 @@ client.plans.create_plan(
+**currency:** `str` + +
+
+ +
+
+ **description:** `str`
@@ -10575,6 +11047,22 @@ client.plans.create_plan(
+**external_id:** `str` + +
+
+ +
+
+ +**interval:** `str` + +
+
+ +
+
+ **name:** `str`
@@ -10583,7 +11071,7 @@ client.plans.create_plan(
-**plan_type:** `CreatePlanRequestBodyPlanType` +**price:** `str`
@@ -10591,7 +11079,15 @@ client.plans.create_plan(
-**icon:** `typing.Optional[str]` +**quantity:** `int` + +
+
+ +
+
+ +**sku:** `str`
@@ -10611,7 +11107,8 @@ client.plans.create_plan(
-
client.plans.get_plan(...) +## events +
client.events.create_event_batch(...)
@@ -10624,13 +11121,17 @@ client.plans.create_plan(
```python -from schematic import Schematic +from schematic import CreateEventRequestBody, Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.plans.get_plan( - plan_id="plan_id", +client.events.create_event_batch( + events=[ + CreateEventRequestBody( + event_type="identify", + ) + ], ) ``` @@ -10647,7 +11148,7 @@ client.plans.get_plan(
-**plan_id:** `str` — plan_id +**events:** `typing.Sequence[CreateEventRequestBody]`
@@ -10667,7 +11168,7 @@ client.plans.get_plan(
-
client.plans.update_plan(...) +
client.events.get_event_summaries(...)
@@ -10685,10 +11186,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.plans.update_plan( - plan_id="plan_id", - name="name", -) +client.events.get_event_summaries() ```
@@ -10704,7 +11202,7 @@ client.plans.update_plan(
-**plan_id:** `str` — plan_id +**q:** `typing.Optional[str]`
@@ -10712,7 +11210,7 @@ client.plans.update_plan(
-**name:** `str` +**event_subtypes:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
@@ -10720,7 +11218,7 @@ client.plans.update_plan(
-**description:** `typing.Optional[str]` +**limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -10728,7 +11226,7 @@ client.plans.update_plan(
-**icon:** `typing.Optional[str]` +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -10748,7 +11246,7 @@ client.plans.update_plan(
-
client.plans.delete_plan(...) +
client.events.list_events(...)
@@ -10766,9 +11264,7 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.plans.delete_plan( - plan_id="plan_id", -) +client.events.list_events() ```
@@ -10784,7 +11280,7 @@ client.plans.delete_plan(
-**plan_id:** `str` — plan_id +**company_id:** `typing.Optional[str]`
@@ -10792,57 +11288,39 @@ client.plans.delete_plan(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**event_subtype:** `typing.Optional[str]`
- -
+
+
+**event_types:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +
-
-
client.plans.upsert_billing_product_plan(...)
-#### 🔌 Usage - -
-
+**flag_id:** `typing.Optional[str]` + +
+
-```python -from schematic import Schematic - -client = Schematic( - api_key="YOUR_API_KEY", -) -client.plans.upsert_billing_product_plan( - plan_id="plan_id", - is_free_plan=True, - is_trialable=True, -) - -``` -
-
+**user_id:** `typing.Optional[str]` +
-#### ⚙️ Parameters - -
-
-
-**plan_id:** `str` — plan_id +**limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -10850,7 +11328,7 @@ client.plans.upsert_billing_product_plan(
-**is_free_plan:** `bool` +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -10858,23 +11336,55 @@ client.plans.upsert_billing_product_plan(
-**is_trialable:** `bool` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+ + + +
+ +
client.events.create_event(...)
-**billing_product_id:** `typing.Optional[str]` - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic + +client = Schematic( + api_key="YOUR_API_KEY", +) +client.events.create_event( + event_type="identify", +) + +``` +
+
+#### ⚙️ Parameters +
-**monthly_price_id:** `typing.Optional[str]` +
+
+ +**event_type:** `CreateEventRequestBodyEventType` — Either 'identify' or 'track'
@@ -10882,7 +11392,7 @@ client.plans.upsert_billing_product_plan(
-**trial_days:** `typing.Optional[int]` +**body:** `typing.Optional[EventBody]`
@@ -10890,7 +11400,7 @@ client.plans.upsert_billing_product_plan(
-**yearly_price_id:** `typing.Optional[str]` +**sent_at:** `typing.Optional[dt.datetime]` — Optionally provide a timestamp at which the event was sent to Schematic
@@ -10910,7 +11420,7 @@ client.plans.upsert_billing_product_plan(
-
client.plans.count_plans(...) +
client.events.get_event(...)
@@ -10928,7 +11438,9 @@ from schematic import Schematic client = Schematic( api_key="YOUR_API_KEY", ) -client.plans.count_plans() +client.events.get_event( + event_id="event_id", +) ```
@@ -10944,7 +11456,7 @@ client.plans.count_plans()
-**company_id:** `typing.Optional[str]` +**event_id:** `str` — event_id
@@ -10952,67 +11464,49 @@ client.plans.count_plans()
-**has_product_id:** `typing.Optional[bool]` — Filter out plans that do not have a billing product ID +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` -
-
-
-**plan_type:** `typing.Optional[CountPlansRequestPlanType]` — Filter by plan type -
+
+
client.events.get_segment_integration_status()
-**q:** `typing.Optional[str]` - -
-
+#### 🔌 Usage
-**without_entitlement_for:** `typing.Optional[str]` — Filter out plans that already have a plan entitlement for the specified feature ID - -
-
-
-**without_product_id:** `typing.Optional[bool]` — Filter out plans that have a billing product ID - -
-
+```python +from schematic import Schematic -
-
+client = Schematic( + api_key="YOUR_API_KEY", +) +client.events.get_segment_integration_status() -**limit:** `typing.Optional[int]` — Page limit (default 100) - +``` +
+
+#### ⚙️ Parameters +
-**offset:** `typing.Optional[int]` — Page offset (default 0) - -
-
-
diff --git a/src/schematic/__init__.py b/src/schematic/__init__.py index 12f119a..fba1add 100644 --- a/src/schematic/__init__.py +++ b/src/schematic/__init__.py @@ -7,6 +7,7 @@ ApiKeyRequestResponseData, ApiKeyResponseData, AudienceRequestBody, + BillingCouponResponseData, BillingCustomerResponseData, BillingCustomerSubscription, BillingCustomerWithSubscriptionsResponseData, @@ -19,14 +20,19 @@ BillingProductPriceResponseData, BillingProductPricing, BillingProductResponseData, + BillingSubscriptionDiscount, + BillingSubscriptionDiscountView, BillingSubscriptionResponseData, BillingSubscriptionView, - CheckFlagOutputWithFlagKey, + ChangeSubscriptionInternalRequestBody, + ChangeSubscriptionRequestBody, CheckFlagRequestBody, CheckFlagResponseData, CheckFlagsResponseData, + CheckoutDataResponseData, CompanyCrmDealsResponseData, CompanyDetailResponseData, + CompanyEventPeriodMetricsResponseData, CompanyMembershipDetailResponseData, CompanyMembershipResponseData, CompanyOverrideResponseData, @@ -39,6 +45,7 @@ ComponentPreviewResponseData, ComponentResponseData, CountResponse, + CouponRequestBody, CreateEntitlementReqCommon, CreateEntitlementReqCommonMetricPeriod, CreateEntitlementReqCommonMetricPeriodMonthReset, @@ -108,6 +115,7 @@ PlanResponseData, PreviewObject, PreviewObjectResponseData, + PreviewSubscriptionChangeResponseData, RawEventBatchResponseData, RawEventResponseData, RuleConditionDetailResponseData, @@ -120,15 +128,18 @@ SegmentStatusResp, StripeEmbedInfo, TemporaryAccessTokenResponseData, + UpdateAddOnRequestBody, UpdateEntitlementReqCommon, UpdateEntitlementReqCommonMetricPeriod, UpdateEntitlementReqCommonMetricPeriodMonthReset, UpdateEntitlementReqCommonValueType, + UpdatePayInAdvanceRequestBody, UpdateRuleRequestBody, UpsertCompanyRequestBody, UpsertTraitRequestBody, UpsertUserRequestBody, UpsertUserSubRequestBody, + UsageBasedEntitlementRequestBody, UsageBasedEntitlementResponseData, UserDetailResponseData, UserResponseData, @@ -141,6 +152,7 @@ accesstokens, accounts, billing, + checkout, companies, components, crm, @@ -195,6 +207,7 @@ ListProductPricesResponse, SearchBillingPricesParams, SearchBillingPricesResponse, + UpsertBillingCouponResponse, UpsertBillingCustomerResponse, UpsertBillingMeterResponse, UpsertBillingPriceResponse, @@ -203,6 +216,12 @@ UpsertInvoiceResponse, UpsertPaymentMethodResponse, ) +from .checkout import ( + CheckoutInternalResponse, + GetCheckoutDataResponse, + PreviewCheckoutInternalResponse, + UpdateCustomerSubscriptionTrialEndResponse, +) from .client import AsyncSchematic, AsyncSchematicConfig, LocalCache, Schematic, SchematicConfig from .companies import ( CountCompaniesParams, @@ -340,7 +359,6 @@ GetEventResponse, GetEventSummariesParams, GetEventSummariesResponse, - GetEventSummaryBySubtypeResponse, GetSegmentIntegrationStatusResponse, ListEventsParams, ListEventsResponse, @@ -389,6 +407,7 @@ ListPlansResponse, ListPlansResponseParamsPlanType, UpdateAudienceResponse, + UpdateCompanyPlansResponse, UpdatePlanResponse, UpsertBillingProductPlanResponse, ) @@ -422,6 +441,7 @@ "AsyncSchematicConfig", "AudienceRequestBody", "BadRequestError", + "BillingCouponResponseData", "BillingCustomerResponseData", "BillingCustomerSubscription", "BillingCustomerWithSubscriptionsResponseData", @@ -434,16 +454,22 @@ "BillingProductPriceResponseData", "BillingProductPricing", "BillingProductResponseData", + "BillingSubscriptionDiscount", + "BillingSubscriptionDiscountView", "BillingSubscriptionResponseData", "BillingSubscriptionView", - "CheckFlagOutputWithFlagKey", + "ChangeSubscriptionInternalRequestBody", + "ChangeSubscriptionRequestBody", "CheckFlagRequestBody", "CheckFlagResponse", "CheckFlagResponseData", "CheckFlagsResponse", "CheckFlagsResponseData", + "CheckoutDataResponseData", + "CheckoutInternalResponse", "CompanyCrmDealsResponseData", "CompanyDetailResponseData", + "CompanyEventPeriodMetricsResponseData", "CompanyMembershipDetailResponseData", "CompanyMembershipResponseData", "CompanyOverrideResponseData", @@ -504,6 +530,7 @@ "CountWebhookEventsResponse", "CountWebhooksParams", "CountWebhooksResponse", + "CouponRequestBody", "CreateApiKeyResponse", "CreateCompanyOverrideRequestBodyMetricPeriod", "CreateCompanyOverrideRequestBodyMetricPeriodMonthReset", @@ -606,6 +633,7 @@ "GetApiKeyResponse", "GetApiRequestResponse", "GetAudienceResponse", + "GetCheckoutDataResponse", "GetCompanyOverrideResponse", "GetCompanyResponse", "GetComponentResponse", @@ -616,7 +644,6 @@ "GetEventResponse", "GetEventSummariesParams", "GetEventSummariesResponse", - "GetEventSummaryBySubtypeResponse", "GetFeatureResponse", "GetFeatureUsageByCompanyParams", "GetFeatureUsageByCompanyResponse", @@ -718,10 +745,12 @@ "PlanGroupPlanDetailResponseData", "PlanGroupResponseData", "PlanResponseData", + "PreviewCheckoutInternalResponse", "PreviewComponentDataParams", "PreviewComponentDataResponse", "PreviewObject", "PreviewObjectResponseData", + "PreviewSubscriptionChangeResponseData", "RawEventBatchResponseData", "RawEventResponseData", "RuleConditionDetailResponseData", @@ -740,15 +769,18 @@ "StripeEmbedInfo", "TemporaryAccessTokenResponseData", "UnauthorizedError", + "UpdateAddOnRequestBody", "UpdateApiKeyResponse", "UpdateAudienceResponse", "UpdateCompanyOverrideRequestBodyMetricPeriod", "UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset", "UpdateCompanyOverrideRequestBodyValueType", "UpdateCompanyOverrideResponse", + "UpdateCompanyPlansResponse", "UpdateComponentRequestBodyEntityType", "UpdateComponentRequestBodyState", "UpdateComponentResponse", + "UpdateCustomerSubscriptionTrialEndResponse", "UpdateEntitlementReqCommon", "UpdateEntitlementReqCommonMetricPeriod", "UpdateEntitlementReqCommonMetricPeriodMonthReset", @@ -761,6 +793,7 @@ "UpdateFeatureResponse", "UpdateFlagResponse", "UpdateFlagRulesResponse", + "UpdatePayInAdvanceRequestBody", "UpdatePlanEntitlementRequestBodyMetricPeriod", "UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset", "UpdatePlanEntitlementRequestBodyValueType", @@ -771,6 +804,7 @@ "UpdateWebhookRequestBodyRequestTypesItem", "UpdateWebhookRequestBodyStatus", "UpdateWebhookResponse", + "UpsertBillingCouponResponse", "UpsertBillingCustomerResponse", "UpsertBillingMeterResponse", "UpsertBillingPriceResponse", @@ -791,6 +825,7 @@ "UpsertUserResponse", "UpsertUserSubRequestBody", "UpsertUserTraitResponse", + "UsageBasedEntitlementRequestBody", "UsageBasedEntitlementResponseData", "UserDetailResponseData", "UserResponseData", @@ -801,6 +836,7 @@ "accesstokens", "accounts", "billing", + "checkout", "companies", "components", "crm", diff --git a/src/schematic/base_client.py b/src/schematic/base_client.py index 90dfab0..adeedb5 100644 --- a/src/schematic/base_client.py +++ b/src/schematic/base_client.py @@ -7,28 +7,27 @@ from .accounts.client import AccountsClient from .features.client import FeaturesClient from .billing.client import BillingClient +from .checkout.client import CheckoutClient from .companies.client import CompaniesClient from .entitlements.client import EntitlementsClient +from .plans.client import PlansClient from .components.client import ComponentsClient from .crm.client import CrmClient from .events.client import EventsClient -from .plans.client import PlansClient from .plangroups.client import PlangroupsClient from .accesstokens.client import AccesstokensClient from .webhooks.client import WebhooksClient -from .core.request_options import RequestOptions -from json.decoder import JSONDecodeError -from .core.api_error import ApiError from .core.client_wrapper import AsyncClientWrapper from .accounts.client import AsyncAccountsClient from .features.client import AsyncFeaturesClient from .billing.client import AsyncBillingClient +from .checkout.client import AsyncCheckoutClient from .companies.client import AsyncCompaniesClient from .entitlements.client import AsyncEntitlementsClient +from .plans.client import AsyncPlansClient from .components.client import AsyncComponentsClient from .crm.client import AsyncCrmClient from .events.client import AsyncEventsClient -from .plans.client import AsyncPlansClient from .plangroups.client import AsyncPlangroupsClient from .accesstokens.client import AsyncAccesstokensClient from .webhooks.client import AsyncWebhooksClient @@ -95,49 +94,17 @@ def __init__( self.accounts = AccountsClient(client_wrapper=self._client_wrapper) self.features = FeaturesClient(client_wrapper=self._client_wrapper) self.billing = BillingClient(client_wrapper=self._client_wrapper) + self.checkout = CheckoutClient(client_wrapper=self._client_wrapper) self.companies = CompaniesClient(client_wrapper=self._client_wrapper) self.entitlements = EntitlementsClient(client_wrapper=self._client_wrapper) + self.plans = PlansClient(client_wrapper=self._client_wrapper) self.components = ComponentsClient(client_wrapper=self._client_wrapper) self.crm = CrmClient(client_wrapper=self._client_wrapper) self.events = EventsClient(client_wrapper=self._client_wrapper) - self.plans = PlansClient(client_wrapper=self._client_wrapper) self.plangroups = PlangroupsClient(client_wrapper=self._client_wrapper) self.accesstokens = AccesstokensClient(client_wrapper=self._client_wrapper) self.webhooks = WebhooksClient(client_wrapper=self._client_wrapper) - def get_company_plans(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from schematic import Schematic - - client = Schematic( - api_key="YOUR_API_KEY", - ) - client.get_company_plans() - """ - _response = self._client_wrapper.httpx_client.request( - "company-plans", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - class AsyncBaseSchematic: """ @@ -200,57 +167,17 @@ def __init__( self.accounts = AsyncAccountsClient(client_wrapper=self._client_wrapper) self.features = AsyncFeaturesClient(client_wrapper=self._client_wrapper) self.billing = AsyncBillingClient(client_wrapper=self._client_wrapper) + self.checkout = AsyncCheckoutClient(client_wrapper=self._client_wrapper) self.companies = AsyncCompaniesClient(client_wrapper=self._client_wrapper) self.entitlements = AsyncEntitlementsClient(client_wrapper=self._client_wrapper) + self.plans = AsyncPlansClient(client_wrapper=self._client_wrapper) self.components = AsyncComponentsClient(client_wrapper=self._client_wrapper) self.crm = AsyncCrmClient(client_wrapper=self._client_wrapper) self.events = AsyncEventsClient(client_wrapper=self._client_wrapper) - self.plans = AsyncPlansClient(client_wrapper=self._client_wrapper) self.plangroups = AsyncPlangroupsClient(client_wrapper=self._client_wrapper) self.accesstokens = AsyncAccesstokensClient(client_wrapper=self._client_wrapper) self.webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper) - async def get_company_plans(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from schematic import AsyncSchematic - - client = AsyncSchematic( - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.get_company_plans() - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "company-plans", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SchematicEnvironment) -> str: if base_url is not None: diff --git a/src/schematic/billing/__init__.py b/src/schematic/billing/__init__.py index 377c2c6..a783de1 100644 --- a/src/schematic/billing/__init__.py +++ b/src/schematic/billing/__init__.py @@ -20,6 +20,7 @@ ListProductPricesResponse, SearchBillingPricesParams, SearchBillingPricesResponse, + UpsertBillingCouponResponse, UpsertBillingCustomerResponse, UpsertBillingMeterResponse, UpsertBillingPriceResponse, @@ -49,6 +50,7 @@ "ListProductPricesResponse", "SearchBillingPricesParams", "SearchBillingPricesResponse", + "UpsertBillingCouponResponse", "UpsertBillingCustomerResponse", "UpsertBillingMeterResponse", "UpsertBillingPriceResponse", diff --git a/src/schematic/billing/client.py b/src/schematic/billing/client.py index 202dc63..d92f108 100644 --- a/src/schematic/billing/client.py +++ b/src/schematic/billing/client.py @@ -3,7 +3,7 @@ import typing from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from .types.upsert_billing_customer_response import UpsertBillingCustomerResponse +from .types.upsert_billing_coupon_response import UpsertBillingCouponResponse from ..core.pydantic_utilities import parse_obj_as from ..errors.bad_request_error import BadRequestError from ..types.api_error import ApiError as types_api_error_ApiError @@ -12,6 +12,7 @@ from ..errors.internal_server_error import InternalServerError from json.decoder import JSONDecodeError from ..core.api_error import ApiError as core_api_error_ApiError +from .types.upsert_billing_customer_response import UpsertBillingCustomerResponse from .types.list_customers_response import ListCustomersResponse from .types.count_customers_response import CountCustomersResponse from .types.list_invoices_response import ListInvoicesResponse @@ -29,6 +30,7 @@ from .types.upsert_billing_product_response import UpsertBillingProductResponse from .types.list_billing_products_response import ListBillingProductsResponse from .types.count_billing_products_response import CountBillingProductsResponse +from ..types.billing_subscription_discount import BillingSubscriptionDiscount from ..types.billing_product_pricing import BillingProductPricing from .types.upsert_billing_subscription_response import UpsertBillingSubscriptionResponse from ..core.serialization import convert_and_respect_annotation_metadata @@ -42,6 +44,141 @@ class BillingClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def upsert_billing_coupon( + self, + *, + amount_off: int, + duration: str, + duration_in_months: int, + external_id: str, + max_redemptions: int, + name: str, + percent_off: float, + times_redeemed: int, + currency: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpsertBillingCouponResponse: + """ + Parameters + ---------- + amount_off : int + + duration : str + + duration_in_months : int + + external_id : str + + max_redemptions : int + + name : str + + percent_off : float + + times_redeemed : int + + currency : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpsertBillingCouponResponse + Created + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.billing.upsert_billing_coupon( + amount_off=1, + duration="duration", + duration_in_months=1, + external_id="external_id", + max_redemptions=1, + name="name", + percent_off=1.1, + times_redeemed=1, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "billing/coupons", + method="POST", + json={ + "amount_off": amount_off, + "currency": currency, + "duration": duration, + "duration_in_months": duration_in_months, + "external_id": external_id, + "max_redemptions": max_redemptions, + "name": name, + "percent_off": percent_off, + "times_redeemed": times_redeemed, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + UpsertBillingCouponResponse, + parse_obj_as( + type_=UpsertBillingCouponResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + def upsert_billing_customer( self, *, @@ -1218,6 +1355,7 @@ def upsert_billing_price( *, currency: str, interval: str, + is_active: bool, price: int, price_external_id: str, product_external_id: str, @@ -1232,6 +1370,8 @@ def upsert_billing_price( interval : str + is_active : bool + price : int price_external_id : str @@ -1260,6 +1400,7 @@ def upsert_billing_price( client.billing.upsert_billing_price( currency="currency", interval="interval", + is_active=True, price=1, price_external_id="price_external_id", product_external_id="product_external_id", @@ -1272,6 +1413,7 @@ def upsert_billing_price( json={ "currency": currency, "interval": interval, + "is_active": is_active, "meter_id": meter_id, "price": price, "price_external_id": price_external_id, @@ -1927,6 +2069,7 @@ def upsert_billing_subscription( *, currency: str, customer_external_id: str, + discounts: typing.Sequence[BillingSubscriptionDiscount], expired_at: dt.datetime, product_external_ids: typing.Sequence[BillingProductPricing], subscription_external_id: str, @@ -1937,6 +2080,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[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertBillingSubscriptionResponse: """ @@ -1946,6 +2090,8 @@ def upsert_billing_subscription( customer_external_id : str + discounts : typing.Sequence[BillingSubscriptionDiscount] + expired_at : dt.datetime product_external_ids : typing.Sequence[BillingProductPricing] @@ -1966,6 +2112,8 @@ def upsert_billing_subscription( trial_end : typing.Optional[int] + trial_end_setting : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1978,7 +2126,11 @@ def upsert_billing_subscription( -------- import datetime - from schematic import BillingProductPricing, Schematic + from schematic import ( + BillingProductPricing, + BillingSubscriptionDiscount, + Schematic, + ) client = Schematic( api_key="YOUR_API_KEY", @@ -1986,6 +2138,16 @@ def upsert_billing_subscription( client.billing.upsert_billing_subscription( currency="currency", customer_external_id="customer_external_id", + discounts=[ + BillingSubscriptionDiscount( + coupon_external_id="coupon_external_id", + external_id="external_id", + is_active=True, + started_at=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + ], expired_at=datetime.datetime.fromisoformat( "2024-01-15 09:30:00+00:00", ), @@ -2010,6 +2172,9 @@ def upsert_billing_subscription( json={ "currency": currency, "customer_external_id": customer_external_id, + "discounts": convert_and_respect_annotation_metadata( + object_=discounts, annotation=typing.Sequence[BillingSubscriptionDiscount], direction="write" + ), "expired_at": expired_at, "interval": interval, "metadata": metadata, @@ -2022,6 +2187,7 @@ def upsert_billing_subscription( "subscription_external_id": subscription_external_id, "total_price": total_price, "trial_end": trial_end, + "trial_end_setting": trial_end_setting, }, headers={ "content-type": "application/json", @@ -2088,6 +2254,149 @@ class AsyncBillingClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + async def upsert_billing_coupon( + self, + *, + amount_off: int, + duration: str, + duration_in_months: int, + external_id: str, + max_redemptions: int, + name: str, + percent_off: float, + times_redeemed: int, + currency: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpsertBillingCouponResponse: + """ + Parameters + ---------- + amount_off : int + + duration : str + + duration_in_months : int + + external_id : str + + max_redemptions : int + + name : str + + percent_off : float + + times_redeemed : int + + currency : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpsertBillingCouponResponse + Created + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.billing.upsert_billing_coupon( + amount_off=1, + duration="duration", + duration_in_months=1, + external_id="external_id", + max_redemptions=1, + name="name", + percent_off=1.1, + times_redeemed=1, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "billing/coupons", + method="POST", + json={ + "amount_off": amount_off, + "currency": currency, + "duration": duration, + "duration_in_months": duration_in_months, + "external_id": external_id, + "max_redemptions": max_redemptions, + "name": name, + "percent_off": percent_off, + "times_redeemed": times_redeemed, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + UpsertBillingCouponResponse, + parse_obj_as( + type_=UpsertBillingCouponResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + async def upsert_billing_customer( self, *, @@ -3344,6 +3653,7 @@ async def upsert_billing_price( *, currency: str, interval: str, + is_active: bool, price: int, price_external_id: str, product_external_id: str, @@ -3358,6 +3668,8 @@ async def upsert_billing_price( interval : str + is_active : bool + price : int price_external_id : str @@ -3391,6 +3703,7 @@ async def main() -> None: await client.billing.upsert_billing_price( currency="currency", interval="interval", + is_active=True, price=1, price_external_id="price_external_id", product_external_id="product_external_id", @@ -3406,6 +3719,7 @@ async def main() -> None: json={ "currency": currency, "interval": interval, + "is_active": is_active, "meter_id": meter_id, "price": price, "price_external_id": price_external_id, @@ -4101,6 +4415,7 @@ async def upsert_billing_subscription( *, currency: str, customer_external_id: str, + discounts: typing.Sequence[BillingSubscriptionDiscount], expired_at: dt.datetime, product_external_ids: typing.Sequence[BillingProductPricing], subscription_external_id: str, @@ -4111,6 +4426,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[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertBillingSubscriptionResponse: """ @@ -4120,6 +4436,8 @@ async def upsert_billing_subscription( customer_external_id : str + discounts : typing.Sequence[BillingSubscriptionDiscount] + expired_at : dt.datetime product_external_ids : typing.Sequence[BillingProductPricing] @@ -4140,6 +4458,8 @@ async def upsert_billing_subscription( trial_end : typing.Optional[int] + trial_end_setting : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4153,7 +4473,11 @@ async def upsert_billing_subscription( import asyncio import datetime - from schematic import AsyncSchematic, BillingProductPricing + from schematic import ( + AsyncSchematic, + BillingProductPricing, + BillingSubscriptionDiscount, + ) client = AsyncSchematic( api_key="YOUR_API_KEY", @@ -4164,6 +4488,16 @@ async def main() -> None: await client.billing.upsert_billing_subscription( currency="currency", customer_external_id="customer_external_id", + discounts=[ + BillingSubscriptionDiscount( + coupon_external_id="coupon_external_id", + external_id="external_id", + is_active=True, + started_at=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + ], expired_at=datetime.datetime.fromisoformat( "2024-01-15 09:30:00+00:00", ), @@ -4191,6 +4525,9 @@ async def main() -> None: json={ "currency": currency, "customer_external_id": customer_external_id, + "discounts": convert_and_respect_annotation_metadata( + object_=discounts, annotation=typing.Sequence[BillingSubscriptionDiscount], direction="write" + ), "expired_at": expired_at, "interval": interval, "metadata": metadata, @@ -4203,6 +4540,7 @@ async def main() -> None: "subscription_external_id": subscription_external_id, "total_price": total_price, "trial_end": trial_end, + "trial_end_setting": trial_end_setting, }, headers={ "content-type": "application/json", diff --git a/src/schematic/billing/types/__init__.py b/src/schematic/billing/types/__init__.py index 414a4ef..79ece5e 100644 --- a/src/schematic/billing/types/__init__.py +++ b/src/schematic/billing/types/__init__.py @@ -19,6 +19,7 @@ from .list_product_prices_response import ListProductPricesResponse from .search_billing_prices_params import SearchBillingPricesParams from .search_billing_prices_response import SearchBillingPricesResponse +from .upsert_billing_coupon_response import UpsertBillingCouponResponse from .upsert_billing_customer_response import UpsertBillingCustomerResponse from .upsert_billing_meter_response import UpsertBillingMeterResponse from .upsert_billing_price_response import UpsertBillingPriceResponse @@ -47,6 +48,7 @@ "ListProductPricesResponse", "SearchBillingPricesParams", "SearchBillingPricesResponse", + "UpsertBillingCouponResponse", "UpsertBillingCustomerResponse", "UpsertBillingMeterResponse", "UpsertBillingPriceResponse", diff --git a/src/schematic/billing/types/upsert_billing_coupon_response.py b/src/schematic/billing/types/upsert_billing_coupon_response.py new file mode 100644 index 0000000..a35eaf1 --- /dev/null +++ b/src/schematic/billing/types/upsert_billing_coupon_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.pydantic_utilities import UniversalBaseModel +from ...types.billing_coupon_response_data import BillingCouponResponseData +import typing +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpsertBillingCouponResponse(UniversalBaseModel): + data: BillingCouponResponseData + 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/__init__.py b/src/schematic/checkout/__init__.py new file mode 100644 index 0000000..fa8be8e --- /dev/null +++ b/src/schematic/checkout/__init__.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import ( + CheckoutInternalResponse, + GetCheckoutDataResponse, + PreviewCheckoutInternalResponse, + UpdateCustomerSubscriptionTrialEndResponse, +) + +__all__ = [ + "CheckoutInternalResponse", + "GetCheckoutDataResponse", + "PreviewCheckoutInternalResponse", + "UpdateCustomerSubscriptionTrialEndResponse", +] diff --git a/src/schematic/checkout/client.py b/src/schematic/checkout/client.py new file mode 100644 index 0000000..396e3bc --- /dev/null +++ b/src/schematic/checkout/client.py @@ -0,0 +1,1019 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +from ..types.update_add_on_request_body import UpdateAddOnRequestBody +from ..types.update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody +from ..core.request_options import RequestOptions +from .types.checkout_internal_response import CheckoutInternalResponse +from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.pydantic_utilities import parse_obj_as +from ..errors.bad_request_error import BadRequestError +from ..types.api_error import ApiError as types_api_error_ApiError +from ..errors.unauthorized_error import UnauthorizedError +from ..errors.forbidden_error import ForbiddenError +from ..errors.internal_server_error import InternalServerError +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError as core_api_error_ApiError +from .types.get_checkout_data_response import GetCheckoutDataResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..errors.not_found_error import NotFoundError +from .types.preview_checkout_internal_response import PreviewCheckoutInternalResponse +import datetime as dt +from .types.update_customer_subscription_trial_end_response import UpdateCustomerSubscriptionTrialEndResponse +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class CheckoutClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def internal( + self, + *, + add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + company_id: str, + new_plan_id: str, + new_price_id: str, + pay_in_advance: typing.Sequence[UpdatePayInAdvanceRequestBody], + payment_method_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CheckoutInternalResponse: + """ + Parameters + ---------- + add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + + company_id : str + + new_plan_id : str + + new_price_id : str + + pay_in_advance : typing.Sequence[UpdatePayInAdvanceRequestBody] + + payment_method_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CheckoutInternalResponse + Created + + Examples + -------- + from schematic import ( + Schematic, + UpdateAddOnRequestBody, + UpdatePayInAdvanceRequestBody, + ) + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.checkout.internal( + add_on_ids=[ + UpdateAddOnRequestBody( + add_on_id="add_on_id", + price_id="price_id", + ) + ], + company_id="company_id", + new_plan_id="new_plan_id", + new_price_id="new_price_id", + pay_in_advance=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], + ) + """ + _response = self._client_wrapper.httpx_client.request( + "checkout-internal", + method="POST", + json={ + "add_on_ids": convert_and_respect_annotation_metadata( + object_=add_on_ids, annotation=typing.Sequence[UpdateAddOnRequestBody], direction="write" + ), + "company_id": company_id, + "new_plan_id": new_plan_id, + "new_price_id": new_price_id, + "pay_in_advance": convert_and_respect_annotation_metadata( + object_=pay_in_advance, annotation=typing.Sequence[UpdatePayInAdvanceRequestBody], direction="write" + ), + "payment_method_id": payment_method_id, + "promo_code": promo_code, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + CheckoutInternalResponse, + parse_obj_as( + type_=CheckoutInternalResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + + def get_checkout_data( + self, checkout_internal_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetCheckoutDataResponse: + """ + Parameters + ---------- + checkout_internal_id : str + checkout_internal_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetCheckoutDataResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.checkout.get_checkout_data( + checkout_internal_id="checkout_internal_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"checkout-internal/{jsonable_encoder(checkout_internal_id)}/data", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + GetCheckoutDataResponse, + parse_obj_as( + type_=GetCheckoutDataResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + + def preview_checkout_internal( + self, + *, + add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + company_id: str, + new_plan_id: str, + new_price_id: str, + pay_in_advance: typing.Sequence[UpdatePayInAdvanceRequestBody], + payment_method_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> PreviewCheckoutInternalResponse: + """ + Parameters + ---------- + add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + + company_id : str + + new_plan_id : str + + new_price_id : str + + pay_in_advance : typing.Sequence[UpdatePayInAdvanceRequestBody] + + payment_method_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PreviewCheckoutInternalResponse + OK + + Examples + -------- + from schematic import ( + Schematic, + UpdateAddOnRequestBody, + UpdatePayInAdvanceRequestBody, + ) + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.checkout.preview_checkout_internal( + add_on_ids=[ + UpdateAddOnRequestBody( + add_on_id="add_on_id", + price_id="price_id", + ) + ], + company_id="company_id", + new_plan_id="new_plan_id", + new_price_id="new_price_id", + pay_in_advance=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], + ) + """ + _response = self._client_wrapper.httpx_client.request( + "checkout-internal/preview", + method="POST", + json={ + "add_on_ids": convert_and_respect_annotation_metadata( + object_=add_on_ids, annotation=typing.Sequence[UpdateAddOnRequestBody], direction="write" + ), + "company_id": company_id, + "new_plan_id": new_plan_id, + "new_price_id": new_price_id, + "pay_in_advance": convert_and_respect_annotation_metadata( + object_=pay_in_advance, annotation=typing.Sequence[UpdatePayInAdvanceRequestBody], direction="write" + ), + "payment_method_id": payment_method_id, + "promo_code": promo_code, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PreviewCheckoutInternalResponse, + parse_obj_as( + type_=PreviewCheckoutInternalResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + + def update_customer_subscription_trial_end( + self, + subscription_id: str, + *, + trial_end: typing.Optional[dt.datetime] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdateCustomerSubscriptionTrialEndResponse: + """ + Parameters + ---------- + subscription_id : str + subscription_id + + trial_end : typing.Optional[dt.datetime] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdateCustomerSubscriptionTrialEndResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.checkout.update_customer_subscription_trial_end( + subscription_id="subscription_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"subscription/{jsonable_encoder(subscription_id)}/edit-trial-end", + method="PUT", + json={ + "trial_end": trial_end, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + UpdateCustomerSubscriptionTrialEndResponse, + parse_obj_as( + type_=UpdateCustomerSubscriptionTrialEndResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncCheckoutClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def internal( + self, + *, + add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + company_id: str, + new_plan_id: str, + new_price_id: str, + pay_in_advance: typing.Sequence[UpdatePayInAdvanceRequestBody], + payment_method_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CheckoutInternalResponse: + """ + Parameters + ---------- + add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + + company_id : str + + new_plan_id : str + + new_price_id : str + + pay_in_advance : typing.Sequence[UpdatePayInAdvanceRequestBody] + + payment_method_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CheckoutInternalResponse + Created + + Examples + -------- + import asyncio + + from schematic import ( + AsyncSchematic, + UpdateAddOnRequestBody, + UpdatePayInAdvanceRequestBody, + ) + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.checkout.internal( + add_on_ids=[ + UpdateAddOnRequestBody( + add_on_id="add_on_id", + price_id="price_id", + ) + ], + company_id="company_id", + new_plan_id="new_plan_id", + new_price_id="new_price_id", + pay_in_advance=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "checkout-internal", + method="POST", + json={ + "add_on_ids": convert_and_respect_annotation_metadata( + object_=add_on_ids, annotation=typing.Sequence[UpdateAddOnRequestBody], direction="write" + ), + "company_id": company_id, + "new_plan_id": new_plan_id, + "new_price_id": new_price_id, + "pay_in_advance": convert_and_respect_annotation_metadata( + object_=pay_in_advance, annotation=typing.Sequence[UpdatePayInAdvanceRequestBody], direction="write" + ), + "payment_method_id": payment_method_id, + "promo_code": promo_code, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + CheckoutInternalResponse, + parse_obj_as( + type_=CheckoutInternalResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + + async def get_checkout_data( + self, checkout_internal_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetCheckoutDataResponse: + """ + Parameters + ---------- + checkout_internal_id : str + checkout_internal_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetCheckoutDataResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.checkout.get_checkout_data( + checkout_internal_id="checkout_internal_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"checkout-internal/{jsonable_encoder(checkout_internal_id)}/data", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + GetCheckoutDataResponse, + parse_obj_as( + type_=GetCheckoutDataResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + + async def preview_checkout_internal( + self, + *, + add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + company_id: str, + new_plan_id: str, + new_price_id: str, + pay_in_advance: typing.Sequence[UpdatePayInAdvanceRequestBody], + payment_method_id: typing.Optional[str] = OMIT, + promo_code: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> PreviewCheckoutInternalResponse: + """ + Parameters + ---------- + add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + + company_id : str + + new_plan_id : str + + new_price_id : str + + pay_in_advance : typing.Sequence[UpdatePayInAdvanceRequestBody] + + payment_method_id : typing.Optional[str] + + promo_code : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PreviewCheckoutInternalResponse + OK + + Examples + -------- + import asyncio + + from schematic import ( + AsyncSchematic, + UpdateAddOnRequestBody, + UpdatePayInAdvanceRequestBody, + ) + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.checkout.preview_checkout_internal( + add_on_ids=[ + UpdateAddOnRequestBody( + add_on_id="add_on_id", + price_id="price_id", + ) + ], + company_id="company_id", + new_plan_id="new_plan_id", + new_price_id="new_price_id", + pay_in_advance=[ + UpdatePayInAdvanceRequestBody( + price_id="price_id", + quantity=1, + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "checkout-internal/preview", + method="POST", + json={ + "add_on_ids": convert_and_respect_annotation_metadata( + object_=add_on_ids, annotation=typing.Sequence[UpdateAddOnRequestBody], direction="write" + ), + "company_id": company_id, + "new_plan_id": new_plan_id, + "new_price_id": new_price_id, + "pay_in_advance": convert_and_respect_annotation_metadata( + object_=pay_in_advance, annotation=typing.Sequence[UpdatePayInAdvanceRequestBody], direction="write" + ), + "payment_method_id": payment_method_id, + "promo_code": promo_code, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + PreviewCheckoutInternalResponse, + parse_obj_as( + type_=PreviewCheckoutInternalResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + + async def update_customer_subscription_trial_end( + self, + subscription_id: str, + *, + trial_end: typing.Optional[dt.datetime] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdateCustomerSubscriptionTrialEndResponse: + """ + Parameters + ---------- + subscription_id : str + subscription_id + + trial_end : typing.Optional[dt.datetime] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdateCustomerSubscriptionTrialEndResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.checkout.update_customer_subscription_trial_end( + subscription_id="subscription_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"subscription/{jsonable_encoder(subscription_id)}/edit-trial-end", + method="PUT", + json={ + "trial_end": trial_end, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + UpdateCustomerSubscriptionTrialEndResponse, + parse_obj_as( + type_=UpdateCustomerSubscriptionTrialEndResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/schematic/checkout/types/__init__.py b/src/schematic/checkout/types/__init__.py new file mode 100644 index 0000000..3b3037a --- /dev/null +++ b/src/schematic/checkout/types/__init__.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +from .checkout_internal_response import CheckoutInternalResponse +from .get_checkout_data_response import GetCheckoutDataResponse +from .preview_checkout_internal_response import PreviewCheckoutInternalResponse +from .update_customer_subscription_trial_end_response import UpdateCustomerSubscriptionTrialEndResponse + +__all__ = [ + "CheckoutInternalResponse", + "GetCheckoutDataResponse", + "PreviewCheckoutInternalResponse", + "UpdateCustomerSubscriptionTrialEndResponse", +] diff --git a/src/schematic/checkout/types/checkout_internal_response.py b/src/schematic/checkout/types/checkout_internal_response.py new file mode 100644 index 0000000..ee0ae11 --- /dev/null +++ b/src/schematic/checkout/types/checkout_internal_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.pydantic_utilities import UniversalBaseModel +from ...types.billing_subscription_response_data import BillingSubscriptionResponseData +import typing +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CheckoutInternalResponse(UniversalBaseModel): + data: BillingSubscriptionResponseData + 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/events/types/get_event_summary_by_subtype_response.py b/src/schematic/checkout/types/get_checkout_data_response.py similarity index 79% rename from src/schematic/events/types/get_event_summary_by_subtype_response.py rename to src/schematic/checkout/types/get_checkout_data_response.py index 79c807f..fefa1d8 100644 --- a/src/schematic/events/types/get_event_summary_by_subtype_response.py +++ b/src/schematic/checkout/types/get_checkout_data_response.py @@ -1,14 +1,14 @@ # This file was auto-generated by Fern from our API Definition. from ...core.pydantic_utilities import UniversalBaseModel -from ...types.event_summary_response_data import EventSummaryResponseData +from ...types.checkout_data_response_data import CheckoutDataResponseData import typing import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2 -class GetEventSummaryBySubtypeResponse(UniversalBaseModel): - data: EventSummaryResponseData +class GetCheckoutDataResponse(UniversalBaseModel): + data: CheckoutDataResponseData params: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() """ Input parameters diff --git a/src/schematic/checkout/types/preview_checkout_internal_response.py b/src/schematic/checkout/types/preview_checkout_internal_response.py new file mode 100644 index 0000000..967a6c8 --- /dev/null +++ b/src/schematic/checkout/types/preview_checkout_internal_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.pydantic_utilities import UniversalBaseModel +from ...types.preview_subscription_change_response_data import PreviewSubscriptionChangeResponseData +import typing +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 + + +class PreviewCheckoutInternalResponse(UniversalBaseModel): + data: PreviewSubscriptionChangeResponseData + 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/update_customer_subscription_trial_end_response.py b/src/schematic/checkout/types/update_customer_subscription_trial_end_response.py new file mode 100644 index 0000000..4fc3054 --- /dev/null +++ b/src/schematic/checkout/types/update_customer_subscription_trial_end_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.pydantic_utilities import UniversalBaseModel +from ...types.billing_subscription_view import BillingSubscriptionView +import typing +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateCustomerSubscriptionTrialEndResponse(UniversalBaseModel): + data: BillingSubscriptionView + 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/client.py b/src/schematic/companies/client.py index 31be254..51676cd 100644 --- a/src/schematic/companies/client.py +++ b/src/schematic/companies/client.py @@ -86,10 +86,10 @@ def list_companies( Parameters ---------- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp\_) + Filter companies by multiple company IDs (starts with comp_) plan_id : typing.Optional[str] - Filter companies by plan ID (starts with plan\_) + Filter companies by plan ID (starts with plan_) q : typing.Optional[str] Search for companies by name, keys or string traits @@ -496,10 +496,10 @@ def count_companies( Parameters ---------- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp\_) + Filter companies by multiple company IDs (starts with comp_) plan_id : typing.Optional[str] - Filter companies by plan ID (starts with plan\_) + Filter companies by plan ID (starts with plan_) q : typing.Optional[str] Search for companies by name, keys or string traits @@ -2501,13 +2501,13 @@ def list_users( Parameters ---------- company_id : typing.Optional[str] - Filter users by company ID (starts with comp\_) + Filter users by company ID (starts with comp_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter users by multiple user IDs (starts with user\_) + Filter users by multiple user IDs (starts with user_) plan_id : typing.Optional[str] - Filter users by plan ID (starts with plan\_) + Filter users by plan ID (starts with plan_) q : typing.Optional[str] Search for users by name, keys or string traits @@ -2915,13 +2915,13 @@ def count_users( Parameters ---------- company_id : typing.Optional[str] - Filter users by company ID (starts with comp\_) + Filter users by company ID (starts with comp_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter users by multiple user IDs (starts with user\_) + Filter users by multiple user IDs (starts with user_) plan_id : typing.Optional[str] - Filter users by plan ID (starts with plan\_) + Filter users by plan ID (starts with plan_) q : typing.Optional[str] Search for users by name, keys or string traits @@ -3346,10 +3346,10 @@ async def list_companies( Parameters ---------- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp\_) + Filter companies by multiple company IDs (starts with comp_) plan_id : typing.Optional[str] - Filter companies by plan ID (starts with plan\_) + Filter companies by plan ID (starts with plan_) q : typing.Optional[str] Search for companies by name, keys or string traits @@ -3788,10 +3788,10 @@ async def count_companies( Parameters ---------- ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter companies by multiple company IDs (starts with comp\_) + Filter companies by multiple company IDs (starts with comp_) plan_id : typing.Optional[str] - Filter companies by plan ID (starts with plan\_) + Filter companies by plan ID (starts with plan_) q : typing.Optional[str] Search for companies by name, keys or string traits @@ -5945,13 +5945,13 @@ async def list_users( Parameters ---------- company_id : typing.Optional[str] - Filter users by company ID (starts with comp\_) + Filter users by company ID (starts with comp_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter users by multiple user IDs (starts with user\_) + Filter users by multiple user IDs (starts with user_) plan_id : typing.Optional[str] - Filter users by plan ID (starts with plan\_) + Filter users by plan ID (starts with plan_) q : typing.Optional[str] Search for users by name, keys or string traits @@ -6393,13 +6393,13 @@ async def count_users( Parameters ---------- company_id : typing.Optional[str] - Filter users by company ID (starts with comp\_) + Filter users by company ID (starts with comp_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter users by multiple user IDs (starts with user\_) + Filter users by multiple user IDs (starts with user_) plan_id : typing.Optional[str] - Filter users by plan ID (starts with plan\_) + Filter users by plan ID (starts with plan_) q : typing.Optional[str] Search for users by name, keys or string traits diff --git a/src/schematic/companies/types/count_companies_params.py b/src/schematic/companies/types/count_companies_params.py index 3efb4ea..40350ad 100644 --- a/src/schematic/companies/types/count_companies_params.py +++ b/src/schematic/companies/types/count_companies_params.py @@ -13,7 +13,7 @@ class CountCompaniesParams(UniversalBaseModel): ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter companies by multiple company IDs (starts with comp\_) + Filter companies by multiple company IDs (starts with comp_) """ limit: typing.Optional[int] = pydantic.Field(default=None) @@ -28,7 +28,7 @@ class CountCompaniesParams(UniversalBaseModel): plan_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter companies by plan ID (starts with plan\_) + Filter companies by plan ID (starts with plan_) """ q: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/schematic/companies/types/count_users_params.py b/src/schematic/companies/types/count_users_params.py index 4f93e50..94a3519 100644 --- a/src/schematic/companies/types/count_users_params.py +++ b/src/schematic/companies/types/count_users_params.py @@ -13,12 +13,12 @@ class CountUsersParams(UniversalBaseModel): company_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter users by company ID (starts with comp\_) + Filter users by company ID (starts with comp_) """ ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter users by multiple user IDs (starts with user\_) + Filter users by multiple user IDs (starts with user_) """ limit: typing.Optional[int] = pydantic.Field(default=None) @@ -33,7 +33,7 @@ class CountUsersParams(UniversalBaseModel): plan_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter users by plan ID (starts with plan\_) + Filter users by plan ID (starts with plan_) """ q: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/schematic/companies/types/list_companies_params.py b/src/schematic/companies/types/list_companies_params.py index b1c2ddb..5cb549e 100644 --- a/src/schematic/companies/types/list_companies_params.py +++ b/src/schematic/companies/types/list_companies_params.py @@ -13,7 +13,7 @@ class ListCompaniesParams(UniversalBaseModel): ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter companies by multiple company IDs (starts with comp\_) + Filter companies by multiple company IDs (starts with comp_) """ limit: typing.Optional[int] = pydantic.Field(default=None) @@ -28,7 +28,7 @@ class ListCompaniesParams(UniversalBaseModel): plan_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter companies by plan ID (starts with plan\_) + Filter companies by plan ID (starts with plan_) """ q: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/schematic/companies/types/list_users_params.py b/src/schematic/companies/types/list_users_params.py index 248d8eb..ac4c21f 100644 --- a/src/schematic/companies/types/list_users_params.py +++ b/src/schematic/companies/types/list_users_params.py @@ -13,12 +13,12 @@ class ListUsersParams(UniversalBaseModel): company_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter users by company ID (starts with comp\_) + Filter users by company ID (starts with comp_) """ ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter users by multiple user IDs (starts with user\_) + Filter users by multiple user IDs (starts with user_) """ limit: typing.Optional[int] = pydantic.Field(default=None) @@ -33,7 +33,7 @@ class ListUsersParams(UniversalBaseModel): plan_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter users by plan ID (starts with plan\_) + Filter users by plan ID (starts with plan_) """ q: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/schematic/core/client_wrapper.py b/src/schematic/core/client_wrapper.py index 773c60b..334ec07 100644 --- a/src/schematic/core/client_wrapper.py +++ b/src/schematic/core/client_wrapper.py @@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "schematichq", - "X-Fern-SDK-Version": "1.0.5", + "X-Fern-SDK-Version": "1.0.6", } headers["X-Schematic-Api-Key"] = self.api_key return headers diff --git a/src/schematic/entitlements/client.py b/src/schematic/entitlements/client.py index 5bc6784..3cc013d 100644 --- a/src/schematic/entitlements/client.py +++ b/src/schematic/entitlements/client.py @@ -71,6 +71,7 @@ def list_company_overrides( feature_id: typing.Optional[str] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + without_expired: typing.Optional[bool] = None, q: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -80,19 +81,22 @@ def list_company_overrides( Parameters ---------- company_id : typing.Optional[str] - Filter company overrides by a single company ID (starting with comp\_) + Filter company overrides by a single company ID (starting with comp_) company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple company IDs (starting with comp\_) + Filter company overrides by multiple company IDs (starting with comp_) feature_id : typing.Optional[str] - Filter company overrides by a single feature ID (starting with feat\_) + Filter company overrides by a single feature ID (starting with feat_) feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple feature IDs (starting with feat\_) + Filter company overrides by multiple feature IDs (starting with feat_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple company override IDs (starting with cmov\_) + Filter company overrides by multiple company override IDs (starting with cmov_) + + without_expired : typing.Optional[bool] + Filter company overrides by whether they have not expired q : typing.Optional[str] Search for company overrides by feature or company name @@ -129,6 +133,7 @@ def list_company_overrides( "feature_id": feature_id, "feature_ids": feature_ids, "ids": ids, + "without_expired": without_expired, "q": q, "limit": limit, "offset": offset, @@ -196,8 +201,6 @@ def create_company_override( feature_id: str, value_type: CreateCompanyOverrideRequestBodyValueType, expiration_date: typing.Optional[dt.datetime] = OMIT, - metered_monthly_price_id: typing.Optional[str] = OMIT, - metered_yearly_price_id: typing.Optional[str] = OMIT, metric_period: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -216,10 +219,6 @@ def create_company_override( expiration_date : typing.Optional[dt.datetime] - metered_monthly_price_id : typing.Optional[str] - - metered_yearly_price_id : typing.Optional[str] - metric_period : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] metric_period_month_reset : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] @@ -258,8 +257,6 @@ def create_company_override( "company_id": company_id, "expiration_date": expiration_date, "feature_id": feature_id, - "metered_monthly_price_id": metered_monthly_price_id, - "metered_yearly_price_id": metered_yearly_price_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, "value_bool": value_bool, @@ -420,8 +417,6 @@ def update_company_override( *, value_type: UpdateCompanyOverrideRequestBodyValueType, expiration_date: typing.Optional[dt.datetime] = OMIT, - metered_monthly_price_id: typing.Optional[str] = OMIT, - metered_yearly_price_id: typing.Optional[str] = OMIT, metric_period: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -439,10 +434,6 @@ def update_company_override( expiration_date : typing.Optional[dt.datetime] - metered_monthly_price_id : typing.Optional[str] - - metered_yearly_price_id : typing.Optional[str] - metric_period : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] metric_period_month_reset : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] @@ -478,8 +469,6 @@ def update_company_override( method="PUT", json={ "expiration_date": expiration_date, - "metered_monthly_price_id": metered_monthly_price_id, - "metered_yearly_price_id": metered_yearly_price_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, "value_bool": value_bool, @@ -652,6 +641,7 @@ def count_company_overrides( feature_id: typing.Optional[str] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + without_expired: typing.Optional[bool] = None, q: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -661,19 +651,22 @@ def count_company_overrides( Parameters ---------- company_id : typing.Optional[str] - Filter company overrides by a single company ID (starting with comp\_) + Filter company overrides by a single company ID (starting with comp_) company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple company IDs (starting with comp\_) + Filter company overrides by multiple company IDs (starting with comp_) feature_id : typing.Optional[str] - Filter company overrides by a single feature ID (starting with feat\_) + Filter company overrides by a single feature ID (starting with feat_) feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple feature IDs (starting with feat\_) + Filter company overrides by multiple feature IDs (starting with feat_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple company override IDs (starting with cmov\_) + Filter company overrides by multiple company override IDs (starting with cmov_) + + without_expired : typing.Optional[bool] + Filter company overrides by whether they have not expired q : typing.Optional[str] Search for company overrides by feature or company name @@ -710,6 +703,7 @@ def count_company_overrides( "feature_id": feature_id, "feature_ids": feature_ids, "ids": ids, + "without_expired": without_expired, "q": q, "limit": limit, "offset": offset, @@ -1444,19 +1438,19 @@ def list_plan_entitlements( Parameters ---------- feature_id : typing.Optional[str] - Filter plan entitlements by a single feature ID (starting with feat\_) + Filter plan entitlements by a single feature ID (starting with feat_) feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple feature IDs (starting with feat\_) + Filter plan entitlements by multiple feature IDs (starting with feat_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple plan entitlement IDs (starting with pltl\_) + Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_) plan_id : typing.Optional[str] - Filter plan entitlements by a single plan ID (starting with plan\_) + Filter plan entitlements by a single plan ID (starting with plan_) plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple plan IDs (starting with plan\_) + Filter plan entitlements by multiple plan IDs (starting with plan_) q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -1563,8 +1557,6 @@ def create_plan_entitlement( feature_id: str, plan_id: str, value_type: CreatePlanEntitlementRequestBodyValueType, - metered_monthly_price_id: typing.Optional[str] = OMIT, - metered_yearly_price_id: typing.Optional[str] = OMIT, metric_period: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriodMonthReset] = OMIT, monthly_metered_price_id: typing.Optional[str] = OMIT, @@ -1584,10 +1576,6 @@ def create_plan_entitlement( value_type : CreatePlanEntitlementRequestBodyValueType - metered_monthly_price_id : typing.Optional[str] - - metered_yearly_price_id : typing.Optional[str] - metric_period : typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] metric_period_month_reset : typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriodMonthReset] @@ -1630,8 +1618,6 @@ def create_plan_entitlement( method="POST", json={ "feature_id": feature_id, - "metered_monthly_price_id": metered_monthly_price_id, - "metered_yearly_price_id": metered_yearly_price_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, "monthly_metered_price_id": monthly_metered_price_id, @@ -1795,13 +1781,14 @@ def update_plan_entitlement( plan_entitlement_id: str, *, value_type: UpdatePlanEntitlementRequestBodyValueType, - metered_monthly_price_id: typing.Optional[str] = OMIT, - metered_yearly_price_id: typing.Optional[str] = OMIT, metric_period: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset] = OMIT, + monthly_metered_price_id: typing.Optional[str] = OMIT, + price_behavior: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_numeric: typing.Optional[int] = OMIT, value_trait_id: typing.Optional[str] = OMIT, + yearly_metered_price_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpdatePlanEntitlementResponse: """ @@ -1812,20 +1799,22 @@ def update_plan_entitlement( value_type : UpdatePlanEntitlementRequestBodyValueType - metered_monthly_price_id : typing.Optional[str] - - metered_yearly_price_id : typing.Optional[str] - metric_period : typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] metric_period_month_reset : typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset] + monthly_metered_price_id : typing.Optional[str] + + price_behavior : typing.Optional[str] + value_bool : typing.Optional[bool] value_numeric : typing.Optional[int] value_trait_id : typing.Optional[str] + yearly_metered_price_id : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1850,14 +1839,15 @@ def update_plan_entitlement( f"plan-entitlements/{jsonable_encoder(plan_entitlement_id)}", method="PUT", json={ - "metered_monthly_price_id": metered_monthly_price_id, - "metered_yearly_price_id": metered_yearly_price_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, + "monthly_metered_price_id": monthly_metered_price_id, + "price_behavior": price_behavior, "value_bool": value_bool, "value_numeric": value_numeric, "value_trait_id": value_trait_id, "value_type": value_type, + "yearly_metered_price_id": yearly_metered_price_id, }, headers={ "content-type": "application/json", @@ -2034,19 +2024,19 @@ def count_plan_entitlements( Parameters ---------- feature_id : typing.Optional[str] - Filter plan entitlements by a single feature ID (starting with feat\_) + Filter plan entitlements by a single feature ID (starting with feat_) feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple feature IDs (starting with feat\_) + Filter plan entitlements by multiple feature IDs (starting with feat_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple plan entitlement IDs (starting with pltl\_) + Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_) plan_id : typing.Optional[str] - Filter plan entitlements by a single plan ID (starting with plan\_) + Filter plan entitlements by a single plan ID (starting with plan_) plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple plan IDs (starting with plan\_) + Filter plan entitlements by multiple plan IDs (starting with plan_) q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -2253,6 +2243,7 @@ async def list_company_overrides( feature_id: typing.Optional[str] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + without_expired: typing.Optional[bool] = None, q: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -2262,19 +2253,22 @@ async def list_company_overrides( Parameters ---------- company_id : typing.Optional[str] - Filter company overrides by a single company ID (starting with comp\_) + Filter company overrides by a single company ID (starting with comp_) company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple company IDs (starting with comp\_) + Filter company overrides by multiple company IDs (starting with comp_) feature_id : typing.Optional[str] - Filter company overrides by a single feature ID (starting with feat\_) + Filter company overrides by a single feature ID (starting with feat_) feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple feature IDs (starting with feat\_) + Filter company overrides by multiple feature IDs (starting with feat_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple company override IDs (starting with cmov\_) + Filter company overrides by multiple company override IDs (starting with cmov_) + + without_expired : typing.Optional[bool] + Filter company overrides by whether they have not expired q : typing.Optional[str] Search for company overrides by feature or company name @@ -2319,6 +2313,7 @@ async def main() -> None: "feature_id": feature_id, "feature_ids": feature_ids, "ids": ids, + "without_expired": without_expired, "q": q, "limit": limit, "offset": offset, @@ -2386,8 +2381,6 @@ async def create_company_override( feature_id: str, value_type: CreateCompanyOverrideRequestBodyValueType, expiration_date: typing.Optional[dt.datetime] = OMIT, - metered_monthly_price_id: typing.Optional[str] = OMIT, - metered_yearly_price_id: typing.Optional[str] = OMIT, metric_period: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -2406,10 +2399,6 @@ async def create_company_override( expiration_date : typing.Optional[dt.datetime] - metered_monthly_price_id : typing.Optional[str] - - metered_yearly_price_id : typing.Optional[str] - metric_period : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriod] metric_period_month_reset : typing.Optional[CreateCompanyOverrideRequestBodyMetricPeriodMonthReset] @@ -2456,8 +2445,6 @@ async def main() -> None: "company_id": company_id, "expiration_date": expiration_date, "feature_id": feature_id, - "metered_monthly_price_id": metered_monthly_price_id, - "metered_yearly_price_id": metered_yearly_price_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, "value_bool": value_bool, @@ -2626,8 +2613,6 @@ async def update_company_override( *, value_type: UpdateCompanyOverrideRequestBodyValueType, expiration_date: typing.Optional[dt.datetime] = OMIT, - metered_monthly_price_id: typing.Optional[str] = OMIT, - metered_yearly_price_id: typing.Optional[str] = OMIT, metric_period: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -2645,10 +2630,6 @@ async def update_company_override( expiration_date : typing.Optional[dt.datetime] - metered_monthly_price_id : typing.Optional[str] - - metered_yearly_price_id : typing.Optional[str] - metric_period : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriod] metric_period_month_reset : typing.Optional[UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset] @@ -2692,8 +2673,6 @@ async def main() -> None: method="PUT", json={ "expiration_date": expiration_date, - "metered_monthly_price_id": metered_monthly_price_id, - "metered_yearly_price_id": metered_yearly_price_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, "value_bool": value_bool, @@ -2874,6 +2853,7 @@ async def count_company_overrides( feature_id: typing.Optional[str] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + without_expired: typing.Optional[bool] = None, q: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -2883,19 +2863,22 @@ async def count_company_overrides( Parameters ---------- company_id : typing.Optional[str] - Filter company overrides by a single company ID (starting with comp\_) + Filter company overrides by a single company ID (starting with comp_) company_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple company IDs (starting with comp\_) + Filter company overrides by multiple company IDs (starting with comp_) feature_id : typing.Optional[str] - Filter company overrides by a single feature ID (starting with feat\_) + Filter company overrides by a single feature ID (starting with feat_) feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple feature IDs (starting with feat\_) + Filter company overrides by multiple feature IDs (starting with feat_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter company overrides by multiple company override IDs (starting with cmov\_) + Filter company overrides by multiple company override IDs (starting with cmov_) + + without_expired : typing.Optional[bool] + Filter company overrides by whether they have not expired q : typing.Optional[str] Search for company overrides by feature or company name @@ -2940,6 +2923,7 @@ async def main() -> None: "feature_id": feature_id, "feature_ids": feature_ids, "ids": ids, + "without_expired": without_expired, "q": q, "limit": limit, "offset": offset, @@ -3722,19 +3706,19 @@ async def list_plan_entitlements( Parameters ---------- feature_id : typing.Optional[str] - Filter plan entitlements by a single feature ID (starting with feat\_) + Filter plan entitlements by a single feature ID (starting with feat_) feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple feature IDs (starting with feat\_) + Filter plan entitlements by multiple feature IDs (starting with feat_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple plan entitlement IDs (starting with pltl\_) + Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_) plan_id : typing.Optional[str] - Filter plan entitlements by a single plan ID (starting with plan\_) + Filter plan entitlements by a single plan ID (starting with plan_) plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple plan IDs (starting with plan\_) + Filter plan entitlements by multiple plan IDs (starting with plan_) q : typing.Optional[str] Search for plan entitlements by feature or company name @@ -3849,8 +3833,6 @@ async def create_plan_entitlement( feature_id: str, plan_id: str, value_type: CreatePlanEntitlementRequestBodyValueType, - metered_monthly_price_id: typing.Optional[str] = OMIT, - metered_yearly_price_id: typing.Optional[str] = OMIT, metric_period: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriodMonthReset] = OMIT, monthly_metered_price_id: typing.Optional[str] = OMIT, @@ -3870,10 +3852,6 @@ async def create_plan_entitlement( value_type : CreatePlanEntitlementRequestBodyValueType - metered_monthly_price_id : typing.Optional[str] - - metered_yearly_price_id : typing.Optional[str] - metric_period : typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriod] metric_period_month_reset : typing.Optional[CreatePlanEntitlementRequestBodyMetricPeriodMonthReset] @@ -3924,8 +3902,6 @@ async def main() -> None: method="POST", json={ "feature_id": feature_id, - "metered_monthly_price_id": metered_monthly_price_id, - "metered_yearly_price_id": metered_yearly_price_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, "monthly_metered_price_id": monthly_metered_price_id, @@ -4097,13 +4073,14 @@ async def update_plan_entitlement( plan_entitlement_id: str, *, value_type: UpdatePlanEntitlementRequestBodyValueType, - metered_monthly_price_id: typing.Optional[str] = OMIT, - metered_yearly_price_id: typing.Optional[str] = OMIT, metric_period: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] = OMIT, metric_period_month_reset: typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset] = OMIT, + monthly_metered_price_id: typing.Optional[str] = OMIT, + price_behavior: typing.Optional[str] = OMIT, value_bool: typing.Optional[bool] = OMIT, value_numeric: typing.Optional[int] = OMIT, value_trait_id: typing.Optional[str] = OMIT, + yearly_metered_price_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpdatePlanEntitlementResponse: """ @@ -4114,20 +4091,22 @@ async def update_plan_entitlement( value_type : UpdatePlanEntitlementRequestBodyValueType - metered_monthly_price_id : typing.Optional[str] - - metered_yearly_price_id : typing.Optional[str] - metric_period : typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriod] metric_period_month_reset : typing.Optional[UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset] + monthly_metered_price_id : typing.Optional[str] + + price_behavior : typing.Optional[str] + value_bool : typing.Optional[bool] value_numeric : typing.Optional[int] value_trait_id : typing.Optional[str] + yearly_metered_price_id : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4160,14 +4139,15 @@ async def main() -> None: f"plan-entitlements/{jsonable_encoder(plan_entitlement_id)}", method="PUT", json={ - "metered_monthly_price_id": metered_monthly_price_id, - "metered_yearly_price_id": metered_yearly_price_id, "metric_period": metric_period, "metric_period_month_reset": metric_period_month_reset, + "monthly_metered_price_id": monthly_metered_price_id, + "price_behavior": price_behavior, "value_bool": value_bool, "value_numeric": value_numeric, "value_trait_id": value_trait_id, "value_type": value_type, + "yearly_metered_price_id": yearly_metered_price_id, }, headers={ "content-type": "application/json", @@ -4352,19 +4332,19 @@ async def count_plan_entitlements( Parameters ---------- feature_id : typing.Optional[str] - Filter plan entitlements by a single feature ID (starting with feat\_) + Filter plan entitlements by a single feature ID (starting with feat_) feature_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple feature IDs (starting with feat\_) + Filter plan entitlements by multiple feature IDs (starting with feat_) ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple plan entitlement IDs (starting with pltl\_) + Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_) plan_id : typing.Optional[str] - Filter plan entitlements by a single plan ID (starting with plan\_) + Filter plan entitlements by a single plan ID (starting with plan_) plan_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - Filter plan entitlements by multiple plan IDs (starting with plan\_) + Filter plan entitlements by multiple plan IDs (starting with plan_) q : typing.Optional[str] Search for plan entitlements by feature or company name diff --git a/src/schematic/entitlements/types/count_company_overrides_params.py b/src/schematic/entitlements/types/count_company_overrides_params.py index 9dc788c..38846a6 100644 --- a/src/schematic/entitlements/types/count_company_overrides_params.py +++ b/src/schematic/entitlements/types/count_company_overrides_params.py @@ -13,27 +13,27 @@ class CountCompanyOverridesParams(UniversalBaseModel): company_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter company overrides by a single company ID (starting with comp\_) + Filter company overrides by a single company ID (starting with comp_) """ company_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter company overrides by multiple company IDs (starting with comp\_) + Filter company overrides by multiple company IDs (starting with comp_) """ feature_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter company overrides by a single feature ID (starting with feat\_) + Filter company overrides by a single feature ID (starting with feat_) """ feature_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter company overrides by multiple feature IDs (starting with feat\_) + Filter company overrides by multiple feature IDs (starting with feat_) """ ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter company overrides by multiple company override IDs (starting with cmov\_) + Filter company overrides by multiple company override IDs (starting with cmov_) """ limit: typing.Optional[int] = pydantic.Field(default=None) @@ -51,6 +51,11 @@ class CountCompanyOverridesParams(UniversalBaseModel): Search for company overrides by feature or company name """ + without_expired: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter company overrides by whether they have not expired + """ + 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/entitlements/types/count_plan_entitlements_params.py b/src/schematic/entitlements/types/count_plan_entitlements_params.py index ecc52bf..e984b14 100644 --- a/src/schematic/entitlements/types/count_plan_entitlements_params.py +++ b/src/schematic/entitlements/types/count_plan_entitlements_params.py @@ -13,17 +13,17 @@ class CountPlanEntitlementsParams(UniversalBaseModel): feature_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter plan entitlements by a single feature ID (starting with feat\_) + Filter plan entitlements by a single feature ID (starting with feat_) """ feature_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter plan entitlements by multiple feature IDs (starting with feat\_) + Filter plan entitlements by multiple feature IDs (starting with feat_) """ ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter plan entitlements by multiple plan entitlement IDs (starting with pltl\_) + Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_) """ limit: typing.Optional[int] = pydantic.Field(default=None) @@ -38,12 +38,12 @@ class CountPlanEntitlementsParams(UniversalBaseModel): plan_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter plan entitlements by a single plan ID (starting with plan\_) + Filter plan entitlements by a single plan ID (starting with plan_) """ plan_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter plan entitlements by multiple plan IDs (starting with plan\_) + Filter plan entitlements by multiple plan IDs (starting with plan_) """ q: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/schematic/entitlements/types/create_company_override_request_body_metric_period.py b/src/schematic/entitlements/types/create_company_override_request_body_metric_period.py index ce0e825..beda67a 100644 --- a/src/schematic/entitlements/types/create_company_override_request_body_metric_period.py +++ b/src/schematic/entitlements/types/create_company_override_request_body_metric_period.py @@ -3,5 +3,5 @@ import typing CreateCompanyOverrideRequestBodyMetricPeriod = typing.Union[ - typing.Literal["all_time", "billing", "current_month", "current_week", "current_day"], typing.Any + typing.Literal["all_time", "current_month", "current_week", "current_day"], typing.Any ] diff --git a/src/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period.py b/src/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period.py index b412e68..0bcfcd1 100644 --- a/src/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period.py +++ b/src/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period.py @@ -3,5 +3,5 @@ import typing CreatePlanEntitlementRequestBodyMetricPeriod = typing.Union[ - typing.Literal["all_time", "billing", "current_month", "current_week", "current_day"], typing.Any + typing.Literal["all_time", "current_month", "current_week", "current_day"], typing.Any ] diff --git a/src/schematic/entitlements/types/list_company_overrides_params.py b/src/schematic/entitlements/types/list_company_overrides_params.py index e31727f..1b28f4d 100644 --- a/src/schematic/entitlements/types/list_company_overrides_params.py +++ b/src/schematic/entitlements/types/list_company_overrides_params.py @@ -13,27 +13,27 @@ class ListCompanyOverridesParams(UniversalBaseModel): company_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter company overrides by a single company ID (starting with comp\_) + Filter company overrides by a single company ID (starting with comp_) """ company_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter company overrides by multiple company IDs (starting with comp\_) + Filter company overrides by multiple company IDs (starting with comp_) """ feature_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter company overrides by a single feature ID (starting with feat\_) + Filter company overrides by a single feature ID (starting with feat_) """ feature_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter company overrides by multiple feature IDs (starting with feat\_) + Filter company overrides by multiple feature IDs (starting with feat_) """ ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter company overrides by multiple company override IDs (starting with cmov\_) + Filter company overrides by multiple company override IDs (starting with cmov_) """ limit: typing.Optional[int] = pydantic.Field(default=None) @@ -51,6 +51,11 @@ class ListCompanyOverridesParams(UniversalBaseModel): Search for company overrides by feature or company name """ + without_expired: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter company overrides by whether they have not expired + """ + 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/entitlements/types/list_plan_entitlements_params.py b/src/schematic/entitlements/types/list_plan_entitlements_params.py index ff3d764..3b6da49 100644 --- a/src/schematic/entitlements/types/list_plan_entitlements_params.py +++ b/src/schematic/entitlements/types/list_plan_entitlements_params.py @@ -13,17 +13,17 @@ class ListPlanEntitlementsParams(UniversalBaseModel): feature_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter plan entitlements by a single feature ID (starting with feat\_) + Filter plan entitlements by a single feature ID (starting with feat_) """ feature_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter plan entitlements by multiple feature IDs (starting with feat\_) + Filter plan entitlements by multiple feature IDs (starting with feat_) """ ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter plan entitlements by multiple plan entitlement IDs (starting with pltl\_) + Filter plan entitlements by multiple plan entitlement IDs (starting with pltl_) """ limit: typing.Optional[int] = pydantic.Field(default=None) @@ -38,12 +38,12 @@ class ListPlanEntitlementsParams(UniversalBaseModel): plan_id: typing.Optional[str] = pydantic.Field(default=None) """ - Filter plan entitlements by a single plan ID (starting with plan\_) + Filter plan entitlements by a single plan ID (starting with plan_) """ plan_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) """ - Filter plan entitlements by multiple plan IDs (starting with plan\_) + Filter plan entitlements by multiple plan IDs (starting with plan_) """ q: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/schematic/entitlements/types/update_company_override_request_body_metric_period.py b/src/schematic/entitlements/types/update_company_override_request_body_metric_period.py index e48e086..d92b779 100644 --- a/src/schematic/entitlements/types/update_company_override_request_body_metric_period.py +++ b/src/schematic/entitlements/types/update_company_override_request_body_metric_period.py @@ -3,5 +3,5 @@ import typing UpdateCompanyOverrideRequestBodyMetricPeriod = typing.Union[ - typing.Literal["all_time", "billing", "current_month", "current_week", "current_day"], typing.Any + typing.Literal["all_time", "current_month", "current_week", "current_day"], typing.Any ] diff --git a/src/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period.py b/src/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period.py index c2e7b24..53cd841 100644 --- a/src/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period.py +++ b/src/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period.py @@ -3,5 +3,5 @@ import typing UpdatePlanEntitlementRequestBodyMetricPeriod = typing.Union[ - typing.Literal["all_time", "billing", "current_month", "current_week", "current_day"], typing.Any + typing.Literal["all_time", "current_month", "current_week", "current_day"], typing.Any ] diff --git a/src/schematic/events/__init__.py b/src/schematic/events/__init__.py index 4a199ae..5cbb386 100644 --- a/src/schematic/events/__init__.py +++ b/src/schematic/events/__init__.py @@ -6,7 +6,6 @@ GetEventResponse, GetEventSummariesParams, GetEventSummariesResponse, - GetEventSummaryBySubtypeResponse, GetSegmentIntegrationStatusResponse, ListEventsParams, ListEventsResponse, @@ -18,7 +17,6 @@ "GetEventResponse", "GetEventSummariesParams", "GetEventSummariesResponse", - "GetEventSummaryBySubtypeResponse", "GetSegmentIntegrationStatusResponse", "ListEventsParams", "ListEventsResponse", diff --git a/src/schematic/events/client.py b/src/schematic/events/client.py index 4ecabfe..4f3adb4 100644 --- a/src/schematic/events/client.py +++ b/src/schematic/events/client.py @@ -15,15 +15,14 @@ from json.decoder import JSONDecodeError from ..core.api_error import ApiError as core_api_error_ApiError from .types.get_event_summaries_response import GetEventSummariesResponse -from .types.get_event_summary_by_subtype_response import GetEventSummaryBySubtypeResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..errors.not_found_error import NotFoundError from .types.list_events_response import ListEventsResponse from ..types.create_event_request_body_event_type import CreateEventRequestBodyEventType from ..types.event_body import EventBody import datetime as dt from .types.create_event_response import CreateEventResponse from .types.get_event_response import GetEventResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..errors.not_found_error import NotFoundError from .types.get_segment_integration_status_response import GetSegmentIntegrationStatusResponse from ..core.client_wrapper import AsyncClientWrapper @@ -241,93 +240,6 @@ def get_event_summaries( raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) - def get_event_summary_by_subtype( - self, key: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> GetEventSummaryBySubtypeResponse: - """ - Parameters - ---------- - key : str - key - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetEventSummaryBySubtypeResponse - OK - - Examples - -------- - from schematic import Schematic - - client = Schematic( - api_key="YOUR_API_KEY", - ) - client.events.get_event_summary_by_subtype( - key="key", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"event-types/{jsonable_encoder(key)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - GetEventSummaryBySubtypeResponse, - parse_obj_as( - type_=GetEventSummaryBySubtypeResponse, # type: ignore - object_=_response.json(), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - 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( - 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( - 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( - 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, body=_response.text) - raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) - def list_events( self, *, @@ -941,101 +853,6 @@ async def main() -> None: raise core_api_error_ApiError(status_code=_response.status_code, body=_response.text) raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) - async def get_event_summary_by_subtype( - self, key: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> GetEventSummaryBySubtypeResponse: - """ - Parameters - ---------- - key : str - key - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - GetEventSummaryBySubtypeResponse - OK - - Examples - -------- - import asyncio - - from schematic import AsyncSchematic - - client = AsyncSchematic( - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.events.get_event_summary_by_subtype( - key="key", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"event-types/{jsonable_encoder(key)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - GetEventSummaryBySubtypeResponse, - parse_obj_as( - type_=GetEventSummaryBySubtypeResponse, # type: ignore - object_=_response.json(), - ), - ) - if _response.status_code == 401: - raise UnauthorizedError( - 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( - 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( - 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( - 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, body=_response.text) - raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) - async def list_events( self, *, diff --git a/src/schematic/events/types/__init__.py b/src/schematic/events/types/__init__.py index 5560213..3a182ea 100644 --- a/src/schematic/events/types/__init__.py +++ b/src/schematic/events/types/__init__.py @@ -5,7 +5,6 @@ from .get_event_response import GetEventResponse from .get_event_summaries_params import GetEventSummariesParams from .get_event_summaries_response import GetEventSummariesResponse -from .get_event_summary_by_subtype_response import GetEventSummaryBySubtypeResponse from .get_segment_integration_status_response import GetSegmentIntegrationStatusResponse from .list_events_params import ListEventsParams from .list_events_response import ListEventsResponse @@ -16,7 +15,6 @@ "GetEventResponse", "GetEventSummariesParams", "GetEventSummariesResponse", - "GetEventSummaryBySubtypeResponse", "GetSegmentIntegrationStatusResponse", "ListEventsParams", "ListEventsResponse", diff --git a/src/schematic/plans/__init__.py b/src/schematic/plans/__init__.py index c593a35..db9ac85 100644 --- a/src/schematic/plans/__init__.py +++ b/src/schematic/plans/__init__.py @@ -16,6 +16,7 @@ ListPlansResponse, ListPlansResponseParamsPlanType, UpdateAudienceResponse, + UpdateCompanyPlansResponse, UpdatePlanResponse, UpsertBillingProductPlanResponse, ) @@ -36,6 +37,7 @@ "ListPlansResponse", "ListPlansResponseParamsPlanType", "UpdateAudienceResponse", + "UpdateCompanyPlansResponse", "UpdatePlanResponse", "UpsertBillingProductPlanResponse", ] diff --git a/src/schematic/plans/client.py b/src/schematic/plans/client.py index ebd57ef..3861550 100644 --- a/src/schematic/plans/client.py +++ b/src/schematic/plans/client.py @@ -3,21 +3,22 @@ import typing from ..core.client_wrapper import SyncClientWrapper from ..core.request_options import RequestOptions -from .types.get_audience_response import GetAudienceResponse +from .types.update_company_plans_response import UpdateCompanyPlansResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.pydantic_utilities import parse_obj_as -from ..errors.unauthorized_error import UnauthorizedError +from ..errors.bad_request_error import BadRequestError from ..types.api_error import ApiError as types_api_error_ApiError +from ..errors.unauthorized_error import UnauthorizedError from ..errors.forbidden_error import ForbiddenError from ..errors.not_found_error import NotFoundError from ..errors.internal_server_error import InternalServerError from json.decoder import JSONDecodeError from ..core.api_error import ApiError as core_api_error_ApiError +from .types.get_audience_response import GetAudienceResponse from ..types.create_or_update_condition_group_request_body import CreateOrUpdateConditionGroupRequestBody from ..types.create_or_update_condition_request_body import CreateOrUpdateConditionRequestBody from .types.update_audience_response import UpdateAudienceResponse from ..core.serialization import convert_and_respect_annotation_metadata -from ..errors.bad_request_error import BadRequestError from .types.delete_audience_response import DeleteAudienceResponse from .types.list_plans_request_plan_type import ListPlansRequestPlanType from .types.list_plans_response import ListPlansResponse @@ -39,6 +40,121 @@ class PlansClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def update_company_plans( + self, + company_plan_id: str, + *, + add_on_ids: typing.Sequence[str], + base_plan_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdateCompanyPlansResponse: + """ + Parameters + ---------- + company_plan_id : str + company_plan_id + + add_on_ids : typing.Sequence[str] + + base_plan_id : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdateCompanyPlansResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.plans.update_company_plans( + company_plan_id="company_plan_id", + add_on_ids=["add_on_ids"], + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"company-plans/{jsonable_encoder(company_plan_id)}", + method="PUT", + json={ + "add_on_ids": add_on_ids, + "base_plan_id": base_plan_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + UpdateCompanyPlansResponse, + parse_obj_as( + type_=UpdateCompanyPlansResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + def get_audience( self, plan_audience_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAudienceResponse: @@ -367,6 +483,7 @@ def list_plans( q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, + without_paid_product_id: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -392,6 +509,9 @@ def list_plans( without_product_id : typing.Optional[bool] Filter out plans that have a billing product ID + without_paid_product_id : typing.Optional[bool] + Filter out plans that have a paid billing product ID + limit : typing.Optional[int] Page limit (default 100) @@ -426,6 +546,7 @@ def list_plans( "q": q, "without_entitlement_for": without_entitlement_for, "without_product_id": without_product_id, + "without_paid_product_id": without_paid_product_id, "limit": limit, "offset": offset, }, @@ -1028,6 +1149,7 @@ def count_plans( q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, + without_paid_product_id: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -1053,6 +1175,9 @@ def count_plans( without_product_id : typing.Optional[bool] Filter out plans that have a billing product ID + without_paid_product_id : typing.Optional[bool] + Filter out plans that have a paid billing product ID + limit : typing.Optional[int] Page limit (default 100) @@ -1087,6 +1212,7 @@ def count_plans( "q": q, "without_entitlement_for": without_entitlement_for, "without_product_id": without_product_id, + "without_paid_product_id": without_paid_product_id, "limit": limit, "offset": offset, }, @@ -1151,6 +1277,129 @@ class AsyncPlansClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + async def update_company_plans( + self, + company_plan_id: str, + *, + add_on_ids: typing.Sequence[str], + base_plan_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> UpdateCompanyPlansResponse: + """ + Parameters + ---------- + company_plan_id : str + company_plan_id + + add_on_ids : typing.Sequence[str] + + base_plan_id : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UpdateCompanyPlansResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.plans.update_company_plans( + company_plan_id="company_plan_id", + add_on_ids=["add_on_ids"], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"company-plans/{jsonable_encoder(company_plan_id)}", + method="PUT", + json={ + "add_on_ids": add_on_ids, + "base_plan_id": base_plan_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + UpdateCompanyPlansResponse, + parse_obj_as( + type_=UpdateCompanyPlansResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestError( + 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( + 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( + 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( + 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( + 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, body=_response.text) + raise core_api_error_ApiError(status_code=_response.status_code, body=_response_json) + async def get_audience( self, plan_audience_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetAudienceResponse: @@ -1503,6 +1752,7 @@ async def list_plans( q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, + without_paid_product_id: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -1528,6 +1778,9 @@ async def list_plans( without_product_id : typing.Optional[bool] Filter out plans that have a billing product ID + without_paid_product_id : typing.Optional[bool] + Filter out plans that have a paid billing product ID + limit : typing.Optional[int] Page limit (default 100) @@ -1570,6 +1823,7 @@ async def main() -> None: "q": q, "without_entitlement_for": without_entitlement_for, "without_product_id": without_product_id, + "without_paid_product_id": without_paid_product_id, "limit": limit, "offset": offset, }, @@ -2214,6 +2468,7 @@ async def count_plans( q: typing.Optional[str] = None, without_entitlement_for: typing.Optional[str] = None, without_product_id: typing.Optional[bool] = None, + without_paid_product_id: typing.Optional[bool] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -2239,6 +2494,9 @@ async def count_plans( without_product_id : typing.Optional[bool] Filter out plans that have a billing product ID + without_paid_product_id : typing.Optional[bool] + Filter out plans that have a paid billing product ID + limit : typing.Optional[int] Page limit (default 100) @@ -2281,6 +2539,7 @@ async def main() -> None: "q": q, "without_entitlement_for": without_entitlement_for, "without_product_id": without_product_id, + "without_paid_product_id": without_paid_product_id, "limit": limit, "offset": offset, }, diff --git a/src/schematic/plans/types/__init__.py b/src/schematic/plans/types/__init__.py index c4103dd..f647e90 100644 --- a/src/schematic/plans/types/__init__.py +++ b/src/schematic/plans/types/__init__.py @@ -15,6 +15,7 @@ from .list_plans_response import ListPlansResponse from .list_plans_response_params_plan_type import ListPlansResponseParamsPlanType from .update_audience_response import UpdateAudienceResponse +from .update_company_plans_response import UpdateCompanyPlansResponse from .update_plan_response import UpdatePlanResponse from .upsert_billing_product_plan_response import UpsertBillingProductPlanResponse @@ -34,6 +35,7 @@ "ListPlansResponse", "ListPlansResponseParamsPlanType", "UpdateAudienceResponse", + "UpdateCompanyPlansResponse", "UpdatePlanResponse", "UpsertBillingProductPlanResponse", ] diff --git a/src/schematic/plans/types/count_plans_params.py b/src/schematic/plans/types/count_plans_params.py index 70d9071..8a36986 100644 --- a/src/schematic/plans/types/count_plans_params.py +++ b/src/schematic/plans/types/count_plans_params.py @@ -40,6 +40,11 @@ class CountPlansParams(UniversalBaseModel): Filter out plans that already have a plan entitlement for the specified feature ID """ + without_paid_product_id: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter out plans that have a paid billing product ID + """ + without_product_id: typing.Optional[bool] = pydantic.Field(default=None) """ Filter out plans that have a billing product ID diff --git a/src/schematic/plans/types/list_plans_params.py b/src/schematic/plans/types/list_plans_params.py index e433140..26d581f 100644 --- a/src/schematic/plans/types/list_plans_params.py +++ b/src/schematic/plans/types/list_plans_params.py @@ -40,6 +40,11 @@ class ListPlansParams(UniversalBaseModel): Filter out plans that already have a plan entitlement for the specified feature ID """ + without_paid_product_id: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter out plans that have a paid billing product ID + """ + without_product_id: typing.Optional[bool] = pydantic.Field(default=None) """ Filter out plans that have a billing product ID diff --git a/src/schematic/plans/types/update_company_plans_response.py b/src/schematic/plans/types/update_company_plans_response.py new file mode 100644 index 0000000..559dd6a --- /dev/null +++ b/src/schematic/plans/types/update_company_plans_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.pydantic_utilities import UniversalBaseModel +from ...types.company_detail_response_data import CompanyDetailResponseData +import typing +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 + + +class UpdateCompanyPlansResponse(UniversalBaseModel): + data: CompanyDetailResponseData + 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/types/__init__.py b/src/schematic/types/__init__.py index 701ae6e..5f9aced 100644 --- a/src/schematic/types/__init__.py +++ b/src/schematic/types/__init__.py @@ -6,6 +6,7 @@ from .api_key_request_response_data import ApiKeyRequestResponseData from .api_key_response_data import ApiKeyResponseData from .audience_request_body import AudienceRequestBody +from .billing_coupon_response_data import BillingCouponResponseData from .billing_customer_response_data import BillingCustomerResponseData from .billing_customer_subscription import BillingCustomerSubscription from .billing_customer_with_subscriptions_response_data import BillingCustomerWithSubscriptionsResponseData @@ -18,14 +19,19 @@ from .billing_product_price_response_data import BillingProductPriceResponseData from .billing_product_pricing import BillingProductPricing from .billing_product_response_data import BillingProductResponseData +from .billing_subscription_discount import BillingSubscriptionDiscount +from .billing_subscription_discount_view import BillingSubscriptionDiscountView from .billing_subscription_response_data import BillingSubscriptionResponseData from .billing_subscription_view import BillingSubscriptionView -from .check_flag_output_with_flag_key import CheckFlagOutputWithFlagKey +from .change_subscription_internal_request_body import ChangeSubscriptionInternalRequestBody +from .change_subscription_request_body import ChangeSubscriptionRequestBody from .check_flag_request_body import CheckFlagRequestBody from .check_flag_response_data import CheckFlagResponseData from .check_flags_response_data import CheckFlagsResponseData +from .checkout_data_response_data import CheckoutDataResponseData 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_membership_detail_response_data import CompanyMembershipDetailResponseData from .company_membership_response_data import CompanyMembershipResponseData from .company_override_response_data import CompanyOverrideResponseData @@ -38,6 +44,7 @@ from .component_preview_response_data import ComponentPreviewResponseData from .component_response_data import ComponentResponseData from .count_response import CountResponse +from .coupon_request_body import CouponRequestBody from .create_entitlement_req_common import CreateEntitlementReqCommon from .create_entitlement_req_common_metric_period import CreateEntitlementReqCommonMetricPeriod from .create_entitlement_req_common_metric_period_month_reset import CreateEntitlementReqCommonMetricPeriodMonthReset @@ -109,6 +116,7 @@ from .plan_response_data import PlanResponseData from .preview_object import PreviewObject from .preview_object_response_data import PreviewObjectResponseData +from .preview_subscription_change_response_data import PreviewSubscriptionChangeResponseData from .raw_event_batch_response_data import RawEventBatchResponseData from .raw_event_response_data import RawEventResponseData from .rule_condition_detail_response_data import RuleConditionDetailResponseData @@ -121,15 +129,18 @@ from .segment_status_resp import SegmentStatusResp from .stripe_embed_info import StripeEmbedInfo from .temporary_access_token_response_data import TemporaryAccessTokenResponseData +from .update_add_on_request_body import UpdateAddOnRequestBody from .update_entitlement_req_common import UpdateEntitlementReqCommon from .update_entitlement_req_common_metric_period import UpdateEntitlementReqCommonMetricPeriod 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_rule_request_body import UpdateRuleRequestBody from .upsert_company_request_body import UpsertCompanyRequestBody from .upsert_trait_request_body import UpsertTraitRequestBody from .upsert_user_request_body import UpsertUserRequestBody from .upsert_user_sub_request_body import UpsertUserSubRequestBody +from .usage_based_entitlement_request_body import UsageBasedEntitlementRequestBody from .usage_based_entitlement_response_data import UsageBasedEntitlementResponseData from .user_detail_response_data import UserDetailResponseData from .user_response_data import UserResponseData @@ -144,6 +155,7 @@ "ApiKeyRequestResponseData", "ApiKeyResponseData", "AudienceRequestBody", + "BillingCouponResponseData", "BillingCustomerResponseData", "BillingCustomerSubscription", "BillingCustomerWithSubscriptionsResponseData", @@ -156,14 +168,19 @@ "BillingProductPriceResponseData", "BillingProductPricing", "BillingProductResponseData", + "BillingSubscriptionDiscount", + "BillingSubscriptionDiscountView", "BillingSubscriptionResponseData", "BillingSubscriptionView", - "CheckFlagOutputWithFlagKey", + "ChangeSubscriptionInternalRequestBody", + "ChangeSubscriptionRequestBody", "CheckFlagRequestBody", "CheckFlagResponseData", "CheckFlagsResponseData", + "CheckoutDataResponseData", "CompanyCrmDealsResponseData", "CompanyDetailResponseData", + "CompanyEventPeriodMetricsResponseData", "CompanyMembershipDetailResponseData", "CompanyMembershipResponseData", "CompanyOverrideResponseData", @@ -176,6 +193,7 @@ "ComponentPreviewResponseData", "ComponentResponseData", "CountResponse", + "CouponRequestBody", "CreateEntitlementReqCommon", "CreateEntitlementReqCommonMetricPeriod", "CreateEntitlementReqCommonMetricPeriodMonthReset", @@ -245,6 +263,7 @@ "PlanResponseData", "PreviewObject", "PreviewObjectResponseData", + "PreviewSubscriptionChangeResponseData", "RawEventBatchResponseData", "RawEventResponseData", "RuleConditionDetailResponseData", @@ -257,15 +276,18 @@ "SegmentStatusResp", "StripeEmbedInfo", "TemporaryAccessTokenResponseData", + "UpdateAddOnRequestBody", "UpdateEntitlementReqCommon", "UpdateEntitlementReqCommonMetricPeriod", "UpdateEntitlementReqCommonMetricPeriodMonthReset", "UpdateEntitlementReqCommonValueType", + "UpdatePayInAdvanceRequestBody", "UpdateRuleRequestBody", "UpsertCompanyRequestBody", "UpsertTraitRequestBody", "UpsertUserRequestBody", "UpsertUserSubRequestBody", + "UsageBasedEntitlementRequestBody", "UsageBasedEntitlementResponseData", "UserDetailResponseData", "UserResponseData", diff --git a/src/schematic/types/billing_coupon_response_data.py b/src/schematic/types/billing_coupon_response_data.py new file mode 100644 index 0000000..fe79f62 --- /dev/null +++ b/src/schematic/types/billing_coupon_response_data.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class BillingCouponResponseData(UniversalBaseModel): + """ + The created resource + """ + + account_id: str + amount_off: typing.Optional[int] = None + currency: typing.Optional[str] = None + duration: typing.Optional[str] = None + duration_in_months: typing.Optional[int] = None + environment_id: str + external_id: str + id: str + is_active: bool + max_redemptions: typing.Optional[int] = None + metadata: typing.Dict[str, typing.Optional[typing.Any]] + name: str + percent_off: typing.Optional[int] = None + times_redeemed: int + valid_from: typing.Optional[dt.datetime] = None + valid_until: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/billing_price_view.py b/src/schematic/types/billing_price_view.py index 2b1f37e..4c18b74 100644 --- a/src/schematic/types/billing_price_view.py +++ b/src/schematic/types/billing_price_view.py @@ -12,6 +12,7 @@ class BillingPriceView(UniversalBaseModel): currency: str id: str interval: str + is_active: bool meter_id: typing.Optional[str] = None price: int price_external_id: str 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 0daca31..e049c83 100644 --- a/src/schematic/types/billing_product_for_subscription_response_data.py +++ b/src/schematic/types/billing_product_for_subscription_response_data.py @@ -18,6 +18,7 @@ class BillingProductForSubscriptionResponseData(UniversalBaseModel): name: str price: int price_external_id: str + price_id: str quantity: float subscription_id: str updated_at: dt.datetime diff --git a/src/schematic/types/billing_product_price_response_data.py b/src/schematic/types/billing_product_price_response_data.py index ada8f9a..3ee29d8 100644 --- a/src/schematic/types/billing_product_price_response_data.py +++ b/src/schematic/types/billing_product_price_response_data.py @@ -12,6 +12,7 @@ class BillingProductPriceResponseData(UniversalBaseModel): currency: str id: str interval: str + is_active: bool meter_id: typing.Optional[str] = None price: int price_external_id: str diff --git a/src/schematic/types/billing_subscription_discount.py b/src/schematic/types/billing_subscription_discount.py new file mode 100644 index 0000000..32c94b1 --- /dev/null +++ b/src/schematic/types/billing_subscription_discount.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class BillingSubscriptionDiscount(UniversalBaseModel): + coupon_external_id: str + customer_facing_code: typing.Optional[str] = None + ended_at: typing.Optional[dt.datetime] = None + external_id: str + is_active: bool + promo_code_external_id: typing.Optional[str] = None + started_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/billing_subscription_discount_view.py b/src/schematic/types/billing_subscription_discount_view.py new file mode 100644 index 0000000..9c29369 --- /dev/null +++ b/src/schematic/types/billing_subscription_discount_view.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class BillingSubscriptionDiscountView(UniversalBaseModel): + amount_off: typing.Optional[int] = None + coupon_id: str + coupon_name: str + currency: typing.Optional[str] = None + customer_facing_code: typing.Optional[str] = None + discount_external_id: str + duration: str + duration_in_months: typing.Optional[int] = None + ended_at: typing.Optional[dt.datetime] = None + is_active: bool + percent_off: typing.Optional[float] = None + promo_code_external_id: typing.Optional[str] = None + started_at: dt.datetime + subscription_external_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/billing_subscription_response_data.py b/src/schematic/types/billing_subscription_response_data.py index 7caffd7..1959417 100644 --- a/src/schematic/types/billing_subscription_response_data.py +++ b/src/schematic/types/billing_subscription_response_data.py @@ -22,6 +22,7 @@ class BillingSubscriptionResponseData(UniversalBaseModel): 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 diff --git a/src/schematic/types/billing_subscription_view.py b/src/schematic/types/billing_subscription_view.py index 4965e92..8ecbf73 100644 --- a/src/schematic/types/billing_subscription_view.py +++ b/src/schematic/types/billing_subscription_view.py @@ -3,6 +3,7 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing import datetime as dt +from .billing_subscription_discount_view import BillingSubscriptionDiscountView from .invoice_response_data import InvoiceResponseData from .payment_method_response_data import PaymentMethodResponseData from .billing_product_for_subscription_response_data import BillingProductForSubscriptionResponseData @@ -11,10 +12,15 @@ class BillingSubscriptionView(UniversalBaseModel): + """ + The updated resource + """ + company_id: typing.Optional[str] = None created_at: dt.datetime currency: str customer_external_id: str + discounts: typing.List[BillingSubscriptionDiscountView] expired_at: typing.Optional[dt.datetime] = None id: str interval: str @@ -28,6 +34,7 @@ class BillingSubscriptionView(UniversalBaseModel): 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 diff --git a/src/schematic/types/change_subscription_internal_request_body.py b/src/schematic/types/change_subscription_internal_request_body.py new file mode 100644 index 0000000..4a6f811 --- /dev/null +++ b/src/schematic/types/change_subscription_internal_request_body.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .update_add_on_request_body import UpdateAddOnRequestBody +from .update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ChangeSubscriptionInternalRequestBody(UniversalBaseModel): + add_on_ids: typing.List[UpdateAddOnRequestBody] + company_id: str + new_plan_id: str + new_price_id: str + pay_in_advance: typing.List[UpdatePayInAdvanceRequestBody] + payment_method_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/change_subscription_request_body.py b/src/schematic/types/change_subscription_request_body.py new file mode 100644 index 0000000..7732b66 --- /dev/null +++ b/src/schematic/types/change_subscription_request_body.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .update_add_on_request_body import UpdateAddOnRequestBody +from .update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ChangeSubscriptionRequestBody(UniversalBaseModel): + add_on_ids: typing.List[UpdateAddOnRequestBody] + new_plan_id: str + new_price_id: str + pay_in_advance: typing.List[UpdatePayInAdvanceRequestBody] + payment_method_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/check_flag_response_data.py b/src/schematic/types/check_flag_response_data.py index e18dfe5..8286741 100644 --- a/src/schematic/types/check_flag_response_data.py +++ b/src/schematic/types/check_flag_response_data.py @@ -2,8 +2,9 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing -from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic +import datetime as dt +from ..core.pydantic_utilities import IS_PYDANTIC_V2 class CheckFlagResponseData(UniversalBaseModel): @@ -11,13 +12,70 @@ class CheckFlagResponseData(UniversalBaseModel): The returned resource """ - company_id: typing.Optional[str] = None - error: typing.Optional[str] = None - flag_id: typing.Optional[str] = None - reason: str - rule_id: typing.Optional[str] = None - user_id: typing.Optional[str] = None - value: bool + company_id: typing.Optional[str] = pydantic.Field(default=None) + """ + If company keys were provided and matched a company, its ID + """ + + error: typing.Optional[str] = pydantic.Field(default=None) + """ + If an error occurred while checking the flag, the error message + """ + + feature_allocation: typing.Optional[int] = pydantic.Field(default=None) + """ + If a numeric feature entitlement rule was matched, its allocation + """ + + feature_usage: typing.Optional[int] = pydantic.Field(default=None) + """ + If a numeric feature entitlement rule was matched, the company's usage + """ + + feature_usage_period: typing.Optional[str] = pydantic.Field(default=None) + """ + For event-based feature entitlement rules, the period over which usage is tracked (current_month, current_day, current_week, all_time) + """ + + feature_usage_reset_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + For event-based feature entitlement rules, when the usage period will reset + """ + + flag: str = pydantic.Field() + """ + The key used to check the flag + """ + + flag_id: typing.Optional[str] = pydantic.Field(default=None) + """ + If a flag was found, its ID + """ + + reason: str = pydantic.Field() + """ + A human-readable explanation of the result + """ + + rule_id: typing.Optional[str] = pydantic.Field(default=None) + """ + If a rule was found, its ID + """ + + rule_type: typing.Optional[str] = pydantic.Field(default=None) + """ + If a rule was found, its type + """ + + user_id: typing.Optional[str] = pydantic.Field(default=None) + """ + If user keys were provided and matched a user, its ID + """ + + value: bool = pydantic.Field() + """ + A boolean flag check result; for feature entitlements, this represents whether further consumption of the feature is permitted + """ 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/check_flags_response_data.py b/src/schematic/types/check_flags_response_data.py index 958e8d6..4fadccd 100644 --- a/src/schematic/types/check_flags_response_data.py +++ b/src/schematic/types/check_flags_response_data.py @@ -2,7 +2,7 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing -from .check_flag_output_with_flag_key import CheckFlagOutputWithFlagKey +from .check_flag_response_data import CheckFlagResponseData from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic @@ -12,7 +12,7 @@ class CheckFlagsResponseData(UniversalBaseModel): The created resource """ - flags: typing.List[CheckFlagOutputWithFlagKey] + flags: typing.List[CheckFlagResponseData] 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/checkout_data_response_data.py b/src/schematic/types/checkout_data_response_data.py new file mode 100644 index 0000000..8bedaaa --- /dev/null +++ b/src/schematic/types/checkout_data_response_data.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from .plan_detail_response_data import PlanDetailResponseData +from .usage_based_entitlement_response_data import UsageBasedEntitlementResponseData +from .company_detail_response_data import CompanyDetailResponseData +from .feature_usage_detail_response_data import FeatureUsageDetailResponseData +from .company_subscription_response_data import CompanySubscriptionResponseData +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CheckoutDataResponseData(UniversalBaseModel): + """ + The returned resource + """ + + active_add_ons: typing.List[PlanDetailResponseData] + active_plan: typing.Optional[PlanDetailResponseData] = None + active_usage_based_entitlements: typing.List[UsageBasedEntitlementResponseData] + company: typing.Optional[CompanyDetailResponseData] = None + feature_usage: typing.Optional[FeatureUsageDetailResponseData] = None + subscription: typing.Optional[CompanySubscriptionResponseData] = 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 9f72596..f4abdca 100644 --- a/src/schematic/types/company_detail_response_data.py +++ b/src/schematic/types/company_detail_response_data.py @@ -7,6 +7,7 @@ import datetime as dt from .entity_trait_detail_response_data import EntityTraitDetailResponseData from .entity_key_detail_response_data import EntityKeyDetailResponseData +from .company_event_period_metrics_response_data import CompanyEventPeriodMetricsResponseData from .generic_preview_object import GenericPreviewObject import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -23,6 +24,7 @@ class CompanyDetailResponseData(UniversalBaseModel): keys: typing.List[EntityKeyDetailResponseData] last_seen_at: typing.Optional[dt.datetime] = None logo_url: typing.Optional[str] = None + metrics: typing.List[CompanyEventPeriodMetricsResponseData] name: str plan: typing.Optional[CompanyPlanWithBillingSubView] = None plans: typing.List[GenericPreviewObject] diff --git a/src/schematic/types/company_event_period_metrics_response_data.py b/src/schematic/types/company_event_period_metrics_response_data.py new file mode 100644 index 0000000..ea49a42 --- /dev/null +++ b/src/schematic/types/company_event_period_metrics_response_data.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import datetime as dt +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class CompanyEventPeriodMetricsResponseData(UniversalBaseModel): + account_id: str + captured_at_max: dt.datetime + captured_at_min: dt.datetime + company_id: str + created_at: dt.datetime + environment_id: str + event_subtype: str + month_reset: str + period: str + valid_until: typing.Optional[dt.datetime] = None + value: 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/company_override_response_data.py b/src/schematic/types/company_override_response_data.py index 544ff21..5569832 100644 --- a/src/schematic/types/company_override_response_data.py +++ b/src/schematic/types/company_override_response_data.py @@ -26,6 +26,7 @@ class CompanyOverrideResponseData(UniversalBaseModel): metric_period: typing.Optional[str] = None metric_period_month_reset: typing.Optional[str] = None rule_id: typing.Optional[str] = None + rule_id_usage_exceeded: typing.Optional[str] = None updated_at: dt.datetime value_bool: typing.Optional[bool] = None value_numeric: typing.Optional[int] = None diff --git a/src/schematic/types/company_subscription_response_data.py b/src/schematic/types/company_subscription_response_data.py index 8bece2c..3892aa1 100644 --- a/src/schematic/types/company_subscription_response_data.py +++ b/src/schematic/types/company_subscription_response_data.py @@ -2,6 +2,7 @@ from ..core.pydantic_utilities import UniversalBaseModel import typing +from .billing_subscription_discount_view import BillingSubscriptionDiscountView import datetime as dt from .invoice_response_data import InvoiceResponseData from .payment_method_response_data import PaymentMethodResponseData @@ -13,6 +14,7 @@ class CompanySubscriptionResponseData(UniversalBaseModel): currency: str customer_external_id: str + discounts: typing.List[BillingSubscriptionDiscountView] expired_at: typing.Optional[dt.datetime] = None interval: str latest_invoice: typing.Optional[InvoiceResponseData] = None @@ -21,6 +23,7 @@ class CompanySubscriptionResponseData(UniversalBaseModel): status: str subscription_external_id: str total_price: int + trial_end: typing.Optional[dt.datetime] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/types/component_hydrate_response_data.py b/src/schematic/types/component_hydrate_response_data.py index c33ef29..946296a 100644 --- a/src/schematic/types/component_hydrate_response_data.py +++ b/src/schematic/types/component_hydrate_response_data.py @@ -7,6 +7,7 @@ from .component_capabilities import ComponentCapabilities from .company_detail_response_data import CompanyDetailResponseData from .component_response_data import ComponentResponseData +from .plan_detail_response_data import PlanDetailResponseData from .feature_usage_detail_response_data import FeatureUsageDetailResponseData from .stripe_embed_info import StripeEmbedInfo from .company_subscription_response_data import CompanySubscriptionResponseData @@ -22,9 +23,11 @@ class ComponentHydrateResponseData(UniversalBaseModel): capabilities: typing.Optional[ComponentCapabilities] = None company: typing.Optional[CompanyDetailResponseData] = None component: typing.Optional[ComponentResponseData] = None + default_plan: typing.Optional[PlanDetailResponseData] = None feature_usage: typing.Optional[FeatureUsageDetailResponseData] = None stripe_embed: typing.Optional[StripeEmbedInfo] = None subscription: typing.Optional[CompanySubscriptionResponseData] = None + trial_payment_method_required: typing.Optional[bool] = None upcoming_invoice: typing.Optional[InvoiceResponseData] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/component_preview_response_data.py b/src/schematic/types/component_preview_response_data.py index 9083ef0..c3f4640 100644 --- a/src/schematic/types/component_preview_response_data.py +++ b/src/schematic/types/component_preview_response_data.py @@ -7,6 +7,7 @@ from .component_capabilities import ComponentCapabilities from .company_detail_response_data import CompanyDetailResponseData from .component_response_data import ComponentResponseData +from .plan_detail_response_data import PlanDetailResponseData from .feature_usage_detail_response_data import FeatureUsageDetailResponseData from .invoice_response_data import InvoiceResponseData from .stripe_embed_info import StripeEmbedInfo @@ -26,10 +27,12 @@ class ComponentPreviewResponseData(UniversalBaseModel): capabilities: typing.Optional[ComponentCapabilities] = None company: typing.Optional[CompanyDetailResponseData] = None component: typing.Optional[ComponentResponseData] = None + default_plan: typing.Optional[PlanDetailResponseData] = None feature_usage: typing.Optional[FeatureUsageDetailResponseData] = None invoices: typing.List[InvoiceResponseData] stripe_embed: typing.Optional[StripeEmbedInfo] = None subscription: typing.Optional[CompanySubscriptionResponseData] = None + trial_payment_method_required: typing.Optional[bool] = None upcoming_invoice: typing.Optional[InvoiceResponseData] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/check_flag_output_with_flag_key.py b/src/schematic/types/coupon_request_body.py similarity index 62% rename from src/schematic/types/check_flag_output_with_flag_key.py rename to src/schematic/types/coupon_request_body.py index 77f5df1..9cff6ca 100644 --- a/src/schematic/types/check_flag_output_with_flag_key.py +++ b/src/schematic/types/coupon_request_body.py @@ -6,15 +6,15 @@ import pydantic -class CheckFlagOutputWithFlagKey(UniversalBaseModel): - company_id: typing.Optional[str] = None - error: typing.Optional[str] = None - flag: str - flag_id: typing.Optional[str] = None - reason: str - rule_id: typing.Optional[str] = None - user_id: typing.Optional[str] = None - value: bool +class CouponRequestBody(UniversalBaseModel): + amount_off: int + currency: typing.Optional[str] = None + duration: str + duration_in_months: int + max_redemptions: int + name: str + percent_off: float + times_redeemed: int 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/create_entitlement_req_common.py b/src/schematic/types/create_entitlement_req_common.py index 13859d1..e4699c4 100644 --- a/src/schematic/types/create_entitlement_req_common.py +++ b/src/schematic/types/create_entitlement_req_common.py @@ -11,8 +11,6 @@ class CreateEntitlementReqCommon(UniversalBaseModel): feature_id: str - metered_monthly_price_id: typing.Optional[str] = None - metered_yearly_price_id: typing.Optional[str] = None metric_period: typing.Optional[CreateEntitlementReqCommonMetricPeriod] = None metric_period_month_reset: typing.Optional[CreateEntitlementReqCommonMetricPeriodMonthReset] = None value_bool: typing.Optional[bool] = None diff --git a/src/schematic/types/create_entitlement_req_common_metric_period.py b/src/schematic/types/create_entitlement_req_common_metric_period.py index 02c5139..87bd1ac 100644 --- a/src/schematic/types/create_entitlement_req_common_metric_period.py +++ b/src/schematic/types/create_entitlement_req_common_metric_period.py @@ -3,5 +3,5 @@ import typing CreateEntitlementReqCommonMetricPeriod = typing.Union[ - typing.Literal["all_time", "billing", "current_month", "current_week", "current_day"], typing.Any + typing.Literal["all_time", "current_month", "current_week", "current_day"], typing.Any ] diff --git a/src/schematic/types/create_or_update_condition_request_body_metric_period.py b/src/schematic/types/create_or_update_condition_request_body_metric_period.py index f13aff9..622b8c9 100644 --- a/src/schematic/types/create_or_update_condition_request_body_metric_period.py +++ b/src/schematic/types/create_or_update_condition_request_body_metric_period.py @@ -3,5 +3,5 @@ import typing CreateOrUpdateConditionRequestBodyMetricPeriod = typing.Union[ - typing.Literal["all_time", "billing", "current_month", "current_week", "current_day"], typing.Any + typing.Literal["all_time", "current_month", "current_week", "current_day"], typing.Any ] diff --git a/src/schematic/types/event_body_flag_check.py b/src/schematic/types/event_body_flag_check.py index b51a264..aa69891 100644 --- a/src/schematic/types/event_body_flag_check.py +++ b/src/schematic/types/event_body_flag_check.py @@ -9,7 +9,7 @@ class EventBodyFlagCheck(UniversalBaseModel): company_id: typing.Optional[str] = pydantic.Field(default=None) """ - Schematic company ID (starting with 'comp\_') of the company evaluated, if any + Schematic company ID (starting with 'comp_') of the company evaluated, if any """ error: typing.Optional[str] = pydantic.Field(default=None) @@ -19,7 +19,7 @@ class EventBodyFlagCheck(UniversalBaseModel): flag_id: typing.Optional[str] = pydantic.Field(default=None) """ - Schematic flag ID (starting with 'flag\_') for the flag matching the key, if any + Schematic flag ID (starting with 'flag_') for the flag matching the key, if any """ flag_key: str = pydantic.Field() @@ -44,12 +44,12 @@ class EventBodyFlagCheck(UniversalBaseModel): rule_id: typing.Optional[str] = pydantic.Field(default=None) """ - Schematic rule ID (starting with 'rule\_') of the rule that matched for the flag, if any + Schematic rule ID (starting with 'rule_') of the rule that matched for the flag, if any """ user_id: typing.Optional[str] = pydantic.Field(default=None) """ - Schematic user ID (starting with 'user\_') of the user evaluated, if any + Schematic user ID (starting with 'user_') of the user evaluated, if any """ value: bool = pydantic.Field() diff --git a/src/schematic/types/event_body_track.py b/src/schematic/types/event_body_track.py index abbd7c9..7b8821b 100644 --- a/src/schematic/types/event_body_track.py +++ b/src/schematic/types/event_body_track.py @@ -17,6 +17,11 @@ class EventBodyTrack(UniversalBaseModel): The name of the type of track event """ + quantity: typing.Optional[int] = pydantic.Field(default=None) + """ + Optionally specify the quantity of the event + """ + 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/event_detail_response_data.py b/src/schematic/types/event_detail_response_data.py index c9eb39c..7f607cf 100644 --- a/src/schematic/types/event_detail_response_data.py +++ b/src/schematic/types/event_detail_response_data.py @@ -23,6 +23,7 @@ class EventDetailResponseData(UniversalBaseModel): id: str loaded_at: typing.Optional[dt.datetime] = None processed_at: typing.Optional[dt.datetime] = None + quantity: int sent_at: typing.Optional[dt.datetime] = None status: str subtype: typing.Optional[str] = None diff --git a/src/schematic/types/event_response_data.py b/src/schematic/types/event_response_data.py index 0172842..e8ed3d2 100644 --- a/src/schematic/types/event_response_data.py +++ b/src/schematic/types/event_response_data.py @@ -20,6 +20,7 @@ class EventResponseData(UniversalBaseModel): id: str loaded_at: typing.Optional[dt.datetime] = None processed_at: typing.Optional[dt.datetime] = None + quantity: int sent_at: typing.Optional[dt.datetime] = None status: str subtype: typing.Optional[str] = None diff --git a/src/schematic/types/feature_company_response_data.py b/src/schematic/types/feature_company_response_data.py index 4ce0335..c052214 100644 --- a/src/schematic/types/feature_company_response_data.py +++ b/src/schematic/types/feature_company_response_data.py @@ -5,8 +5,8 @@ import typing from .feature_company_response_data_allocation_type import FeatureCompanyResponseDataAllocationType from .company_detail_response_data import CompanyDetailResponseData -from .feature_detail_response_data import FeatureDetailResponseData import datetime as dt +from .feature_detail_response_data import FeatureDetailResponseData from .plan_response_data import PlanResponseData from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -28,6 +28,7 @@ class FeatureCompanyResponseData(UniversalBaseModel): """ company: typing.Optional[CompanyDetailResponseData] = None + entitlement_expiration_date: typing.Optional[dt.datetime] = None entitlement_id: str entitlement_type: str feature: typing.Optional[FeatureDetailResponseData] = None diff --git a/src/schematic/types/feature_usage_response_data.py b/src/schematic/types/feature_usage_response_data.py index d4bd42f..59111a5 100644 --- a/src/schematic/types/feature_usage_response_data.py +++ b/src/schematic/types/feature_usage_response_data.py @@ -4,8 +4,9 @@ import pydantic import typing from .feature_usage_response_data_allocation_type import FeatureUsageResponseDataAllocationType -from .feature_detail_response_data import FeatureDetailResponseData import datetime as dt +from .feature_detail_response_data import FeatureDetailResponseData +from .billing_price_view import BillingPriceView from .plan_response_data import PlanResponseData from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -26,12 +27,13 @@ class FeatureUsageResponseData(UniversalBaseModel): The type of allocation that is being used. """ + entitlement_expiration_date: typing.Optional[dt.datetime] = None entitlement_id: str entitlement_type: str feature: typing.Optional[FeatureDetailResponseData] = None 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) @@ -39,17 +41,21 @@ class FeatureUsageResponseData(UniversalBaseModel): If the period is current_month, when the month resets. """ + monthly_usage_based_price: typing.Optional[BillingPriceView] = None period: typing.Optional[str] = pydantic.Field(default=None) """ The period over which usage is measured. """ plan: typing.Optional[PlanResponseData] = None + price_behavior: typing.Optional[str] = None 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/plan_entitlement_response_data.py b/src/schematic/types/plan_entitlement_response_data.py index 2f87d6c..ab0833f 100644 --- a/src/schematic/types/plan_entitlement_response_data.py +++ b/src/schematic/types/plan_entitlement_response_data.py @@ -25,6 +25,7 @@ class PlanEntitlementResponseData(UniversalBaseModel): plan_id: str price_behavior: typing.Optional[str] = None rule_id: str + rule_id_usage_exceeded: typing.Optional[str] = None updated_at: dt.datetime value_bool: typing.Optional[bool] = None value_numeric: typing.Optional[int] = None diff --git a/src/schematic/types/preview_subscription_change_response_data.py b/src/schematic/types/preview_subscription_change_response_data.py new file mode 100644 index 0000000..8a2fa4f --- /dev/null +++ b/src/schematic/types/preview_subscription_change_response_data.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import datetime as dt +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class PreviewSubscriptionChangeResponseData(UniversalBaseModel): + """ + The requested resource + """ + + amount_off: int + due_now: int + new_charges: int + percent_off: float + period_start: dt.datetime + promo_code_applied: bool + proration: int + trial_end: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/update_add_on_request_body.py b/src/schematic/types/update_add_on_request_body.py new file mode 100644 index 0000000..e1b2551 --- /dev/null +++ b/src/schematic/types/update_add_on_request_body.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class UpdateAddOnRequestBody(UniversalBaseModel): + add_on_id: str + price_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_entitlement_req_common.py b/src/schematic/types/update_entitlement_req_common.py index bb16b08..ffda479 100644 --- a/src/schematic/types/update_entitlement_req_common.py +++ b/src/schematic/types/update_entitlement_req_common.py @@ -10,8 +10,6 @@ class UpdateEntitlementReqCommon(UniversalBaseModel): - metered_monthly_price_id: typing.Optional[str] = None - metered_yearly_price_id: typing.Optional[str] = None metric_period: typing.Optional[UpdateEntitlementReqCommonMetricPeriod] = None metric_period_month_reset: typing.Optional[UpdateEntitlementReqCommonMetricPeriodMonthReset] = None value_bool: typing.Optional[bool] = None diff --git a/src/schematic/types/update_entitlement_req_common_metric_period.py b/src/schematic/types/update_entitlement_req_common_metric_period.py index 03eb778..077d04f 100644 --- a/src/schematic/types/update_entitlement_req_common_metric_period.py +++ b/src/schematic/types/update_entitlement_req_common_metric_period.py @@ -3,5 +3,5 @@ import typing UpdateEntitlementReqCommonMetricPeriod = typing.Union[ - typing.Literal["all_time", "billing", "current_month", "current_week", "current_day"], typing.Any + typing.Literal["all_time", "current_month", "current_week", "current_day"], typing.Any ] diff --git a/src/schematic/types/update_pay_in_advance_request_body.py b/src/schematic/types/update_pay_in_advance_request_body.py new file mode 100644 index 0000000..712190f --- /dev/null +++ b/src/schematic/types/update_pay_in_advance_request_body.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class UpdatePayInAdvanceRequestBody(UniversalBaseModel): + price_id: str + quantity: 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/usage_based_entitlement_request_body.py b/src/schematic/types/usage_based_entitlement_request_body.py new file mode 100644 index 0000000..cc849e2 --- /dev/null +++ b/src/schematic/types/usage_based_entitlement_request_body.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.pydantic_utilities import UniversalBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class UsageBasedEntitlementRequestBody(UniversalBaseModel): + monthly_metered_price_id: typing.Optional[str] = None + price_behavior: typing.Optional[str] = None + yearly_metered_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/usage_based_entitlement_response_data.py b/src/schematic/types/usage_based_entitlement_response_data.py index 4240afb..4ac0e6c 100644 --- a/src/schematic/types/usage_based_entitlement_response_data.py +++ b/src/schematic/types/usage_based_entitlement_response_data.py @@ -12,10 +12,12 @@ class UsageBasedEntitlementResponseData(UniversalBaseModel): metered_price: typing.Optional[BillingPriceView] = None metric_period: typing.Optional[str] = None metric_period_month_reset: typing.Optional[str] = None + monthly_usage_based_price: typing.Optional[BillingPriceView] = None price_behavior: typing.Optional[str] = None value_bool: typing.Optional[bool] = None value_numeric: typing.Optional[int] = None value_type: str + 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/webhooks/types/create_webhook_request_body_request_types_item.py b/src/schematic/webhooks/types/create_webhook_request_body_request_types_item.py index f12100d..23ce805 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 @@ -27,6 +27,7 @@ "feature.deleted", "flag.deleted", "test.send", + "subscription.trial.ended", ], typing.Any, ] 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 bfb5177..e0cb636 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 @@ -27,6 +27,7 @@ "feature.deleted", "flag.deleted", "test.send", + "subscription.trial.ended", ], typing.Any, ]