diff --git a/.fern/metadata.json b/.fern/metadata.json index da44bf6..9cb516a 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "4.76.1", + "cliVersion": "5.6.0", "generatorName": "fernapi/fern-python-sdk", "generatorVersion": "4.64.1", "generatorConfig": { @@ -23,6 +23,6 @@ } ] }, - "originGitCommit": "5315b1ba06c9c71f00ac501c3e7ea3092701cd7b", + "originGitCommit": "a0658700ca9b3d362ce6594c0740c41d9286e429", "sdkVersion": "1.2.0" } \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8baf77a..8fd8b68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,11 @@ jobs: with: python-version: 3.9 - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + uses: snok/install-poetry@v1 + with: + version: 2.1.4 + virtualenvs-create: true + virtualenvs-in-project: true - name: Download WASM binary run: ./scripts/download-wasm.sh - name: Install dependencies @@ -31,8 +34,11 @@ jobs: with: python-version: 3.9 - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + uses: snok/install-poetry@v1 + with: + version: 2.1.4 + virtualenvs-create: true + virtualenvs-in-project: true - name: Download WASM binary run: ./scripts/download-wasm.sh - name: Install dependencies @@ -51,8 +57,11 @@ jobs: with: python-version: 3.9 - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + uses: snok/install-poetry@v1 + with: + version: 2.1.4 + virtualenvs-create: true + virtualenvs-in-project: true - name: Download WASM binary run: ./scripts/download-wasm.sh - name: Build package @@ -79,8 +88,11 @@ jobs: with: python-version: 3.9 - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + uses: snok/install-poetry@v1 + with: + version: 2.1.4 + virtualenvs-create: true + virtualenvs-in-project: true - name: Download WASM binary run: ./scripts/download-wasm.sh - name: Install dependencies diff --git a/poetry.lock b/poetry.lock index 25e2811..921b844 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.3.2 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -6,6 +6,8 @@ version = "2.6.1" description = "Happy Eyeballs for asyncio" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "python_version >= \"3.9\"" files = [ {file = "aiohappyeyeballs-2.6.1-py3-none-any.whl", hash = "sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8"}, {file = "aiohappyeyeballs-2.6.1.tar.gz", hash = "sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558"}, @@ -17,6 +19,8 @@ version = "3.13.5" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "python_version >= \"3.9\"" files = [ {file = "aiohttp-3.13.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:02222e7e233295f40e011c1b00e3b0bd451f22cf853a0304c3595633ee47da4b"}, {file = "aiohttp-3.13.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bace460460ed20614fa6bc8cb09966c0b8517b8c58ad8046828c6078d25333b5"}, @@ -151,7 +155,7 @@ propcache = ">=0.2.0" yarl = ">=1.17.0,<2.0" [package.extras] -speedups = ["Brotli (>=1.2)", "aiodns (>=3.3.0)", "backports.zstd", "brotlicffi (>=1.2)"] +speedups = ["Brotli (>=1.2) ; platform_python_implementation == \"CPython\"", "aiodns (>=3.3.0)", "backports.zstd ; platform_python_implementation == \"CPython\" and python_version < \"3.14\"", "brotlicffi (>=1.2) ; platform_python_implementation != \"CPython\""] [[package]] name = "aiosignal" @@ -159,6 +163,8 @@ version = "1.4.0" description = "aiosignal: a list of registered asynchronous callbacks" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "python_version >= \"3.9\"" files = [ {file = "aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e"}, {file = "aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7"}, @@ -174,6 +180,7 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, @@ -188,6 +195,7 @@ version = "4.5.2" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, @@ -201,7 +209,7 @@ typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} [package.extras] doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1) ; python_version >= \"3.10\"", "uvloop (>=0.21.0b1) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""] trio = ["trio (>=0.26.1)"] [[package]] @@ -210,6 +218,8 @@ version = "5.0.1" description = "Timeout context manager for asyncio programs" optional = false python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version >= \"3.9\" and python_full_version < \"3.11.3\"" files = [ {file = "async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c"}, {file = "async_timeout-5.0.1.tar.gz", hash = "sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3"}, @@ -221,6 +231,8 @@ version = "26.1.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "python_version >= \"3.9\"" files = [ {file = "attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309"}, {file = "attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32"}, @@ -232,6 +244,7 @@ version = "2026.4.22" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "certifi-2026.4.22-py3-none-any.whl", hash = "sha256:3cb2210c8f88ba2318d29b0388d1023c8492ff72ecdde4ebdaddbb13a31b1c4a"}, {file = "certifi-2026.4.22.tar.gz", hash = "sha256:8d455352a37b71bf76a79caa83a3d6c25afee4a385d632127b6afb3963f1c580"}, @@ -243,6 +256,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -254,6 +269,8 @@ version = "1.3.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" +groups = ["main", "dev"] +markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, @@ -271,6 +288,7 @@ version = "2.1.2" description = "execnet: rapid multi-Python deployment" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec"}, {file = "execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd"}, @@ -285,6 +303,8 @@ version = "1.8.0" description = "A list-like structure which implements collections.abc.MutableSequence" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "python_version >= \"3.9\"" files = [ {file = "frozenlist-1.8.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b37f6d31b3dcea7deb5e9696e529a6aa4a898adc33db82da12e4c60a7c4d2011"}, {file = "frozenlist-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ef2b7b394f208233e471abc541cc6991f907ffd47dc72584acee3147899d6565"}, @@ -424,6 +444,7 @@ version = "0.16.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, @@ -435,6 +456,7 @@ version = "1.0.9" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, @@ -456,6 +478,7 @@ version = "0.28.1" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, @@ -468,7 +491,7 @@ httpcore = "==1.*" idna = "*" [package.extras] -brotli = ["brotli", "brotlicffi"] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] @@ -476,14 +499,16 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "idna" -version = "3.13" +version = "3.15" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ - {file = "idna-3.13-py3-none-any.whl", hash = "sha256:892ea0cde124a99ce773decba204c5552b69c3c67ffd5f232eb7696135bc8bb3"}, - {file = "idna-3.13.tar.gz", hash = "sha256:585ea8fe5d69b9181ec1afba340451fba6ba764af97026f92a91d4eef164a242"}, + {file = "idna-3.15-py3-none-any.whl", hash = "sha256:048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8"}, + {file = "idna-3.15.tar.gz", hash = "sha256:ca962446ea538f7092a95e057da437618e886f4d349216d2b1e294abfdb65fdc"}, ] +markers = {dev = "python_version >= \"3.9\""} [package.extras] all = ["mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] @@ -494,6 +519,8 @@ version = "6.4.5" description = "Read resources from Python packages" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"datastream\" or extra == \"rulesengine\"" files = [ {file = "importlib_resources-6.4.5-py3-none-any.whl", hash = "sha256:ac29d5f956f01d5e4bb63102a5a19957f1b9175e45649977264a1416783bb717"}, {file = "importlib_resources-6.4.5.tar.gz", hash = "sha256:980862a1d16c9e147a59603677fa2aa5fd82b87f223b6cb870695bcfce830065"}, @@ -503,7 +530,7 @@ files = [ zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] @@ -516,6 +543,7 @@ version = "2.1.0" description = "brain-dead simple config-ini parsing" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, @@ -527,6 +555,8 @@ version = "6.7.1" description = "multidict implementation" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "python_version >= \"3.9\"" files = [ {file = "multidict-6.7.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c93c3db7ea657dd4637d57e74ab73de31bccefe144d3d4ce370052035bc85fb5"}, {file = "multidict-6.7.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:974e72a2474600827abaeda71af0c53d9ebbc3c2eb7da37b37d7829ae31232d8"}, @@ -685,6 +715,7 @@ version = "1.13.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, @@ -738,6 +769,7 @@ version = "1.1.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, @@ -745,13 +777,14 @@ files = [ [[package]] name = "packaging" -version = "26.1" +version = "26.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "packaging-26.1-py3-none-any.whl", hash = "sha256:5d9c0669c6285e491e0ced2eee587eaf67b670d94a19e94e3984a481aba6802f"}, - {file = "packaging-26.1.tar.gz", hash = "sha256:f042152b681c4bfac5cae2742a55e103d27ab2ec0f3d88037136b6bfe7c9c5de"}, + {file = "packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e"}, + {file = "packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661"}, ] [[package]] @@ -760,6 +793,7 @@ version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, @@ -775,6 +809,8 @@ version = "0.4.1" description = "Accelerated property cache" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "python_version >= \"3.9\"" files = [ {file = "propcache-0.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7c2d1fa3201efaf55d730400d945b5b3ab6e672e100ba0f9a409d950ab25d7db"}, {file = "propcache-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1eb2994229cc8ce7fe9b3db88f5465f5fd8651672840b2e426b88cdb1a30aac8"}, @@ -906,6 +942,7 @@ version = "2.10.6" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, @@ -918,7 +955,7 @@ typing-extensions = ">=4.12.2" [package.extras] email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata"] +timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] [[package]] name = "pydantic-core" @@ -926,6 +963,7 @@ version = "2.27.2" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {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"}, @@ -1038,6 +1076,8 @@ version = "2.12.1" description = "JSON Web Token implementation in Python" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "python_version >= \"3.10\"" files = [ {file = "pyjwt-2.12.1-py3-none-any.whl", hash = "sha256:28ca37c070cad8ba8cd9790cd940535d40274d22f80ab87f3ac6a713e6e8454c"}, {file = "pyjwt-2.12.1.tar.gz", hash = "sha256:c74a7a2adf861c04d002db713dd85f84beb242228e671280bf709d765b03672b"}, @@ -1058,6 +1098,7 @@ version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, @@ -1080,6 +1121,7 @@ version = "0.23.8" description = "Pytest support for asyncio" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, @@ -1098,6 +1140,7 @@ version = "3.6.1" description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"}, {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"}, @@ -1118,6 +1161,7 @@ version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["dev"] files = [ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, @@ -1132,6 +1176,8 @@ version = "5.3.1" description = "Python client for Redis database and key-value store" optional = false python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version >= \"3.10\"" files = [ {file = "redis-5.3.1-py3-none-any.whl", hash = "sha256:dc1909bd24669cc31b5f67a039700b16ec30571096c5f1f0d9d2324bff31af97"}, {file = "redis-5.3.1.tar.gz", hash = "sha256:ca49577a531ea64039b5a36db3d6cd1a0c7a60c34124d46924a45b956e8cf14c"}, @@ -1151,6 +1197,7 @@ version = "0.11.5" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "ruff-0.11.5-py3-none-linux_armv6l.whl", hash = "sha256:2561294e108eb648e50f210671cc56aee590fb6167b594144401532138c66c7b"}, {file = "ruff-0.11.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac12884b9e005c12d0bd121f56ccf8033e1614f736f766c118ad60780882a077"}, @@ -1178,6 +1225,7 @@ version = "1.17.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["dev"] files = [ {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, @@ -1189,6 +1237,7 @@ version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -1200,6 +1249,8 @@ version = "2.4.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30"}, {file = "tomli-2.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a"}, @@ -1256,6 +1307,7 @@ version = "2.9.0.20241206" description = "Typing stubs for python-dateutil" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {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"}, @@ -1267,6 +1319,7 @@ version = "4.13.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, @@ -1278,6 +1331,8 @@ version = "25.0.0" description = "A WebAssembly runtime powered by Wasmtime" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"datastream\" or extra == \"rulesengine\"" files = [ {file = "wasmtime-25.0.0-py3-none-any.whl", hash = "sha256:22aa59fc6e01deec8a6703046f82466090d5811096a3bb5c169907e36c842af1"}, {file = "wasmtime-25.0.0-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:13e9a718e9d580c1738782cc19f4dcb9fb068f7e51778ea621fd664f4433525b"}, @@ -1300,6 +1355,8 @@ version = "13.1" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"datastream\"" files = [ {file = "websockets-13.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f48c749857f8fb598fb890a75f540e3221d0976ed0bf879cf3c7eef34151acee"}, {file = "websockets-13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c7e72ce6bda6fb9409cc1e8164dd41d7c91466fb599eb047cfda72fe758a34a7"}, @@ -1395,6 +1452,8 @@ version = "1.22.0" description = "Yet another URL library" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "python_version >= \"3.9\"" files = [ {file = "yarl-1.22.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c7bd6683587567e5a49ee6e336e0612bec8329be1b7d4c8af5687dcdeb67ee1e"}, {file = "yarl-1.22.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5cdac20da754f3a723cceea5b3448e1a2074866406adeb4ef35b469d089adb8f"}, @@ -1539,17 +1598,19 @@ version = "3.20.2" description = "Backport of pathlib-compatible object wrapper for zip files" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "(extra == \"datastream\" or extra == \"rulesengine\") and python_version < \"3.10\"" files = [ {file = "zipp-3.20.2-py3-none-any.whl", hash = "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350"}, {file = "zipp-3.20.2.tar.gz", hash = "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29"}, ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] -test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] +test = ["big-O", "importlib-resources ; python_version < \"3.9\"", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] type = ["pytest-mypy"] [extras] @@ -1557,6 +1618,6 @@ datastream = ["wasmtime", "websockets"] rulesengine = ["wasmtime"] [metadata] -lock-version = "2.0" +lock-version = "2.1" python-versions = "^3.8" content-hash = "7f8cd32f6180e0e5180d40c7376b4ba77af39b5647c1c2e9b93f49aea5eb3ac3" diff --git a/reference.md b/reference.md index f87be82..631a8ae 100644 --- a/reference.md +++ b/reference.md @@ -2853,6 +2853,14 @@ client.billing.upsert_billing_price(
+**interval_count:** `typing.Optional[int]` + +
+
+ +
+
+ **meter_id:** `typing.Optional[str]`
@@ -3351,6 +3359,7 @@ client.billing.list_billing_products( price_usage_type="licensed", provider_type="orb", q="q", + recurring_charges_only=True, with_one_time_charges=True, with_prices_only=True, with_zero_price=True, @@ -3421,6 +3430,14 @@ client.billing.list_billing_products(
+**recurring_charges_only:** `typing.Optional[bool]` — Filter to products that have at least one recurring price + +
+
+ +
+
+ **with_one_time_charges:** `typing.Optional[bool]` — Filter products that are one time charges
@@ -3511,6 +3528,7 @@ client.billing.count_billing_products( price_usage_type="licensed", provider_type="orb", q="q", + recurring_charges_only=True, with_one_time_charges=True, with_prices_only=True, with_zero_price=True, @@ -3581,6 +3599,14 @@ client.billing.count_billing_products(
+**recurring_charges_only:** `typing.Optional[bool]` — Filter to products that have at least one recurring price + +
+
+ +
+
+ **with_one_time_charges:** `typing.Optional[bool]` — Filter products that are one time charges
@@ -4394,6 +4420,65 @@ client.credits.soft_delete_billing_credit(
+ +
+ + +
client.credits.list_company_credit_balances(...) -> ListCompanyCreditBalancesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.credits.list_company_credit_balances( + company_id="company_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
@@ -5957,6 +6042,9 @@ client.credits.list_billing_plan_credit_grants( "plan_ids" ], plan_version_id="plan_version_id", + plan_version_ids=[ + "plan_version_ids" + ], limit=1000000, offset=1000000, ) @@ -6015,6 +6103,14 @@ client.credits.list_billing_plan_credit_grants(
+**plan_version_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` + +
+
+ +
+
+ **limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -6333,6 +6429,9 @@ client.credits.count_billing_plan_credit_grants( "plan_ids" ], plan_version_id="plan_version_id", + plan_version_ids=[ + "plan_version_ids" + ], limit=1000000, offset=1000000, ) @@ -6391,6 +6490,14 @@ client.credits.count_billing_plan_credit_grants(
+**plan_version_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` + +
+
+ +
+
+ **limit:** `typing.Optional[int]` — Page limit (default 100)
@@ -6677,7 +6784,7 @@ client.credits.count_credit_event_ledger(
```python -from schematic import Schematic, UpdateAddOnRequestBody, UpdateCreditBundleRequestBody, UpdatePayInAdvanceRequestBody +from schematic import Schematic, UpdateAddOnRequestBody, UpdateAutoTopupOverrideRequestBody, UpdateCreditBundleRequestBody, UpdatePayInAdvanceRequestBody from schematic.environment import SchematicEnvironment client = Schematic( @@ -6692,6 +6799,11 @@ client.checkout.internal( price_id="price_id", ) ], + auto_topup_overrides=[ + UpdateAutoTopupOverrideRequestBody( + plan_credit_grant_id="plan_credit_grant_id", + ) + ], company_id="company_id", credit_bundles=[ UpdateCreditBundleRequestBody( @@ -6824,7 +6936,7 @@ client.checkout.get_checkout_data(
```python -from schematic import Schematic, UpdateAddOnRequestBody, UpdateCreditBundleRequestBody, UpdatePayInAdvanceRequestBody +from schematic import Schematic, UpdateAddOnRequestBody, UpdateAutoTopupOverrideRequestBody, UpdateCreditBundleRequestBody, UpdatePayInAdvanceRequestBody from schematic.environment import SchematicEnvironment client = Schematic( @@ -6839,6 +6951,11 @@ client.checkout.preview_checkout_internal( price_id="price_id", ) ], + auto_topup_overrides=[ + UpdateAutoTopupOverrideRequestBody( + plan_credit_grant_id="plan_credit_grant_id", + ) + ], company_id="company_id", credit_bundles=[ UpdateCreditBundleRequestBody( @@ -11195,6 +11312,7 @@ client.entitlements.list_feature_usage( "feature_ids" ], include_usage_aggregation=True, + managed_by="orb", q="q", without_negative_entitlements=True, limit=1000000, @@ -11247,6 +11365,14 @@ client.entitlements.list_feature_usage(
+**managed_by:** `typing.Optional[BillingProviderType]` — Filter for features managed by a billing provider, or by Schematic (no billing provider) + +
+
+ +
+
+ **q:** `typing.Optional[str]`
@@ -11414,6 +11540,7 @@ client.entitlements.count_feature_usage( "feature_ids" ], include_usage_aggregation=True, + managed_by="orb", q="q", without_negative_entitlements=True, limit=1000000, @@ -11466,6 +11593,14 @@ client.entitlements.count_feature_usage(
+**managed_by:** `typing.Optional[BillingProviderType]` — Filter for features managed by a billing provider, or by Schematic (no billing provider) + +
+
+ +
+
+ **q:** `typing.Optional[str]`
@@ -12024,6 +12159,38 @@ client.entitlements.create_plan_entitlement(
+**quarterly_metered_price_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**quarterly_price_tiers:** `typing.Optional[typing.List[CreatePriceTierRequestBody]]` + +
+
+ +
+
+ +**quarterly_unit_price:** `typing.Optional[int]` + +
+
+ +
+
+ +**quarterly_unit_price_decimal:** `typing.Optional[str]` + +
+
+ +
+
+ **soft_limit:** `typing.Optional[int]`
@@ -12343,6 +12510,38 @@ client.entitlements.update_plan_entitlement(
+**quarterly_metered_price_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**quarterly_price_tiers:** `typing.Optional[typing.List[CreatePriceTierRequestBody]]` + +
+
+ +
+
+ +**quarterly_unit_price:** `typing.Optional[int]` + +
+
+ +
+
+ +**quarterly_unit_price_decimal:** `typing.Optional[str]` + +
+
+ +
+
+ **soft_limit:** `typing.Optional[int]`
@@ -12697,6 +12896,38 @@ client.entitlements.upsert_plan_entitlement_for_billing_product(
+**quarterly_metered_price_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**quarterly_price_tiers:** `typing.Optional[typing.List[CreatePriceTierRequestBody]]` + +
+
+ +
+
+ +**quarterly_unit_price:** `typing.Optional[int]` + +
+
+ +
+
+ +**quarterly_unit_price_decimal:** `typing.Optional[str]` + +
+
+ +
+
+ **soft_limit:** `typing.Optional[int]`
@@ -13474,6 +13705,7 @@ client = Schematic( client.plans.list_plans( company_id="company_id", + company_scoped_only=True, exclude_company_scoped=True, for_fallback_plan=True, for_initial_plan=True, @@ -13514,6 +13746,14 @@ client.plans.list_plans(
+**company_scoped_only:** `typing.Optional[bool]` — Only return plans that are scoped to a company (custom plans assigned to a company) + +
+
+ +
+
+ **exclude_company_scoped:** `typing.Optional[bool]` — Exclude plans that are scoped to a company (custom plans assigned to a company)
@@ -14046,6 +14286,14 @@ client.plans.upsert_plan_for_billing_product(
+**external_resource_version:** `typing.Optional[str]` + +
+
+ +
+
+ **icon:** `typing.Optional[PlanIcon]`
@@ -14261,6 +14509,7 @@ client = Schematic( client.plans.count_plans( company_id="company_id", + company_scoped_only=True, exclude_company_scoped=True, for_fallback_plan=True, for_initial_plan=True, @@ -14301,6 +14550,14 @@ client.plans.count_plans(
+**company_scoped_only:** `typing.Optional[bool]` — Only return plans that are scoped to a company (custom plans assigned to a company) + +
+
+ +
+
+ **exclude_company_scoped:** `typing.Optional[bool]` — Exclude plans that are scoped to a company (custom plans assigned to a company)
@@ -15186,8 +15443,8 @@ client.components.preview_component_data(
-## dataexports -
client.dataexports.create_data_export(...) -> CreateDataExportResponse +## planbundle +
client.planbundle.create_custom_plan_bundle(...) -> CreateCustomPlanBundleResponse
@@ -15200,7 +15457,7 @@ client.components.preview_component_data(
```python -from schematic import Schematic +from schematic import Schematic, PlanBundleEntitlementRequestBody from schematic.environment import SchematicEnvironment client = Schematic( @@ -15208,8 +15465,12 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.dataexports.create_data_export( - metadata="metadata", +client.planbundle.create_custom_plan_bundle( + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) + ], ) ``` @@ -15226,7 +15487,7 @@ client.dataexports.create_data_export(
-**export_type:** `DataExportType` +**entitlements:** `typing.List[PlanBundleEntitlementRequestBody]`
@@ -15234,7 +15495,7 @@ client.dataexports.create_data_export(
-**metadata:** `str` +**billing_product:** `typing.Optional[UpsertBillingProductRequestBody]`
@@ -15242,7 +15503,7 @@ client.dataexports.create_data_export(
-**output_file_type:** `DataExportOutputFileType` +**plan:** `typing.Optional[CreateCustomPlanBundlePlanRequestBody]`
@@ -15262,7 +15523,7 @@ client.dataexports.create_data_export(
-
client.dataexports.get_data_export_artifact(...) -> typing.Iterator[bytes] +
client.planbundle.create_plan_bundle(...) -> CreatePlanBundleResponse
@@ -15275,7 +15536,7 @@ client.dataexports.create_data_export(
```python -from schematic import Schematic +from schematic import Schematic, PlanBundleEntitlementRequestBody from schematic.environment import SchematicEnvironment client = Schematic( @@ -15283,8 +15544,12 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.dataexports.get_data_export_artifact( - data_export_id="data_export_id", +client.planbundle.create_plan_bundle( + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) + ], ) ``` @@ -15301,7 +15566,7 @@ client.dataexports.get_data_export_artifact(
-**data_export_id:** `str` — data_export_id +**entitlements:** `typing.List[PlanBundleEntitlementRequestBody]`
@@ -15309,63 +15574,31 @@ client.dataexports.get_data_export_artifact(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**billing_product:** `typing.Optional[UpsertBillingProductRequestBody]`
-
-
- -
-
- - -## events -
client.events.create_event_batch(...) -> CreateEventBatchResponse
-#### 🔌 Usage - -
-
+**credit_grants:** `typing.Optional[typing.List[PlanBundleCreditGrantRequestBody]]` + +
+
-```python -from schematic import Schematic, CreateEventRequestBody -from schematic.environment import SchematicEnvironment - -client = Schematic( - api_key="", - environment=SchematicEnvironment.DEFAULT, -) - -client.events.create_event_batch( - events=[ - CreateEventRequestBody( - event_type="flag_check", - ) - ], -) - -``` -
-
+**plan:** `typing.Optional[CreatePlanRequestBody]` +
-#### ⚙️ Parameters - -
-
-
-**events:** `typing.List[CreateEventRequestBody]` +**traits:** `typing.Optional[typing.List[UpdatePlanTraitTraitRequestBody]]`
@@ -15385,7 +15618,7 @@ client.events.create_event_batch(
-
client.events.get_event_summaries(...) -> GetEventSummariesResponse +
client.planbundle.update_plan_bundle(...) -> UpdatePlanBundleResponse
@@ -15398,7 +15631,7 @@ client.events.create_event_batch(
```python -from schematic import Schematic +from schematic import Schematic, PlanBundleEntitlementRequestBody from schematic.environment import SchematicEnvironment client = Schematic( @@ -15406,13 +15639,13 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.events.get_event_summaries( - q="q", - event_subtypes=[ - "event_subtypes" +client.planbundle.update_plan_bundle( + plan_bundle_id="plan_bundle_id", + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) ], - limit=1000000, - offset=1000000, ) ``` @@ -15429,7 +15662,7 @@ client.events.get_event_summaries(
-**q:** `typing.Optional[str]` +**plan_bundle_id:** `str` — plan_bundle_id
@@ -15437,7 +15670,7 @@ client.events.get_event_summaries(
-**event_subtypes:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**entitlements:** `typing.List[PlanBundleEntitlementRequestBody]`
@@ -15445,7 +15678,7 @@ client.events.get_event_summaries(
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**billing_product:** `typing.Optional[UpsertBillingProductRequestBody]`
@@ -15453,7 +15686,31 @@ client.events.get_event_summaries(
-**offset:** `typing.Optional[int]` — Page offset (default 0) +**credit_grants:** `typing.Optional[typing.List[PlanBundleCreditGrantRequestBody]]` + +
+
+ +
+
+ +**plan:** `typing.Optional[UpdatePlanRequestBody]` + +
+
+ +
+
+ +**plan_version_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**traits:** `typing.Optional[typing.List[UpdatePlanTraitTraitRequestBody]]`
@@ -15473,7 +15730,8 @@ client.events.get_event_summaries(
-
client.events.list_events(...) -> ListEventsResponse +## dataexports +
client.dataexports.create_data_export(...) -> CreateDataExportResponse
@@ -15494,16 +15752,8 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.events.list_events( - company_id="company_id", - event_subtype="event_subtype", - event_types=[ - "flag_check" - ], - flag_id="flag_id", - user_id="user_id", - limit=1000000, - offset=1000000, +client.dataexports.create_data_export( + metadata="metadata", ) ``` @@ -15520,39 +15770,7 @@ client.events.list_events(
-**company_id:** `typing.Optional[str]` - -
-
- -
-
- -**event_subtype:** `typing.Optional[str]` - -
-
- -
-
- -**event_types:** `typing.Optional[typing.Union[EventType, typing.Sequence[EventType]]]` - -
-
- -
-
- -**flag_id:** `typing.Optional[str]` - -
-
- -
-
- -**user_id:** `typing.Optional[str]` +**export_type:** `DataExportType`
@@ -15560,7 +15778,7 @@ client.events.list_events(
-**limit:** `typing.Optional[int]` — Page limit (default 100) +**metadata:** `str`
@@ -15568,7 +15786,7 @@ client.events.list_events(
-**offset:** `typing.Optional[int]` — Page offset (default 0) +**output_file_type:** `DataExportOutputFileType`
@@ -15588,7 +15806,7 @@ client.events.list_events(
-
client.events.create_event(...) -> CreateEventResponse +
client.dataexports.get_data_export_artifact(...) -> typing.Iterator[bytes]
@@ -15609,8 +15827,8 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.events.create_event( - event_type="flag_check", +client.dataexports.get_data_export_artifact( + data_export_id="data_export_id", ) ``` @@ -15627,7 +15845,7 @@ client.events.create_event(
-**request:** `CreateEventRequestBody` +**data_export_id:** `str` — data_export_id
@@ -15647,7 +15865,8 @@ client.events.create_event(
-
client.events.get_event(...) -> GetEventResponse +## events +
client.events.create_event_batch(...) -> CreateEventBatchResponse
@@ -15660,7 +15879,7 @@ client.events.create_event(
```python -from schematic import Schematic +from schematic import Schematic, CreateEventRequestBody from schematic.environment import SchematicEnvironment client = Schematic( @@ -15668,8 +15887,12 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.events.get_event( - event_id="event_id", +client.events.create_event_batch( + events=[ + CreateEventRequestBody( + event_type="flag_check", + ) + ], ) ``` @@ -15686,7 +15909,7 @@ client.events.get_event(
-**event_id:** `str` — event_id +**events:** `typing.List[CreateEventRequestBody]`
@@ -15706,7 +15929,7 @@ client.events.get_event(
-
client.events.get_segment_integration_status() -> GetSegmentIntegrationStatusResponse +
client.events.get_event_summaries(...) -> GetEventSummariesResponse
@@ -15727,7 +15950,14 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.events.get_segment_integration_status() +client.events.get_event_summaries( + q="q", + event_subtypes=[ + "event_subtypes" + ], + limit=1000000, + offset=1000000, +) ```
@@ -15743,6 +15973,38 @@ client.events.get_segment_integration_status()
+**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) + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -15755,8 +16017,7 @@ client.events.get_segment_integration_status()
-## features -
client.features.list_features(...) -> ListFeaturesResponse +
client.events.list_events(...) -> ListEventsResponse
@@ -15777,18 +16038,15 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.list_features( - boolean_require_event=True, - feature_type=[ - "boolean" - ], - ids=[ - "ids" +client.events.list_events( + company_id="company_id", + event_subtype="event_subtype", + event_types=[ + "flag_check" ], - plan_version_id="plan_version_id", - q="q", - without_company_override_for="without_company_override_for", - without_plan_entitlement_for="without_plan_entitlement_for", + flag_id="flag_id", + idempotency_key="idempotency_key", + user_id="user_id", limit=1000000, offset=1000000, ) @@ -15807,15 +16065,7 @@ client.features.list_features(
-**boolean_require_event:** `typing.Optional[bool]` — Only return boolean features if there is an associated event. Automatically includes boolean in the feature types filter. - -
-
- -
-
- -**feature_type:** `typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]]` — Filter by one or more feature types (boolean, event, trait) +**company_id:** `typing.Optional[str]`
@@ -15823,7 +16073,7 @@ client.features.list_features(
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**event_subtype:** `typing.Optional[str]`
@@ -15831,7 +16081,7 @@ client.features.list_features(
-**plan_version_id:** `typing.Optional[str]` — Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used +**event_types:** `typing.Optional[typing.Union[EventType, typing.Sequence[EventType]]]`
@@ -15839,7 +16089,7 @@ client.features.list_features(
-**q:** `typing.Optional[str]` — Search by feature name or ID +**flag_id:** `typing.Optional[str]`
@@ -15847,7 +16097,7 @@ client.features.list_features(
-**without_company_override_for:** `typing.Optional[str]` — Filter out features that already have a company override for the specified company ID +**idempotency_key:** `typing.Optional[str]`
@@ -15855,7 +16105,7 @@ client.features.list_features(
-**without_plan_entitlement_for:** `typing.Optional[str]` — Filter out features that already have a plan entitlement for the specified plan ID +**user_id:** `typing.Optional[str]`
@@ -15891,7 +16141,7 @@ client.features.list_features(
-
client.features.create_feature(...) -> CreateFeatureResponse +
client.events.create_event(...) -> CreateEventResponse
@@ -15912,10 +16162,8 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.create_feature( - description="description", - feature_type="boolean", - name="name", +client.events.create_event( + event_type="flag_check", ) ``` @@ -15932,7 +16180,7 @@ client.features.create_feature(
-**description:** `str` +**request:** `CreateEventRequestBody`
@@ -15940,47 +16188,58 @@ client.features.create_feature(
-**feature_type:** `FeatureType` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**name:** `str` -
+
+
client.events.get_event(...) -> GetEventResponse
-**event_subtype:** `typing.Optional[str]` - -
-
+#### 🔌 Usage
-**flag:** `typing.Optional[CreateOrUpdateFlagRequestBody]` - -
-
-
-**icon:** `typing.Optional[str]` - +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.events.get_event( + event_id="event_id", +) + +``` +
+
+#### ⚙️ Parameters +
-**lifecycle_phase:** `typing.Optional[FeatureLifecyclePhase]` +
+
+ +**event_id:** `str` — event_id
@@ -15988,35 +16247,52 @@ client.features.create_feature(
-**maintainer_account_member_id:** `typing.Optional[str]` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**plural_name:** `typing.Optional[str]` -
+ +
client.events.get_segment_integration_status() -> GetSegmentIntegrationStatusResponse
-**singular_name:** `typing.Optional[str]` - -
-
+#### 🔌 Usage
-**trait_id:** `typing.Optional[str]` - +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.events.get_segment_integration_status() + +``` +
+
+#### ⚙️ Parameters + +
+
+
@@ -16032,7 +16308,8 @@ client.features.create_feature(
-
client.features.get_feature(...) -> GetFeatureResponse +## features +
client.features.list_features(...) -> ListFeaturesResponse
@@ -16053,8 +16330,21 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.get_feature( - feature_id="feature_id", +client.features.list_features( + boolean_require_event=True, + feature_type=[ + "boolean" + ], + ids=[ + "ids" + ], + managed_by="orb", + plan_version_id="plan_version_id", + q="q", + without_company_override_for="without_company_override_for", + without_plan_entitlement_for="without_plan_entitlement_for", + limit=1000000, + offset=1000000, ) ``` @@ -16071,7 +16361,79 @@ client.features.get_feature(
-**feature_id:** `str` — feature_id +**boolean_require_event:** `typing.Optional[bool]` — Only return boolean features if there is an associated event. Automatically includes boolean in the feature types filter. + +
+
+ +
+
+ +**feature_type:** `typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]]` — Filter by one or more feature types (boolean, event, trait) + +
+
+ +
+
+ +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` + +
+
+ +
+
+ +**managed_by:** `typing.Optional[BillingProviderType]` — Filter for features managed by a billing provider, or by Schematic (no billing provider) + +
+
+ +
+
+ +**plan_version_id:** `typing.Optional[str]` — Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used + +
+
+ +
+
+ +**q:** `typing.Optional[str]` — Search by feature name or ID + +
+
+ +
+
+ +**without_company_override_for:** `typing.Optional[str]` — Filter out features that already have a company override for the specified company ID + +
+
+ +
+
+ +**without_plan_entitlement_for:** `typing.Optional[str]` — Filter out features that already have a plan entitlement for the specified plan ID + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0)
@@ -16091,7 +16453,7 @@ client.features.get_feature(
-
client.features.update_feature(...) -> UpdateFeatureResponse +
client.features.create_feature(...) -> CreateFeatureResponse
@@ -16112,8 +16474,10 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.update_feature( - feature_id="feature_id", +client.features.create_feature( + description="description", + feature_type="boolean", + name="name", ) ``` @@ -16130,7 +16494,7 @@ client.features.update_feature(
-**feature_id:** `str` — feature_id +**description:** `str`
@@ -16138,7 +16502,7 @@ client.features.update_feature(
-**description:** `typing.Optional[str]` +**feature_type:** `FeatureType`
@@ -16146,7 +16510,7 @@ client.features.update_feature(
-**event_subtype:** `typing.Optional[str]` +**name:** `str`
@@ -16154,7 +16518,7 @@ client.features.update_feature(
-**feature_type:** `typing.Optional[FeatureType]` +**event_subtype:** `typing.Optional[str]`
@@ -16194,14 +16558,6 @@ client.features.update_feature(
-**name:** `typing.Optional[str]` - -
-
- -
-
- **plural_name:** `typing.Optional[str]`
@@ -16238,7 +16594,7 @@ client.features.update_feature(
-
client.features.delete_feature(...) -> DeleteFeatureResponse +
client.features.get_feature(...) -> GetFeatureResponse
@@ -16259,7 +16615,7 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.delete_feature( +client.features.get_feature( feature_id="feature_id", ) @@ -16297,7 +16653,7 @@ client.features.delete_feature(
-
client.features.upsert_feature_for_billing_product(...) -> UpsertFeatureForBillingProductResponse +
client.features.update_feature(...) -> UpdateFeatureResponse
@@ -16318,12 +16674,8 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.upsert_feature_for_billing_product( - billing_provider="orb", - description="description", - external_resource_id="external_resource_id", - feature_type="boolean", - name="name", +client.features.update_feature( + feature_id="feature_id", ) ``` @@ -16340,15 +16692,7 @@ client.features.upsert_feature_for_billing_product(
-**billing_provider:** `BillingProviderType` - -
-
- -
-
- -**description:** `str` +**feature_id:** `str` — feature_id
@@ -16356,7 +16700,7 @@ client.features.upsert_feature_for_billing_product(
-**external_resource_id:** `str` +**description:** `typing.Optional[str]`
@@ -16364,7 +16708,7 @@ client.features.upsert_feature_for_billing_product(
-**feature_type:** `FeatureType` +**event_subtype:** `typing.Optional[str]`
@@ -16372,7 +16716,7 @@ client.features.upsert_feature_for_billing_product(
-**name:** `str` +**feature_type:** `typing.Optional[FeatureType]`
@@ -16380,7 +16724,7 @@ client.features.upsert_feature_for_billing_product(
-**event_subtype:** `typing.Optional[str]` +**flag:** `typing.Optional[CreateOrUpdateFlagRequestBody]`
@@ -16388,7 +16732,7 @@ client.features.upsert_feature_for_billing_product(
-**flag:** `typing.Optional[CreateOrUpdateFlagRequestBody]` +**icon:** `typing.Optional[str]`
@@ -16396,7 +16740,7 @@ client.features.upsert_feature_for_billing_product(
-**icon:** `typing.Optional[str]` +**lifecycle_phase:** `typing.Optional[FeatureLifecyclePhase]`
@@ -16404,7 +16748,7 @@ client.features.upsert_feature_for_billing_product(
-**lifecycle_phase:** `typing.Optional[FeatureLifecyclePhase]` +**maintainer_account_member_id:** `typing.Optional[str]`
@@ -16412,7 +16756,7 @@ client.features.upsert_feature_for_billing_product(
-**maintainer_account_member_id:** `typing.Optional[str]` +**name:** `typing.Optional[str]`
@@ -16456,7 +16800,7 @@ client.features.upsert_feature_for_billing_product(
-
client.features.count_features(...) -> CountFeaturesResponse +
client.features.delete_feature(...) -> DeleteFeatureResponse
@@ -16477,15 +16821,234 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.count_features( - boolean_require_event=True, - feature_type=[ - "boolean" - ], - ids=[ - "ids" - ], - plan_version_id="plan_version_id", +client.features.delete_feature( + feature_id="feature_id", +) + +``` +
+
+ +
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**feature_id:** `str` — feature_id + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + + + +
client.features.upsert_feature_for_billing_product(...) -> UpsertFeatureForBillingProductResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.features.upsert_feature_for_billing_product( + billing_provider="orb", + description="description", + external_resource_id="external_resource_id", + feature_type="boolean", + name="name", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**billing_provider:** `BillingProviderType` + +
+
+ +
+
+ +**description:** `str` + +
+
+ +
+
+ +**external_resource_id:** `str` + +
+
+ +
+
+ +**feature_type:** `FeatureType` + +
+
+ +
+
+ +**name:** `str` + +
+
+ +
+
+ +**event_subtype:** `typing.Optional[str]` + +
+
+ +
+
+ +**flag:** `typing.Optional[CreateOrUpdateFlagRequestBody]` + +
+
+ +
+
+ +**icon:** `typing.Optional[str]` + +
+
+ +
+
+ +**lifecycle_phase:** `typing.Optional[FeatureLifecyclePhase]` + +
+
+ +
+
+ +**maintainer_account_member_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**plural_name:** `typing.Optional[str]` + +
+
+ +
+
+ +**singular_name:** `typing.Optional[str]` + +
+
+ +
+
+ +**trait_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.features.count_features(...) -> CountFeaturesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.features.count_features( + boolean_require_event=True, + feature_type=[ + "boolean" + ], + ids=[ + "ids" + ], + managed_by="orb", + plan_version_id="plan_version_id", q="q", without_company_override_for="without_company_override_for", without_plan_entitlement_for="without_plan_entitlement_for", @@ -16531,6 +17094,14 @@ client.features.count_features(
+**managed_by:** `typing.Optional[BillingProviderType]` — Filter for features managed by a billing provider, or by Schematic (no billing provider) + +
+
+ +
+
+ **plan_version_id:** `typing.Optional[str]` — Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used
@@ -16789,7 +17360,575 @@ client.features.get_flag(
-**flag_id:** `str` — flag_id +**flag_id:** `str` — flag_id + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.features.update_flag(...) -> UpdateFlagResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.features.update_flag( + flag_id="flag_id", + default_value=True, + description="description", + key="key", + name="name", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**flag_id:** `str` — flag_id + +
+
+ +
+
+ +**request:** `CreateFlagRequestBody` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.features.delete_flag(...) -> DeleteFlagResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.features.delete_flag( + flag_id="flag_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**flag_id:** `str` — flag_id + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.features.update_flag_rules(...) -> UpdateFlagRulesResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic, CreateOrUpdateRuleRequestBody, CreateOrUpdateConditionGroupRequestBody, CreateOrUpdateConditionRequestBody +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.features.update_flag_rules( + flag_id="flag_id", + rules=[ + CreateOrUpdateRuleRequestBody( + condition_groups=[ + CreateOrUpdateConditionGroupRequestBody( + conditions=[ + CreateOrUpdateConditionRequestBody( + condition_type="base_plan", + operator="eq", + resource_ids=[ + "resource_ids" + ], + ) + ], + ) + ], + conditions=[ + CreateOrUpdateConditionRequestBody( + condition_type="base_plan", + operator="eq", + resource_ids=[ + "resource_ids" + ], + ) + ], + name="name", + priority=1000000, + value=True, + ) + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**flag_id:** `str` — flag_id + +
+
+ +
+
+ +**rules:** `typing.List[CreateOrUpdateRuleRequestBody]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.features.check_flag(...) -> CheckFlagResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.features.check_flag( + key="key", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**key:** `str` — key + +
+
+ +
+
+ +**request:** `CheckFlagRequestBody` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.features.check_flags(...) -> CheckFlagsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.features.check_flags() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CheckFlagRequestBody` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.features.check_flags_bulk(...) -> CheckFlagsBulkResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic, CheckFlagRequestBody +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.features.check_flags_bulk( + contexts=[ + CheckFlagRequestBody() + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**contexts:** `typing.List[CheckFlagRequestBody]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.features.count_flags(...) -> CountFlagsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.features.count_flags( + feature_id="feature_id", + ids=[ + "ids" + ], + q="q", + limit=1000000, + offset=1000000, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**feature_id:** `typing.Optional[str]` + +
+
+ +
+
+ +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` + +
+
+ +
+
+ +**q:** `typing.Optional[str]` — Search by flag name, key, or ID + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `typing.Optional[int]` — Page offset (default 0) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## insights +
client.insights.get_activity(...) -> GetActivityResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.insights.get_activity( + limit=1000000, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `typing.Optional[int]`
@@ -16809,7 +17948,7 @@ client.features.get_flag(
-
client.features.update_flag(...) -> UpdateFlagResponse +
client.insights.get_environment_feature_usage_time_series(...) -> GetEnvironmentFeatureUsageTimeSeriesResponse
@@ -16824,18 +17963,18 @@ client.features.get_flag( ```python from schematic import Schematic from schematic.environment import SchematicEnvironment +import datetime client = Schematic( api_key="", environment=SchematicEnvironment.DEFAULT, ) -client.features.update_flag( - flag_id="flag_id", - default_value=True, - description="description", - key="key", - name="name", +client.insights.get_environment_feature_usage_time_series( + end_time=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), + feature_id="feature_id", + granularity="daily", + start_time=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), ) ``` @@ -16852,7 +17991,7 @@ client.features.update_flag(
-**flag_id:** `str` — flag_id +**end_time:** `datetime.datetime`
@@ -16860,7 +17999,23 @@ client.features.update_flag(
-**request:** `CreateFlagRequestBody` +**feature_id:** `str` + +
+
+ +
+
+ +**start_time:** `datetime.datetime` + +
+
+ +
+
+ +**granularity:** `typing.Optional[TimeSeriesGranularity]`
@@ -16880,7 +18035,7 @@ client.features.update_flag(
-
client.features.delete_flag(...) -> DeleteFlagResponse +
client.insights.get_plan_growth(...) -> GetPlanGrowthResponse
@@ -16901,8 +18056,8 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.delete_flag( - flag_id="flag_id", +client.insights.get_plan_growth( + months=1000000, ) ``` @@ -16919,7 +18074,7 @@ client.features.delete_flag(
-**flag_id:** `str` — flag_id +**months:** `typing.Optional[int]`
@@ -16939,7 +18094,7 @@ client.features.delete_flag(
-
client.features.update_flag_rules(...) -> UpdateFlagRulesResponse +
client.insights.get_summary() -> GetSummaryResponse
@@ -16952,7 +18107,7 @@ client.features.delete_flag(
```python -from schematic import Schematic, CreateOrUpdateRuleRequestBody, CreateOrUpdateConditionGroupRequestBody, CreateOrUpdateConditionRequestBody +from schematic import Schematic from schematic.environment import SchematicEnvironment client = Schematic( @@ -16960,38 +18115,7 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.update_flag_rules( - flag_id="flag_id", - rules=[ - CreateOrUpdateRuleRequestBody( - condition_groups=[ - CreateOrUpdateConditionGroupRequestBody( - conditions=[ - CreateOrUpdateConditionRequestBody( - condition_type="base_plan", - operator="eq", - resource_ids=[ - "resource_ids" - ], - ) - ], - ) - ], - conditions=[ - CreateOrUpdateConditionRequestBody( - condition_type="base_plan", - operator="eq", - resource_ids=[ - "resource_ids" - ], - ) - ], - name="name", - priority=1000000, - value=True, - ) - ], -) +client.insights.get_summary() ```
@@ -17007,22 +18131,6 @@ client.features.update_flag_rules(
-**flag_id:** `str` — flag_id - -
-
- -
-
- -**rules:** `typing.List[CreateOrUpdateRuleRequestBody]` - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -17035,7 +18143,7 @@ client.features.update_flag_rules(
-
client.features.check_flag(...) -> CheckFlagResponse +
client.insights.get_top_features_by_usage(...) -> GetTopFeaturesByUsageResponse
@@ -17050,14 +18158,17 @@ client.features.update_flag_rules( ```python from schematic import Schematic from schematic.environment import SchematicEnvironment +import datetime client = Schematic( api_key="", environment=SchematicEnvironment.DEFAULT, ) -client.features.check_flag( - key="key", +client.insights.get_top_features_by_usage( + end_time=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), + limit=1000000, + start_time=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), ) ``` @@ -17074,7 +18185,7 @@ client.features.check_flag(
-**key:** `str` — key +**end_time:** `datetime.datetime`
@@ -17082,7 +18193,15 @@ client.features.check_flag(
-**request:** `CheckFlagRequestBody` +**start_time:** `datetime.datetime` + +
+
+ +
+
+ +**limit:** `typing.Optional[int]`
@@ -17102,7 +18221,7 @@ client.features.check_flag(
-
client.features.check_flags(...) -> CheckFlagsResponse +
client.insights.get_environment_trait_usage_time_series(...) -> GetEnvironmentTraitUsageTimeSeriesResponse
@@ -17117,13 +18236,19 @@ client.features.check_flag( ```python from schematic import Schematic from schematic.environment import SchematicEnvironment +import datetime client = Schematic( api_key="", environment=SchematicEnvironment.DEFAULT, ) -client.features.check_flags() +client.insights.get_environment_trait_usage_time_series( + end_time=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), + feature_id="feature_id", + granularity="daily", + start_time=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"), +) ```
@@ -17139,7 +18264,31 @@ client.features.check_flags()
-**request:** `CheckFlagRequestBody` +**end_time:** `datetime.datetime` + +
+
+ +
+
+ +**feature_id:** `str` + +
+
+ +
+
+ +**start_time:** `datetime.datetime` + +
+
+ +
+
+ +**granularity:** `typing.Optional[TimeSeriesGranularity]`
@@ -17159,7 +18308,8 @@ client.features.check_flags()
-
client.features.check_flags_bulk(...) -> CheckFlagsBulkResponse +## integrationsapi +
client.integrationsapi.run_integration(...) -> RunIntegrationResponse
@@ -17172,7 +18322,7 @@ client.features.check_flags()
```python -from schematic import Schematic, CheckFlagRequestBody +from schematic import Schematic from schematic.environment import SchematicEnvironment client = Schematic( @@ -17180,10 +18330,8 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.check_flags_bulk( - contexts=[ - CheckFlagRequestBody() - ], +client.integrationsapi.run_integration( + integration_id="integration_id", ) ``` @@ -17200,7 +18348,7 @@ client.features.check_flags_bulk(
-**contexts:** `typing.List[CheckFlagRequestBody]` +**integration_id:** `str` — integration_id
@@ -17220,7 +18368,7 @@ client.features.check_flags_bulk(
-
client.features.count_flags(...) -> CountFlagsResponse +
client.integrationsapi.list_integrations(...) -> ListIntegrationsResponse
@@ -17241,12 +18389,14 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.features.count_flags( - feature_id="feature_id", - ids=[ - "ids" +client.integrationsapi.list_integrations( + billing_only=True, + exclude_ids=[ + "exclude_ids" ], - q="q", + id="id", + state="active", + type="clerk", limit=1000000, offset=1000000, ) @@ -17265,7 +18415,7 @@ client.features.count_flags(
-**feature_id:** `typing.Optional[str]` +**billing_only:** `typing.Optional[bool]`
@@ -17273,7 +18423,7 @@ client.features.count_flags(
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` +**exclude_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
@@ -17281,7 +18431,23 @@ client.features.count_flags(
-**q:** `typing.Optional[str]` — Search by flag name, key, or ID +**id:** `typing.Optional[str]` + +
+
+ +
+
+ +**state:** `typing.Optional[IntegrationState]` + +
+
+ +
+
+ +**type:** `typing.Optional[IntegrationType]`
@@ -17317,7 +18483,6 @@ client.features.count_flags(
-## integrationsapi
client.integrationsapi.get_integration_webhook_url(...) -> GetIntegrationWebhookUrlResponse
@@ -17377,8 +18542,7 @@ client.integrationsapi.get_integration_webhook_url(
-## planbundle -
client.planbundle.create_plan_bundle(...) -> CreatePlanBundleResponse +
client.integrationsapi.start_data_import(...) -> StartDataImportResponse
@@ -17391,7 +18555,7 @@ client.integrationsapi.get_integration_webhook_url(
```python -from schematic import Schematic, PlanBundleEntitlementRequestBody +from schematic import Schematic from schematic.environment import SchematicEnvironment client = Schematic( @@ -17399,12 +18563,8 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.planbundle.create_plan_bundle( - entitlements=[ - PlanBundleEntitlementRequestBody( - action="create", - ) - ], +client.integrationsapi.start_data_import( + integration_id="integration_id", ) ``` @@ -17421,23 +18581,7 @@ client.planbundle.create_plan_bundle(
-**entitlements:** `typing.List[PlanBundleEntitlementRequestBody]` - -
-
- -
-
- -**billing_product:** `typing.Optional[UpsertBillingProductRequestBody]` - -
-
- -
-
- -**credit_grants:** `typing.Optional[typing.List[PlanBundleCreditGrantRequestBody]]` +**integration_id:** `str`
@@ -17445,7 +18589,7 @@ client.planbundle.create_plan_bundle(
-**plan:** `typing.Optional[CreatePlanRequestBody]` +**company_matching_criteria:** `typing.Optional[CompanyMatchingCriteria]`
@@ -17453,7 +18597,7 @@ client.planbundle.create_plan_bundle(
-**traits:** `typing.Optional[typing.List[UpdatePlanTraitTraitRequestBody]]` +**company_matching_field:** `typing.Optional[str]`
@@ -17473,7 +18617,7 @@ client.planbundle.create_plan_bundle(
-
client.planbundle.update_plan_bundle(...) -> UpdatePlanBundleResponse +
client.integrationsapi.load_sample_data_set_v_2() -> LoadSampleDataSetV2Response
@@ -17486,7 +18630,7 @@ client.planbundle.create_plan_bundle(
```python -from schematic import Schematic, PlanBundleEntitlementRequestBody +from schematic import Schematic from schematic.environment import SchematicEnvironment client = Schematic( @@ -17494,14 +18638,7 @@ client = Schematic( environment=SchematicEnvironment.DEFAULT, ) -client.planbundle.update_plan_bundle( - plan_bundle_id="plan_bundle_id", - entitlements=[ - PlanBundleEntitlementRequestBody( - action="create", - ) - ], -) +client.integrationsapi.load_sample_data_set_v_2() ```
@@ -17517,55 +18654,58 @@ client.planbundle.update_plan_bundle(
-**plan_bundle_id:** `str` — plan_bundle_id +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**entitlements:** `typing.List[PlanBundleEntitlementRequestBody]` -
+
+
client.integrationsapi.uninstall_integration(...) -> UninstallIntegrationResponse
-**billing_product:** `typing.Optional[UpsertBillingProductRequestBody]` - -
-
+#### 🔌 Usage
-**credit_grants:** `typing.Optional[typing.List[PlanBundleCreditGrantRequestBody]]` - -
-
-
-**plan:** `typing.Optional[UpdatePlanRequestBody]` - +```python +from schematic import Schematic +from schematic.environment import SchematicEnvironment + +client = Schematic( + api_key="", + environment=SchematicEnvironment.DEFAULT, +) + +client.integrationsapi.uninstall_integration( + integration_id="integration_id", +) + +``` +
+
+#### ⚙️ Parameters +
-**plan_version_id:** `typing.Optional[str]` - -
-
-
-**traits:** `typing.Optional[typing.List[UpdatePlanTraitTraitRequestBody]]` +**integration_id:** `str` — integration_id
diff --git a/src/schematic/__init__.py b/src/schematic/__init__.py index 7fae489..5866425 100644 --- a/src/schematic/__init__.py +++ b/src/schematic/__init__.py @@ -10,9 +10,12 @@ AccountMemberPermission, AccountMemberResponseData, AccountMemberRole, + ActivityEntryResponseData, + ActivityResponseResponseData, ActorType, ApiError, ApiKeyCreateResponseData, + ApiKeyIntegrationResponseData, ApiKeyResponseData, ApiKeyScope, AuditLogListResponseData, @@ -72,13 +75,17 @@ CheckoutDataResponseData, CheckoutSettingsResponseData, CheckoutSubscription, + ClerkIntegrationConfig, + CompanyCreditBalanceResponseData, CompanyDetailResponseData, CompanyEventPeriodMetricsResponseData, CompanyLedgerResponseData, + CompanyMatchingCriteria, CompanyMembershipDetailResponseData, CompanyMembershipResponseData, CompanyOverrideNoteResponseData, CompanyOverrideResponseData, + CompanyPlanCreditGrantView, CompanyPlanDetailResponseData, CompanyPlanInvalidReason, CompanyPlanWithBillingSubView, @@ -107,6 +114,7 @@ CouponRequestBody, CreateBillingPlanCreditGrantRequestBody, CreateBillingPriceTierRequestBody, + CreateCustomPlanBundlePlanRequestBody, CreateEntitlementInBundleRequestBody, CreateEntitlementReqCommon, CreateEventRequestBody, @@ -123,6 +131,7 @@ CreditBundleCurrencyPriceResponseData, CreditBundlePurchaseResponseData, CreditCompanyGrantView, + CreditCurrencyPrice, CreditCurrencyPriceRequestBody, CreditCurrencyPriceResponseData, CreditEventLedgerResponseData, @@ -171,8 +180,11 @@ EntityTraitValue, EntityType, EnvironmentDetailResponseData, + EnvironmentFeatureUsageTimeSeriesResponseData, EnvironmentResponseData, + EnvironmentTraitUsageTimeSeriesResponseData, EnvironmentType, + EnvironmentUsagePointResponseData, EventBody, EventBodyFlagCheck, EventBodyIdentify, @@ -203,8 +215,19 @@ FlagType, FlagView, GenericPreviewObject, + InsightsSummaryResponseData, + IntegrationCapabilities, + IntegrationConfig, + IntegrationConfig_Clerk, + IntegrationConfig_Orb, + IntegrationConfig_Stripe, + IntegrationResponseData, + IntegrationState, IntegrationType, IntegrationWebhookUrlResponseData, + IntegrationsDataSetResponseData, + IntegrationsListResponseData, + IntegrationsResponseData, InvoiceRequestBody, InvoiceResponseData, InvoiceStatus, @@ -217,6 +240,8 @@ MeterRequestBody, MetricPeriod, MetricPeriodMonthReset, + MrrResponseData, + OrbIntegrationConfig, OrderedPlansInGroup, PaymentMethodRequestBody, PaymentMethodResponseData, @@ -239,6 +264,8 @@ PlanGroupPlanDetailResponseData, PlanGroupPlanEntitlementsOrder, PlanGroupResponseData, + PlanGrowthPointResponseData, + PlanGrowthResponseData, PlanIcon, PlanIssueResponseData, PlanResponseData, @@ -304,17 +331,21 @@ SkippedEntitlementResponseData, SortDirection, StripeEmbedInfo, + StripeIntegrationConfig, SubscriptionStatus, SubscriptionTraitUpdate, SubscriptionType, TemporaryAccessTokenResourceType, TemporaryAccessTokenResponseData, TimeSeriesGranularity, + TopFeatureByUsageResponseData, + TopFeaturesByUsageResponseData, TraitDefinition, TraitDefinitionComparableType, TraitType, TrialStatus, UpdateAddOnRequestBody, + UpdateAutoTopupOverrideRequestBody, UpdateBillingPlanCreditGrantRequestBody, UpdateCreditBundleRequestBody, UpdateEntitlementReqCommon, @@ -357,6 +388,7 @@ entitlements, events, features, + insights, integrationsapi, planbundle, plangroups, @@ -533,6 +565,8 @@ ListBillingCreditsResponse, ListBillingPlanCreditGrantsParams, ListBillingPlanCreditGrantsResponse, + ListCompanyCreditBalancesParams, + ListCompanyCreditBalancesResponse, ListCompanyGrantsParams, ListCompanyGrantsResponse, ListCreditBundlesParams, @@ -618,8 +652,29 @@ UpdateFlagRulesResponse, UpsertFeatureForBillingProductResponse, ) - from .integrationsapi import GetIntegrationWebhookUrlResponse - from .planbundle import CreatePlanBundleResponse, UpdatePlanBundleResponse + from .insights import ( + GetActivityParams, + GetActivityResponse, + GetEnvironmentFeatureUsageTimeSeriesParams, + GetEnvironmentFeatureUsageTimeSeriesResponse, + GetEnvironmentTraitUsageTimeSeriesParams, + GetEnvironmentTraitUsageTimeSeriesResponse, + GetPlanGrowthParams, + GetPlanGrowthResponse, + GetSummaryResponse, + GetTopFeaturesByUsageParams, + GetTopFeaturesByUsageResponse, + ) + from .integrationsapi import ( + GetIntegrationWebhookUrlResponse, + ListIntegrationsParams, + ListIntegrationsResponse, + LoadSampleDataSetV2Response, + RunIntegrationResponse, + StartDataImportResponse, + UninstallIntegrationResponse, + ) + from .planbundle import CreateCustomPlanBundleResponse, CreatePlanBundleResponse, UpdatePlanBundleResponse from .plangroups import CreatePlanGroupResponse, GetPlanGroupParams, GetPlanGroupResponse, UpdatePlanGroupResponse from .planmigrations import ( CountCompanyMigrationsParams, @@ -686,9 +741,12 @@ "AccountMemberPermission": ".types", "AccountMemberResponseData": ".types", "AccountMemberRole": ".types", + "ActivityEntryResponseData": ".types", + "ActivityResponseResponseData": ".types", "ActorType": ".types", "ApiError": ".types", "ApiKeyCreateResponseData": ".types", + "ApiKeyIntegrationResponseData": ".types", "ApiKeyResponseData": ".types", "ApiKeyScope": ".types", "AsyncSchematic": ".client", @@ -756,13 +814,17 @@ "CheckoutInternalResponse": ".checkout", "CheckoutSettingsResponseData": ".types", "CheckoutSubscription": ".types", + "ClerkIntegrationConfig": ".types", + "CompanyCreditBalanceResponseData": ".types", "CompanyDetailResponseData": ".types", "CompanyEventPeriodMetricsResponseData": ".types", "CompanyLedgerResponseData": ".types", + "CompanyMatchingCriteria": ".types", "CompanyMembershipDetailResponseData": ".types", "CompanyMembershipResponseData": ".types", "CompanyOverrideNoteResponseData": ".types", "CompanyOverrideResponseData": ".types", + "CompanyPlanCreditGrantView": ".types", "CompanyPlanDetailResponseData": ".types", "CompanyPlanInvalidReason": ".types", "CompanyPlanWithBillingSubView": ".types", @@ -858,6 +920,8 @@ "CreateCompanyResponse": ".companies", "CreateComponentResponse": ".components", "CreateCreditBundleResponse": ".credits", + "CreateCustomPlanBundlePlanRequestBody": ".types", + "CreateCustomPlanBundleResponse": ".planbundle", "CreateCustomPlanResponse": ".plans", "CreateDataExportResponse": ".dataexports", "CreateEntitlementInBundleRequestBody": ".types", @@ -888,6 +952,7 @@ "CreditBundleCurrencyPriceResponseData": ".types", "CreditBundlePurchaseResponseData": ".types", "CreditCompanyGrantView": ".types", + "CreditCurrencyPrice": ".types", "CreditCurrencyPriceRequestBody": ".types", "CreditCurrencyPriceResponseData": ".types", "CreditEventLedgerResponseData": ".types", @@ -959,8 +1024,11 @@ "EntityTraitValue": ".types", "EntityType": ".types", "EnvironmentDetailResponseData": ".types", + "EnvironmentFeatureUsageTimeSeriesResponseData": ".types", "EnvironmentResponseData": ".types", + "EnvironmentTraitUsageTimeSeriesResponseData": ".types", "EnvironmentType": ".types", + "EnvironmentUsagePointResponseData": ".types", "EventBody": ".types", "EventBodyFlagCheck": ".types", "EventBodyIdentify": ".types", @@ -995,6 +1063,8 @@ "GetAccountMemberResponse": ".accounts", "GetActiveCompanySubscriptionParams": ".companies", "GetActiveCompanySubscriptionResponse": ".companies", + "GetActivityParams": ".insights", + "GetActivityResponse": ".insights", "GetApiKeyResponse": ".accounts", "GetAuditLogResponse": ".accounts", "GetCheckoutDataResponse": ".checkout", @@ -1007,7 +1077,11 @@ "GetEntityTraitDefinitionResponse": ".companies", "GetEntityTraitValuesParams": ".companies", "GetEntityTraitValuesResponse": ".companies", + "GetEnvironmentFeatureUsageTimeSeriesParams": ".insights", + "GetEnvironmentFeatureUsageTimeSeriesResponse": ".insights", "GetEnvironmentResponse": ".accounts", + "GetEnvironmentTraitUsageTimeSeriesParams": ".insights", + "GetEnvironmentTraitUsageTimeSeriesResponse": ".insights", "GetEventResponse": ".events", "GetEventSummariesParams": ".events", "GetEventSummariesResponse": ".events", @@ -1025,6 +1099,8 @@ "GetPlanEntitlementResponse": ".entitlements", "GetPlanGroupParams": ".plangroups", "GetPlanGroupResponse": ".plangroups", + "GetPlanGrowthParams": ".insights", + "GetPlanGrowthResponse": ".insights", "GetPlanParams": ".plans", "GetPlanResponse": ".plans", "GetPlanTraitResponse": ".companies", @@ -1033,13 +1109,27 @@ "GetSegmentIntegrationStatusResponse": ".events", "GetSingleBillingCreditResponse": ".credits", "GetSingleBillingPlanCreditGrantResponse": ".credits", + "GetSummaryResponse": ".insights", + "GetTopFeaturesByUsageParams": ".insights", + "GetTopFeaturesByUsageResponse": ".insights", "GetUserResponse": ".companies", "GetWebhookEventResponse": ".webhooks", "GetWebhookResponse": ".webhooks", "GetWhoAmIResponse": ".accounts", "GrantBillingCreditsToCompanyResponse": ".credits", + "InsightsSummaryResponseData": ".types", + "IntegrationCapabilities": ".types", + "IntegrationConfig": ".types", + "IntegrationConfig_Clerk": ".types", + "IntegrationConfig_Orb": ".types", + "IntegrationConfig_Stripe": ".types", + "IntegrationResponseData": ".types", + "IntegrationState": ".types", "IntegrationType": ".types", "IntegrationWebhookUrlResponseData": ".types", + "IntegrationsDataSetResponseData": ".types", + "IntegrationsListResponseData": ".types", + "IntegrationsResponseData": ".types", "InternalServerError": ".errors", "InvoiceRequestBody": ".types", "InvoiceResponseData": ".types", @@ -1068,6 +1158,8 @@ "ListBillingProductsResponse": ".billing", "ListCompaniesParams": ".companies", "ListCompaniesResponse": ".companies", + "ListCompanyCreditBalancesParams": ".credits", + "ListCompanyCreditBalancesResponse": ".credits", "ListCompanyGrantsParams": ".credits", "ListCompanyGrantsResponse": ".credits", "ListCompanyMembershipsParams": ".companies", @@ -1108,6 +1200,8 @@ "ListFlagsResponse": ".features", "ListGrantsForCreditParams": ".credits", "ListGrantsForCreditResponse": ".credits", + "ListIntegrationsParams": ".integrationsapi", + "ListIntegrationsResponse": ".integrationsapi", "ListInvoicesParams": ".billing", "ListInvoicesResponse": ".billing", "ListMetersParams": ".billing", @@ -1134,6 +1228,7 @@ "ListWebhookEventsResponse": ".webhooks", "ListWebhooksParams": ".webhooks", "ListWebhooksResponse": ".webhooks", + "LoadSampleDataSetV2Response": ".integrationsapi", "LocalCache": ".client", "LookupCompanyParams": ".companies", "LookupCompanyResponse": ".companies", @@ -1146,7 +1241,9 @@ "MeterRequestBody": ".types", "MetricPeriod": ".types", "MetricPeriodMonthReset": ".types", + "MrrResponseData": ".types", "NotFoundError": ".errors", + "OrbIntegrationConfig": ".types", "OrderedPlansInGroup": ".types", "PaymentMethodRequestBody": ".types", "PaymentMethodResponseData": ".types", @@ -1169,6 +1266,8 @@ "PlanGroupPlanDetailResponseData": ".types", "PlanGroupPlanEntitlementsOrder": ".types", "PlanGroupResponseData": ".types", + "PlanGrowthPointResponseData": ".types", + "PlanGrowthResponseData": ".types", "PlanIcon": ".types", "PlanIssueResponseData": ".types", "PlanResponseData": ".types", @@ -1232,6 +1331,7 @@ "RulesengineTraitDefinition": ".types", "RulesengineTraitDefinitionComparableType": ".types", "RulesengineUser": ".types", + "RunIntegrationResponse": ".integrationsapi", "ScheduledCheckoutResponseData": ".types", "ScheduledCheckoutStatus": ".types", "ScheduledDowngradeConfigBehavior": ".types", @@ -1244,20 +1344,26 @@ "SkippedEntitlementResponseData": ".types", "SoftDeleteBillingCreditResponse": ".credits", "SortDirection": ".types", + "StartDataImportResponse": ".integrationsapi", "StripeEmbedInfo": ".types", + "StripeIntegrationConfig": ".types", "SubscriptionStatus": ".types", "SubscriptionTraitUpdate": ".types", "SubscriptionType": ".types", "TemporaryAccessTokenResourceType": ".types", "TemporaryAccessTokenResponseData": ".types", "TimeSeriesGranularity": ".types", + "TopFeatureByUsageResponseData": ".types", + "TopFeaturesByUsageResponseData": ".types", "TraitDefinition": ".types", "TraitDefinitionComparableType": ".types", "TraitType": ".types", "TrialStatus": ".types", "UnauthorizedError": ".errors", + "UninstallIntegrationResponse": ".integrationsapi", "UpdateAddOnRequestBody": ".types", "UpdateApiKeyResponse": ".accounts", + "UpdateAutoTopupOverrideRequestBody": ".types", "UpdateBillingCreditResponse": ".credits", "UpdateBillingPlanCreditGrantRequestBody": ".types", "UpdateBillingPlanCreditGrantResponse": ".credits", @@ -1334,6 +1440,7 @@ "entitlements": ".entitlements", "events": ".events", "features": ".features", + "insights": ".insights", "integrationsapi": ".integrationsapi", "planbundle": ".planbundle", "plangroups": ".plangroups", @@ -1369,9 +1476,12 @@ def __dir__(): "AccountMemberPermission", "AccountMemberResponseData", "AccountMemberRole", + "ActivityEntryResponseData", + "ActivityResponseResponseData", "ActorType", "ApiError", "ApiKeyCreateResponseData", + "ApiKeyIntegrationResponseData", "ApiKeyResponseData", "ApiKeyScope", "AsyncSchematic", @@ -1439,13 +1549,17 @@ def __dir__(): "CheckoutInternalResponse", "CheckoutSettingsResponseData", "CheckoutSubscription", + "ClerkIntegrationConfig", + "CompanyCreditBalanceResponseData", "CompanyDetailResponseData", "CompanyEventPeriodMetricsResponseData", "CompanyLedgerResponseData", + "CompanyMatchingCriteria", "CompanyMembershipDetailResponseData", "CompanyMembershipResponseData", "CompanyOverrideNoteResponseData", "CompanyOverrideResponseData", + "CompanyPlanCreditGrantView", "CompanyPlanDetailResponseData", "CompanyPlanInvalidReason", "CompanyPlanWithBillingSubView", @@ -1541,6 +1655,8 @@ def __dir__(): "CreateCompanyResponse", "CreateComponentResponse", "CreateCreditBundleResponse", + "CreateCustomPlanBundlePlanRequestBody", + "CreateCustomPlanBundleResponse", "CreateCustomPlanResponse", "CreateDataExportResponse", "CreateEntitlementInBundleRequestBody", @@ -1571,6 +1687,7 @@ def __dir__(): "CreditBundleCurrencyPriceResponseData", "CreditBundlePurchaseResponseData", "CreditCompanyGrantView", + "CreditCurrencyPrice", "CreditCurrencyPriceRequestBody", "CreditCurrencyPriceResponseData", "CreditEventLedgerResponseData", @@ -1642,8 +1759,11 @@ def __dir__(): "EntityTraitValue", "EntityType", "EnvironmentDetailResponseData", + "EnvironmentFeatureUsageTimeSeriesResponseData", "EnvironmentResponseData", + "EnvironmentTraitUsageTimeSeriesResponseData", "EnvironmentType", + "EnvironmentUsagePointResponseData", "EventBody", "EventBodyFlagCheck", "EventBodyIdentify", @@ -1678,6 +1798,8 @@ def __dir__(): "GetAccountMemberResponse", "GetActiveCompanySubscriptionParams", "GetActiveCompanySubscriptionResponse", + "GetActivityParams", + "GetActivityResponse", "GetApiKeyResponse", "GetAuditLogResponse", "GetCheckoutDataResponse", @@ -1690,7 +1812,11 @@ def __dir__(): "GetEntityTraitDefinitionResponse", "GetEntityTraitValuesParams", "GetEntityTraitValuesResponse", + "GetEnvironmentFeatureUsageTimeSeriesParams", + "GetEnvironmentFeatureUsageTimeSeriesResponse", "GetEnvironmentResponse", + "GetEnvironmentTraitUsageTimeSeriesParams", + "GetEnvironmentTraitUsageTimeSeriesResponse", "GetEventResponse", "GetEventSummariesParams", "GetEventSummariesResponse", @@ -1708,6 +1834,8 @@ def __dir__(): "GetPlanEntitlementResponse", "GetPlanGroupParams", "GetPlanGroupResponse", + "GetPlanGrowthParams", + "GetPlanGrowthResponse", "GetPlanParams", "GetPlanResponse", "GetPlanTraitResponse", @@ -1716,13 +1844,27 @@ def __dir__(): "GetSegmentIntegrationStatusResponse", "GetSingleBillingCreditResponse", "GetSingleBillingPlanCreditGrantResponse", + "GetSummaryResponse", + "GetTopFeaturesByUsageParams", + "GetTopFeaturesByUsageResponse", "GetUserResponse", "GetWebhookEventResponse", "GetWebhookResponse", "GetWhoAmIResponse", "GrantBillingCreditsToCompanyResponse", + "InsightsSummaryResponseData", + "IntegrationCapabilities", + "IntegrationConfig", + "IntegrationConfig_Clerk", + "IntegrationConfig_Orb", + "IntegrationConfig_Stripe", + "IntegrationResponseData", + "IntegrationState", "IntegrationType", "IntegrationWebhookUrlResponseData", + "IntegrationsDataSetResponseData", + "IntegrationsListResponseData", + "IntegrationsResponseData", "InternalServerError", "InvoiceRequestBody", "InvoiceResponseData", @@ -1751,6 +1893,8 @@ def __dir__(): "ListBillingProductsResponse", "ListCompaniesParams", "ListCompaniesResponse", + "ListCompanyCreditBalancesParams", + "ListCompanyCreditBalancesResponse", "ListCompanyGrantsParams", "ListCompanyGrantsResponse", "ListCompanyMembershipsParams", @@ -1791,6 +1935,8 @@ def __dir__(): "ListFlagsResponse", "ListGrantsForCreditParams", "ListGrantsForCreditResponse", + "ListIntegrationsParams", + "ListIntegrationsResponse", "ListInvoicesParams", "ListInvoicesResponse", "ListMetersParams", @@ -1817,6 +1963,7 @@ def __dir__(): "ListWebhookEventsResponse", "ListWebhooksParams", "ListWebhooksResponse", + "LoadSampleDataSetV2Response", "LocalCache", "LookupCompanyParams", "LookupCompanyResponse", @@ -1829,7 +1976,9 @@ def __dir__(): "MeterRequestBody", "MetricPeriod", "MetricPeriodMonthReset", + "MrrResponseData", "NotFoundError", + "OrbIntegrationConfig", "OrderedPlansInGroup", "PaymentMethodRequestBody", "PaymentMethodResponseData", @@ -1852,6 +2001,8 @@ def __dir__(): "PlanGroupPlanDetailResponseData", "PlanGroupPlanEntitlementsOrder", "PlanGroupResponseData", + "PlanGrowthPointResponseData", + "PlanGrowthResponseData", "PlanIcon", "PlanIssueResponseData", "PlanResponseData", @@ -1915,6 +2066,7 @@ def __dir__(): "RulesengineTraitDefinition", "RulesengineTraitDefinitionComparableType", "RulesengineUser", + "RunIntegrationResponse", "ScheduledCheckoutResponseData", "ScheduledCheckoutStatus", "ScheduledDowngradeConfigBehavior", @@ -1927,20 +2079,26 @@ def __dir__(): "SkippedEntitlementResponseData", "SoftDeleteBillingCreditResponse", "SortDirection", + "StartDataImportResponse", "StripeEmbedInfo", + "StripeIntegrationConfig", "SubscriptionStatus", "SubscriptionTraitUpdate", "SubscriptionType", "TemporaryAccessTokenResourceType", "TemporaryAccessTokenResponseData", "TimeSeriesGranularity", + "TopFeatureByUsageResponseData", + "TopFeaturesByUsageResponseData", "TraitDefinition", "TraitDefinitionComparableType", "TraitType", "TrialStatus", "UnauthorizedError", + "UninstallIntegrationResponse", "UpdateAddOnRequestBody", "UpdateApiKeyResponse", + "UpdateAutoTopupOverrideRequestBody", "UpdateBillingCreditResponse", "UpdateBillingPlanCreditGrantRequestBody", "UpdateBillingPlanCreditGrantResponse", @@ -2017,6 +2175,7 @@ def __dir__(): "entitlements", "events", "features", + "insights", "integrationsapi", "planbundle", "plangroups", diff --git a/src/schematic/base_client.py b/src/schematic/base_client.py index 0dbd075..f3d3125 100644 --- a/src/schematic/base_client.py +++ b/src/schematic/base_client.py @@ -22,6 +22,7 @@ from .entitlements.client import AsyncEntitlementsClient, EntitlementsClient from .events.client import AsyncEventsClient, EventsClient from .features.client import AsyncFeaturesClient, FeaturesClient + from .insights.client import AsyncInsightsClient, InsightsClient from .integrationsapi.client import AsyncIntegrationsapiClient, IntegrationsapiClient from .planbundle.client import AsyncPlanbundleClient, PlanbundleClient from .plangroups.client import AsyncPlangroupsClient, PlangroupsClient @@ -109,11 +110,12 @@ def __init__( self._entitlements: typing.Optional[EntitlementsClient] = None self._plans: typing.Optional[PlansClient] = None self._components: typing.Optional[ComponentsClient] = None + self._planbundle: typing.Optional[PlanbundleClient] = None self._dataexports: typing.Optional[DataexportsClient] = None self._events: typing.Optional[EventsClient] = None self._features: typing.Optional[FeaturesClient] = None + self._insights: typing.Optional[InsightsClient] = None self._integrationsapi: typing.Optional[IntegrationsapiClient] = None - self._planbundle: typing.Optional[PlanbundleClient] = None self._plangroups: typing.Optional[PlangroupsClient] = None self._planmigrations: typing.Optional[PlanmigrationsClient] = None self._componentspublic: typing.Optional[ComponentspublicClient] = None @@ -185,6 +187,14 @@ def components(self): self._components = ComponentsClient(client_wrapper=self._client_wrapper) return self._components + @property + def planbundle(self): + if self._planbundle is None: + from .planbundle.client import PlanbundleClient # noqa: E402 + + self._planbundle = PlanbundleClient(client_wrapper=self._client_wrapper) + return self._planbundle + @property def dataexports(self): if self._dataexports is None: @@ -209,6 +219,14 @@ def features(self): self._features = FeaturesClient(client_wrapper=self._client_wrapper) return self._features + @property + def insights(self): + if self._insights is None: + from .insights.client import InsightsClient # noqa: E402 + + self._insights = InsightsClient(client_wrapper=self._client_wrapper) + return self._insights + @property def integrationsapi(self): if self._integrationsapi is None: @@ -217,14 +235,6 @@ def integrationsapi(self): self._integrationsapi = IntegrationsapiClient(client_wrapper=self._client_wrapper) return self._integrationsapi - @property - def planbundle(self): - if self._planbundle is None: - from .planbundle.client import PlanbundleClient # noqa: E402 - - self._planbundle = PlanbundleClient(client_wrapper=self._client_wrapper) - return self._planbundle - @property def plangroups(self): if self._plangroups is None: @@ -352,11 +362,12 @@ def __init__( self._entitlements: typing.Optional[AsyncEntitlementsClient] = None self._plans: typing.Optional[AsyncPlansClient] = None self._components: typing.Optional[AsyncComponentsClient] = None + self._planbundle: typing.Optional[AsyncPlanbundleClient] = None self._dataexports: typing.Optional[AsyncDataexportsClient] = None self._events: typing.Optional[AsyncEventsClient] = None self._features: typing.Optional[AsyncFeaturesClient] = None + self._insights: typing.Optional[AsyncInsightsClient] = None self._integrationsapi: typing.Optional[AsyncIntegrationsapiClient] = None - self._planbundle: typing.Optional[AsyncPlanbundleClient] = None self._plangroups: typing.Optional[AsyncPlangroupsClient] = None self._planmigrations: typing.Optional[AsyncPlanmigrationsClient] = None self._componentspublic: typing.Optional[AsyncComponentspublicClient] = None @@ -428,6 +439,14 @@ def components(self): self._components = AsyncComponentsClient(client_wrapper=self._client_wrapper) return self._components + @property + def planbundle(self): + if self._planbundle is None: + from .planbundle.client import AsyncPlanbundleClient # noqa: E402 + + self._planbundle = AsyncPlanbundleClient(client_wrapper=self._client_wrapper) + return self._planbundle + @property def dataexports(self): if self._dataexports is None: @@ -452,6 +471,14 @@ def features(self): self._features = AsyncFeaturesClient(client_wrapper=self._client_wrapper) return self._features + @property + def insights(self): + if self._insights is None: + from .insights.client import AsyncInsightsClient # noqa: E402 + + self._insights = AsyncInsightsClient(client_wrapper=self._client_wrapper) + return self._insights + @property def integrationsapi(self): if self._integrationsapi is None: @@ -460,14 +487,6 @@ def integrationsapi(self): self._integrationsapi = AsyncIntegrationsapiClient(client_wrapper=self._client_wrapper) return self._integrationsapi - @property - def planbundle(self): - if self._planbundle is None: - from .planbundle.client import AsyncPlanbundleClient # noqa: E402 - - self._planbundle = AsyncPlanbundleClient(client_wrapper=self._client_wrapper) - return self._planbundle - @property def plangroups(self): if self._plangroups is None: diff --git a/src/schematic/billing/client.py b/src/schematic/billing/client.py index 5faffeb..62b9e19 100644 --- a/src/schematic/billing/client.py +++ b/src/schematic/billing/client.py @@ -882,6 +882,7 @@ def upsert_billing_price( price_tiers: typing.Sequence[CreateBillingPriceTierRequestBody], product_external_id: str, usage_type: BillingPriceUsageType, + interval_count: typing.Optional[int] = OMIT, meter_id: typing.Optional[str] = OMIT, nickname: typing.Optional[str] = OMIT, package_size: typing.Optional[int] = OMIT, @@ -913,6 +914,8 @@ def upsert_billing_price( usage_type : BillingPriceUsageType + interval_count : typing.Optional[int] + meter_id : typing.Optional[str] nickname : typing.Optional[str] @@ -968,6 +971,7 @@ def upsert_billing_price( price_tiers=price_tiers, product_external_id=product_external_id, usage_type=usage_type, + interval_count=interval_count, meter_id=meter_id, nickname=nickname, package_size=package_size, @@ -1220,6 +1224,7 @@ def list_billing_products( price_usage_type: typing.Optional[BillingPriceUsageType] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, + recurring_charges_only: typing.Optional[bool] = None, with_one_time_charges: typing.Optional[bool] = None, with_prices_only: typing.Optional[bool] = None, with_zero_price: typing.Optional[bool] = None, @@ -1244,6 +1249,9 @@ def list_billing_products( q : typing.Optional[str] + recurring_charges_only : typing.Optional[bool] + Filter to products that have at least one recurring price + with_one_time_charges : typing.Optional[bool] Filter products that are one time charges @@ -1284,6 +1292,7 @@ def list_billing_products( price_usage_type="licensed", provider_type="orb", q="q", + recurring_charges_only=True, with_one_time_charges=True, with_prices_only=True, with_zero_price=True, @@ -1299,6 +1308,7 @@ def list_billing_products( price_usage_type=price_usage_type, provider_type=provider_type, q=q, + recurring_charges_only=recurring_charges_only, with_one_time_charges=with_one_time_charges, with_prices_only=with_prices_only, with_zero_price=with_zero_price, @@ -1318,6 +1328,7 @@ def count_billing_products( price_usage_type: typing.Optional[BillingPriceUsageType] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, + recurring_charges_only: typing.Optional[bool] = None, with_one_time_charges: typing.Optional[bool] = None, with_prices_only: typing.Optional[bool] = None, with_zero_price: typing.Optional[bool] = None, @@ -1342,6 +1353,9 @@ def count_billing_products( q : typing.Optional[str] + recurring_charges_only : typing.Optional[bool] + Filter to products that have at least one recurring price + with_one_time_charges : typing.Optional[bool] Filter products that are one time charges @@ -1382,6 +1396,7 @@ def count_billing_products( price_usage_type="licensed", provider_type="orb", q="q", + recurring_charges_only=True, with_one_time_charges=True, with_prices_only=True, with_zero_price=True, @@ -1397,6 +1412,7 @@ def count_billing_products( price_usage_type=price_usage_type, provider_type=provider_type, q=q, + recurring_charges_only=recurring_charges_only, with_one_time_charges=with_one_time_charges, with_prices_only=with_prices_only, with_zero_price=with_zero_price, @@ -2492,6 +2508,7 @@ async def upsert_billing_price( price_tiers: typing.Sequence[CreateBillingPriceTierRequestBody], product_external_id: str, usage_type: BillingPriceUsageType, + interval_count: typing.Optional[int] = OMIT, meter_id: typing.Optional[str] = OMIT, nickname: typing.Optional[str] = OMIT, package_size: typing.Optional[int] = OMIT, @@ -2523,6 +2540,8 @@ async def upsert_billing_price( usage_type : BillingPriceUsageType + interval_count : typing.Optional[int] + meter_id : typing.Optional[str] nickname : typing.Optional[str] @@ -2586,6 +2605,7 @@ async def main() -> None: price_tiers=price_tiers, product_external_id=product_external_id, usage_type=usage_type, + interval_count=interval_count, meter_id=meter_id, nickname=nickname, package_size=package_size, @@ -2870,6 +2890,7 @@ async def list_billing_products( price_usage_type: typing.Optional[BillingPriceUsageType] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, + recurring_charges_only: typing.Optional[bool] = None, with_one_time_charges: typing.Optional[bool] = None, with_prices_only: typing.Optional[bool] = None, with_zero_price: typing.Optional[bool] = None, @@ -2894,6 +2915,9 @@ async def list_billing_products( q : typing.Optional[str] + recurring_charges_only : typing.Optional[bool] + Filter to products that have at least one recurring price + with_one_time_charges : typing.Optional[bool] Filter products that are one time charges @@ -2939,6 +2963,7 @@ async def main() -> None: price_usage_type="licensed", provider_type="orb", q="q", + recurring_charges_only=True, with_one_time_charges=True, with_prices_only=True, with_zero_price=True, @@ -2957,6 +2982,7 @@ async def main() -> None: price_usage_type=price_usage_type, provider_type=provider_type, q=q, + recurring_charges_only=recurring_charges_only, with_one_time_charges=with_one_time_charges, with_prices_only=with_prices_only, with_zero_price=with_zero_price, @@ -2976,6 +3002,7 @@ async def count_billing_products( price_usage_type: typing.Optional[BillingPriceUsageType] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, + recurring_charges_only: typing.Optional[bool] = None, with_one_time_charges: typing.Optional[bool] = None, with_prices_only: typing.Optional[bool] = None, with_zero_price: typing.Optional[bool] = None, @@ -3000,6 +3027,9 @@ async def count_billing_products( q : typing.Optional[str] + recurring_charges_only : typing.Optional[bool] + Filter to products that have at least one recurring price + with_one_time_charges : typing.Optional[bool] Filter products that are one time charges @@ -3045,6 +3075,7 @@ async def main() -> None: price_usage_type="licensed", provider_type="orb", q="q", + recurring_charges_only=True, with_one_time_charges=True, with_prices_only=True, with_zero_price=True, @@ -3063,6 +3094,7 @@ async def main() -> None: price_usage_type=price_usage_type, provider_type=provider_type, q=q, + recurring_charges_only=recurring_charges_only, with_one_time_charges=with_one_time_charges, with_prices_only=with_prices_only, with_zero_price=with_zero_price, diff --git a/src/schematic/billing/raw_client.py b/src/schematic/billing/raw_client.py index d2d02aa..03f0ae3 100644 --- a/src/schematic/billing/raw_client.py +++ b/src/schematic/billing/raw_client.py @@ -1681,6 +1681,7 @@ def upsert_billing_price( price_tiers: typing.Sequence[CreateBillingPriceTierRequestBody], product_external_id: str, usage_type: BillingPriceUsageType, + interval_count: typing.Optional[int] = OMIT, meter_id: typing.Optional[str] = OMIT, nickname: typing.Optional[str] = OMIT, package_size: typing.Optional[int] = OMIT, @@ -1712,6 +1713,8 @@ def upsert_billing_price( usage_type : BillingPriceUsageType + interval_count : typing.Optional[int] + meter_id : typing.Optional[str] nickname : typing.Optional[str] @@ -1740,6 +1743,7 @@ def upsert_billing_price( "currency": currency, "external_account_id": external_account_id, "interval": interval, + "interval_count": interval_count, "is_active": is_active, "meter_id": meter_id, "nickname": nickname, @@ -2347,6 +2351,7 @@ def list_billing_products( price_usage_type: typing.Optional[BillingPriceUsageType] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, + recurring_charges_only: typing.Optional[bool] = None, with_one_time_charges: typing.Optional[bool] = None, with_prices_only: typing.Optional[bool] = None, with_zero_price: typing.Optional[bool] = None, @@ -2371,6 +2376,9 @@ def list_billing_products( q : typing.Optional[str] + recurring_charges_only : typing.Optional[bool] + Filter to products that have at least one recurring price + with_one_time_charges : typing.Optional[bool] Filter products that are one time charges @@ -2407,6 +2415,7 @@ def list_billing_products( "price_usage_type": price_usage_type, "provider_type": provider_type, "q": q, + "recurring_charges_only": recurring_charges_only, "with_one_time_charges": with_one_time_charges, "with_prices_only": with_prices_only, "with_zero_price": with_zero_price, @@ -2503,6 +2512,7 @@ def count_billing_products( price_usage_type: typing.Optional[BillingPriceUsageType] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, + recurring_charges_only: typing.Optional[bool] = None, with_one_time_charges: typing.Optional[bool] = None, with_prices_only: typing.Optional[bool] = None, with_zero_price: typing.Optional[bool] = None, @@ -2527,6 +2537,9 @@ def count_billing_products( q : typing.Optional[str] + recurring_charges_only : typing.Optional[bool] + Filter to products that have at least one recurring price + with_one_time_charges : typing.Optional[bool] Filter products that are one time charges @@ -2563,6 +2576,7 @@ def count_billing_products( "price_usage_type": price_usage_type, "provider_type": provider_type, "q": q, + "recurring_charges_only": recurring_charges_only, "with_one_time_charges": with_one_time_charges, "with_prices_only": with_prices_only, "with_zero_price": with_zero_price, @@ -4468,6 +4482,7 @@ async def upsert_billing_price( price_tiers: typing.Sequence[CreateBillingPriceTierRequestBody], product_external_id: str, usage_type: BillingPriceUsageType, + interval_count: typing.Optional[int] = OMIT, meter_id: typing.Optional[str] = OMIT, nickname: typing.Optional[str] = OMIT, package_size: typing.Optional[int] = OMIT, @@ -4499,6 +4514,8 @@ async def upsert_billing_price( usage_type : BillingPriceUsageType + interval_count : typing.Optional[int] + meter_id : typing.Optional[str] nickname : typing.Optional[str] @@ -4527,6 +4544,7 @@ async def upsert_billing_price( "currency": currency, "external_account_id": external_account_id, "interval": interval, + "interval_count": interval_count, "is_active": is_active, "meter_id": meter_id, "nickname": nickname, @@ -5134,6 +5152,7 @@ async def list_billing_products( price_usage_type: typing.Optional[BillingPriceUsageType] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, + recurring_charges_only: typing.Optional[bool] = None, with_one_time_charges: typing.Optional[bool] = None, with_prices_only: typing.Optional[bool] = None, with_zero_price: typing.Optional[bool] = None, @@ -5158,6 +5177,9 @@ async def list_billing_products( q : typing.Optional[str] + recurring_charges_only : typing.Optional[bool] + Filter to products that have at least one recurring price + with_one_time_charges : typing.Optional[bool] Filter products that are one time charges @@ -5194,6 +5216,7 @@ async def list_billing_products( "price_usage_type": price_usage_type, "provider_type": provider_type, "q": q, + "recurring_charges_only": recurring_charges_only, "with_one_time_charges": with_one_time_charges, "with_prices_only": with_prices_only, "with_zero_price": with_zero_price, @@ -5290,6 +5313,7 @@ async def count_billing_products( price_usage_type: typing.Optional[BillingPriceUsageType] = None, provider_type: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, + recurring_charges_only: typing.Optional[bool] = None, with_one_time_charges: typing.Optional[bool] = None, with_prices_only: typing.Optional[bool] = None, with_zero_price: typing.Optional[bool] = None, @@ -5314,6 +5338,9 @@ async def count_billing_products( q : typing.Optional[str] + recurring_charges_only : typing.Optional[bool] + Filter to products that have at least one recurring price + with_one_time_charges : typing.Optional[bool] Filter products that are one time charges @@ -5350,6 +5377,7 @@ async def count_billing_products( "price_usage_type": price_usage_type, "provider_type": provider_type, "q": q, + "recurring_charges_only": recurring_charges_only, "with_one_time_charges": with_one_time_charges, "with_prices_only": with_prices_only, "with_zero_price": with_zero_price, diff --git a/src/schematic/billing/types/count_billing_products_params.py b/src/schematic/billing/types/count_billing_products_params.py index 8571863..cdb3137 100644 --- a/src/schematic/billing/types/count_billing_products_params.py +++ b/src/schematic/billing/types/count_billing_products_params.py @@ -33,6 +33,11 @@ class CountBillingProductsParams(UniversalBaseModel): price_usage_type: typing.Optional[BillingPriceUsageType] = None provider_type: typing.Optional[BillingProviderType] = None q: typing.Optional[str] = None + recurring_charges_only: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter to products that have at least one recurring price + """ + with_one_time_charges: typing.Optional[bool] = pydantic.Field(default=None) """ Filter products that are one time charges diff --git a/src/schematic/billing/types/list_billing_products_params.py b/src/schematic/billing/types/list_billing_products_params.py index 535e85d..dae2772 100644 --- a/src/schematic/billing/types/list_billing_products_params.py +++ b/src/schematic/billing/types/list_billing_products_params.py @@ -33,6 +33,11 @@ class ListBillingProductsParams(UniversalBaseModel): price_usage_type: typing.Optional[BillingPriceUsageType] = None provider_type: typing.Optional[BillingProviderType] = None q: typing.Optional[str] = None + recurring_charges_only: typing.Optional[bool] = pydantic.Field(default=None) + """ + Filter to products that have at least one recurring price + """ + with_one_time_charges: typing.Optional[bool] = pydantic.Field(default=None) """ Filter products that are one time charges diff --git a/src/schematic/checkout/client.py b/src/schematic/checkout/client.py index 5f57a2f..1fbed9e 100644 --- a/src/schematic/checkout/client.py +++ b/src/schematic/checkout/client.py @@ -7,6 +7,7 @@ from ..core.request_options import RequestOptions from ..types.plan_selection import PlanSelection from ..types.update_add_on_request_body import UpdateAddOnRequestBody +from ..types.update_auto_topup_override_request_body import UpdateAutoTopupOverrideRequestBody from ..types.update_credit_bundle_request_body import UpdateCreditBundleRequestBody from ..types.update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody from .raw_client import AsyncRawCheckoutClient, RawCheckoutClient @@ -41,6 +42,7 @@ def internal( self, *, add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + auto_topup_overrides: typing.Sequence[UpdateAutoTopupOverrideRequestBody], company_id: str, credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], new_plan_id: str, @@ -57,6 +59,8 @@ def internal( ---------- add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + auto_topup_overrides : typing.Sequence[UpdateAutoTopupOverrideRequestBody] + company_id : str credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] @@ -88,6 +92,7 @@ def internal( from schematic import ( Schematic, UpdateAddOnRequestBody, + UpdateAutoTopupOverrideRequestBody, UpdateCreditBundleRequestBody, UpdatePayInAdvanceRequestBody, ) @@ -102,6 +107,11 @@ def internal( price_id="price_id", ) ], + auto_topup_overrides=[ + UpdateAutoTopupOverrideRequestBody( + plan_credit_grant_id="plan_credit_grant_id", + ) + ], company_id="company_id", credit_bundles=[ UpdateCreditBundleRequestBody( @@ -122,6 +132,7 @@ def internal( """ _response = self._raw_client.internal( add_on_ids=add_on_ids, + auto_topup_overrides=auto_topup_overrides, company_id=company_id, credit_bundles=credit_bundles, new_plan_id=new_plan_id, @@ -177,6 +188,7 @@ def preview_checkout_internal( self, *, add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + auto_topup_overrides: typing.Sequence[UpdateAutoTopupOverrideRequestBody], company_id: str, credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], new_plan_id: str, @@ -193,6 +205,8 @@ def preview_checkout_internal( ---------- add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + auto_topup_overrides : typing.Sequence[UpdateAutoTopupOverrideRequestBody] + company_id : str credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] @@ -224,6 +238,7 @@ def preview_checkout_internal( from schematic import ( Schematic, UpdateAddOnRequestBody, + UpdateAutoTopupOverrideRequestBody, UpdateCreditBundleRequestBody, UpdatePayInAdvanceRequestBody, ) @@ -238,6 +253,11 @@ def preview_checkout_internal( price_id="price_id", ) ], + auto_topup_overrides=[ + UpdateAutoTopupOverrideRequestBody( + plan_credit_grant_id="plan_credit_grant_id", + ) + ], company_id="company_id", credit_bundles=[ UpdateCreditBundleRequestBody( @@ -258,6 +278,7 @@ def preview_checkout_internal( """ _response = self._raw_client.preview_checkout_internal( add_on_ids=add_on_ids, + auto_topup_overrides=auto_topup_overrides, company_id=company_id, credit_bundles=credit_bundles, new_plan_id=new_plan_id, @@ -592,6 +613,7 @@ async def internal( self, *, add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + auto_topup_overrides: typing.Sequence[UpdateAutoTopupOverrideRequestBody], company_id: str, credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], new_plan_id: str, @@ -608,6 +630,8 @@ async def internal( ---------- add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + auto_topup_overrides : typing.Sequence[UpdateAutoTopupOverrideRequestBody] + company_id : str credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] @@ -641,6 +665,7 @@ async def internal( from schematic import ( AsyncSchematic, UpdateAddOnRequestBody, + UpdateAutoTopupOverrideRequestBody, UpdateCreditBundleRequestBody, UpdatePayInAdvanceRequestBody, ) @@ -658,6 +683,11 @@ async def main() -> None: price_id="price_id", ) ], + auto_topup_overrides=[ + UpdateAutoTopupOverrideRequestBody( + plan_credit_grant_id="plan_credit_grant_id", + ) + ], company_id="company_id", credit_bundles=[ UpdateCreditBundleRequestBody( @@ -681,6 +711,7 @@ async def main() -> None: """ _response = await self._raw_client.internal( add_on_ids=add_on_ids, + auto_topup_overrides=auto_topup_overrides, company_id=company_id, credit_bundles=credit_bundles, new_plan_id=new_plan_id, @@ -744,6 +775,7 @@ async def preview_checkout_internal( self, *, add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + auto_topup_overrides: typing.Sequence[UpdateAutoTopupOverrideRequestBody], company_id: str, credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], new_plan_id: str, @@ -760,6 +792,8 @@ async def preview_checkout_internal( ---------- add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + auto_topup_overrides : typing.Sequence[UpdateAutoTopupOverrideRequestBody] + company_id : str credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] @@ -793,6 +827,7 @@ async def preview_checkout_internal( from schematic import ( AsyncSchematic, UpdateAddOnRequestBody, + UpdateAutoTopupOverrideRequestBody, UpdateCreditBundleRequestBody, UpdatePayInAdvanceRequestBody, ) @@ -810,6 +845,11 @@ async def main() -> None: price_id="price_id", ) ], + auto_topup_overrides=[ + UpdateAutoTopupOverrideRequestBody( + plan_credit_grant_id="plan_credit_grant_id", + ) + ], company_id="company_id", credit_bundles=[ UpdateCreditBundleRequestBody( @@ -833,6 +873,7 @@ async def main() -> None: """ _response = await self._raw_client.preview_checkout_internal( add_on_ids=add_on_ids, + auto_topup_overrides=auto_topup_overrides, company_id=company_id, credit_bundles=credit_bundles, new_plan_id=new_plan_id, diff --git a/src/schematic/checkout/raw_client.py b/src/schematic/checkout/raw_client.py index cde331d..0134955 100644 --- a/src/schematic/checkout/raw_client.py +++ b/src/schematic/checkout/raw_client.py @@ -20,6 +20,7 @@ from ..types.api_error import ApiError as types_api_error_ApiError from ..types.plan_selection import PlanSelection from ..types.update_add_on_request_body import UpdateAddOnRequestBody +from ..types.update_auto_topup_override_request_body import UpdateAutoTopupOverrideRequestBody from ..types.update_credit_bundle_request_body import UpdateCreditBundleRequestBody from ..types.update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody from .types.cancel_subscription_response import CancelSubscriptionResponse @@ -43,6 +44,7 @@ def internal( self, *, add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + auto_topup_overrides: typing.Sequence[UpdateAutoTopupOverrideRequestBody], company_id: str, credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], new_plan_id: str, @@ -59,6 +61,8 @@ def internal( ---------- add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + auto_topup_overrides : typing.Sequence[UpdateAutoTopupOverrideRequestBody] + company_id : str credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] @@ -92,6 +96,11 @@ def internal( "add_on_ids": convert_and_respect_annotation_metadata( object_=add_on_ids, annotation=typing.Sequence[UpdateAddOnRequestBody], direction="write" ), + "auto_topup_overrides": convert_and_respect_annotation_metadata( + object_=auto_topup_overrides, + annotation=typing.Sequence[UpdateAutoTopupOverrideRequestBody], + direction="write", + ), "company_id": company_id, "coupon_external_id": coupon_external_id, "credit_bundles": convert_and_respect_annotation_metadata( @@ -307,6 +316,7 @@ def preview_checkout_internal( self, *, add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + auto_topup_overrides: typing.Sequence[UpdateAutoTopupOverrideRequestBody], company_id: str, credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], new_plan_id: str, @@ -323,6 +333,8 @@ def preview_checkout_internal( ---------- add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + auto_topup_overrides : typing.Sequence[UpdateAutoTopupOverrideRequestBody] + company_id : str credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] @@ -356,6 +368,11 @@ def preview_checkout_internal( "add_on_ids": convert_and_respect_annotation_metadata( object_=add_on_ids, annotation=typing.Sequence[UpdateAddOnRequestBody], direction="write" ), + "auto_topup_overrides": convert_and_respect_annotation_metadata( + object_=auto_topup_overrides, + annotation=typing.Sequence[UpdateAutoTopupOverrideRequestBody], + direction="write", + ), "company_id": company_id, "coupon_external_id": coupon_external_id, "credit_bundles": convert_and_respect_annotation_metadata( @@ -1029,6 +1046,7 @@ async def internal( self, *, add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + auto_topup_overrides: typing.Sequence[UpdateAutoTopupOverrideRequestBody], company_id: str, credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], new_plan_id: str, @@ -1045,6 +1063,8 @@ async def internal( ---------- add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + auto_topup_overrides : typing.Sequence[UpdateAutoTopupOverrideRequestBody] + company_id : str credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] @@ -1078,6 +1098,11 @@ async def internal( "add_on_ids": convert_and_respect_annotation_metadata( object_=add_on_ids, annotation=typing.Sequence[UpdateAddOnRequestBody], direction="write" ), + "auto_topup_overrides": convert_and_respect_annotation_metadata( + object_=auto_topup_overrides, + annotation=typing.Sequence[UpdateAutoTopupOverrideRequestBody], + direction="write", + ), "company_id": company_id, "coupon_external_id": coupon_external_id, "credit_bundles": convert_and_respect_annotation_metadata( @@ -1293,6 +1318,7 @@ async def preview_checkout_internal( self, *, add_on_ids: typing.Sequence[UpdateAddOnRequestBody], + auto_topup_overrides: typing.Sequence[UpdateAutoTopupOverrideRequestBody], company_id: str, credit_bundles: typing.Sequence[UpdateCreditBundleRequestBody], new_plan_id: str, @@ -1309,6 +1335,8 @@ async def preview_checkout_internal( ---------- add_on_ids : typing.Sequence[UpdateAddOnRequestBody] + auto_topup_overrides : typing.Sequence[UpdateAutoTopupOverrideRequestBody] + company_id : str credit_bundles : typing.Sequence[UpdateCreditBundleRequestBody] @@ -1342,6 +1370,11 @@ async def preview_checkout_internal( "add_on_ids": convert_and_respect_annotation_metadata( object_=add_on_ids, annotation=typing.Sequence[UpdateAddOnRequestBody], direction="write" ), + "auto_topup_overrides": convert_and_respect_annotation_metadata( + object_=auto_topup_overrides, + annotation=typing.Sequence[UpdateAutoTopupOverrideRequestBody], + direction="write", + ), "company_id": company_id, "coupon_external_id": coupon_external_id, "credit_bundles": convert_and_respect_annotation_metadata( diff --git a/src/schematic/credits/__init__.py b/src/schematic/credits/__init__.py index 13c1dd5..67a9887 100644 --- a/src/schematic/credits/__init__.py +++ b/src/schematic/credits/__init__.py @@ -37,6 +37,8 @@ ListBillingCreditsResponse, ListBillingPlanCreditGrantsParams, ListBillingPlanCreditGrantsResponse, + ListCompanyCreditBalancesParams, + ListCompanyCreditBalancesResponse, ListCompanyGrantsParams, ListCompanyGrantsResponse, ListCreditBundlesParams, @@ -82,6 +84,8 @@ "ListBillingCreditsResponse": ".types", "ListBillingPlanCreditGrantsParams": ".types", "ListBillingPlanCreditGrantsResponse": ".types", + "ListCompanyCreditBalancesParams": ".types", + "ListCompanyCreditBalancesResponse": ".types", "ListCompanyGrantsParams": ".types", "ListCompanyGrantsResponse": ".types", "ListCreditBundlesParams": ".types", @@ -150,6 +154,8 @@ def __dir__(): "ListBillingCreditsResponse", "ListBillingPlanCreditGrantsParams", "ListBillingPlanCreditGrantsResponse", + "ListCompanyCreditBalancesParams", + "ListCompanyCreditBalancesResponse", "ListCompanyGrantsParams", "ListCompanyGrantsResponse", "ListCreditBundlesParams", diff --git a/src/schematic/credits/client.py b/src/schematic/credits/client.py index 57fa403..8cc0234 100644 --- a/src/schematic/credits/client.py +++ b/src/schematic/credits/client.py @@ -43,6 +43,7 @@ from .types.grant_billing_credits_to_company_response import GrantBillingCreditsToCompanyResponse from .types.list_billing_credits_response import ListBillingCreditsResponse from .types.list_billing_plan_credit_grants_response import ListBillingPlanCreditGrantsResponse +from .types.list_company_credit_balances_response import ListCompanyCreditBalancesResponse from .types.list_company_grants_response import ListCompanyGrantsResponse from .types.list_credit_bundles_response import ListCreditBundlesResponse from .types.list_credit_event_ledger_response import ListCreditEventLedgerResponse @@ -356,6 +357,38 @@ def soft_delete_billing_credit( _response = self._raw_client.soft_delete_billing_credit(credit_id, request_options=request_options) return _response.data + def list_company_credit_balances( + self, *, company_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> ListCompanyCreditBalancesResponse: + """ + Parameters + ---------- + company_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListCompanyCreditBalancesResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.credits.list_company_credit_balances( + company_id="company_id", + ) + """ + _response = self._raw_client.list_company_credit_balances( + company_id=company_id, request_options=request_options + ) + return _response.data + def list_credit_bundles( self, *, @@ -1227,6 +1260,7 @@ def list_billing_plan_credit_grants( plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -1244,6 +1278,8 @@ def list_billing_plan_credit_grants( plan_version_id : typing.Optional[str] + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + limit : typing.Optional[int] Page limit (default 100) @@ -1271,6 +1307,7 @@ def list_billing_plan_credit_grants( plan_id="plan_id", plan_ids=["plan_ids"], plan_version_id="plan_version_id", + plan_version_ids=["plan_version_ids"], limit=1000000, offset=1000000, ) @@ -1281,6 +1318,7 @@ def list_billing_plan_credit_grants( plan_id=plan_id, plan_ids=plan_ids, plan_version_id=plan_version_id, + plan_version_ids=plan_version_ids, limit=limit, offset=offset, request_options=request_options, @@ -1302,6 +1340,7 @@ def create_billing_plan_credit_grant( auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, auto_topup_expiry_unit_count: typing.Optional[int] = OMIT, + auto_topup_self_service: typing.Optional[bool] = OMIT, auto_topup_threshold_credits: typing.Optional[int] = OMIT, auto_topup_threshold_percent: typing.Optional[int] = OMIT, expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, @@ -1338,6 +1377,8 @@ def create_billing_plan_credit_grant( auto_topup_expiry_unit_count : typing.Optional[int] + auto_topup_self_service : typing.Optional[bool] + auto_topup_threshold_credits : typing.Optional[int] auto_topup_threshold_percent : typing.Optional[int] @@ -1388,6 +1429,7 @@ def create_billing_plan_credit_grant( auto_topup_expiry_type=auto_topup_expiry_type, auto_topup_expiry_unit=auto_topup_expiry_unit, auto_topup_expiry_unit_count=auto_topup_expiry_unit_count, + auto_topup_self_service=auto_topup_self_service, auto_topup_threshold_credits=auto_topup_threshold_credits, auto_topup_threshold_percent=auto_topup_threshold_percent, expiry_type=expiry_type, @@ -1445,6 +1487,7 @@ def update_billing_plan_credit_grant( auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, auto_topup_expiry_unit_count: typing.Optional[int] = OMIT, + auto_topup_self_service: typing.Optional[bool] = OMIT, auto_topup_threshold_credits: typing.Optional[int] = OMIT, auto_topup_threshold_percent: typing.Optional[int] = OMIT, credit_amount: typing.Optional[int] = OMIT, @@ -1478,6 +1521,8 @@ def update_billing_plan_credit_grant( auto_topup_expiry_unit_count : typing.Optional[int] + auto_topup_self_service : typing.Optional[bool] + auto_topup_threshold_credits : typing.Optional[int] auto_topup_threshold_percent : typing.Optional[int] @@ -1524,6 +1569,7 @@ def update_billing_plan_credit_grant( auto_topup_expiry_type=auto_topup_expiry_type, auto_topup_expiry_unit=auto_topup_expiry_unit, auto_topup_expiry_unit_count=auto_topup_expiry_unit_count, + auto_topup_self_service=auto_topup_self_service, auto_topup_threshold_credits=auto_topup_threshold_credits, auto_topup_threshold_percent=auto_topup_threshold_percent, credit_amount=credit_amount, @@ -1583,6 +1629,7 @@ def count_billing_plan_credit_grants( plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -1600,6 +1647,8 @@ def count_billing_plan_credit_grants( plan_version_id : typing.Optional[str] + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + limit : typing.Optional[int] Page limit (default 100) @@ -1627,6 +1676,7 @@ def count_billing_plan_credit_grants( plan_id="plan_id", plan_ids=["plan_ids"], plan_version_id="plan_version_id", + plan_version_ids=["plan_version_ids"], limit=1000000, offset=1000000, ) @@ -1637,6 +1687,7 @@ def count_billing_plan_credit_grants( plan_id=plan_id, plan_ids=plan_ids, plan_version_id=plan_version_id, + plan_version_ids=plan_version_ids, limit=limit, offset=offset, request_options=request_options, @@ -2129,6 +2180,46 @@ async def main() -> None: _response = await self._raw_client.soft_delete_billing_credit(credit_id, request_options=request_options) return _response.data + async def list_company_credit_balances( + self, *, company_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> ListCompanyCreditBalancesResponse: + """ + Parameters + ---------- + company_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListCompanyCreditBalancesResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.credits.list_company_credit_balances( + company_id="company_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_company_credit_balances( + company_id=company_id, request_options=request_options + ) + return _response.data + async def list_credit_bundles( self, *, @@ -3120,6 +3211,7 @@ async def list_billing_plan_credit_grants( plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -3137,6 +3229,8 @@ async def list_billing_plan_credit_grants( plan_version_id : typing.Optional[str] + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + limit : typing.Optional[int] Page limit (default 100) @@ -3169,6 +3263,7 @@ async def main() -> None: plan_id="plan_id", plan_ids=["plan_ids"], plan_version_id="plan_version_id", + plan_version_ids=["plan_version_ids"], limit=1000000, offset=1000000, ) @@ -3182,6 +3277,7 @@ async def main() -> None: plan_id=plan_id, plan_ids=plan_ids, plan_version_id=plan_version_id, + plan_version_ids=plan_version_ids, limit=limit, offset=offset, request_options=request_options, @@ -3203,6 +3299,7 @@ async def create_billing_plan_credit_grant( auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, auto_topup_expiry_unit_count: typing.Optional[int] = OMIT, + auto_topup_self_service: typing.Optional[bool] = OMIT, auto_topup_threshold_credits: typing.Optional[int] = OMIT, auto_topup_threshold_percent: typing.Optional[int] = OMIT, expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, @@ -3239,6 +3336,8 @@ async def create_billing_plan_credit_grant( auto_topup_expiry_unit_count : typing.Optional[int] + auto_topup_self_service : typing.Optional[bool] + auto_topup_threshold_credits : typing.Optional[int] auto_topup_threshold_percent : typing.Optional[int] @@ -3297,6 +3396,7 @@ async def main() -> None: auto_topup_expiry_type=auto_topup_expiry_type, auto_topup_expiry_unit=auto_topup_expiry_unit, auto_topup_expiry_unit_count=auto_topup_expiry_unit_count, + auto_topup_self_service=auto_topup_self_service, auto_topup_threshold_credits=auto_topup_threshold_credits, auto_topup_threshold_percent=auto_topup_threshold_percent, expiry_type=expiry_type, @@ -3362,6 +3462,7 @@ async def update_billing_plan_credit_grant( auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, auto_topup_expiry_unit_count: typing.Optional[int] = OMIT, + auto_topup_self_service: typing.Optional[bool] = OMIT, auto_topup_threshold_credits: typing.Optional[int] = OMIT, auto_topup_threshold_percent: typing.Optional[int] = OMIT, credit_amount: typing.Optional[int] = OMIT, @@ -3395,6 +3496,8 @@ async def update_billing_plan_credit_grant( auto_topup_expiry_unit_count : typing.Optional[int] + auto_topup_self_service : typing.Optional[bool] + auto_topup_threshold_credits : typing.Optional[int] auto_topup_threshold_percent : typing.Optional[int] @@ -3449,6 +3552,7 @@ async def main() -> None: auto_topup_expiry_type=auto_topup_expiry_type, auto_topup_expiry_unit=auto_topup_expiry_unit, auto_topup_expiry_unit_count=auto_topup_expiry_unit_count, + auto_topup_self_service=auto_topup_self_service, auto_topup_threshold_credits=auto_topup_threshold_credits, auto_topup_threshold_percent=auto_topup_threshold_percent, credit_amount=credit_amount, @@ -3516,6 +3620,7 @@ async def count_billing_plan_credit_grants( plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -3533,6 +3638,8 @@ async def count_billing_plan_credit_grants( plan_version_id : typing.Optional[str] + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + limit : typing.Optional[int] Page limit (default 100) @@ -3565,6 +3672,7 @@ async def main() -> None: plan_id="plan_id", plan_ids=["plan_ids"], plan_version_id="plan_version_id", + plan_version_ids=["plan_version_ids"], limit=1000000, offset=1000000, ) @@ -3578,6 +3686,7 @@ async def main() -> None: plan_id=plan_id, plan_ids=plan_ids, plan_version_id=plan_version_id, + plan_version_ids=plan_version_ids, limit=limit, offset=offset, request_options=request_options, diff --git a/src/schematic/credits/raw_client.py b/src/schematic/credits/raw_client.py index 13165e0..e745709 100644 --- a/src/schematic/credits/raw_client.py +++ b/src/schematic/credits/raw_client.py @@ -55,6 +55,7 @@ from .types.grant_billing_credits_to_company_response import GrantBillingCreditsToCompanyResponse from .types.list_billing_credits_response import ListBillingCreditsResponse from .types.list_billing_plan_credit_grants_response import ListBillingPlanCreditGrantsResponse +from .types.list_company_credit_balances_response import ListCompanyCreditBalancesResponse from .types.list_company_grants_response import ListCompanyGrantsResponse from .types.list_credit_bundles_response import ListCreditBundlesResponse from .types.list_credit_event_ledger_response import ListCreditEventLedgerResponse @@ -704,6 +705,108 @@ def soft_delete_billing_credit( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def list_company_credit_balances( + self, *, company_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ListCompanyCreditBalancesResponse]: + """ + Parameters + ---------- + company_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ListCompanyCreditBalancesResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "billing/credits/balance", + method="GET", + params={ + "company_id": company_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListCompanyCreditBalancesResponse, + parse_obj_as( + type_=ListCompanyCreditBalancesResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + def list_credit_bundles( self, *, @@ -2600,6 +2703,7 @@ def list_billing_plan_credit_grants( plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -2617,6 +2721,8 @@ def list_billing_plan_credit_grants( plan_version_id : typing.Optional[str] + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + limit : typing.Optional[int] Page limit (default 100) @@ -2640,6 +2746,7 @@ def list_billing_plan_credit_grants( "plan_id": plan_id, "plan_ids": plan_ids, "plan_version_id": plan_version_id, + "plan_version_ids": plan_version_ids, "limit": limit, "offset": offset, }, @@ -2738,6 +2845,7 @@ def create_billing_plan_credit_grant( auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, auto_topup_expiry_unit_count: typing.Optional[int] = OMIT, + auto_topup_self_service: typing.Optional[bool] = OMIT, auto_topup_threshold_credits: typing.Optional[int] = OMIT, auto_topup_threshold_percent: typing.Optional[int] = OMIT, expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, @@ -2774,6 +2882,8 @@ def create_billing_plan_credit_grant( auto_topup_expiry_unit_count : typing.Optional[int] + auto_topup_self_service : typing.Optional[bool] + auto_topup_threshold_credits : typing.Optional[int] auto_topup_threshold_percent : typing.Optional[int] @@ -2807,6 +2917,7 @@ def create_billing_plan_credit_grant( "auto_topup_expiry_type": auto_topup_expiry_type, "auto_topup_expiry_unit": auto_topup_expiry_unit, "auto_topup_expiry_unit_count": auto_topup_expiry_unit_count, + "auto_topup_self_service": auto_topup_self_service, "auto_topup_threshold_credits": auto_topup_threshold_credits, "auto_topup_threshold_percent": auto_topup_threshold_percent, "credit_amount": credit_amount, @@ -3006,6 +3117,7 @@ def update_billing_plan_credit_grant( auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, auto_topup_expiry_unit_count: typing.Optional[int] = OMIT, + auto_topup_self_service: typing.Optional[bool] = OMIT, auto_topup_threshold_credits: typing.Optional[int] = OMIT, auto_topup_threshold_percent: typing.Optional[int] = OMIT, credit_amount: typing.Optional[int] = OMIT, @@ -3039,6 +3151,8 @@ def update_billing_plan_credit_grant( auto_topup_expiry_unit_count : typing.Optional[int] + auto_topup_self_service : typing.Optional[bool] + auto_topup_threshold_credits : typing.Optional[int] auto_topup_threshold_percent : typing.Optional[int] @@ -3072,6 +3186,7 @@ def update_billing_plan_credit_grant( "auto_topup_expiry_type": auto_topup_expiry_type, "auto_topup_expiry_unit": auto_topup_expiry_unit, "auto_topup_expiry_unit_count": auto_topup_expiry_unit_count, + "auto_topup_self_service": auto_topup_self_service, "auto_topup_threshold_credits": auto_topup_threshold_credits, "auto_topup_threshold_percent": auto_topup_threshold_percent, "credit_amount": credit_amount, @@ -3283,6 +3398,7 @@ def count_billing_plan_credit_grants( plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -3300,6 +3416,8 @@ def count_billing_plan_credit_grants( plan_version_id : typing.Optional[str] + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + limit : typing.Optional[int] Page limit (default 100) @@ -3323,6 +3441,7 @@ def count_billing_plan_credit_grants( "plan_id": plan_id, "plan_ids": plan_ids, "plan_version_id": plan_version_id, + "plan_version_ids": plan_version_ids, "limit": limit, "offset": offset, }, @@ -4311,6 +4430,108 @@ async def soft_delete_billing_credit( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + async def list_company_credit_balances( + self, *, company_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ListCompanyCreditBalancesResponse]: + """ + Parameters + ---------- + company_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ListCompanyCreditBalancesResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "billing/credits/balance", + method="GET", + params={ + "company_id": company_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListCompanyCreditBalancesResponse, + parse_obj_as( + type_=ListCompanyCreditBalancesResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + async def list_credit_bundles( self, *, @@ -6207,6 +6428,7 @@ async def list_billing_plan_credit_grants( plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -6224,6 +6446,8 @@ async def list_billing_plan_credit_grants( plan_version_id : typing.Optional[str] + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + limit : typing.Optional[int] Page limit (default 100) @@ -6247,6 +6471,7 @@ async def list_billing_plan_credit_grants( "plan_id": plan_id, "plan_ids": plan_ids, "plan_version_id": plan_version_id, + "plan_version_ids": plan_version_ids, "limit": limit, "offset": offset, }, @@ -6345,6 +6570,7 @@ async def create_billing_plan_credit_grant( auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, auto_topup_expiry_unit_count: typing.Optional[int] = OMIT, + auto_topup_self_service: typing.Optional[bool] = OMIT, auto_topup_threshold_credits: typing.Optional[int] = OMIT, auto_topup_threshold_percent: typing.Optional[int] = OMIT, expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, @@ -6381,6 +6607,8 @@ async def create_billing_plan_credit_grant( auto_topup_expiry_unit_count : typing.Optional[int] + auto_topup_self_service : typing.Optional[bool] + auto_topup_threshold_credits : typing.Optional[int] auto_topup_threshold_percent : typing.Optional[int] @@ -6414,6 +6642,7 @@ async def create_billing_plan_credit_grant( "auto_topup_expiry_type": auto_topup_expiry_type, "auto_topup_expiry_unit": auto_topup_expiry_unit, "auto_topup_expiry_unit_count": auto_topup_expiry_unit_count, + "auto_topup_self_service": auto_topup_self_service, "auto_topup_threshold_credits": auto_topup_threshold_credits, "auto_topup_threshold_percent": auto_topup_threshold_percent, "credit_amount": credit_amount, @@ -6613,6 +6842,7 @@ async def update_billing_plan_credit_grant( auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = OMIT, auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = OMIT, auto_topup_expiry_unit_count: typing.Optional[int] = OMIT, + auto_topup_self_service: typing.Optional[bool] = OMIT, auto_topup_threshold_credits: typing.Optional[int] = OMIT, auto_topup_threshold_percent: typing.Optional[int] = OMIT, credit_amount: typing.Optional[int] = OMIT, @@ -6646,6 +6876,8 @@ async def update_billing_plan_credit_grant( auto_topup_expiry_unit_count : typing.Optional[int] + auto_topup_self_service : typing.Optional[bool] + auto_topup_threshold_credits : typing.Optional[int] auto_topup_threshold_percent : typing.Optional[int] @@ -6679,6 +6911,7 @@ async def update_billing_plan_credit_grant( "auto_topup_expiry_type": auto_topup_expiry_type, "auto_topup_expiry_unit": auto_topup_expiry_unit, "auto_topup_expiry_unit_count": auto_topup_expiry_unit_count, + "auto_topup_self_service": auto_topup_self_service, "auto_topup_threshold_credits": auto_topup_threshold_credits, "auto_topup_threshold_percent": auto_topup_threshold_percent, "credit_amount": credit_amount, @@ -6890,6 +7123,7 @@ async def count_billing_plan_credit_grants( plan_id: typing.Optional[str] = None, plan_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, plan_version_id: typing.Optional[str] = None, + plan_version_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -6907,6 +7141,8 @@ async def count_billing_plan_credit_grants( plan_version_id : typing.Optional[str] + plan_version_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + limit : typing.Optional[int] Page limit (default 100) @@ -6930,6 +7166,7 @@ async def count_billing_plan_credit_grants( "plan_id": plan_id, "plan_ids": plan_ids, "plan_version_id": plan_version_id, + "plan_version_ids": plan_version_ids, "limit": limit, "offset": offset, }, diff --git a/src/schematic/credits/types/__init__.py b/src/schematic/credits/types/__init__.py index f83605b..d06f5e9 100644 --- a/src/schematic/credits/types/__init__.py +++ b/src/schematic/credits/types/__init__.py @@ -36,6 +36,8 @@ from .list_billing_credits_response import ListBillingCreditsResponse from .list_billing_plan_credit_grants_params import ListBillingPlanCreditGrantsParams from .list_billing_plan_credit_grants_response import ListBillingPlanCreditGrantsResponse + from .list_company_credit_balances_params import ListCompanyCreditBalancesParams + from .list_company_credit_balances_response import ListCompanyCreditBalancesResponse from .list_company_grants_params import ListCompanyGrantsParams from .list_company_grants_response import ListCompanyGrantsResponse from .list_credit_bundles_params import ListCreditBundlesParams @@ -80,6 +82,8 @@ "ListBillingCreditsResponse": ".list_billing_credits_response", "ListBillingPlanCreditGrantsParams": ".list_billing_plan_credit_grants_params", "ListBillingPlanCreditGrantsResponse": ".list_billing_plan_credit_grants_response", + "ListCompanyCreditBalancesParams": ".list_company_credit_balances_params", + "ListCompanyCreditBalancesResponse": ".list_company_credit_balances_response", "ListCompanyGrantsParams": ".list_company_grants_params", "ListCompanyGrantsResponse": ".list_company_grants_response", "ListCreditBundlesParams": ".list_credit_bundles_params", @@ -148,6 +152,8 @@ def __dir__(): "ListBillingCreditsResponse", "ListBillingPlanCreditGrantsParams", "ListBillingPlanCreditGrantsResponse", + "ListCompanyCreditBalancesParams", + "ListCompanyCreditBalancesResponse", "ListCompanyGrantsParams", "ListCompanyGrantsResponse", "ListCreditBundlesParams", diff --git a/src/schematic/credits/types/count_billing_plan_credit_grants_params.py b/src/schematic/credits/types/count_billing_plan_credit_grants_params.py index 4cca569..00d4421 100644 --- a/src/schematic/credits/types/count_billing_plan_credit_grants_params.py +++ b/src/schematic/credits/types/count_billing_plan_credit_grants_params.py @@ -26,6 +26,7 @@ class CountBillingPlanCreditGrantsParams(UniversalBaseModel): plan_id: typing.Optional[str] = None plan_ids: typing.Optional[typing.List[str]] = None plan_version_id: typing.Optional[str] = None + plan_version_ids: typing.Optional[typing.List[str]] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/credits/types/list_billing_plan_credit_grants_params.py b/src/schematic/credits/types/list_billing_plan_credit_grants_params.py index 6c1a67b..2eed56d 100644 --- a/src/schematic/credits/types/list_billing_plan_credit_grants_params.py +++ b/src/schematic/credits/types/list_billing_plan_credit_grants_params.py @@ -26,6 +26,7 @@ class ListBillingPlanCreditGrantsParams(UniversalBaseModel): plan_id: typing.Optional[str] = None plan_ids: typing.Optional[typing.List[str]] = None plan_version_id: typing.Optional[str] = None + plan_version_ids: typing.Optional[typing.List[str]] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/schematic/credits/types/list_company_credit_balances_params.py b/src/schematic/credits/types/list_company_credit_balances_params.py new file mode 100644 index 0000000..c500b12 --- /dev/null +++ b/src/schematic/credits/types/list_company_credit_balances_params.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ListCompanyCreditBalancesParams(UniversalBaseModel): + """ + Input parameters + """ + + company_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/credits/types/list_company_credit_balances_response.py b/src/schematic/credits/types/list_company_credit_balances_response.py new file mode 100644 index 0000000..165fc51 --- /dev/null +++ b/src/schematic/credits/types/list_company_credit_balances_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.company_credit_balance_response_data import CompanyCreditBalanceResponseData +from .list_company_credit_balances_params import ListCompanyCreditBalancesParams + + +class ListCompanyCreditBalancesResponse(UniversalBaseModel): + data: typing.List[CompanyCreditBalanceResponseData] + params: ListCompanyCreditBalancesParams = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/entitlements/client.py b/src/schematic/entitlements/client.py index 028fcf5..9cd008a 100644 --- a/src/schematic/entitlements/client.py +++ b/src/schematic/entitlements/client.py @@ -554,6 +554,7 @@ def list_feature_usage( company_keys: typing.Optional[typing.Dict[str, str]] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, include_usage_aggregation: typing.Optional[bool] = None, + managed_by: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, without_negative_entitlements: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -572,6 +573,9 @@ def list_feature_usage( include_usage_aggregation : typing.Optional[bool] Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance. + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + q : typing.Optional[str] without_negative_entitlements : typing.Optional[bool] @@ -601,6 +605,7 @@ def list_feature_usage( company_id="company_id", feature_ids=["feature_ids"], include_usage_aggregation=True, + managed_by="orb", q="q", without_negative_entitlements=True, limit=1000000, @@ -612,6 +617,7 @@ def list_feature_usage( company_keys=company_keys, feature_ids=feature_ids, include_usage_aggregation=include_usage_aggregation, + managed_by=managed_by, q=q, without_negative_entitlements=without_negative_entitlements, limit=limit, @@ -689,6 +695,7 @@ def count_feature_usage( company_keys: typing.Optional[typing.Dict[str, str]] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, include_usage_aggregation: typing.Optional[bool] = None, + managed_by: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, without_negative_entitlements: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -707,6 +714,9 @@ def count_feature_usage( include_usage_aggregation : typing.Optional[bool] Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance. + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + q : typing.Optional[str] without_negative_entitlements : typing.Optional[bool] @@ -736,6 +746,7 @@ def count_feature_usage( company_id="company_id", feature_ids=["feature_ids"], include_usage_aggregation=True, + managed_by="orb", q="q", without_negative_entitlements=True, limit=1000000, @@ -747,6 +758,7 @@ def count_feature_usage( company_keys=company_keys, feature_ids=feature_ids, include_usage_aggregation=include_usage_aggregation, + managed_by=managed_by, q=q, without_negative_entitlements=without_negative_entitlements, limit=limit, @@ -971,6 +983,10 @@ def create_plan_entitlement( plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -1023,6 +1039,14 @@ def create_plan_entitlement( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -1083,6 +1107,10 @@ def create_plan_entitlement( plan_version_id=plan_version_id, price_behavior=price_behavior, price_tiers=price_tiers, + quarterly_metered_price_id=quarterly_metered_price_id, + quarterly_price_tiers=quarterly_price_tiers, + quarterly_unit_price=quarterly_unit_price, + quarterly_unit_price_decimal=quarterly_unit_price_decimal, soft_limit=soft_limit, tier_mode=tier_mode, value_bool=value_bool, @@ -1147,6 +1175,10 @@ def update_plan_entitlement( overage_billing_product_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -1196,6 +1228,14 @@ def update_plan_entitlement( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -1253,6 +1293,10 @@ def update_plan_entitlement( overage_billing_product_id=overage_billing_product_id, price_behavior=price_behavior, price_tiers=price_tiers, + quarterly_metered_price_id=quarterly_metered_price_id, + quarterly_price_tiers=quarterly_price_tiers, + quarterly_unit_price=quarterly_unit_price, + quarterly_unit_price_decimal=quarterly_unit_price_decimal, soft_limit=soft_limit, tier_mode=tier_mode, value_bool=value_bool, @@ -1321,6 +1365,10 @@ def upsert_plan_entitlement_for_billing_product( plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -1377,6 +1425,14 @@ def upsert_plan_entitlement_for_billing_product( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -1441,6 +1497,10 @@ def upsert_plan_entitlement_for_billing_product( plan_version_id=plan_version_id, price_behavior=price_behavior, price_tiers=price_tiers, + quarterly_metered_price_id=quarterly_metered_price_id, + quarterly_price_tiers=quarterly_price_tiers, + quarterly_unit_price=quarterly_unit_price, + quarterly_unit_price_decimal=quarterly_unit_price_decimal, soft_limit=soft_limit, tier_mode=tier_mode, value_bool=value_bool, @@ -2195,6 +2255,7 @@ async def list_feature_usage( company_keys: typing.Optional[typing.Dict[str, str]] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, include_usage_aggregation: typing.Optional[bool] = None, + managed_by: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, without_negative_entitlements: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -2213,6 +2274,9 @@ async def list_feature_usage( include_usage_aggregation : typing.Optional[bool] Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance. + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + q : typing.Optional[str] without_negative_entitlements : typing.Optional[bool] @@ -2247,6 +2311,7 @@ async def main() -> None: company_id="company_id", feature_ids=["feature_ids"], include_usage_aggregation=True, + managed_by="orb", q="q", without_negative_entitlements=True, limit=1000000, @@ -2261,6 +2326,7 @@ async def main() -> None: company_keys=company_keys, feature_ids=feature_ids, include_usage_aggregation=include_usage_aggregation, + managed_by=managed_by, q=q, without_negative_entitlements=without_negative_entitlements, limit=limit, @@ -2345,6 +2411,7 @@ async def count_feature_usage( company_keys: typing.Optional[typing.Dict[str, str]] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, include_usage_aggregation: typing.Optional[bool] = None, + managed_by: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, without_negative_entitlements: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -2363,6 +2430,9 @@ async def count_feature_usage( include_usage_aggregation : typing.Optional[bool] Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance. + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + q : typing.Optional[str] without_negative_entitlements : typing.Optional[bool] @@ -2397,6 +2467,7 @@ async def main() -> None: company_id="company_id", feature_ids=["feature_ids"], include_usage_aggregation=True, + managed_by="orb", q="q", without_negative_entitlements=True, limit=1000000, @@ -2411,6 +2482,7 @@ async def main() -> None: company_keys=company_keys, feature_ids=feature_ids, include_usage_aggregation=include_usage_aggregation, + managed_by=managed_by, q=q, without_negative_entitlements=without_negative_entitlements, limit=limit, @@ -2659,6 +2731,10 @@ async def create_plan_entitlement( plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -2711,6 +2787,14 @@ async def create_plan_entitlement( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -2779,6 +2863,10 @@ async def main() -> None: plan_version_id=plan_version_id, price_behavior=price_behavior, price_tiers=price_tiers, + quarterly_metered_price_id=quarterly_metered_price_id, + quarterly_price_tiers=quarterly_price_tiers, + quarterly_unit_price=quarterly_unit_price, + quarterly_unit_price_decimal=quarterly_unit_price_decimal, soft_limit=soft_limit, tier_mode=tier_mode, value_bool=value_bool, @@ -2851,6 +2939,10 @@ async def update_plan_entitlement( overage_billing_product_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -2900,6 +2992,14 @@ async def update_plan_entitlement( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -2965,6 +3065,10 @@ async def main() -> None: overage_billing_product_id=overage_billing_product_id, price_behavior=price_behavior, price_tiers=price_tiers, + quarterly_metered_price_id=quarterly_metered_price_id, + quarterly_price_tiers=quarterly_price_tiers, + quarterly_unit_price=quarterly_unit_price, + quarterly_unit_price_decimal=quarterly_unit_price_decimal, soft_limit=soft_limit, tier_mode=tier_mode, value_bool=value_bool, @@ -3041,6 +3145,10 @@ async def upsert_plan_entitlement_for_billing_product( plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -3097,6 +3205,14 @@ async def upsert_plan_entitlement_for_billing_product( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -3169,6 +3285,10 @@ async def main() -> None: plan_version_id=plan_version_id, price_behavior=price_behavior, price_tiers=price_tiers, + quarterly_metered_price_id=quarterly_metered_price_id, + quarterly_price_tiers=quarterly_price_tiers, + quarterly_unit_price=quarterly_unit_price, + quarterly_unit_price_decimal=quarterly_unit_price_decimal, soft_limit=soft_limit, tier_mode=tier_mode, value_bool=value_bool, diff --git a/src/schematic/entitlements/raw_client.py b/src/schematic/entitlements/raw_client.py index 5e29542..292235f 100644 --- a/src/schematic/entitlements/raw_client.py +++ b/src/schematic/entitlements/raw_client.py @@ -1088,6 +1088,7 @@ def list_feature_usage( company_keys: typing.Optional[typing.Dict[str, str]] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, include_usage_aggregation: typing.Optional[bool] = None, + managed_by: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, without_negative_entitlements: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -1106,6 +1107,9 @@ def list_feature_usage( include_usage_aggregation : typing.Optional[bool] Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance. + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + q : typing.Optional[str] without_negative_entitlements : typing.Optional[bool] @@ -1132,6 +1136,7 @@ def list_feature_usage( "company_keys": company_keys, "feature_ids": feature_ids, "include_usage_aggregation": include_usage_aggregation, + "managed_by": managed_by, "q": q, "without_negative_entitlements": without_negative_entitlements, "limit": limit, @@ -1334,6 +1339,7 @@ def count_feature_usage( company_keys: typing.Optional[typing.Dict[str, str]] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, include_usage_aggregation: typing.Optional[bool] = None, + managed_by: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, without_negative_entitlements: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -1352,6 +1358,9 @@ def count_feature_usage( include_usage_aggregation : typing.Optional[bool] Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance. + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + q : typing.Optional[str] without_negative_entitlements : typing.Optional[bool] @@ -1378,6 +1387,7 @@ def count_feature_usage( "company_keys": company_keys, "feature_ids": feature_ids, "include_usage_aggregation": include_usage_aggregation, + "managed_by": managed_by, "q": q, "without_negative_entitlements": without_negative_entitlements, "limit": limit, @@ -1878,6 +1888,10 @@ def create_plan_entitlement( plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -1930,6 +1944,14 @@ def create_plan_entitlement( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -1987,6 +2009,14 @@ def create_plan_entitlement( "price_tiers": convert_and_respect_annotation_metadata( object_=price_tiers, annotation=typing.Sequence[CreatePriceTierRequestBody], direction="write" ), + "quarterly_metered_price_id": quarterly_metered_price_id, + "quarterly_price_tiers": convert_and_respect_annotation_metadata( + object_=quarterly_price_tiers, + annotation=typing.Sequence[CreatePriceTierRequestBody], + direction="write", + ), + "quarterly_unit_price": quarterly_unit_price, + "quarterly_unit_price_decimal": quarterly_unit_price_decimal, "soft_limit": soft_limit, "tier_mode": tier_mode, "value_bool": value_bool, @@ -2195,6 +2225,10 @@ def update_plan_entitlement( overage_billing_product_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -2244,6 +2278,14 @@ def update_plan_entitlement( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -2298,6 +2340,14 @@ def update_plan_entitlement( "price_tiers": convert_and_respect_annotation_metadata( object_=price_tiers, annotation=typing.Sequence[CreatePriceTierRequestBody], direction="write" ), + "quarterly_metered_price_id": quarterly_metered_price_id, + "quarterly_price_tiers": convert_and_respect_annotation_metadata( + object_=quarterly_price_tiers, + annotation=typing.Sequence[CreatePriceTierRequestBody], + direction="write", + ), + "quarterly_unit_price": quarterly_unit_price, + "quarterly_unit_price_decimal": quarterly_unit_price_decimal, "soft_limit": soft_limit, "tier_mode": tier_mode, "value_bool": value_bool, @@ -2521,6 +2571,10 @@ def upsert_plan_entitlement_for_billing_product( plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -2577,6 +2631,14 @@ def upsert_plan_entitlement_for_billing_product( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -2636,6 +2698,14 @@ def upsert_plan_entitlement_for_billing_product( "price_tiers": convert_and_respect_annotation_metadata( object_=price_tiers, annotation=typing.Sequence[CreatePriceTierRequestBody], direction="write" ), + "quarterly_metered_price_id": quarterly_metered_price_id, + "quarterly_price_tiers": convert_and_respect_annotation_metadata( + object_=quarterly_price_tiers, + annotation=typing.Sequence[CreatePriceTierRequestBody], + direction="write", + ), + "quarterly_unit_price": quarterly_unit_price, + "quarterly_unit_price_decimal": quarterly_unit_price_decimal, "soft_limit": soft_limit, "tier_mode": tier_mode, "value_bool": value_bool, @@ -4126,6 +4196,7 @@ async def list_feature_usage( company_keys: typing.Optional[typing.Dict[str, str]] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, include_usage_aggregation: typing.Optional[bool] = None, + managed_by: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, without_negative_entitlements: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -4144,6 +4215,9 @@ async def list_feature_usage( include_usage_aggregation : typing.Optional[bool] Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance. + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + q : typing.Optional[str] without_negative_entitlements : typing.Optional[bool] @@ -4170,6 +4244,7 @@ async def list_feature_usage( "company_keys": company_keys, "feature_ids": feature_ids, "include_usage_aggregation": include_usage_aggregation, + "managed_by": managed_by, "q": q, "without_negative_entitlements": without_negative_entitlements, "limit": limit, @@ -4372,6 +4447,7 @@ async def count_feature_usage( company_keys: typing.Optional[typing.Dict[str, str]] = None, feature_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, include_usage_aggregation: typing.Optional[bool] = None, + managed_by: typing.Optional[BillingProviderType] = None, q: typing.Optional[str] = None, without_negative_entitlements: typing.Optional[bool] = None, limit: typing.Optional[int] = None, @@ -4390,6 +4466,9 @@ async def count_feature_usage( include_usage_aggregation : typing.Optional[bool] Include time-bucketed usage aggregation (today, this week, this month, billing period) for credit-based entitlements. Defaults to false for performance. + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + q : typing.Optional[str] without_negative_entitlements : typing.Optional[bool] @@ -4416,6 +4495,7 @@ async def count_feature_usage( "company_keys": company_keys, "feature_ids": feature_ids, "include_usage_aggregation": include_usage_aggregation, + "managed_by": managed_by, "q": q, "without_negative_entitlements": without_negative_entitlements, "limit": limit, @@ -4916,6 +4996,10 @@ async def create_plan_entitlement( plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -4968,6 +5052,14 @@ async def create_plan_entitlement( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -5025,6 +5117,14 @@ async def create_plan_entitlement( "price_tiers": convert_and_respect_annotation_metadata( object_=price_tiers, annotation=typing.Sequence[CreatePriceTierRequestBody], direction="write" ), + "quarterly_metered_price_id": quarterly_metered_price_id, + "quarterly_price_tiers": convert_and_respect_annotation_metadata( + object_=quarterly_price_tiers, + annotation=typing.Sequence[CreatePriceTierRequestBody], + direction="write", + ), + "quarterly_unit_price": quarterly_unit_price, + "quarterly_unit_price_decimal": quarterly_unit_price_decimal, "soft_limit": soft_limit, "tier_mode": tier_mode, "value_bool": value_bool, @@ -5233,6 +5333,10 @@ async def update_plan_entitlement( overage_billing_product_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -5282,6 +5386,14 @@ async def update_plan_entitlement( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -5336,6 +5448,14 @@ async def update_plan_entitlement( "price_tiers": convert_and_respect_annotation_metadata( object_=price_tiers, annotation=typing.Sequence[CreatePriceTierRequestBody], direction="write" ), + "quarterly_metered_price_id": quarterly_metered_price_id, + "quarterly_price_tiers": convert_and_respect_annotation_metadata( + object_=quarterly_price_tiers, + annotation=typing.Sequence[CreatePriceTierRequestBody], + direction="write", + ), + "quarterly_unit_price": quarterly_unit_price, + "quarterly_unit_price_decimal": quarterly_unit_price_decimal, "soft_limit": soft_limit, "tier_mode": tier_mode, "value_bool": value_bool, @@ -5559,6 +5679,10 @@ async def upsert_plan_entitlement_for_billing_product( plan_version_id: typing.Optional[str] = OMIT, price_behavior: typing.Optional[EntitlementPriceBehavior] = OMIT, price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_metered_price_id: typing.Optional[str] = OMIT, + quarterly_price_tiers: typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] = OMIT, + quarterly_unit_price: typing.Optional[int] = OMIT, + quarterly_unit_price_decimal: typing.Optional[str] = OMIT, soft_limit: typing.Optional[int] = OMIT, tier_mode: typing.Optional[BillingTiersMode] = OMIT, value_bool: typing.Optional[bool] = OMIT, @@ -5615,6 +5739,14 @@ async def upsert_plan_entitlement_for_billing_product( price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] Use MonthlyPriceTiers or YearlyPriceTiers instead + quarterly_metered_price_id : typing.Optional[str] + + quarterly_price_tiers : typing.Optional[typing.Sequence[CreatePriceTierRequestBody]] + + quarterly_unit_price : typing.Optional[int] + + quarterly_unit_price_decimal : typing.Optional[str] + soft_limit : typing.Optional[int] tier_mode : typing.Optional[BillingTiersMode] @@ -5674,6 +5806,14 @@ async def upsert_plan_entitlement_for_billing_product( "price_tiers": convert_and_respect_annotation_metadata( object_=price_tiers, annotation=typing.Sequence[CreatePriceTierRequestBody], direction="write" ), + "quarterly_metered_price_id": quarterly_metered_price_id, + "quarterly_price_tiers": convert_and_respect_annotation_metadata( + object_=quarterly_price_tiers, + annotation=typing.Sequence[CreatePriceTierRequestBody], + direction="write", + ), + "quarterly_unit_price": quarterly_unit_price, + "quarterly_unit_price_decimal": quarterly_unit_price_decimal, "soft_limit": soft_limit, "tier_mode": tier_mode, "value_bool": value_bool, diff --git a/src/schematic/entitlements/types/count_feature_usage_params.py b/src/schematic/entitlements/types/count_feature_usage_params.py index 715aaa8..604c81a 100644 --- a/src/schematic/entitlements/types/count_feature_usage_params.py +++ b/src/schematic/entitlements/types/count_feature_usage_params.py @@ -4,6 +4,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.billing_provider_type import BillingProviderType class CountFeatureUsageParams(UniversalBaseModel): @@ -24,6 +25,11 @@ class CountFeatureUsageParams(UniversalBaseModel): Page limit (default 100) """ + managed_by: typing.Optional[BillingProviderType] = pydantic.Field(default=None) + """ + Filter for features managed by a billing provider, or by Schematic (no billing provider) + """ + offset: typing.Optional[int] = pydantic.Field(default=None) """ Page offset (default 0) diff --git a/src/schematic/entitlements/types/list_feature_usage_params.py b/src/schematic/entitlements/types/list_feature_usage_params.py index 3a1f160..48b2b9a 100644 --- a/src/schematic/entitlements/types/list_feature_usage_params.py +++ b/src/schematic/entitlements/types/list_feature_usage_params.py @@ -4,6 +4,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.billing_provider_type import BillingProviderType class ListFeatureUsageParams(UniversalBaseModel): @@ -24,6 +25,11 @@ class ListFeatureUsageParams(UniversalBaseModel): Page limit (default 100) """ + managed_by: typing.Optional[BillingProviderType] = pydantic.Field(default=None) + """ + Filter for features managed by a billing provider, or by Schematic (no billing provider) + """ + offset: typing.Optional[int] = pydantic.Field(default=None) """ Page offset (default 0) diff --git a/src/schematic/events/client.py b/src/schematic/events/client.py index 908afd8..4782084 100644 --- a/src/schematic/events/client.py +++ b/src/schematic/events/client.py @@ -128,6 +128,7 @@ def list_events( event_subtype: typing.Optional[str] = None, event_types: typing.Optional[typing.Union[EventType, typing.Sequence[EventType]]] = None, flag_id: typing.Optional[str] = None, + idempotency_key: typing.Optional[str] = None, user_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -144,6 +145,8 @@ def list_events( flag_id : typing.Optional[str] + idempotency_key : typing.Optional[str] + user_id : typing.Optional[str] limit : typing.Optional[int] @@ -172,6 +175,7 @@ def list_events( event_subtype="event_subtype", event_types=["flag_check"], flag_id="flag_id", + idempotency_key="idempotency_key", user_id="user_id", limit=1000000, offset=1000000, @@ -182,6 +186,7 @@ def list_events( event_subtype=event_subtype, event_types=event_types, flag_id=flag_id, + idempotency_key=idempotency_key, user_id=user_id, limit=limit, offset=offset, @@ -194,6 +199,7 @@ def create_event( *, event_type: EventType, body: typing.Optional[EventBody] = OMIT, + idempotency_key: typing.Optional[str] = OMIT, sent_at: typing.Optional[dt.datetime] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateEventResponse: @@ -205,6 +211,9 @@ def create_event( body : typing.Optional[EventBody] + idempotency_key : typing.Optional[str] + Optional client-supplied key. Duplicate events with the same key (scoped to the environment) are dropped for 24h. + sent_at : typing.Optional[dt.datetime] Optionally provide a timestamp at which the event was sent to Schematic @@ -228,7 +237,11 @@ def create_event( ) """ _response = self._raw_client.create_event( - event_type=event_type, body=body, sent_at=sent_at, request_options=request_options + event_type=event_type, + body=body, + idempotency_key=idempotency_key, + sent_at=sent_at, + request_options=request_options, ) return _response.data @@ -412,6 +425,7 @@ async def list_events( event_subtype: typing.Optional[str] = None, event_types: typing.Optional[typing.Union[EventType, typing.Sequence[EventType]]] = None, flag_id: typing.Optional[str] = None, + idempotency_key: typing.Optional[str] = None, user_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -428,6 +442,8 @@ async def list_events( flag_id : typing.Optional[str] + idempotency_key : typing.Optional[str] + user_id : typing.Optional[str] limit : typing.Optional[int] @@ -461,6 +477,7 @@ async def main() -> None: event_subtype="event_subtype", event_types=["flag_check"], flag_id="flag_id", + idempotency_key="idempotency_key", user_id="user_id", limit=1000000, offset=1000000, @@ -474,6 +491,7 @@ async def main() -> None: event_subtype=event_subtype, event_types=event_types, flag_id=flag_id, + idempotency_key=idempotency_key, user_id=user_id, limit=limit, offset=offset, @@ -486,6 +504,7 @@ async def create_event( *, event_type: EventType, body: typing.Optional[EventBody] = OMIT, + idempotency_key: typing.Optional[str] = OMIT, sent_at: typing.Optional[dt.datetime] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateEventResponse: @@ -497,6 +516,9 @@ async def create_event( body : typing.Optional[EventBody] + idempotency_key : typing.Optional[str] + Optional client-supplied key. Duplicate events with the same key (scoped to the environment) are dropped for 24h. + sent_at : typing.Optional[dt.datetime] Optionally provide a timestamp at which the event was sent to Schematic @@ -528,7 +550,11 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.create_event( - event_type=event_type, body=body, sent_at=sent_at, request_options=request_options + event_type=event_type, + body=body, + idempotency_key=idempotency_key, + sent_at=sent_at, + request_options=request_options, ) return _response.data diff --git a/src/schematic/events/raw_client.py b/src/schematic/events/raw_client.py index bcc8153..2324805 100644 --- a/src/schematic/events/raw_client.py +++ b/src/schematic/events/raw_client.py @@ -274,6 +274,7 @@ def list_events( event_subtype: typing.Optional[str] = None, event_types: typing.Optional[typing.Union[EventType, typing.Sequence[EventType]]] = None, flag_id: typing.Optional[str] = None, + idempotency_key: typing.Optional[str] = None, user_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -290,6 +291,8 @@ def list_events( flag_id : typing.Optional[str] + idempotency_key : typing.Optional[str] + user_id : typing.Optional[str] limit : typing.Optional[int] @@ -314,6 +317,7 @@ def list_events( "event_subtype": event_subtype, "event_types": event_types, "flag_id": flag_id, + "idempotency_key": idempotency_key, "user_id": user_id, "limit": limit, "offset": offset, @@ -403,6 +407,7 @@ def create_event( *, event_type: EventType, body: typing.Optional[EventBody] = OMIT, + idempotency_key: typing.Optional[str] = OMIT, sent_at: typing.Optional[dt.datetime] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[CreateEventResponse]: @@ -414,6 +419,9 @@ def create_event( body : typing.Optional[EventBody] + idempotency_key : typing.Optional[str] + Optional client-supplied key. Duplicate events with the same key (scoped to the environment) are dropped for 24h. + sent_at : typing.Optional[dt.datetime] Optionally provide a timestamp at which the event was sent to Schematic @@ -431,6 +439,7 @@ def create_event( json={ "body": convert_and_respect_annotation_metadata(object_=body, annotation=EventBody, direction="write"), "event_type": event_type, + "idempotency_key": idempotency_key, "sent_at": sent_at, }, headers={ @@ -934,6 +943,7 @@ async def list_events( event_subtype: typing.Optional[str] = None, event_types: typing.Optional[typing.Union[EventType, typing.Sequence[EventType]]] = None, flag_id: typing.Optional[str] = None, + idempotency_key: typing.Optional[str] = None, user_id: typing.Optional[str] = None, limit: typing.Optional[int] = None, offset: typing.Optional[int] = None, @@ -950,6 +960,8 @@ async def list_events( flag_id : typing.Optional[str] + idempotency_key : typing.Optional[str] + user_id : typing.Optional[str] limit : typing.Optional[int] @@ -974,6 +986,7 @@ async def list_events( "event_subtype": event_subtype, "event_types": event_types, "flag_id": flag_id, + "idempotency_key": idempotency_key, "user_id": user_id, "limit": limit, "offset": offset, @@ -1063,6 +1076,7 @@ async def create_event( *, event_type: EventType, body: typing.Optional[EventBody] = OMIT, + idempotency_key: typing.Optional[str] = OMIT, sent_at: typing.Optional[dt.datetime] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[CreateEventResponse]: @@ -1074,6 +1088,9 @@ async def create_event( body : typing.Optional[EventBody] + idempotency_key : typing.Optional[str] + Optional client-supplied key. Duplicate events with the same key (scoped to the environment) are dropped for 24h. + sent_at : typing.Optional[dt.datetime] Optionally provide a timestamp at which the event was sent to Schematic @@ -1091,6 +1108,7 @@ async def create_event( json={ "body": convert_and_respect_annotation_metadata(object_=body, annotation=EventBody, direction="write"), "event_type": event_type, + "idempotency_key": idempotency_key, "sent_at": sent_at, }, headers={ diff --git a/src/schematic/events/types/list_events_params.py b/src/schematic/events/types/list_events_params.py index 1667c88..b19676e 100644 --- a/src/schematic/events/types/list_events_params.py +++ b/src/schematic/events/types/list_events_params.py @@ -16,6 +16,7 @@ class ListEventsParams(UniversalBaseModel): event_subtype: typing.Optional[str] = None event_types: typing.Optional[typing.List[EventType]] = None flag_id: typing.Optional[str] = None + idempotency_key: typing.Optional[str] = None limit: typing.Optional[int] = pydantic.Field(default=None) """ Page limit (default 100) diff --git a/src/schematic/features/client.py b/src/schematic/features/client.py index d8a6be2..8f8cffc 100644 --- a/src/schematic/features/client.py +++ b/src/schematic/features/client.py @@ -54,6 +54,7 @@ def list_features( boolean_require_event: typing.Optional[bool] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + managed_by: typing.Optional[BillingProviderType] = None, plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, @@ -73,6 +74,9 @@ def list_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + plan_version_id : typing.Optional[str] Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used @@ -110,6 +114,7 @@ def list_features( boolean_require_event=True, feature_type=["boolean"], ids=["ids"], + managed_by="orb", plan_version_id="plan_version_id", q="q", without_company_override_for="without_company_override_for", @@ -122,6 +127,7 @@ def list_features( boolean_require_event=boolean_require_event, feature_type=feature_type, ids=ids, + managed_by=managed_by, plan_version_id=plan_version_id, q=q, without_company_override_for=without_company_override_for, @@ -447,6 +453,7 @@ def count_features( boolean_require_event: typing.Optional[bool] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + managed_by: typing.Optional[BillingProviderType] = None, plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, @@ -466,6 +473,9 @@ def count_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + plan_version_id : typing.Optional[str] Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used @@ -503,6 +513,7 @@ def count_features( boolean_require_event=True, feature_type=["boolean"], ids=["ids"], + managed_by="orb", plan_version_id="plan_version_id", q="q", without_company_override_for="without_company_override_for", @@ -515,6 +526,7 @@ def count_features( boolean_require_event=boolean_require_event, feature_type=feature_type, ids=ids, + managed_by=managed_by, plan_version_id=plan_version_id, q=q, without_company_override_for=without_company_override_for, @@ -1013,6 +1025,7 @@ async def list_features( boolean_require_event: typing.Optional[bool] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + managed_by: typing.Optional[BillingProviderType] = None, plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, @@ -1032,6 +1045,9 @@ async def list_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + plan_version_id : typing.Optional[str] Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used @@ -1074,6 +1090,7 @@ async def main() -> None: boolean_require_event=True, feature_type=["boolean"], ids=["ids"], + managed_by="orb", plan_version_id="plan_version_id", q="q", without_company_override_for="without_company_override_for", @@ -1089,6 +1106,7 @@ async def main() -> None: boolean_require_event=boolean_require_event, feature_type=feature_type, ids=ids, + managed_by=managed_by, plan_version_id=plan_version_id, q=q, without_company_override_for=without_company_override_for, @@ -1454,6 +1472,7 @@ async def count_features( boolean_require_event: typing.Optional[bool] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + managed_by: typing.Optional[BillingProviderType] = None, plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, @@ -1473,6 +1492,9 @@ async def count_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + plan_version_id : typing.Optional[str] Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used @@ -1515,6 +1537,7 @@ async def main() -> None: boolean_require_event=True, feature_type=["boolean"], ids=["ids"], + managed_by="orb", plan_version_id="plan_version_id", q="q", without_company_override_for="without_company_override_for", @@ -1530,6 +1553,7 @@ async def main() -> None: boolean_require_event=boolean_require_event, feature_type=feature_type, ids=ids, + managed_by=managed_by, plan_version_id=plan_version_id, q=q, without_company_override_for=without_company_override_for, diff --git a/src/schematic/features/raw_client.py b/src/schematic/features/raw_client.py index 6b60fba..cd9e048 100644 --- a/src/schematic/features/raw_client.py +++ b/src/schematic/features/raw_client.py @@ -56,6 +56,7 @@ def list_features( boolean_require_event: typing.Optional[bool] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + managed_by: typing.Optional[BillingProviderType] = None, plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, @@ -75,6 +76,9 @@ def list_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + plan_version_id : typing.Optional[str] Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used @@ -108,6 +112,7 @@ def list_features( "boolean_require_event": boolean_require_event, "feature_type": feature_type, "ids": ids, + "managed_by": managed_by, "plan_version_id": plan_version_id, "q": q, "without_company_override_for": without_company_override_for, @@ -855,6 +860,7 @@ def count_features( boolean_require_event: typing.Optional[bool] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + managed_by: typing.Optional[BillingProviderType] = None, plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, @@ -874,6 +880,9 @@ def count_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + plan_version_id : typing.Optional[str] Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used @@ -907,6 +916,7 @@ def count_features( "boolean_require_event": boolean_require_event, "feature_type": feature_type, "ids": ids, + "managed_by": managed_by, "plan_version_id": plan_version_id, "q": q, "without_company_override_for": without_company_override_for, @@ -2162,6 +2172,7 @@ async def list_features( boolean_require_event: typing.Optional[bool] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + managed_by: typing.Optional[BillingProviderType] = None, plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, @@ -2181,6 +2192,9 @@ async def list_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + plan_version_id : typing.Optional[str] Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used @@ -2214,6 +2228,7 @@ async def list_features( "boolean_require_event": boolean_require_event, "feature_type": feature_type, "ids": ids, + "managed_by": managed_by, "plan_version_id": plan_version_id, "q": q, "without_company_override_for": without_company_override_for, @@ -2961,6 +2976,7 @@ async def count_features( boolean_require_event: typing.Optional[bool] = None, feature_type: typing.Optional[typing.Union[FeatureType, typing.Sequence[FeatureType]]] = None, ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + managed_by: typing.Optional[BillingProviderType] = None, plan_version_id: typing.Optional[str] = None, q: typing.Optional[str] = None, without_company_override_for: typing.Optional[str] = None, @@ -2980,6 +2996,9 @@ async def count_features( ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + managed_by : typing.Optional[BillingProviderType] + Filter for features managed by a billing provider, or by Schematic (no billing provider) + plan_version_id : typing.Optional[str] Filter by plan version ID when used with without_plan_entitlement_for; if not provided, the latest published version is used @@ -3013,6 +3032,7 @@ async def count_features( "boolean_require_event": boolean_require_event, "feature_type": feature_type, "ids": ids, + "managed_by": managed_by, "plan_version_id": plan_version_id, "q": q, "without_company_override_for": without_company_override_for, diff --git a/src/schematic/features/types/count_features_params.py b/src/schematic/features/types/count_features_params.py index 2938333..74883e8 100644 --- a/src/schematic/features/types/count_features_params.py +++ b/src/schematic/features/types/count_features_params.py @@ -4,6 +4,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.billing_provider_type import BillingProviderType from ...types.feature_type import FeatureType @@ -28,6 +29,11 @@ class CountFeaturesParams(UniversalBaseModel): Page limit (default 100) """ + managed_by: typing.Optional[BillingProviderType] = pydantic.Field(default=None) + """ + Filter for features managed by a billing provider, or by Schematic (no billing provider) + """ + offset: typing.Optional[int] = pydantic.Field(default=None) """ Page offset (default 0) diff --git a/src/schematic/features/types/list_features_params.py b/src/schematic/features/types/list_features_params.py index 1756467..df863c5 100644 --- a/src/schematic/features/types/list_features_params.py +++ b/src/schematic/features/types/list_features_params.py @@ -4,6 +4,7 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.billing_provider_type import BillingProviderType from ...types.feature_type import FeatureType @@ -28,6 +29,11 @@ class ListFeaturesParams(UniversalBaseModel): Page limit (default 100) """ + managed_by: typing.Optional[BillingProviderType] = pydantic.Field(default=None) + """ + Filter for features managed by a billing provider, or by Schematic (no billing provider) + """ + offset: typing.Optional[int] = pydantic.Field(default=None) """ Page offset (default 0) diff --git a/src/schematic/insights/__init__.py b/src/schematic/insights/__init__.py new file mode 100644 index 0000000..08da82c --- /dev/null +++ b/src/schematic/insights/__init__.py @@ -0,0 +1,70 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + GetActivityParams, + GetActivityResponse, + GetEnvironmentFeatureUsageTimeSeriesParams, + GetEnvironmentFeatureUsageTimeSeriesResponse, + GetEnvironmentTraitUsageTimeSeriesParams, + GetEnvironmentTraitUsageTimeSeriesResponse, + GetPlanGrowthParams, + GetPlanGrowthResponse, + GetSummaryResponse, + GetTopFeaturesByUsageParams, + GetTopFeaturesByUsageResponse, + ) +_dynamic_imports: typing.Dict[str, str] = { + "GetActivityParams": ".types", + "GetActivityResponse": ".types", + "GetEnvironmentFeatureUsageTimeSeriesParams": ".types", + "GetEnvironmentFeatureUsageTimeSeriesResponse": ".types", + "GetEnvironmentTraitUsageTimeSeriesParams": ".types", + "GetEnvironmentTraitUsageTimeSeriesResponse": ".types", + "GetPlanGrowthParams": ".types", + "GetPlanGrowthResponse": ".types", + "GetSummaryResponse": ".types", + "GetTopFeaturesByUsageParams": ".types", + "GetTopFeaturesByUsageResponse": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "GetActivityParams", + "GetActivityResponse", + "GetEnvironmentFeatureUsageTimeSeriesParams", + "GetEnvironmentFeatureUsageTimeSeriesResponse", + "GetEnvironmentTraitUsageTimeSeriesParams", + "GetEnvironmentTraitUsageTimeSeriesResponse", + "GetPlanGrowthParams", + "GetPlanGrowthResponse", + "GetSummaryResponse", + "GetTopFeaturesByUsageParams", + "GetTopFeaturesByUsageResponse", +] diff --git a/src/schematic/insights/client.py b/src/schematic/insights/client.py new file mode 100644 index 0000000..586db67 --- /dev/null +++ b/src/schematic/insights/client.py @@ -0,0 +1,586 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.time_series_granularity import TimeSeriesGranularity +from .raw_client import AsyncRawInsightsClient, RawInsightsClient +from .types.get_activity_response import GetActivityResponse +from .types.get_environment_feature_usage_time_series_response import GetEnvironmentFeatureUsageTimeSeriesResponse +from .types.get_environment_trait_usage_time_series_response import GetEnvironmentTraitUsageTimeSeriesResponse +from .types.get_plan_growth_response import GetPlanGrowthResponse +from .types.get_summary_response import GetSummaryResponse +from .types.get_top_features_by_usage_response import GetTopFeaturesByUsageResponse + + +class InsightsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawInsightsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawInsightsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawInsightsClient + """ + return self._raw_client + + def get_activity( + self, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> GetActivityResponse: + """ + Parameters + ---------- + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetActivityResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.insights.get_activity( + limit=1000000, + ) + """ + _response = self._raw_client.get_activity(limit=limit, request_options=request_options) + return _response.data + + def get_environment_feature_usage_time_series( + self, + *, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetEnvironmentFeatureUsageTimeSeriesResponse: + """ + Parameters + ---------- + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetEnvironmentFeatureUsageTimeSeriesResponse + OK + + Examples + -------- + import datetime + + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.insights.get_environment_feature_usage_time_series( + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + feature_id="feature_id", + granularity="daily", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + """ + _response = self._raw_client.get_environment_feature_usage_time_series( + end_time=end_time, + feature_id=feature_id, + start_time=start_time, + granularity=granularity, + request_options=request_options, + ) + return _response.data + + def get_plan_growth( + self, *, months: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> GetPlanGrowthResponse: + """ + Parameters + ---------- + months : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetPlanGrowthResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.insights.get_plan_growth( + months=1000000, + ) + """ + _response = self._raw_client.get_plan_growth(months=months, request_options=request_options) + return _response.data + + def get_summary(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetSummaryResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetSummaryResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.insights.get_summary() + """ + _response = self._raw_client.get_summary(request_options=request_options) + return _response.data + + def get_top_features_by_usage( + self, + *, + end_time: dt.datetime, + start_time: dt.datetime, + limit: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetTopFeaturesByUsageResponse: + """ + Parameters + ---------- + end_time : dt.datetime + + start_time : dt.datetime + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetTopFeaturesByUsageResponse + OK + + Examples + -------- + import datetime + + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.insights.get_top_features_by_usage( + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + limit=1000000, + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + """ + _response = self._raw_client.get_top_features_by_usage( + end_time=end_time, start_time=start_time, limit=limit, request_options=request_options + ) + return _response.data + + def get_environment_trait_usage_time_series( + self, + *, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetEnvironmentTraitUsageTimeSeriesResponse: + """ + Parameters + ---------- + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetEnvironmentTraitUsageTimeSeriesResponse + OK + + Examples + -------- + import datetime + + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.insights.get_environment_trait_usage_time_series( + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + feature_id="feature_id", + granularity="daily", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + """ + _response = self._raw_client.get_environment_trait_usage_time_series( + end_time=end_time, + feature_id=feature_id, + start_time=start_time, + granularity=granularity, + request_options=request_options, + ) + return _response.data + + +class AsyncInsightsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawInsightsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawInsightsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawInsightsClient + """ + return self._raw_client + + async def get_activity( + self, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> GetActivityResponse: + """ + Parameters + ---------- + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetActivityResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.insights.get_activity( + limit=1000000, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_activity(limit=limit, request_options=request_options) + return _response.data + + async def get_environment_feature_usage_time_series( + self, + *, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetEnvironmentFeatureUsageTimeSeriesResponse: + """ + Parameters + ---------- + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetEnvironmentFeatureUsageTimeSeriesResponse + OK + + Examples + -------- + import asyncio + import datetime + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.insights.get_environment_feature_usage_time_series( + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + feature_id="feature_id", + granularity="daily", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_environment_feature_usage_time_series( + end_time=end_time, + feature_id=feature_id, + start_time=start_time, + granularity=granularity, + request_options=request_options, + ) + return _response.data + + async def get_plan_growth( + self, *, months: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> GetPlanGrowthResponse: + """ + Parameters + ---------- + months : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetPlanGrowthResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.insights.get_plan_growth( + months=1000000, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_plan_growth(months=months, request_options=request_options) + return _response.data + + async def get_summary(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetSummaryResponse: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetSummaryResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.insights.get_summary() + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_summary(request_options=request_options) + return _response.data + + async def get_top_features_by_usage( + self, + *, + end_time: dt.datetime, + start_time: dt.datetime, + limit: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetTopFeaturesByUsageResponse: + """ + Parameters + ---------- + end_time : dt.datetime + + start_time : dt.datetime + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetTopFeaturesByUsageResponse + OK + + Examples + -------- + import asyncio + import datetime + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.insights.get_top_features_by_usage( + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + limit=1000000, + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_top_features_by_usage( + end_time=end_time, start_time=start_time, limit=limit, request_options=request_options + ) + return _response.data + + async def get_environment_trait_usage_time_series( + self, + *, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetEnvironmentTraitUsageTimeSeriesResponse: + """ + Parameters + ---------- + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetEnvironmentTraitUsageTimeSeriesResponse + OK + + Examples + -------- + import asyncio + import datetime + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.insights.get_environment_trait_usage_time_series( + end_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + feature_id="feature_id", + granularity="daily", + start_time=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_environment_trait_usage_time_series( + end_time=end_time, + feature_id=feature_id, + start_time=start_time, + granularity=granularity, + request_options=request_options, + ) + return _response.data diff --git a/src/schematic/insights/raw_client.py b/src/schematic/insights/raw_client.py new file mode 100644 index 0000000..44f4256 --- /dev/null +++ b/src/schematic/insights/raw_client.py @@ -0,0 +1,1200 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError as core_api_error_ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.datetime_utils import serialize_datetime +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.parse_error import ParsingError +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..errors.forbidden_error import ForbiddenError +from ..errors.internal_server_error import InternalServerError +from ..errors.not_found_error import NotFoundError +from ..errors.unauthorized_error import UnauthorizedError +from ..types.api_error import ApiError as types_api_error_ApiError +from ..types.time_series_granularity import TimeSeriesGranularity +from .types.get_activity_response import GetActivityResponse +from .types.get_environment_feature_usage_time_series_response import GetEnvironmentFeatureUsageTimeSeriesResponse +from .types.get_environment_trait_usage_time_series_response import GetEnvironmentTraitUsageTimeSeriesResponse +from .types.get_plan_growth_response import GetPlanGrowthResponse +from .types.get_summary_response import GetSummaryResponse +from .types.get_top_features_by_usage_response import GetTopFeaturesByUsageResponse +from pydantic import ValidationError + + +class RawInsightsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_activity( + self, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetActivityResponse]: + """ + Parameters + ---------- + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetActivityResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "insights/activity", + method="GET", + params={ + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetActivityResponse, + parse_obj_as( + type_=GetActivityResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def get_environment_feature_usage_time_series( + self, + *, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[GetEnvironmentFeatureUsageTimeSeriesResponse]: + """ + Parameters + ---------- + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetEnvironmentFeatureUsageTimeSeriesResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "insights/feature-usage-timeseries", + method="GET", + params={ + "end_time": serialize_datetime(end_time), + "feature_id": feature_id, + "granularity": granularity, + "start_time": serialize_datetime(start_time), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetEnvironmentFeatureUsageTimeSeriesResponse, + parse_obj_as( + type_=GetEnvironmentFeatureUsageTimeSeriesResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def get_plan_growth( + self, *, months: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetPlanGrowthResponse]: + """ + Parameters + ---------- + months : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetPlanGrowthResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "insights/plan-growth", + method="GET", + params={ + "months": months, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetPlanGrowthResponse, + parse_obj_as( + type_=GetPlanGrowthResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def get_summary( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetSummaryResponse]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetSummaryResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "insights/summary", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetSummaryResponse, + parse_obj_as( + type_=GetSummaryResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def get_top_features_by_usage( + self, + *, + end_time: dt.datetime, + start_time: dt.datetime, + limit: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[GetTopFeaturesByUsageResponse]: + """ + Parameters + ---------- + end_time : dt.datetime + + start_time : dt.datetime + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetTopFeaturesByUsageResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "insights/top-features", + method="GET", + params={ + "end_time": serialize_datetime(end_time), + "limit": limit, + "start_time": serialize_datetime(start_time), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetTopFeaturesByUsageResponse, + parse_obj_as( + type_=GetTopFeaturesByUsageResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def get_environment_trait_usage_time_series( + self, + *, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[GetEnvironmentTraitUsageTimeSeriesResponse]: + """ + Parameters + ---------- + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetEnvironmentTraitUsageTimeSeriesResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "insights/trait-usage-timeseries", + method="GET", + params={ + "end_time": serialize_datetime(end_time), + "feature_id": feature_id, + "granularity": granularity, + "start_time": serialize_datetime(start_time), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetEnvironmentTraitUsageTimeSeriesResponse, + parse_obj_as( + type_=GetEnvironmentTraitUsageTimeSeriesResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + +class AsyncRawInsightsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_activity( + self, *, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetActivityResponse]: + """ + Parameters + ---------- + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetActivityResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "insights/activity", + method="GET", + params={ + "limit": limit, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetActivityResponse, + parse_obj_as( + type_=GetActivityResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get_environment_feature_usage_time_series( + self, + *, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[GetEnvironmentFeatureUsageTimeSeriesResponse]: + """ + Parameters + ---------- + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetEnvironmentFeatureUsageTimeSeriesResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "insights/feature-usage-timeseries", + method="GET", + params={ + "end_time": serialize_datetime(end_time), + "feature_id": feature_id, + "granularity": granularity, + "start_time": serialize_datetime(start_time), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetEnvironmentFeatureUsageTimeSeriesResponse, + parse_obj_as( + type_=GetEnvironmentFeatureUsageTimeSeriesResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get_plan_growth( + self, *, months: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetPlanGrowthResponse]: + """ + Parameters + ---------- + months : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetPlanGrowthResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "insights/plan-growth", + method="GET", + params={ + "months": months, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetPlanGrowthResponse, + parse_obj_as( + type_=GetPlanGrowthResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get_summary( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetSummaryResponse]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetSummaryResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "insights/summary", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetSummaryResponse, + parse_obj_as( + type_=GetSummaryResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get_top_features_by_usage( + self, + *, + end_time: dt.datetime, + start_time: dt.datetime, + limit: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[GetTopFeaturesByUsageResponse]: + """ + Parameters + ---------- + end_time : dt.datetime + + start_time : dt.datetime + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetTopFeaturesByUsageResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "insights/top-features", + method="GET", + params={ + "end_time": serialize_datetime(end_time), + "limit": limit, + "start_time": serialize_datetime(start_time), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetTopFeaturesByUsageResponse, + parse_obj_as( + type_=GetTopFeaturesByUsageResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get_environment_trait_usage_time_series( + self, + *, + end_time: dt.datetime, + feature_id: str, + start_time: dt.datetime, + granularity: typing.Optional[TimeSeriesGranularity] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[GetEnvironmentTraitUsageTimeSeriesResponse]: + """ + Parameters + ---------- + end_time : dt.datetime + + feature_id : str + + start_time : dt.datetime + + granularity : typing.Optional[TimeSeriesGranularity] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetEnvironmentTraitUsageTimeSeriesResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "insights/trait-usage-timeseries", + method="GET", + params={ + "end_time": serialize_datetime(end_time), + "feature_id": feature_id, + "granularity": granularity, + "start_time": serialize_datetime(start_time), + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetEnvironmentTraitUsageTimeSeriesResponse, + parse_obj_as( + type_=GetEnvironmentTraitUsageTimeSeriesResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) diff --git a/src/schematic/insights/types/__init__.py b/src/schematic/insights/types/__init__.py new file mode 100644 index 0000000..c796994 --- /dev/null +++ b/src/schematic/insights/types/__init__.py @@ -0,0 +1,68 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .get_activity_params import GetActivityParams + from .get_activity_response import GetActivityResponse + from .get_environment_feature_usage_time_series_params import GetEnvironmentFeatureUsageTimeSeriesParams + from .get_environment_feature_usage_time_series_response import GetEnvironmentFeatureUsageTimeSeriesResponse + from .get_environment_trait_usage_time_series_params import GetEnvironmentTraitUsageTimeSeriesParams + from .get_environment_trait_usage_time_series_response import GetEnvironmentTraitUsageTimeSeriesResponse + from .get_plan_growth_params import GetPlanGrowthParams + from .get_plan_growth_response import GetPlanGrowthResponse + from .get_summary_response import GetSummaryResponse + from .get_top_features_by_usage_params import GetTopFeaturesByUsageParams + from .get_top_features_by_usage_response import GetTopFeaturesByUsageResponse +_dynamic_imports: typing.Dict[str, str] = { + "GetActivityParams": ".get_activity_params", + "GetActivityResponse": ".get_activity_response", + "GetEnvironmentFeatureUsageTimeSeriesParams": ".get_environment_feature_usage_time_series_params", + "GetEnvironmentFeatureUsageTimeSeriesResponse": ".get_environment_feature_usage_time_series_response", + "GetEnvironmentTraitUsageTimeSeriesParams": ".get_environment_trait_usage_time_series_params", + "GetEnvironmentTraitUsageTimeSeriesResponse": ".get_environment_trait_usage_time_series_response", + "GetPlanGrowthParams": ".get_plan_growth_params", + "GetPlanGrowthResponse": ".get_plan_growth_response", + "GetSummaryResponse": ".get_summary_response", + "GetTopFeaturesByUsageParams": ".get_top_features_by_usage_params", + "GetTopFeaturesByUsageResponse": ".get_top_features_by_usage_response", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "GetActivityParams", + "GetActivityResponse", + "GetEnvironmentFeatureUsageTimeSeriesParams", + "GetEnvironmentFeatureUsageTimeSeriesResponse", + "GetEnvironmentTraitUsageTimeSeriesParams", + "GetEnvironmentTraitUsageTimeSeriesResponse", + "GetPlanGrowthParams", + "GetPlanGrowthResponse", + "GetSummaryResponse", + "GetTopFeaturesByUsageParams", + "GetTopFeaturesByUsageResponse", +] diff --git a/src/schematic/insights/types/get_activity_params.py b/src/schematic/insights/types/get_activity_params.py new file mode 100644 index 0000000..6fb9277 --- /dev/null +++ b/src/schematic/insights/types/get_activity_params.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class GetActivityParams(UniversalBaseModel): + """ + Input parameters + """ + + limit: typing.Optional[int] = 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/insights/types/get_activity_response.py b/src/schematic/insights/types/get_activity_response.py new file mode 100644 index 0000000..6e42881 --- /dev/null +++ b/src/schematic/insights/types/get_activity_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.activity_response_response_data import ActivityResponseResponseData +from .get_activity_params import GetActivityParams + + +class GetActivityResponse(UniversalBaseModel): + data: ActivityResponseResponseData + params: GetActivityParams = 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/insights/types/get_environment_feature_usage_time_series_params.py b/src/schematic/insights/types/get_environment_feature_usage_time_series_params.py new file mode 100644 index 0000000..0f97c75 --- /dev/null +++ b/src/schematic/insights/types/get_environment_feature_usage_time_series_params.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.time_series_granularity import TimeSeriesGranularity + + +class GetEnvironmentFeatureUsageTimeSeriesParams(UniversalBaseModel): + """ + Input parameters + """ + + end_time: typing.Optional[dt.datetime] = None + feature_id: typing.Optional[str] = None + granularity: typing.Optional[TimeSeriesGranularity] = None + start_time: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/insights/types/get_environment_feature_usage_time_series_response.py b/src/schematic/insights/types/get_environment_feature_usage_time_series_response.py new file mode 100644 index 0000000..5d1a2a8 --- /dev/null +++ b/src/schematic/insights/types/get_environment_feature_usage_time_series_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.environment_feature_usage_time_series_response_data import EnvironmentFeatureUsageTimeSeriesResponseData +from .get_environment_feature_usage_time_series_params import GetEnvironmentFeatureUsageTimeSeriesParams + + +class GetEnvironmentFeatureUsageTimeSeriesResponse(UniversalBaseModel): + data: EnvironmentFeatureUsageTimeSeriesResponseData + params: GetEnvironmentFeatureUsageTimeSeriesParams = 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/insights/types/get_environment_trait_usage_time_series_params.py b/src/schematic/insights/types/get_environment_trait_usage_time_series_params.py new file mode 100644 index 0000000..6c97e00 --- /dev/null +++ b/src/schematic/insights/types/get_environment_trait_usage_time_series_params.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.time_series_granularity import TimeSeriesGranularity + + +class GetEnvironmentTraitUsageTimeSeriesParams(UniversalBaseModel): + """ + Input parameters + """ + + end_time: typing.Optional[dt.datetime] = None + feature_id: typing.Optional[str] = None + granularity: typing.Optional[TimeSeriesGranularity] = None + start_time: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/insights/types/get_environment_trait_usage_time_series_response.py b/src/schematic/insights/types/get_environment_trait_usage_time_series_response.py new file mode 100644 index 0000000..392c536 --- /dev/null +++ b/src/schematic/insights/types/get_environment_trait_usage_time_series_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.environment_trait_usage_time_series_response_data import EnvironmentTraitUsageTimeSeriesResponseData +from .get_environment_trait_usage_time_series_params import GetEnvironmentTraitUsageTimeSeriesParams + + +class GetEnvironmentTraitUsageTimeSeriesResponse(UniversalBaseModel): + data: EnvironmentTraitUsageTimeSeriesResponseData + params: GetEnvironmentTraitUsageTimeSeriesParams = 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/insights/types/get_plan_growth_params.py b/src/schematic/insights/types/get_plan_growth_params.py new file mode 100644 index 0000000..f30b1f6 --- /dev/null +++ b/src/schematic/insights/types/get_plan_growth_params.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class GetPlanGrowthParams(UniversalBaseModel): + """ + Input parameters + """ + + months: typing.Optional[int] = 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/insights/types/get_plan_growth_response.py b/src/schematic/insights/types/get_plan_growth_response.py new file mode 100644 index 0000000..cb91325 --- /dev/null +++ b/src/schematic/insights/types/get_plan_growth_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_growth_response_data import PlanGrowthResponseData +from .get_plan_growth_params import GetPlanGrowthParams + + +class GetPlanGrowthResponse(UniversalBaseModel): + data: PlanGrowthResponseData + params: GetPlanGrowthParams = 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/insights/types/get_summary_response.py b/src/schematic/insights/types/get_summary_response.py new file mode 100644 index 0000000..18aeddd --- /dev/null +++ b/src/schematic/insights/types/get_summary_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.insights_summary_response_data import InsightsSummaryResponseData + + +class GetSummaryResponse(UniversalBaseModel): + data: InsightsSummaryResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/insights/types/get_top_features_by_usage_params.py b/src/schematic/insights/types/get_top_features_by_usage_params.py new file mode 100644 index 0000000..6810d3f --- /dev/null +++ b/src/schematic/insights/types/get_top_features_by_usage_params.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class GetTopFeaturesByUsageParams(UniversalBaseModel): + """ + Input parameters + """ + + end_time: typing.Optional[dt.datetime] = None + limit: typing.Optional[int] = None + start_time: typing.Optional[dt.datetime] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/insights/types/get_top_features_by_usage_response.py b/src/schematic/insights/types/get_top_features_by_usage_response.py new file mode 100644 index 0000000..03cec59 --- /dev/null +++ b/src/schematic/insights/types/get_top_features_by_usage_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.top_features_by_usage_response_data import TopFeaturesByUsageResponseData +from .get_top_features_by_usage_params import GetTopFeaturesByUsageParams + + +class GetTopFeaturesByUsageResponse(UniversalBaseModel): + data: TopFeaturesByUsageResponseData + params: GetTopFeaturesByUsageParams = 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/integrationsapi/__init__.py b/src/schematic/integrationsapi/__init__.py index 8e9a8dd..c6490c5 100644 --- a/src/schematic/integrationsapi/__init__.py +++ b/src/schematic/integrationsapi/__init__.py @@ -6,8 +6,24 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .types import GetIntegrationWebhookUrlResponse -_dynamic_imports: typing.Dict[str, str] = {"GetIntegrationWebhookUrlResponse": ".types"} + from .types import ( + GetIntegrationWebhookUrlResponse, + ListIntegrationsParams, + ListIntegrationsResponse, + LoadSampleDataSetV2Response, + RunIntegrationResponse, + StartDataImportResponse, + UninstallIntegrationResponse, + ) +_dynamic_imports: typing.Dict[str, str] = { + "GetIntegrationWebhookUrlResponse": ".types", + "ListIntegrationsParams": ".types", + "ListIntegrationsResponse": ".types", + "LoadSampleDataSetV2Response": ".types", + "RunIntegrationResponse": ".types", + "StartDataImportResponse": ".types", + "UninstallIntegrationResponse": ".types", +} def __getattr__(attr_name: str) -> typing.Any: @@ -31,4 +47,12 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["GetIntegrationWebhookUrlResponse"] +__all__ = [ + "GetIntegrationWebhookUrlResponse", + "ListIntegrationsParams", + "ListIntegrationsResponse", + "LoadSampleDataSetV2Response", + "RunIntegrationResponse", + "StartDataImportResponse", + "UninstallIntegrationResponse", +] diff --git a/src/schematic/integrationsapi/client.py b/src/schematic/integrationsapi/client.py index 57c9923..b64bbd8 100644 --- a/src/schematic/integrationsapi/client.py +++ b/src/schematic/integrationsapi/client.py @@ -4,8 +4,19 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions +from ..types.company_matching_criteria import CompanyMatchingCriteria +from ..types.integration_state import IntegrationState +from ..types.integration_type import IntegrationType from .raw_client import AsyncRawIntegrationsapiClient, RawIntegrationsapiClient from .types.get_integration_webhook_url_response import GetIntegrationWebhookUrlResponse +from .types.list_integrations_response import ListIntegrationsResponse +from .types.load_sample_data_set_v_2_response import LoadSampleDataSetV2Response +from .types.run_integration_response import RunIntegrationResponse +from .types.start_data_import_response import StartDataImportResponse +from .types.uninstall_integration_response import UninstallIntegrationResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) class IntegrationsapiClient: @@ -23,6 +34,105 @@ def with_raw_response(self) -> RawIntegrationsapiClient: """ return self._raw_client + def run_integration( + self, integration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> RunIntegrationResponse: + """ + Parameters + ---------- + integration_id : str + integration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RunIntegrationResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.integrationsapi.run_integration( + integration_id="integration_id", + ) + """ + _response = self._raw_client.run_integration(integration_id, request_options=request_options) + return _response.data + + def list_integrations( + self, + *, + billing_only: typing.Optional[bool] = None, + exclude_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + id: typing.Optional[str] = None, + state: typing.Optional[IntegrationState] = None, + type: typing.Optional[IntegrationType] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListIntegrationsResponse: + """ + Parameters + ---------- + billing_only : typing.Optional[bool] + + exclude_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + + id : typing.Optional[str] + + state : typing.Optional[IntegrationState] + + type : typing.Optional[IntegrationType] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListIntegrationsResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.integrationsapi.list_integrations( + billing_only=True, + exclude_ids=["exclude_ids"], + id="id", + state="active", + type="clerk", + limit=1000000, + offset=1000000, + ) + """ + _response = self._raw_client.list_integrations( + billing_only=billing_only, + exclude_ids=exclude_ids, + id=id, + state=state, + type=type, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + def get_integration_webhook_url( self, type: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetIntegrationWebhookUrlResponse: @@ -54,6 +164,107 @@ def get_integration_webhook_url( _response = self._raw_client.get_integration_webhook_url(type, request_options=request_options) return _response.data + def start_data_import( + self, + *, + integration_id: str, + company_matching_criteria: typing.Optional[CompanyMatchingCriteria] = OMIT, + company_matching_field: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> StartDataImportResponse: + """ + Parameters + ---------- + integration_id : str + + company_matching_criteria : typing.Optional[CompanyMatchingCriteria] + + company_matching_field : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StartDataImportResponse + Created + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.integrationsapi.start_data_import( + integration_id="integration_id", + ) + """ + _response = self._raw_client.start_data_import( + integration_id=integration_id, + company_matching_criteria=company_matching_criteria, + company_matching_field=company_matching_field, + request_options=request_options, + ) + return _response.data + + def load_sample_data_set_v_2( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> LoadSampleDataSetV2Response: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + LoadSampleDataSetV2Response + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.integrationsapi.load_sample_data_set_v_2() + """ + _response = self._raw_client.load_sample_data_set_v_2(request_options=request_options) + return _response.data + + def uninstall_integration( + self, integration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> UninstallIntegrationResponse: + """ + Parameters + ---------- + integration_id : str + integration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UninstallIntegrationResponse + OK + + Examples + -------- + from schematic import Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.integrationsapi.uninstall_integration( + integration_id="integration_id", + ) + """ + _response = self._raw_client.uninstall_integration(integration_id, request_options=request_options) + return _response.data + class AsyncIntegrationsapiClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -70,6 +281,121 @@ def with_raw_response(self) -> AsyncRawIntegrationsapiClient: """ return self._raw_client + async def run_integration( + self, integration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> RunIntegrationResponse: + """ + Parameters + ---------- + integration_id : str + integration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RunIntegrationResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.integrationsapi.run_integration( + integration_id="integration_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.run_integration(integration_id, request_options=request_options) + return _response.data + + async def list_integrations( + self, + *, + billing_only: typing.Optional[bool] = None, + exclude_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + id: typing.Optional[str] = None, + state: typing.Optional[IntegrationState] = None, + type: typing.Optional[IntegrationType] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ListIntegrationsResponse: + """ + Parameters + ---------- + billing_only : typing.Optional[bool] + + exclude_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + + id : typing.Optional[str] + + state : typing.Optional[IntegrationState] + + type : typing.Optional[IntegrationType] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ListIntegrationsResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.integrationsapi.list_integrations( + billing_only=True, + exclude_ids=["exclude_ids"], + id="id", + state="active", + type="clerk", + limit=1000000, + offset=1000000, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_integrations( + billing_only=billing_only, + exclude_ids=exclude_ids, + id=id, + state=state, + type=type, + limit=limit, + offset=offset, + request_options=request_options, + ) + return _response.data + async def get_integration_webhook_url( self, type: str, *, request_options: typing.Optional[RequestOptions] = None ) -> GetIntegrationWebhookUrlResponse: @@ -108,3 +434,128 @@ async def main() -> None: """ _response = await self._raw_client.get_integration_webhook_url(type, request_options=request_options) return _response.data + + async def start_data_import( + self, + *, + integration_id: str, + company_matching_criteria: typing.Optional[CompanyMatchingCriteria] = OMIT, + company_matching_field: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> StartDataImportResponse: + """ + Parameters + ---------- + integration_id : str + + company_matching_criteria : typing.Optional[CompanyMatchingCriteria] + + company_matching_field : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StartDataImportResponse + Created + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.integrationsapi.start_data_import( + integration_id="integration_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.start_data_import( + integration_id=integration_id, + company_matching_criteria=company_matching_criteria, + company_matching_field=company_matching_field, + request_options=request_options, + ) + return _response.data + + async def load_sample_data_set_v_2( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> LoadSampleDataSetV2Response: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + LoadSampleDataSetV2Response + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.integrationsapi.load_sample_data_set_v_2() + + + asyncio.run(main()) + """ + _response = await self._raw_client.load_sample_data_set_v_2(request_options=request_options) + return _response.data + + async def uninstall_integration( + self, integration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> UninstallIntegrationResponse: + """ + Parameters + ---------- + integration_id : str + integration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + UninstallIntegrationResponse + OK + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.integrationsapi.uninstall_integration( + integration_id="integration_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.uninstall_integration(integration_id, request_options=request_options) + return _response.data diff --git a/src/schematic/integrationsapi/raw_client.py b/src/schematic/integrationsapi/raw_client.py index 2a04672..4889c44 100644 --- a/src/schematic/integrationsapi/raw_client.py +++ b/src/schematic/integrationsapi/raw_client.py @@ -10,47 +10,59 @@ from ..core.parse_error import ParsingError from ..core.pydantic_utilities import parse_obj_as from ..core.request_options import RequestOptions +from ..errors.bad_request_error import BadRequestError from ..errors.forbidden_error import ForbiddenError from ..errors.internal_server_error import InternalServerError from ..errors.not_found_error import NotFoundError from ..errors.unauthorized_error import UnauthorizedError from ..types.api_error import ApiError as types_api_error_ApiError +from ..types.company_matching_criteria import CompanyMatchingCriteria +from ..types.integration_state import IntegrationState +from ..types.integration_type import IntegrationType from .types.get_integration_webhook_url_response import GetIntegrationWebhookUrlResponse +from .types.list_integrations_response import ListIntegrationsResponse +from .types.load_sample_data_set_v_2_response import LoadSampleDataSetV2Response +from .types.run_integration_response import RunIntegrationResponse +from .types.start_data_import_response import StartDataImportResponse +from .types.uninstall_integration_response import UninstallIntegrationResponse from pydantic import ValidationError +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + class RawIntegrationsapiClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def get_integration_webhook_url( - self, type: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[GetIntegrationWebhookUrlResponse]: + def run_integration( + self, integration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[RunIntegrationResponse]: """ Parameters ---------- - type : str - type + integration_id : str + integration_id request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[GetIntegrationWebhookUrlResponse] + HttpResponse[RunIntegrationResponse] OK """ _response = self._client_wrapper.httpx_client.request( - f"integrations/{jsonable_encoder(type)}/webhook-url", + f"integration/start/{jsonable_encoder(integration_id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - GetIntegrationWebhookUrlResponse, + RunIntegrationResponse, parse_obj_as( - type_=GetIntegrationWebhookUrlResponse, # type: ignore + type_=RunIntegrationResponse, # type: ignore object_=_response.json(), ), ) @@ -112,14 +124,140 @@ def get_integration_webhook_url( status_code=_response.status_code, headers=dict(_response.headers), body=_response_json ) + def list_integrations( + self, + *, + billing_only: typing.Optional[bool] = None, + exclude_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + id: typing.Optional[str] = None, + state: typing.Optional[IntegrationState] = None, + type: typing.Optional[IntegrationType] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ListIntegrationsResponse]: + """ + Parameters + ---------- + billing_only : typing.Optional[bool] -class AsyncRawIntegrationsapiClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper + exclude_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] - async def get_integration_webhook_url( + id : typing.Optional[str] + + state : typing.Optional[IntegrationState] + + type : typing.Optional[IntegrationType] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ListIntegrationsResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "integrations", + method="GET", + params={ + "billing_only": billing_only, + "exclude_ids": exclude_ids, + "id": id, + "state": state, + "type": type, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListIntegrationsResponse, + parse_obj_as( + type_=ListIntegrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def get_integration_webhook_url( self, type: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[GetIntegrationWebhookUrlResponse]: + ) -> HttpResponse[GetIntegrationWebhookUrlResponse]: """ Parameters ---------- @@ -131,10 +269,10 @@ async def get_integration_webhook_url( Returns ------- - AsyncHttpResponse[GetIntegrationWebhookUrlResponse] + HttpResponse[GetIntegrationWebhookUrlResponse] OK """ - _response = await self._client_wrapper.httpx_client.request( + _response = self._client_wrapper.httpx_client.request( f"integrations/{jsonable_encoder(type)}/webhook-url", method="GET", request_options=request_options, @@ -148,7 +286,927 @@ async def get_integration_webhook_url( object_=_response.json(), ), ) - return AsyncHttpResponse(response=_response, data=_data) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def start_data_import( + self, + *, + integration_id: str, + company_matching_criteria: typing.Optional[CompanyMatchingCriteria] = OMIT, + company_matching_field: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[StartDataImportResponse]: + """ + Parameters + ---------- + integration_id : str + + company_matching_criteria : typing.Optional[CompanyMatchingCriteria] + + company_matching_field : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[StartDataImportResponse] + Created + """ + _response = self._client_wrapper.httpx_client.request( + "integrations/start-data-import", + method="POST", + json={ + "company_matching_criteria": company_matching_criteria, + "company_matching_field": company_matching_field, + "integration_id": integration_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + StartDataImportResponse, + parse_obj_as( + type_=StartDataImportResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def load_sample_data_set_v_2( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[LoadSampleDataSetV2Response]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[LoadSampleDataSetV2Response] + OK + """ + _response = self._client_wrapper.httpx_client.request( + "integrations/stripe/dataset-sample-v2", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + LoadSampleDataSetV2Response, + parse_obj_as( + type_=LoadSampleDataSetV2Response, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def uninstall_integration( + self, integration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[UninstallIntegrationResponse]: + """ + Parameters + ---------- + integration_id : str + integration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[UninstallIntegrationResponse] + OK + """ + _response = self._client_wrapper.httpx_client.request( + f"integrations/uninstall/{jsonable_encoder(integration_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + UninstallIntegrationResponse, + parse_obj_as( + type_=UninstallIntegrationResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + +class AsyncRawIntegrationsapiClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def run_integration( + self, integration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[RunIntegrationResponse]: + """ + Parameters + ---------- + integration_id : str + integration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[RunIntegrationResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + f"integration/start/{jsonable_encoder(integration_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + RunIntegrationResponse, + parse_obj_as( + type_=RunIntegrationResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def list_integrations( + self, + *, + billing_only: typing.Optional[bool] = None, + exclude_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + id: typing.Optional[str] = None, + state: typing.Optional[IntegrationState] = None, + type: typing.Optional[IntegrationType] = None, + limit: typing.Optional[int] = None, + offset: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ListIntegrationsResponse]: + """ + Parameters + ---------- + billing_only : typing.Optional[bool] + + exclude_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] + + id : typing.Optional[str] + + state : typing.Optional[IntegrationState] + + type : typing.Optional[IntegrationType] + + limit : typing.Optional[int] + Page limit (default 100) + + offset : typing.Optional[int] + Page offset (default 0) + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ListIntegrationsResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "integrations", + method="GET", + params={ + "billing_only": billing_only, + "exclude_ids": exclude_ids, + "id": id, + "state": state, + "type": type, + "limit": limit, + "offset": offset, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ListIntegrationsResponse, + parse_obj_as( + type_=ListIntegrationsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get_integration_webhook_url( + self, type: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetIntegrationWebhookUrlResponse]: + """ + Parameters + ---------- + type : str + type + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetIntegrationWebhookUrlResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + f"integrations/{jsonable_encoder(type)}/webhook-url", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetIntegrationWebhookUrlResponse, + parse_obj_as( + type_=GetIntegrationWebhookUrlResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def start_data_import( + self, + *, + integration_id: str, + company_matching_criteria: typing.Optional[CompanyMatchingCriteria] = OMIT, + company_matching_field: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[StartDataImportResponse]: + """ + Parameters + ---------- + integration_id : str + + company_matching_criteria : typing.Optional[CompanyMatchingCriteria] + + company_matching_field : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[StartDataImportResponse] + Created + """ + _response = await self._client_wrapper.httpx_client.request( + "integrations/start-data-import", + method="POST", + json={ + "company_matching_criteria": company_matching_criteria, + "company_matching_field": company_matching_field, + "integration_id": integration_id, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + StartDataImportResponse, + parse_obj_as( + type_=StartDataImportResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def load_sample_data_set_v_2( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[LoadSampleDataSetV2Response]: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[LoadSampleDataSetV2Response] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + "integrations/stripe/dataset-sample-v2", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + LoadSampleDataSetV2Response, + parse_obj_as( + type_=LoadSampleDataSetV2Response, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def uninstall_integration( + self, integration_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[UninstallIntegrationResponse]: + """ + Parameters + ---------- + integration_id : str + integration_id + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[UninstallIntegrationResponse] + OK + """ + _response = await self._client_wrapper.httpx_client.request( + f"integrations/uninstall/{jsonable_encoder(integration_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + UninstallIntegrationResponse, + parse_obj_as( + type_=UninstallIntegrationResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 401: raise UnauthorizedError( headers=dict(_response.headers), diff --git a/src/schematic/integrationsapi/types/__init__.py b/src/schematic/integrationsapi/types/__init__.py index 2e299bd..df68e27 100644 --- a/src/schematic/integrationsapi/types/__init__.py +++ b/src/schematic/integrationsapi/types/__init__.py @@ -7,7 +7,21 @@ if typing.TYPE_CHECKING: from .get_integration_webhook_url_response import GetIntegrationWebhookUrlResponse -_dynamic_imports: typing.Dict[str, str] = {"GetIntegrationWebhookUrlResponse": ".get_integration_webhook_url_response"} + from .list_integrations_params import ListIntegrationsParams + from .list_integrations_response import ListIntegrationsResponse + from .load_sample_data_set_v_2_response import LoadSampleDataSetV2Response + from .run_integration_response import RunIntegrationResponse + from .start_data_import_response import StartDataImportResponse + from .uninstall_integration_response import UninstallIntegrationResponse +_dynamic_imports: typing.Dict[str, str] = { + "GetIntegrationWebhookUrlResponse": ".get_integration_webhook_url_response", + "ListIntegrationsParams": ".list_integrations_params", + "ListIntegrationsResponse": ".list_integrations_response", + "LoadSampleDataSetV2Response": ".load_sample_data_set_v_2_response", + "RunIntegrationResponse": ".run_integration_response", + "StartDataImportResponse": ".start_data_import_response", + "UninstallIntegrationResponse": ".uninstall_integration_response", +} def __getattr__(attr_name: str) -> typing.Any: @@ -31,4 +45,12 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["GetIntegrationWebhookUrlResponse"] +__all__ = [ + "GetIntegrationWebhookUrlResponse", + "ListIntegrationsParams", + "ListIntegrationsResponse", + "LoadSampleDataSetV2Response", + "RunIntegrationResponse", + "StartDataImportResponse", + "UninstallIntegrationResponse", +] diff --git a/src/schematic/integrationsapi/types/list_integrations_params.py b/src/schematic/integrationsapi/types/list_integrations_params.py new file mode 100644 index 0000000..e215e3b --- /dev/null +++ b/src/schematic/integrationsapi/types/list_integrations_params.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.integration_state import IntegrationState +from ...types.integration_type import IntegrationType + + +class ListIntegrationsParams(UniversalBaseModel): + """ + Input parameters + """ + + billing_only: typing.Optional[bool] = None + exclude_ids: typing.Optional[typing.List[str]] = None + id: typing.Optional[str] = None + limit: typing.Optional[int] = pydantic.Field(default=None) + """ + Page limit (default 100) + """ + + offset: typing.Optional[int] = pydantic.Field(default=None) + """ + Page offset (default 0) + """ + + state: typing.Optional[IntegrationState] = None + type: typing.Optional[IntegrationType] = 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/integrationsapi/types/list_integrations_response.py b/src/schematic/integrationsapi/types/list_integrations_response.py new file mode 100644 index 0000000..be1649f --- /dev/null +++ b/src/schematic/integrationsapi/types/list_integrations_response.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.integrations_list_response_data import IntegrationsListResponseData +from .list_integrations_params import ListIntegrationsParams + + +class ListIntegrationsResponse(UniversalBaseModel): + data: typing.List[IntegrationsListResponseData] + params: ListIntegrationsParams = 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/integrationsapi/types/load_sample_data_set_v_2_response.py b/src/schematic/integrationsapi/types/load_sample_data_set_v_2_response.py new file mode 100644 index 0000000..28bdbe8 --- /dev/null +++ b/src/schematic/integrationsapi/types/load_sample_data_set_v_2_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.integrations_data_set_response_data import IntegrationsDataSetResponseData + + +class LoadSampleDataSetV2Response(UniversalBaseModel): + data: IntegrationsDataSetResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/integrationsapi/types/run_integration_response.py b/src/schematic/integrationsapi/types/run_integration_response.py new file mode 100644 index 0000000..a0b669b --- /dev/null +++ b/src/schematic/integrationsapi/types/run_integration_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.integrations_response_data import IntegrationsResponseData + + +class RunIntegrationResponse(UniversalBaseModel): + data: IntegrationsResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/integrationsapi/types/start_data_import_response.py b/src/schematic/integrationsapi/types/start_data_import_response.py new file mode 100644 index 0000000..bd0e0dc --- /dev/null +++ b/src/schematic/integrationsapi/types/start_data_import_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.integrations_response_data import IntegrationsResponseData + + +class StartDataImportResponse(UniversalBaseModel): + data: IntegrationsResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/integrationsapi/types/uninstall_integration_response.py b/src/schematic/integrationsapi/types/uninstall_integration_response.py new file mode 100644 index 0000000..7dc0aeb --- /dev/null +++ b/src/schematic/integrationsapi/types/uninstall_integration_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.delete_response import DeleteResponse + + +class UninstallIntegrationResponse(UniversalBaseModel): + data: DeleteResponse + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/planbundle/__init__.py b/src/schematic/planbundle/__init__.py index e316a0a..29c0184 100644 --- a/src/schematic/planbundle/__init__.py +++ b/src/schematic/planbundle/__init__.py @@ -6,8 +6,12 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .types import CreatePlanBundleResponse, UpdatePlanBundleResponse -_dynamic_imports: typing.Dict[str, str] = {"CreatePlanBundleResponse": ".types", "UpdatePlanBundleResponse": ".types"} + from .types import CreateCustomPlanBundleResponse, CreatePlanBundleResponse, UpdatePlanBundleResponse +_dynamic_imports: typing.Dict[str, str] = { + "CreateCustomPlanBundleResponse": ".types", + "CreatePlanBundleResponse": ".types", + "UpdatePlanBundleResponse": ".types", +} def __getattr__(attr_name: str) -> typing.Any: @@ -31,4 +35,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["CreatePlanBundleResponse", "UpdatePlanBundleResponse"] +__all__ = ["CreateCustomPlanBundleResponse", "CreatePlanBundleResponse", "UpdatePlanBundleResponse"] diff --git a/src/schematic/planbundle/client.py b/src/schematic/planbundle/client.py index d1d2ca4..d525cb7 100644 --- a/src/schematic/planbundle/client.py +++ b/src/schematic/planbundle/client.py @@ -4,6 +4,7 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions +from ..types.create_custom_plan_bundle_plan_request_body import CreateCustomPlanBundlePlanRequestBody from ..types.create_plan_request_body import CreatePlanRequestBody from ..types.plan_bundle_credit_grant_request_body import PlanBundleCreditGrantRequestBody from ..types.plan_bundle_entitlement_request_body import PlanBundleEntitlementRequestBody @@ -11,6 +12,7 @@ from ..types.update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody from ..types.upsert_billing_product_request_body import UpsertBillingProductRequestBody from .raw_client import AsyncRawPlanbundleClient, RawPlanbundleClient +from .types.create_custom_plan_bundle_response import CreateCustomPlanBundleResponse from .types.create_plan_bundle_response import CreatePlanBundleResponse from .types.update_plan_bundle_response import UpdatePlanBundleResponse @@ -33,6 +35,51 @@ def with_raw_response(self) -> RawPlanbundleClient: """ return self._raw_client + def create_custom_plan_bundle( + self, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + plan: typing.Optional[CreateCustomPlanBundlePlanRequestBody] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CreateCustomPlanBundleResponse: + """ + Parameters + ---------- + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + plan : typing.Optional[CreateCustomPlanBundlePlanRequestBody] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CreateCustomPlanBundleResponse + Created + + Examples + -------- + from schematic import PlanBundleEntitlementRequestBody, Schematic + + client = Schematic( + api_key="YOUR_API_KEY", + ) + client.planbundle.create_custom_plan_bundle( + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) + ], + ) + """ + _response = self._raw_client.create_custom_plan_bundle( + entitlements=entitlements, billing_product=billing_product, plan=plan, request_options=request_options + ) + return _response.data + def create_plan_bundle( self, *, @@ -171,6 +218,59 @@ def with_raw_response(self) -> AsyncRawPlanbundleClient: """ return self._raw_client + async def create_custom_plan_bundle( + self, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + plan: typing.Optional[CreateCustomPlanBundlePlanRequestBody] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> CreateCustomPlanBundleResponse: + """ + Parameters + ---------- + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + plan : typing.Optional[CreateCustomPlanBundlePlanRequestBody] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CreateCustomPlanBundleResponse + Created + + Examples + -------- + import asyncio + + from schematic import AsyncSchematic, PlanBundleEntitlementRequestBody + + client = AsyncSchematic( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.planbundle.create_custom_plan_bundle( + entitlements=[ + PlanBundleEntitlementRequestBody( + action="create", + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create_custom_plan_bundle( + entitlements=entitlements, billing_product=billing_product, plan=plan, request_options=request_options + ) + return _response.data + async def create_plan_bundle( self, *, diff --git a/src/schematic/planbundle/raw_client.py b/src/schematic/planbundle/raw_client.py index c494ee2..df71df9 100644 --- a/src/schematic/planbundle/raw_client.py +++ b/src/schematic/planbundle/raw_client.py @@ -17,12 +17,14 @@ from ..errors.not_found_error import NotFoundError from ..errors.unauthorized_error import UnauthorizedError from ..types.api_error import ApiError as types_api_error_ApiError +from ..types.create_custom_plan_bundle_plan_request_body import CreateCustomPlanBundlePlanRequestBody from ..types.create_plan_request_body import CreatePlanRequestBody from ..types.plan_bundle_credit_grant_request_body import PlanBundleCreditGrantRequestBody from ..types.plan_bundle_entitlement_request_body import PlanBundleEntitlementRequestBody from ..types.update_plan_request_body import UpdatePlanRequestBody from ..types.update_plan_trait_trait_request_body import UpdatePlanTraitTraitRequestBody from ..types.upsert_billing_product_request_body import UpsertBillingProductRequestBody +from .types.create_custom_plan_bundle_response import CreateCustomPlanBundleResponse from .types.create_plan_bundle_response import CreatePlanBundleResponse from .types.update_plan_bundle_response import UpdatePlanBundleResponse from pydantic import ValidationError @@ -35,6 +37,131 @@ class RawPlanbundleClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + def create_custom_plan_bundle( + self, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + plan: typing.Optional[CreateCustomPlanBundlePlanRequestBody] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[CreateCustomPlanBundleResponse]: + """ + Parameters + ---------- + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + plan : typing.Optional[CreateCustomPlanBundlePlanRequestBody] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CreateCustomPlanBundleResponse] + Created + """ + _response = self._client_wrapper.httpx_client.request( + "custom-plan-bundles", + method="POST", + json={ + "billing_product": convert_and_respect_annotation_metadata( + object_=billing_product, annotation=UpsertBillingProductRequestBody, direction="write" + ), + "entitlements": convert_and_respect_annotation_metadata( + object_=entitlements, + annotation=typing.Sequence[PlanBundleEntitlementRequestBody], + direction="write", + ), + "plan": convert_and_respect_annotation_metadata( + object_=plan, annotation=CreateCustomPlanBundlePlanRequestBody, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CreateCustomPlanBundleResponse, + parse_obj_as( + type_=CreateCustomPlanBundleResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + def create_plan_bundle( self, *, @@ -326,6 +453,131 @@ class AsyncRawPlanbundleClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + async def create_custom_plan_bundle( + self, + *, + entitlements: typing.Sequence[PlanBundleEntitlementRequestBody], + billing_product: typing.Optional[UpsertBillingProductRequestBody] = OMIT, + plan: typing.Optional[CreateCustomPlanBundlePlanRequestBody] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CreateCustomPlanBundleResponse]: + """ + Parameters + ---------- + entitlements : typing.Sequence[PlanBundleEntitlementRequestBody] + + billing_product : typing.Optional[UpsertBillingProductRequestBody] + + plan : typing.Optional[CreateCustomPlanBundlePlanRequestBody] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CreateCustomPlanBundleResponse] + Created + """ + _response = await self._client_wrapper.httpx_client.request( + "custom-plan-bundles", + method="POST", + json={ + "billing_product": convert_and_respect_annotation_metadata( + object_=billing_product, annotation=UpsertBillingProductRequestBody, direction="write" + ), + "entitlements": convert_and_respect_annotation_metadata( + object_=entitlements, + annotation=typing.Sequence[PlanBundleEntitlementRequestBody], + direction="write", + ), + "plan": convert_and_respect_annotation_metadata( + object_=plan, annotation=CreateCustomPlanBundlePlanRequestBody, direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CreateCustomPlanBundleResponse, + parse_obj_as( + type_=CreateCustomPlanBundleResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 401: + raise UnauthorizedError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + except ValidationError as e: + raise ParsingError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + async def create_plan_bundle( self, *, diff --git a/src/schematic/planbundle/types/__init__.py b/src/schematic/planbundle/types/__init__.py index 378e6a4..92ab14f 100644 --- a/src/schematic/planbundle/types/__init__.py +++ b/src/schematic/planbundle/types/__init__.py @@ -6,9 +6,11 @@ from importlib import import_module if typing.TYPE_CHECKING: + from .create_custom_plan_bundle_response import CreateCustomPlanBundleResponse from .create_plan_bundle_response import CreatePlanBundleResponse from .update_plan_bundle_response import UpdatePlanBundleResponse _dynamic_imports: typing.Dict[str, str] = { + "CreateCustomPlanBundleResponse": ".create_custom_plan_bundle_response", "CreatePlanBundleResponse": ".create_plan_bundle_response", "UpdatePlanBundleResponse": ".update_plan_bundle_response", } @@ -35,4 +37,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["CreatePlanBundleResponse", "UpdatePlanBundleResponse"] +__all__ = ["CreateCustomPlanBundleResponse", "CreatePlanBundleResponse", "UpdatePlanBundleResponse"] diff --git a/src/schematic/planbundle/types/create_custom_plan_bundle_response.py b/src/schematic/planbundle/types/create_custom_plan_bundle_response.py new file mode 100644 index 0000000..402802a --- /dev/null +++ b/src/schematic/planbundle/types/create_custom_plan_bundle_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ...types.plan_bundle_response_data import PlanBundleResponseData + + +class CreateCustomPlanBundleResponse(UniversalBaseModel): + data: PlanBundleResponseData + params: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Input parameters + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/plans/client.py b/src/schematic/plans/client.py index 3016829..16ba1f2 100644 --- a/src/schematic/plans/client.py +++ b/src/schematic/plans/client.py @@ -281,6 +281,7 @@ def list_plans( self, *, company_id: typing.Optional[str] = None, + company_scoped_only: typing.Optional[bool] = None, exclude_company_scoped: typing.Optional[bool] = None, for_fallback_plan: typing.Optional[bool] = None, for_initial_plan: typing.Optional[bool] = None, @@ -302,6 +303,9 @@ def list_plans( ---------- company_id : typing.Optional[str] + company_scoped_only : typing.Optional[bool] + Only return plans that are scoped to a company (custom plans assigned to a company) + exclude_company_scoped : typing.Optional[bool] Exclude plans that are scoped to a company (custom plans assigned to a company) @@ -359,6 +363,7 @@ def list_plans( ) client.plans.list_plans( company_id="company_id", + company_scoped_only=True, exclude_company_scoped=True, for_fallback_plan=True, for_initial_plan=True, @@ -377,6 +382,7 @@ def list_plans( """ _response = self._raw_client.list_plans( company_id=company_id, + company_scoped_only=company_scoped_only, exclude_company_scoped=exclude_company_scoped, for_fallback_plan=for_fallback_plan, for_initial_plan=for_initial_plan, @@ -570,6 +576,8 @@ def upsert_billing_product_plan( monthly_price_id: typing.Optional[str] = OMIT, one_time_price: typing.Optional[int] = OMIT, one_time_price_id: typing.Optional[str] = OMIT, + quarterly_price: typing.Optional[int] = OMIT, + quarterly_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, yearly_price: typing.Optional[int] = OMIT, yearly_price_id: typing.Optional[str] = OMIT, @@ -599,6 +607,10 @@ def upsert_billing_product_plan( one_time_price_id : typing.Optional[str] + quarterly_price : typing.Optional[int] + + quarterly_price_id : typing.Optional[str] + trial_days : typing.Optional[int] yearly_price : typing.Optional[int] @@ -637,6 +649,8 @@ def upsert_billing_product_plan( monthly_price_id=monthly_price_id, one_time_price=one_time_price, one_time_price_id=one_time_price_id, + quarterly_price=quarterly_price, + quarterly_price_id=quarterly_price_id, trial_days=trial_days, yearly_price=yearly_price, yearly_price_id=yearly_price_id, @@ -652,6 +666,7 @@ def upsert_plan_for_billing_product( external_resource_id: str, name: str, plan_type: PlanType, + external_resource_version: typing.Optional[str] = OMIT, icon: typing.Optional[PlanIcon] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertPlanForBillingProductResponse: @@ -668,6 +683,8 @@ def upsert_plan_for_billing_product( plan_type : PlanType + external_resource_version : typing.Optional[str] + icon : typing.Optional[PlanIcon] request_options : typing.Optional[RequestOptions] @@ -699,6 +716,7 @@ def upsert_plan_for_billing_product( external_resource_id=external_resource_id, name=name, plan_type=plan_type, + external_resource_version=external_resource_version, icon=icon, request_options=request_options, ) @@ -810,6 +828,7 @@ def count_plans( self, *, company_id: typing.Optional[str] = None, + company_scoped_only: typing.Optional[bool] = None, exclude_company_scoped: typing.Optional[bool] = None, for_fallback_plan: typing.Optional[bool] = None, for_initial_plan: typing.Optional[bool] = None, @@ -831,6 +850,9 @@ def count_plans( ---------- company_id : typing.Optional[str] + company_scoped_only : typing.Optional[bool] + Only return plans that are scoped to a company (custom plans assigned to a company) + exclude_company_scoped : typing.Optional[bool] Exclude plans that are scoped to a company (custom plans assigned to a company) @@ -888,6 +910,7 @@ def count_plans( ) client.plans.count_plans( company_id="company_id", + company_scoped_only=True, exclude_company_scoped=True, for_fallback_plan=True, for_initial_plan=True, @@ -906,6 +929,7 @@ def count_plans( """ _response = self._raw_client.count_plans( company_id=company_id, + company_scoped_only=company_scoped_only, exclude_company_scoped=exclude_company_scoped, for_fallback_plan=for_fallback_plan, for_initial_plan=for_initial_plan, @@ -1350,6 +1374,7 @@ async def list_plans( self, *, company_id: typing.Optional[str] = None, + company_scoped_only: typing.Optional[bool] = None, exclude_company_scoped: typing.Optional[bool] = None, for_fallback_plan: typing.Optional[bool] = None, for_initial_plan: typing.Optional[bool] = None, @@ -1371,6 +1396,9 @@ async def list_plans( ---------- company_id : typing.Optional[str] + company_scoped_only : typing.Optional[bool] + Only return plans that are scoped to a company (custom plans assigned to a company) + exclude_company_scoped : typing.Optional[bool] Exclude plans that are scoped to a company (custom plans assigned to a company) @@ -1433,6 +1461,7 @@ async def list_plans( async def main() -> None: await client.plans.list_plans( company_id="company_id", + company_scoped_only=True, exclude_company_scoped=True, for_fallback_plan=True, for_initial_plan=True, @@ -1454,6 +1483,7 @@ async def main() -> None: """ _response = await self._raw_client.list_plans( company_id=company_id, + company_scoped_only=company_scoped_only, exclude_company_scoped=exclude_company_scoped, for_fallback_plan=for_fallback_plan, for_initial_plan=for_initial_plan, @@ -1681,6 +1711,8 @@ async def upsert_billing_product_plan( monthly_price_id: typing.Optional[str] = OMIT, one_time_price: typing.Optional[int] = OMIT, one_time_price_id: typing.Optional[str] = OMIT, + quarterly_price: typing.Optional[int] = OMIT, + quarterly_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, yearly_price: typing.Optional[int] = OMIT, yearly_price_id: typing.Optional[str] = OMIT, @@ -1710,6 +1742,10 @@ async def upsert_billing_product_plan( one_time_price_id : typing.Optional[str] + quarterly_price : typing.Optional[int] + + quarterly_price_id : typing.Optional[str] + trial_days : typing.Optional[int] yearly_price : typing.Optional[int] @@ -1756,6 +1792,8 @@ async def main() -> None: monthly_price_id=monthly_price_id, one_time_price=one_time_price, one_time_price_id=one_time_price_id, + quarterly_price=quarterly_price, + quarterly_price_id=quarterly_price_id, trial_days=trial_days, yearly_price=yearly_price, yearly_price_id=yearly_price_id, @@ -1771,6 +1809,7 @@ async def upsert_plan_for_billing_product( external_resource_id: str, name: str, plan_type: PlanType, + external_resource_version: typing.Optional[str] = OMIT, icon: typing.Optional[PlanIcon] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> UpsertPlanForBillingProductResponse: @@ -1787,6 +1826,8 @@ async def upsert_plan_for_billing_product( plan_type : PlanType + external_resource_version : typing.Optional[str] + icon : typing.Optional[PlanIcon] request_options : typing.Optional[RequestOptions] @@ -1826,6 +1867,7 @@ async def main() -> None: external_resource_id=external_resource_id, name=name, plan_type=plan_type, + external_resource_version=external_resource_version, icon=icon, request_options=request_options, ) @@ -1953,6 +1995,7 @@ async def count_plans( self, *, company_id: typing.Optional[str] = None, + company_scoped_only: typing.Optional[bool] = None, exclude_company_scoped: typing.Optional[bool] = None, for_fallback_plan: typing.Optional[bool] = None, for_initial_plan: typing.Optional[bool] = None, @@ -1974,6 +2017,9 @@ async def count_plans( ---------- company_id : typing.Optional[str] + company_scoped_only : typing.Optional[bool] + Only return plans that are scoped to a company (custom plans assigned to a company) + exclude_company_scoped : typing.Optional[bool] Exclude plans that are scoped to a company (custom plans assigned to a company) @@ -2036,6 +2082,7 @@ async def count_plans( async def main() -> None: await client.plans.count_plans( company_id="company_id", + company_scoped_only=True, exclude_company_scoped=True, for_fallback_plan=True, for_initial_plan=True, @@ -2057,6 +2104,7 @@ async def main() -> None: """ _response = await self._raw_client.count_plans( company_id=company_id, + company_scoped_only=company_scoped_only, exclude_company_scoped=exclude_company_scoped, for_fallback_plan=for_fallback_plan, for_initial_plan=for_initial_plan, diff --git a/src/schematic/plans/raw_client.py b/src/schematic/plans/raw_client.py index 4e31e15..9c7def3 100644 --- a/src/schematic/plans/raw_client.py +++ b/src/schematic/plans/raw_client.py @@ -559,6 +559,7 @@ def list_plans( self, *, company_id: typing.Optional[str] = None, + company_scoped_only: typing.Optional[bool] = None, exclude_company_scoped: typing.Optional[bool] = None, for_fallback_plan: typing.Optional[bool] = None, for_initial_plan: typing.Optional[bool] = None, @@ -580,6 +581,9 @@ def list_plans( ---------- company_id : typing.Optional[str] + company_scoped_only : typing.Optional[bool] + Only return plans that are scoped to a company (custom plans assigned to a company) + exclude_company_scoped : typing.Optional[bool] Exclude plans that are scoped to a company (custom plans assigned to a company) @@ -633,6 +637,7 @@ def list_plans( method="GET", params={ "company_id": company_id, + "company_scoped_only": company_scoped_only, "exclude_company_scoped": exclude_company_scoped, "for_fallback_plan": for_fallback_plan, "for_initial_plan": for_initial_plan, @@ -1182,6 +1187,8 @@ def upsert_billing_product_plan( monthly_price_id: typing.Optional[str] = OMIT, one_time_price: typing.Optional[int] = OMIT, one_time_price_id: typing.Optional[str] = OMIT, + quarterly_price: typing.Optional[int] = OMIT, + quarterly_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, yearly_price: typing.Optional[int] = OMIT, yearly_price_id: typing.Optional[str] = OMIT, @@ -1211,6 +1218,10 @@ def upsert_billing_product_plan( one_time_price_id : typing.Optional[str] + quarterly_price : typing.Optional[int] + + quarterly_price_id : typing.Optional[str] + trial_days : typing.Optional[int] yearly_price : typing.Optional[int] @@ -1240,6 +1251,8 @@ def upsert_billing_product_plan( "monthly_price_id": monthly_price_id, "one_time_price": one_time_price, "one_time_price_id": one_time_price_id, + "quarterly_price": quarterly_price, + "quarterly_price_id": quarterly_price_id, "trial_days": trial_days, "yearly_price": yearly_price, "yearly_price_id": yearly_price_id, @@ -1336,6 +1349,7 @@ def upsert_plan_for_billing_product( external_resource_id: str, name: str, plan_type: PlanType, + external_resource_version: typing.Optional[str] = OMIT, icon: typing.Optional[PlanIcon] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[UpsertPlanForBillingProductResponse]: @@ -1352,6 +1366,8 @@ def upsert_plan_for_billing_product( plan_type : PlanType + external_resource_version : typing.Optional[str] + icon : typing.Optional[PlanIcon] request_options : typing.Optional[RequestOptions] @@ -1369,6 +1385,7 @@ def upsert_plan_for_billing_product( "billing_provider": billing_provider, "description": description, "external_resource_id": external_resource_id, + "external_resource_version": external_resource_version, "icon": icon, "name": name, "plan_type": plan_type, @@ -1703,6 +1720,7 @@ def count_plans( self, *, company_id: typing.Optional[str] = None, + company_scoped_only: typing.Optional[bool] = None, exclude_company_scoped: typing.Optional[bool] = None, for_fallback_plan: typing.Optional[bool] = None, for_initial_plan: typing.Optional[bool] = None, @@ -1724,6 +1742,9 @@ def count_plans( ---------- company_id : typing.Optional[str] + company_scoped_only : typing.Optional[bool] + Only return plans that are scoped to a company (custom plans assigned to a company) + exclude_company_scoped : typing.Optional[bool] Exclude plans that are scoped to a company (custom plans assigned to a company) @@ -1777,6 +1798,7 @@ def count_plans( method="GET", params={ "company_id": company_id, + "company_scoped_only": company_scoped_only, "exclude_company_scoped": exclude_company_scoped, "for_fallback_plan": for_fallback_plan, "for_initial_plan": for_initial_plan, @@ -2736,6 +2758,7 @@ async def list_plans( self, *, company_id: typing.Optional[str] = None, + company_scoped_only: typing.Optional[bool] = None, exclude_company_scoped: typing.Optional[bool] = None, for_fallback_plan: typing.Optional[bool] = None, for_initial_plan: typing.Optional[bool] = None, @@ -2757,6 +2780,9 @@ async def list_plans( ---------- company_id : typing.Optional[str] + company_scoped_only : typing.Optional[bool] + Only return plans that are scoped to a company (custom plans assigned to a company) + exclude_company_scoped : typing.Optional[bool] Exclude plans that are scoped to a company (custom plans assigned to a company) @@ -2810,6 +2836,7 @@ async def list_plans( method="GET", params={ "company_id": company_id, + "company_scoped_only": company_scoped_only, "exclude_company_scoped": exclude_company_scoped, "for_fallback_plan": for_fallback_plan, "for_initial_plan": for_initial_plan, @@ -3359,6 +3386,8 @@ async def upsert_billing_product_plan( monthly_price_id: typing.Optional[str] = OMIT, one_time_price: typing.Optional[int] = OMIT, one_time_price_id: typing.Optional[str] = OMIT, + quarterly_price: typing.Optional[int] = OMIT, + quarterly_price_id: typing.Optional[str] = OMIT, trial_days: typing.Optional[int] = OMIT, yearly_price: typing.Optional[int] = OMIT, yearly_price_id: typing.Optional[str] = OMIT, @@ -3388,6 +3417,10 @@ async def upsert_billing_product_plan( one_time_price_id : typing.Optional[str] + quarterly_price : typing.Optional[int] + + quarterly_price_id : typing.Optional[str] + trial_days : typing.Optional[int] yearly_price : typing.Optional[int] @@ -3417,6 +3450,8 @@ async def upsert_billing_product_plan( "monthly_price_id": monthly_price_id, "one_time_price": one_time_price, "one_time_price_id": one_time_price_id, + "quarterly_price": quarterly_price, + "quarterly_price_id": quarterly_price_id, "trial_days": trial_days, "yearly_price": yearly_price, "yearly_price_id": yearly_price_id, @@ -3513,6 +3548,7 @@ async def upsert_plan_for_billing_product( external_resource_id: str, name: str, plan_type: PlanType, + external_resource_version: typing.Optional[str] = OMIT, icon: typing.Optional[PlanIcon] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[UpsertPlanForBillingProductResponse]: @@ -3529,6 +3565,8 @@ async def upsert_plan_for_billing_product( plan_type : PlanType + external_resource_version : typing.Optional[str] + icon : typing.Optional[PlanIcon] request_options : typing.Optional[RequestOptions] @@ -3546,6 +3584,7 @@ async def upsert_plan_for_billing_product( "billing_provider": billing_provider, "description": description, "external_resource_id": external_resource_id, + "external_resource_version": external_resource_version, "icon": icon, "name": name, "plan_type": plan_type, @@ -3880,6 +3919,7 @@ async def count_plans( self, *, company_id: typing.Optional[str] = None, + company_scoped_only: typing.Optional[bool] = None, exclude_company_scoped: typing.Optional[bool] = None, for_fallback_plan: typing.Optional[bool] = None, for_initial_plan: typing.Optional[bool] = None, @@ -3901,6 +3941,9 @@ async def count_plans( ---------- company_id : typing.Optional[str] + company_scoped_only : typing.Optional[bool] + Only return plans that are scoped to a company (custom plans assigned to a company) + exclude_company_scoped : typing.Optional[bool] Exclude plans that are scoped to a company (custom plans assigned to a company) @@ -3954,6 +3997,7 @@ async def count_plans( method="GET", params={ "company_id": company_id, + "company_scoped_only": company_scoped_only, "exclude_company_scoped": exclude_company_scoped, "for_fallback_plan": for_fallback_plan, "for_initial_plan": for_initial_plan, diff --git a/src/schematic/plans/types/count_plans_params.py b/src/schematic/plans/types/count_plans_params.py index de92dfb..0ab901f 100644 --- a/src/schematic/plans/types/count_plans_params.py +++ b/src/schematic/plans/types/count_plans_params.py @@ -13,6 +13,11 @@ class CountPlansParams(UniversalBaseModel): """ company_id: typing.Optional[str] = None + company_scoped_only: typing.Optional[bool] = pydantic.Field(default=None) + """ + Only return plans that are scoped to a company (custom plans assigned to a company) + """ + exclude_company_scoped: typing.Optional[bool] = pydantic.Field(default=None) """ Exclude plans that are scoped to a company (custom plans assigned to a company) diff --git a/src/schematic/plans/types/list_plans_params.py b/src/schematic/plans/types/list_plans_params.py index ad46bb6..f43ae92 100644 --- a/src/schematic/plans/types/list_plans_params.py +++ b/src/schematic/plans/types/list_plans_params.py @@ -13,6 +13,11 @@ class ListPlansParams(UniversalBaseModel): """ company_id: typing.Optional[str] = None + company_scoped_only: typing.Optional[bool] = pydantic.Field(default=None) + """ + Only return plans that are scoped to a company (custom plans assigned to a company) + """ + exclude_company_scoped: typing.Optional[bool] = pydantic.Field(default=None) """ Exclude plans that are scoped to a company (custom plans assigned to a company) diff --git a/src/schematic/types/__init__.py b/src/schematic/types/__init__.py index 0ce3ea8..0daaed6 100644 --- a/src/schematic/types/__init__.py +++ b/src/schematic/types/__init__.py @@ -9,9 +9,12 @@ from .account_member_permission import AccountMemberPermission from .account_member_response_data import AccountMemberResponseData from .account_member_role import AccountMemberRole + from .activity_entry_response_data import ActivityEntryResponseData + from .activity_response_response_data import ActivityResponseResponseData from .actor_type import ActorType from .api_error import ApiError from .api_key_create_response_data import ApiKeyCreateResponseData + from .api_key_integration_response_data import ApiKeyIntegrationResponseData from .api_key_response_data import ApiKeyResponseData from .api_key_scope import ApiKeyScope from .audit_log_list_response_data import AuditLogListResponseData @@ -71,13 +74,17 @@ from .checkout_data_response_data import CheckoutDataResponseData from .checkout_settings_response_data import CheckoutSettingsResponseData from .checkout_subscription import CheckoutSubscription + from .clerk_integration_config import ClerkIntegrationConfig + from .company_credit_balance_response_data import CompanyCreditBalanceResponseData from .company_detail_response_data import CompanyDetailResponseData from .company_event_period_metrics_response_data import CompanyEventPeriodMetricsResponseData from .company_ledger_response_data import CompanyLedgerResponseData + from .company_matching_criteria import CompanyMatchingCriteria from .company_membership_detail_response_data import CompanyMembershipDetailResponseData from .company_membership_response_data import CompanyMembershipResponseData from .company_override_note_response_data import CompanyOverrideNoteResponseData from .company_override_response_data import CompanyOverrideResponseData + from .company_plan_credit_grant_view import CompanyPlanCreditGrantView from .company_plan_detail_response_data import CompanyPlanDetailResponseData from .company_plan_invalid_reason import CompanyPlanInvalidReason from .company_plan_with_billing_sub_view import CompanyPlanWithBillingSubView @@ -106,6 +113,7 @@ from .coupon_request_body import CouponRequestBody from .create_billing_plan_credit_grant_request_body import CreateBillingPlanCreditGrantRequestBody from .create_billing_price_tier_request_body import CreateBillingPriceTierRequestBody + from .create_custom_plan_bundle_plan_request_body import CreateCustomPlanBundlePlanRequestBody from .create_entitlement_in_bundle_request_body import CreateEntitlementInBundleRequestBody from .create_entitlement_req_common import CreateEntitlementReqCommon from .create_event_request_body import CreateEventRequestBody @@ -122,6 +130,7 @@ from .credit_bundle_currency_price_response_data import CreditBundleCurrencyPriceResponseData from .credit_bundle_purchase_response_data import CreditBundlePurchaseResponseData from .credit_company_grant_view import CreditCompanyGrantView + from .credit_currency_price import CreditCurrencyPrice from .credit_currency_price_request_body import CreditCurrencyPriceRequestBody from .credit_currency_price_response_data import CreditCurrencyPriceResponseData from .credit_event_ledger_response_data import CreditEventLedgerResponseData @@ -170,8 +179,11 @@ from .entity_trait_value import EntityTraitValue from .entity_type import EntityType from .environment_detail_response_data import EnvironmentDetailResponseData + from .environment_feature_usage_time_series_response_data import EnvironmentFeatureUsageTimeSeriesResponseData from .environment_response_data import EnvironmentResponseData + from .environment_trait_usage_time_series_response_data import EnvironmentTraitUsageTimeSeriesResponseData from .environment_type import EnvironmentType + from .environment_usage_point_response_data import EnvironmentUsagePointResponseData from .event_body import EventBody from .event_body_flag_check import EventBodyFlagCheck from .event_body_identify import EventBodyIdentify @@ -202,8 +214,21 @@ from .flag_type import FlagType from .flag_view import FlagView from .generic_preview_object import GenericPreviewObject + from .insights_summary_response_data import InsightsSummaryResponseData + from .integration_capabilities import IntegrationCapabilities + from .integration_config import ( + IntegrationConfig, + IntegrationConfig_Clerk, + IntegrationConfig_Orb, + IntegrationConfig_Stripe, + ) + from .integration_response_data import IntegrationResponseData + from .integration_state import IntegrationState from .integration_type import IntegrationType from .integration_webhook_url_response_data import IntegrationWebhookUrlResponseData + from .integrations_data_set_response_data import IntegrationsDataSetResponseData + from .integrations_list_response_data import IntegrationsListResponseData + from .integrations_response_data import IntegrationsResponseData from .invoice_request_body import InvoiceRequestBody from .invoice_response_data import InvoiceResponseData from .invoice_status import InvoiceStatus @@ -216,6 +241,8 @@ from .meter_request_body import MeterRequestBody from .metric_period import MetricPeriod from .metric_period_month_reset import MetricPeriodMonthReset + from .mrr_response_data import MrrResponseData + from .orb_integration_config import OrbIntegrationConfig from .ordered_plans_in_group import OrderedPlansInGroup from .payment_method_request_body import PaymentMethodRequestBody from .payment_method_response_data import PaymentMethodResponseData @@ -238,6 +265,8 @@ from .plan_group_plan_detail_response_data import PlanGroupPlanDetailResponseData from .plan_group_plan_entitlements_order import PlanGroupPlanEntitlementsOrder from .plan_group_response_data import PlanGroupResponseData + from .plan_growth_point_response_data import PlanGrowthPointResponseData + from .plan_growth_response_data import PlanGrowthResponseData from .plan_icon import PlanIcon from .plan_issue_response_data import PlanIssueResponseData from .plan_response_data import PlanResponseData @@ -303,17 +332,21 @@ from .skipped_entitlement_response_data import SkippedEntitlementResponseData from .sort_direction import SortDirection from .stripe_embed_info import StripeEmbedInfo + from .stripe_integration_config import StripeIntegrationConfig from .subscription_status import SubscriptionStatus from .subscription_trait_update import SubscriptionTraitUpdate from .subscription_type import SubscriptionType from .temporary_access_token_resource_type import TemporaryAccessTokenResourceType from .temporary_access_token_response_data import TemporaryAccessTokenResponseData from .time_series_granularity import TimeSeriesGranularity + from .top_feature_by_usage_response_data import TopFeatureByUsageResponseData + from .top_features_by_usage_response_data import TopFeaturesByUsageResponseData from .trait_definition import TraitDefinition from .trait_definition_comparable_type import TraitDefinitionComparableType from .trait_type import TraitType from .trial_status import TrialStatus from .update_add_on_request_body import UpdateAddOnRequestBody + from .update_auto_topup_override_request_body import UpdateAutoTopupOverrideRequestBody from .update_billing_plan_credit_grant_request_body import UpdateBillingPlanCreditGrantRequestBody from .update_credit_bundle_request_body import UpdateCreditBundleRequestBody from .update_entitlement_req_common import UpdateEntitlementReqCommon @@ -345,9 +378,12 @@ "AccountMemberPermission": ".account_member_permission", "AccountMemberResponseData": ".account_member_response_data", "AccountMemberRole": ".account_member_role", + "ActivityEntryResponseData": ".activity_entry_response_data", + "ActivityResponseResponseData": ".activity_response_response_data", "ActorType": ".actor_type", "ApiError": ".api_error", "ApiKeyCreateResponseData": ".api_key_create_response_data", + "ApiKeyIntegrationResponseData": ".api_key_integration_response_data", "ApiKeyResponseData": ".api_key_response_data", "ApiKeyScope": ".api_key_scope", "AuditLogListResponseData": ".audit_log_list_response_data", @@ -407,13 +443,17 @@ "CheckoutDataResponseData": ".checkout_data_response_data", "CheckoutSettingsResponseData": ".checkout_settings_response_data", "CheckoutSubscription": ".checkout_subscription", + "ClerkIntegrationConfig": ".clerk_integration_config", + "CompanyCreditBalanceResponseData": ".company_credit_balance_response_data", "CompanyDetailResponseData": ".company_detail_response_data", "CompanyEventPeriodMetricsResponseData": ".company_event_period_metrics_response_data", "CompanyLedgerResponseData": ".company_ledger_response_data", + "CompanyMatchingCriteria": ".company_matching_criteria", "CompanyMembershipDetailResponseData": ".company_membership_detail_response_data", "CompanyMembershipResponseData": ".company_membership_response_data", "CompanyOverrideNoteResponseData": ".company_override_note_response_data", "CompanyOverrideResponseData": ".company_override_response_data", + "CompanyPlanCreditGrantView": ".company_plan_credit_grant_view", "CompanyPlanDetailResponseData": ".company_plan_detail_response_data", "CompanyPlanInvalidReason": ".company_plan_invalid_reason", "CompanyPlanWithBillingSubView": ".company_plan_with_billing_sub_view", @@ -442,6 +482,7 @@ "CouponRequestBody": ".coupon_request_body", "CreateBillingPlanCreditGrantRequestBody": ".create_billing_plan_credit_grant_request_body", "CreateBillingPriceTierRequestBody": ".create_billing_price_tier_request_body", + "CreateCustomPlanBundlePlanRequestBody": ".create_custom_plan_bundle_plan_request_body", "CreateEntitlementInBundleRequestBody": ".create_entitlement_in_bundle_request_body", "CreateEntitlementReqCommon": ".create_entitlement_req_common", "CreateEventRequestBody": ".create_event_request_body", @@ -458,6 +499,7 @@ "CreditBundleCurrencyPriceResponseData": ".credit_bundle_currency_price_response_data", "CreditBundlePurchaseResponseData": ".credit_bundle_purchase_response_data", "CreditCompanyGrantView": ".credit_company_grant_view", + "CreditCurrencyPrice": ".credit_currency_price", "CreditCurrencyPriceRequestBody": ".credit_currency_price_request_body", "CreditCurrencyPriceResponseData": ".credit_currency_price_response_data", "CreditEventLedgerResponseData": ".credit_event_ledger_response_data", @@ -506,8 +548,11 @@ "EntityTraitValue": ".entity_trait_value", "EntityType": ".entity_type", "EnvironmentDetailResponseData": ".environment_detail_response_data", + "EnvironmentFeatureUsageTimeSeriesResponseData": ".environment_feature_usage_time_series_response_data", "EnvironmentResponseData": ".environment_response_data", + "EnvironmentTraitUsageTimeSeriesResponseData": ".environment_trait_usage_time_series_response_data", "EnvironmentType": ".environment_type", + "EnvironmentUsagePointResponseData": ".environment_usage_point_response_data", "EventBody": ".event_body", "EventBodyFlagCheck": ".event_body_flag_check", "EventBodyIdentify": ".event_body_identify", @@ -538,8 +583,19 @@ "FlagType": ".flag_type", "FlagView": ".flag_view", "GenericPreviewObject": ".generic_preview_object", + "InsightsSummaryResponseData": ".insights_summary_response_data", + "IntegrationCapabilities": ".integration_capabilities", + "IntegrationConfig": ".integration_config", + "IntegrationConfig_Clerk": ".integration_config", + "IntegrationConfig_Orb": ".integration_config", + "IntegrationConfig_Stripe": ".integration_config", + "IntegrationResponseData": ".integration_response_data", + "IntegrationState": ".integration_state", "IntegrationType": ".integration_type", "IntegrationWebhookUrlResponseData": ".integration_webhook_url_response_data", + "IntegrationsDataSetResponseData": ".integrations_data_set_response_data", + "IntegrationsListResponseData": ".integrations_list_response_data", + "IntegrationsResponseData": ".integrations_response_data", "InvoiceRequestBody": ".invoice_request_body", "InvoiceResponseData": ".invoice_response_data", "InvoiceStatus": ".invoice_status", @@ -552,6 +608,8 @@ "MeterRequestBody": ".meter_request_body", "MetricPeriod": ".metric_period", "MetricPeriodMonthReset": ".metric_period_month_reset", + "MrrResponseData": ".mrr_response_data", + "OrbIntegrationConfig": ".orb_integration_config", "OrderedPlansInGroup": ".ordered_plans_in_group", "PaymentMethodRequestBody": ".payment_method_request_body", "PaymentMethodResponseData": ".payment_method_response_data", @@ -574,6 +632,8 @@ "PlanGroupPlanDetailResponseData": ".plan_group_plan_detail_response_data", "PlanGroupPlanEntitlementsOrder": ".plan_group_plan_entitlements_order", "PlanGroupResponseData": ".plan_group_response_data", + "PlanGrowthPointResponseData": ".plan_growth_point_response_data", + "PlanGrowthResponseData": ".plan_growth_response_data", "PlanIcon": ".plan_icon", "PlanIssueResponseData": ".plan_issue_response_data", "PlanResponseData": ".plan_response_data", @@ -639,17 +699,21 @@ "SkippedEntitlementResponseData": ".skipped_entitlement_response_data", "SortDirection": ".sort_direction", "StripeEmbedInfo": ".stripe_embed_info", + "StripeIntegrationConfig": ".stripe_integration_config", "SubscriptionStatus": ".subscription_status", "SubscriptionTraitUpdate": ".subscription_trait_update", "SubscriptionType": ".subscription_type", "TemporaryAccessTokenResourceType": ".temporary_access_token_resource_type", "TemporaryAccessTokenResponseData": ".temporary_access_token_response_data", "TimeSeriesGranularity": ".time_series_granularity", + "TopFeatureByUsageResponseData": ".top_feature_by_usage_response_data", + "TopFeaturesByUsageResponseData": ".top_features_by_usage_response_data", "TraitDefinition": ".trait_definition", "TraitDefinitionComparableType": ".trait_definition_comparable_type", "TraitType": ".trait_type", "TrialStatus": ".trial_status", "UpdateAddOnRequestBody": ".update_add_on_request_body", + "UpdateAutoTopupOverrideRequestBody": ".update_auto_topup_override_request_body", "UpdateBillingPlanCreditGrantRequestBody": ".update_billing_plan_credit_grant_request_body", "UpdateCreditBundleRequestBody": ".update_credit_bundle_request_body", "UpdateEntitlementReqCommon": ".update_entitlement_req_common", @@ -705,9 +769,12 @@ def __dir__(): "AccountMemberPermission", "AccountMemberResponseData", "AccountMemberRole", + "ActivityEntryResponseData", + "ActivityResponseResponseData", "ActorType", "ApiError", "ApiKeyCreateResponseData", + "ApiKeyIntegrationResponseData", "ApiKeyResponseData", "ApiKeyScope", "AuditLogListResponseData", @@ -767,13 +834,17 @@ def __dir__(): "CheckoutDataResponseData", "CheckoutSettingsResponseData", "CheckoutSubscription", + "ClerkIntegrationConfig", + "CompanyCreditBalanceResponseData", "CompanyDetailResponseData", "CompanyEventPeriodMetricsResponseData", "CompanyLedgerResponseData", + "CompanyMatchingCriteria", "CompanyMembershipDetailResponseData", "CompanyMembershipResponseData", "CompanyOverrideNoteResponseData", "CompanyOverrideResponseData", + "CompanyPlanCreditGrantView", "CompanyPlanDetailResponseData", "CompanyPlanInvalidReason", "CompanyPlanWithBillingSubView", @@ -802,6 +873,7 @@ def __dir__(): "CouponRequestBody", "CreateBillingPlanCreditGrantRequestBody", "CreateBillingPriceTierRequestBody", + "CreateCustomPlanBundlePlanRequestBody", "CreateEntitlementInBundleRequestBody", "CreateEntitlementReqCommon", "CreateEventRequestBody", @@ -818,6 +890,7 @@ def __dir__(): "CreditBundleCurrencyPriceResponseData", "CreditBundlePurchaseResponseData", "CreditCompanyGrantView", + "CreditCurrencyPrice", "CreditCurrencyPriceRequestBody", "CreditCurrencyPriceResponseData", "CreditEventLedgerResponseData", @@ -866,8 +939,11 @@ def __dir__(): "EntityTraitValue", "EntityType", "EnvironmentDetailResponseData", + "EnvironmentFeatureUsageTimeSeriesResponseData", "EnvironmentResponseData", + "EnvironmentTraitUsageTimeSeriesResponseData", "EnvironmentType", + "EnvironmentUsagePointResponseData", "EventBody", "EventBodyFlagCheck", "EventBodyIdentify", @@ -898,8 +974,19 @@ def __dir__(): "FlagType", "FlagView", "GenericPreviewObject", + "InsightsSummaryResponseData", + "IntegrationCapabilities", + "IntegrationConfig", + "IntegrationConfig_Clerk", + "IntegrationConfig_Orb", + "IntegrationConfig_Stripe", + "IntegrationResponseData", + "IntegrationState", "IntegrationType", "IntegrationWebhookUrlResponseData", + "IntegrationsDataSetResponseData", + "IntegrationsListResponseData", + "IntegrationsResponseData", "InvoiceRequestBody", "InvoiceResponseData", "InvoiceStatus", @@ -912,6 +999,8 @@ def __dir__(): "MeterRequestBody", "MetricPeriod", "MetricPeriodMonthReset", + "MrrResponseData", + "OrbIntegrationConfig", "OrderedPlansInGroup", "PaymentMethodRequestBody", "PaymentMethodResponseData", @@ -934,6 +1023,8 @@ def __dir__(): "PlanGroupPlanDetailResponseData", "PlanGroupPlanEntitlementsOrder", "PlanGroupResponseData", + "PlanGrowthPointResponseData", + "PlanGrowthResponseData", "PlanIcon", "PlanIssueResponseData", "PlanResponseData", @@ -999,17 +1090,21 @@ def __dir__(): "SkippedEntitlementResponseData", "SortDirection", "StripeEmbedInfo", + "StripeIntegrationConfig", "SubscriptionStatus", "SubscriptionTraitUpdate", "SubscriptionType", "TemporaryAccessTokenResourceType", "TemporaryAccessTokenResponseData", "TimeSeriesGranularity", + "TopFeatureByUsageResponseData", + "TopFeaturesByUsageResponseData", "TraitDefinition", "TraitDefinitionComparableType", "TraitType", "TrialStatus", "UpdateAddOnRequestBody", + "UpdateAutoTopupOverrideRequestBody", "UpdateBillingPlanCreditGrantRequestBody", "UpdateCreditBundleRequestBody", "UpdateEntitlementReqCommon", diff --git a/src/schematic/types/activity_entry_response_data.py b/src/schematic/types/activity_entry_response_data.py new file mode 100644 index 0000000..4abb612 --- /dev/null +++ b/src/schematic/types/activity_entry_response_data.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ActivityEntryResponseData(UniversalBaseModel): + actor_name: str + method: str + resource_name: str + resource_type: str + timestamp: dt.datetime + title: 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/activity_response_response_data.py b/src/schematic/types/activity_response_response_data.py new file mode 100644 index 0000000..258103a --- /dev/null +++ b/src/schematic/types/activity_response_response_data.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .activity_entry_response_data import ActivityEntryResponseData + + +class ActivityResponseResponseData(UniversalBaseModel): + entries: typing.List[ActivityEntryResponseData] + + 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/api_key_create_response_data.py b/src/schematic/types/api_key_create_response_data.py index d1ad347..0ab1183 100644 --- a/src/schematic/types/api_key_create_response_data.py +++ b/src/schematic/types/api_key_create_response_data.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .api_key_integration_response_data import ApiKeyIntegrationResponseData from .api_key_scope import ApiKeyScope from .environment_response_data import EnvironmentResponseData @@ -15,6 +16,7 @@ class ApiKeyCreateResponseData(UniversalBaseModel): environment: typing.Optional[EnvironmentResponseData] = None environment_id: typing.Optional[str] = None id: str + integration: typing.Optional[ApiKeyIntegrationResponseData] = None last_used_at: typing.Optional[dt.datetime] = None name: str readonly: bool diff --git a/src/schematic/types/api_key_integration_response_data.py b/src/schematic/types/api_key_integration_response_data.py new file mode 100644 index 0000000..ba0fcd5 --- /dev/null +++ b/src/schematic/types/api_key_integration_response_data.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .integration_state import IntegrationState +from .integration_type import IntegrationType + + +class ApiKeyIntegrationResponseData(UniversalBaseModel): + id: str + state: IntegrationState + type: IntegrationType + + 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/api_key_response_data.py b/src/schematic/types/api_key_response_data.py index 9e695b4..336483e 100644 --- a/src/schematic/types/api_key_response_data.py +++ b/src/schematic/types/api_key_response_data.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .api_key_integration_response_data import ApiKeyIntegrationResponseData from .api_key_scope import ApiKeyScope from .environment_response_data import EnvironmentResponseData @@ -15,6 +16,7 @@ class ApiKeyResponseData(UniversalBaseModel): environment: typing.Optional[EnvironmentResponseData] = None environment_id: typing.Optional[str] = None id: str + integration: typing.Optional[ApiKeyIntegrationResponseData] = None last_used_at: typing.Optional[dt.datetime] = None name: str readonly: bool diff --git a/src/schematic/types/audit_log_list_response_data.py b/src/schematic/types/audit_log_list_response_data.py index 6fbedc4..e51fd09 100644 --- a/src/schematic/types/audit_log_list_response_data.py +++ b/src/schematic/types/audit_log_list_response_data.py @@ -6,11 +6,13 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .actor_type import ActorType +from .api_key_response_data import ApiKeyResponseData from .environment_response_data import EnvironmentResponseData class AuditLogListResponseData(UniversalBaseModel): actor_type: ActorType + api_key: typing.Optional[ApiKeyResponseData] = None api_key_id: typing.Optional[str] = None ended_at: typing.Optional[dt.datetime] = None environment: typing.Optional[EnvironmentResponseData] = None diff --git a/src/schematic/types/audit_log_response_data.py b/src/schematic/types/audit_log_response_data.py index b9bf233..f1932ca 100644 --- a/src/schematic/types/audit_log_response_data.py +++ b/src/schematic/types/audit_log_response_data.py @@ -6,11 +6,13 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .actor_type import ActorType +from .api_key_response_data import ApiKeyResponseData from .environment_response_data import EnvironmentResponseData class AuditLogResponseData(UniversalBaseModel): actor_type: ActorType + api_key: typing.Optional[ApiKeyResponseData] = None api_key_id: typing.Optional[str] = None ended_at: typing.Optional[dt.datetime] = None environment: typing.Optional[EnvironmentResponseData] = None diff --git a/src/schematic/types/billing_credit_bundle_view.py b/src/schematic/types/billing_credit_bundle_view.py index 9627de7..4554b25 100644 --- a/src/schematic/types/billing_credit_bundle_view.py +++ b/src/schematic/types/billing_credit_bundle_view.py @@ -20,7 +20,7 @@ class BillingCreditBundleView(UniversalBaseModel): credit_icon: typing.Optional[str] = None credit_id: str credit_name: str - currency_prices: typing.Optional[typing.List[CreditBundleCurrencyPrice]] = None + currency_prices: typing.List[CreditBundleCurrencyPrice] expiry_type: BillingCreditExpiryType expiry_unit: BillingCreditExpiryUnit expiry_unit_count: typing.Optional[int] = None diff --git a/src/schematic/types/billing_credit_view.py b/src/schematic/types/billing_credit_view.py index c1be42c..b4dca66 100644 --- a/src/schematic/types/billing_credit_view.py +++ b/src/schematic/types/billing_credit_view.py @@ -10,6 +10,7 @@ from .billing_credit_rollover_policy import BillingCreditRolloverPolicy from .billing_price_view import BillingPriceView from .billing_product_response_data import BillingProductResponseData +from .credit_currency_price import CreditCurrencyPrice class BillingCreditView(UniversalBaseModel): @@ -17,6 +18,7 @@ class BillingCreditView(UniversalBaseModel): burn_strategy: BillingCreditBurnStrategy cost_editable: bool created_at: dt.datetime + currency_prices: typing.List[CreditCurrencyPrice] default_expiry_unit: BillingCreditExpiryUnit default_expiry_unit_count: typing.Optional[int] = None default_rollover_policy: BillingCreditRolloverPolicy diff --git a/src/schematic/types/billing_plan_credit_grant_response_data.py b/src/schematic/types/billing_plan_credit_grant_response_data.py index 959a1e4..d026dda 100644 --- a/src/schematic/types/billing_plan_credit_grant_response_data.py +++ b/src/schematic/types/billing_plan_credit_grant_response_data.py @@ -21,6 +21,7 @@ class BillingPlanCreditGrantResponseData(UniversalBaseModel): auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = None auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None auto_topup_expiry_unit_count: typing.Optional[int] = None + auto_topup_self_service: bool auto_topup_threshold_credits: typing.Optional[int] = None auto_topup_threshold_percent: typing.Optional[int] = None created_at: dt.datetime diff --git a/src/schematic/types/billing_price_response_data.py b/src/schematic/types/billing_price_response_data.py index 6e075ba..a429d81 100644 --- a/src/schematic/types/billing_price_response_data.py +++ b/src/schematic/types/billing_price_response_data.py @@ -14,6 +14,7 @@ class BillingPriceResponseData(UniversalBaseModel): external_price_id: str id: str interval: BillingProductPriceInterval + interval_count: int nickname: typing.Optional[str] = None price: int price_decimal: typing.Optional[str] = None diff --git a/src/schematic/types/billing_price_view.py b/src/schematic/types/billing_price_view.py index 7c8a5e2..fa2d6f1 100644 --- a/src/schematic/types/billing_price_view.py +++ b/src/schematic/types/billing_price_view.py @@ -19,6 +19,7 @@ class BillingPriceView(UniversalBaseModel): currency: str id: str interval: BillingProductPriceInterval + interval_count: int is_active: bool meter_event_name: typing.Optional[str] = None meter_event_payload_key: typing.Optional[str] = None 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 081b1ee..7b4bc77 100644 --- a/src/schematic/types/billing_product_for_subscription_response_data.py +++ b/src/schematic/types/billing_product_for_subscription_response_data.py @@ -20,6 +20,7 @@ class BillingProductForSubscriptionResponseData(UniversalBaseModel): external_id: str id: str interval: str + interval_count: typing.Optional[int] = None meter_id: typing.Optional[str] = None name: str package_size: int diff --git a/src/schematic/types/billing_product_price_response_data.py b/src/schematic/types/billing_product_price_response_data.py index 18f077c..77d0272 100644 --- a/src/schematic/types/billing_product_price_response_data.py +++ b/src/schematic/types/billing_product_price_response_data.py @@ -18,6 +18,7 @@ class BillingProductPriceResponseData(UniversalBaseModel): currency: str id: str interval: BillingProductPriceInterval + interval_count: int is_active: bool meter_id: typing.Optional[str] = None nickname: typing.Optional[str] = None diff --git a/src/schematic/types/change_subscription_internal_request_body.py b/src/schematic/types/change_subscription_internal_request_body.py index d791bcc..37d09f0 100644 --- a/src/schematic/types/change_subscription_internal_request_body.py +++ b/src/schematic/types/change_subscription_internal_request_body.py @@ -5,12 +5,14 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .update_add_on_request_body import UpdateAddOnRequestBody +from .update_auto_topup_override_request_body import UpdateAutoTopupOverrideRequestBody from .update_credit_bundle_request_body import UpdateCreditBundleRequestBody from .update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody class ChangeSubscriptionInternalRequestBody(UniversalBaseModel): add_on_ids: typing.List[UpdateAddOnRequestBody] + auto_topup_overrides: typing.List[UpdateAutoTopupOverrideRequestBody] company_id: str coupon_external_id: typing.Optional[str] = None credit_bundles: typing.List[UpdateCreditBundleRequestBody] diff --git a/src/schematic/types/change_subscription_request_body.py b/src/schematic/types/change_subscription_request_body.py index 0452aba..50079f0 100644 --- a/src/schematic/types/change_subscription_request_body.py +++ b/src/schematic/types/change_subscription_request_body.py @@ -5,12 +5,14 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .update_add_on_request_body import UpdateAddOnRequestBody +from .update_auto_topup_override_request_body import UpdateAutoTopupOverrideRequestBody from .update_credit_bundle_request_body import UpdateCreditBundleRequestBody from .update_pay_in_advance_request_body import UpdatePayInAdvanceRequestBody class ChangeSubscriptionRequestBody(UniversalBaseModel): add_on_ids: typing.List[UpdateAddOnRequestBody] + auto_topup_overrides: typing.List[UpdateAutoTopupOverrideRequestBody] coupon_external_id: typing.Optional[str] = None credit_bundles: typing.List[UpdateCreditBundleRequestBody] new_plan_id: str diff --git a/src/schematic/types/clerk_integration_config.py b/src/schematic/types/clerk_integration_config.py new file mode 100644 index 0000000..c95fb4a --- /dev/null +++ b/src/schematic/types/clerk_integration_config.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ClerkIntegrationConfig(UniversalBaseModel): + first_events_received: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether Schematic has received the first webhook event from Clerk after install + """ + + webhook_url: typing.Optional[str] = pydantic.Field(default=None) + """ + URL configured on the Clerk webhook endpoint that delivers events to Schematic + """ + + 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_credit_balance_response_data.py b/src/schematic/types/company_credit_balance_response_data.py new file mode 100644 index 0000000..0abf080 --- /dev/null +++ b/src/schematic/types/company_credit_balance_response_data.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_provider_type import BillingProviderType + + +class CompanyCreditBalanceResponseData(UniversalBaseModel): + credit_id: str + remaining: float + source: BillingProviderType + total: typing.Optional[float] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/company_matching_criteria.py b/src/schematic/types/company_matching_criteria.py new file mode 100644 index 0000000..d5ce4bf --- /dev/null +++ b/src/schematic/types/company_matching_criteria.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CompanyMatchingCriteria = typing.Union[typing.Literal["billing_meta_object", "manual_upsert"], typing.Any] diff --git a/src/schematic/types/company_plan_credit_grant_view.py b/src/schematic/types/company_plan_credit_grant_view.py new file mode 100644 index 0000000..4ca5df2 --- /dev/null +++ b/src/schematic/types/company_plan_credit_grant_view.py @@ -0,0 +1,78 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_credit_expiry_type import BillingCreditExpiryType +from .billing_credit_expiry_unit import BillingCreditExpiryUnit +from .billing_credit_view import BillingCreditView +from .billing_plan_credit_grant_reset_cadence import BillingPlanCreditGrantResetCadence +from .billing_plan_credit_grant_reset_start import BillingPlanCreditGrantResetStart +from .billing_plan_credit_grant_reset_type import BillingPlanCreditGrantResetType +from .generic_preview_object import GenericPreviewObject + + +class CompanyPlanCreditGrantView(UniversalBaseModel): + billing_credit_auto_topup_amount: typing.Optional[int] = None + billing_credit_auto_topup_amount_type: typing.Optional[str] = None + billing_credit_auto_topup_enabled: bool + billing_credit_auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = None + billing_credit_auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None + billing_credit_auto_topup_expiry_unit_count: typing.Optional[int] = None + billing_credit_auto_topup_self_service: bool + billing_credit_auto_topup_threshold_credits: typing.Optional[int] = None + billing_credit_auto_topup_threshold_percent: typing.Optional[int] = None + company_auto_topup_amount: typing.Optional[int] = None + company_auto_topup_enabled: typing.Optional[bool] = None + company_auto_topup_threshold_credits: typing.Optional[int] = None + created_at: dt.datetime + credit: typing.Optional[BillingCreditView] = None + credit_amount: int + credit_description: str = pydantic.Field() + """ + Deprecated field, will be removed in the future. Use Credit.Description instead. + """ + + credit_icon: typing.Optional[str] = pydantic.Field(default=None) + """ + Deprecated field, will be removed in the future. Use Credit.Icon instead. + """ + + credit_id: str + credit_name: str = pydantic.Field() + """ + Deprecated field, will be removed in the future. Use Credit.Name instead. + """ + + expiry_type: typing.Optional[BillingCreditExpiryType] = None + expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None + expiry_unit_count: typing.Optional[int] = None + id: str + plan: typing.Optional[GenericPreviewObject] = None + plan_id: str + plan_version_id: typing.Optional[str] = None + plural_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Deprecated field, will be removed in the future. Use Credit.PluralName instead. + """ + + reset_cadence: typing.Optional[BillingPlanCreditGrantResetCadence] = None + reset_start: typing.Optional[BillingPlanCreditGrantResetStart] = None + reset_type: BillingPlanCreditGrantResetType + singular_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Deprecated field, will be removed in the future. Use Credit.SingularName instead. + """ + + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/company_plan_detail_response_data.py b/src/schematic/types/company_plan_detail_response_data.py index 109ee39..639f78b 100644 --- a/src/schematic/types/company_plan_detail_response_data.py +++ b/src/schematic/types/company_plan_detail_response_data.py @@ -56,6 +56,7 @@ class CompanyPlanDetailResponseData(UniversalBaseModel): name: str one_time_price: typing.Optional[BillingPriceResponseData] = None plan_type: PlanType + quarterly_price: typing.Optional[BillingPriceResponseData] = None trial_days: typing.Optional[int] = None updated_at: dt.datetime usage_violations: typing.List[FeatureUsageResponseData] diff --git a/src/schematic/types/company_plan_with_billing_sub_view.py b/src/schematic/types/company_plan_with_billing_sub_view.py index e849243..a88ad12 100644 --- a/src/schematic/types/company_plan_with_billing_sub_view.py +++ b/src/schematic/types/company_plan_with_billing_sub_view.py @@ -5,7 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .plan_credit_grant_view import PlanCreditGrantView +from .company_plan_credit_grant_view import CompanyPlanCreditGrantView class CompanyPlanWithBillingSubView(UniversalBaseModel): @@ -15,7 +15,7 @@ class CompanyPlanWithBillingSubView(UniversalBaseModel): description: typing.Optional[str] = None id: str image_url: typing.Optional[str] = None - included_credit_grants: typing.List[PlanCreditGrantView] + included_credit_grants: typing.List[CompanyPlanCreditGrantView] name: str plan_period: typing.Optional[str] = None plan_price: typing.Optional[int] = None diff --git a/src/schematic/types/create_billing_plan_credit_grant_request_body.py b/src/schematic/types/create_billing_plan_credit_grant_request_body.py index 07257fe..400cd48 100644 --- a/src/schematic/types/create_billing_plan_credit_grant_request_body.py +++ b/src/schematic/types/create_billing_plan_credit_grant_request_body.py @@ -20,6 +20,7 @@ class CreateBillingPlanCreditGrantRequestBody(UniversalBaseModel): auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = None auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None auto_topup_expiry_unit_count: typing.Optional[int] = None + auto_topup_self_service: typing.Optional[bool] = None auto_topup_threshold_credits: typing.Optional[int] = None auto_topup_threshold_percent: typing.Optional[int] = None credit_amount: int diff --git a/src/schematic/types/create_custom_plan_bundle_plan_request_body.py b/src/schematic/types/create_custom_plan_bundle_plan_request_body.py new file mode 100644 index 0000000..df86367 --- /dev/null +++ b/src/schematic/types/create_custom_plan_bundle_plan_request_body.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .plan_icon import PlanIcon + + +class CreateCustomPlanBundlePlanRequestBody(UniversalBaseModel): + company_id: str + description: str + icon: typing.Optional[PlanIcon] = None + name: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/create_entitlement_in_bundle_request_body.py b/src/schematic/types/create_entitlement_in_bundle_request_body.py index 64d97ff..7422449 100644 --- a/src/schematic/types/create_entitlement_in_bundle_request_body.py +++ b/src/schematic/types/create_entitlement_in_bundle_request_body.py @@ -35,6 +35,10 @@ class CreateEntitlementInBundleRequestBody(UniversalBaseModel): Use MonthlyPriceTiers or YearlyPriceTiers instead """ + quarterly_metered_price_id: typing.Optional[str] = None + quarterly_price_tiers: typing.Optional[typing.List[CreatePriceTierRequestBody]] = None + quarterly_unit_price: typing.Optional[int] = None + quarterly_unit_price_decimal: typing.Optional[str] = None soft_limit: typing.Optional[int] = None tier_mode: typing.Optional[BillingTiersMode] = None value_bool: typing.Optional[bool] = None diff --git a/src/schematic/types/create_event_request_body.py b/src/schematic/types/create_event_request_body.py index cb1a451..0ff189b 100644 --- a/src/schematic/types/create_event_request_body.py +++ b/src/schematic/types/create_event_request_body.py @@ -16,6 +16,11 @@ class CreateEventRequestBody(UniversalBaseModel): Either 'identify' or 'track' """ + idempotency_key: typing.Optional[str] = pydantic.Field(default=None) + """ + Optional client-supplied key. Duplicate events with the same key (scoped to the environment) are dropped for 24h. + """ + sent_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) """ Optionally provide a timestamp at which the event was sent to Schematic diff --git a/src/schematic/types/credit_currency_price.py b/src/schematic/types/credit_currency_price.py new file mode 100644 index 0000000..2e793b6 --- /dev/null +++ b/src/schematic/types/credit_currency_price.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .billing_price_view import BillingPriceView + + +class CreditCurrencyPrice(UniversalBaseModel): + currency: str + price: typing.Optional[BillingPriceView] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/currency_price_request_body.py b/src/schematic/types/currency_price_request_body.py index 425ff39..56dacb8 100644 --- a/src/schematic/types/currency_price_request_body.py +++ b/src/schematic/types/currency_price_request_body.py @@ -12,6 +12,9 @@ class CurrencyPriceRequestBody(UniversalBaseModel): monthly_price_tiers: typing.Optional[typing.List[CreatePriceTierRequestBody]] = None monthly_unit_price: typing.Optional[int] = None monthly_unit_price_decimal: typing.Optional[str] = None + quarterly_price_tiers: typing.Optional[typing.List[CreatePriceTierRequestBody]] = None + quarterly_unit_price: typing.Optional[int] = None + quarterly_unit_price_decimal: typing.Optional[str] = None yearly_price_tiers: typing.Optional[typing.List[CreatePriceTierRequestBody]] = None yearly_unit_price: typing.Optional[int] = None yearly_unit_price_decimal: typing.Optional[str] = None diff --git a/src/schematic/types/data_event_payload.py b/src/schematic/types/data_event_payload.py index e57d74c..0356c58 100644 --- a/src/schematic/types/data_event_payload.py +++ b/src/schematic/types/data_event_payload.py @@ -11,6 +11,7 @@ class DataEventPayload(UniversalBaseModel): api_key: str body: typing.Optional[typing.Dict[str, typing.Any]] = None + idempotency_key: typing.Optional[str] = None sent_at: typing.Optional[dt.datetime] = None type: EventType diff --git a/src/schematic/types/duplicate_plan_entitlements_response_response_data.py b/src/schematic/types/duplicate_plan_entitlements_response_response_data.py index 5690c0a..5a0e7a1 100644 --- a/src/schematic/types/duplicate_plan_entitlements_response_response_data.py +++ b/src/schematic/types/duplicate_plan_entitlements_response_response_data.py @@ -5,11 +5,13 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .plan_entitlement_response_data import PlanEntitlementResponseData +from .plan_issue_response_data import PlanIssueResponseData from .skipped_entitlement_response_data import SkippedEntitlementResponseData class DuplicatePlanEntitlementsResponseResponseData(UniversalBaseModel): data: typing.List[PlanEntitlementResponseData] + issues: typing.List[PlanIssueResponseData] skipped: typing.List[SkippedEntitlementResponseData] if IS_PYDANTIC_V2: diff --git a/src/schematic/types/entitlement_currency_prices_response_data.py b/src/schematic/types/entitlement_currency_prices_response_data.py index 2060d37..50b8ca6 100644 --- a/src/schematic/types/entitlement_currency_prices_response_data.py +++ b/src/schematic/types/entitlement_currency_prices_response_data.py @@ -10,6 +10,7 @@ class EntitlementCurrencyPricesResponseData(UniversalBaseModel): currency: str monthly_price: typing.Optional[BillingPriceView] = None + quarterly_price: typing.Optional[BillingPriceView] = None yearly_price: typing.Optional[BillingPriceView] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/environment_feature_usage_time_series_response_data.py b/src/schematic/types/environment_feature_usage_time_series_response_data.py new file mode 100644 index 0000000..9698360 --- /dev/null +++ b/src/schematic/types/environment_feature_usage_time_series_response_data.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .environment_usage_point_response_data import EnvironmentUsagePointResponseData + + +class EnvironmentFeatureUsageTimeSeriesResponseData(UniversalBaseModel): + event_subtype: str + feature_id: str + points: typing.List[EnvironmentUsagePointResponseData] + + 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/environment_trait_usage_time_series_response_data.py b/src/schematic/types/environment_trait_usage_time_series_response_data.py new file mode 100644 index 0000000..70b313b --- /dev/null +++ b/src/schematic/types/environment_trait_usage_time_series_response_data.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .environment_usage_point_response_data import EnvironmentUsagePointResponseData + + +class EnvironmentTraitUsageTimeSeriesResponseData(UniversalBaseModel): + feature_id: str + points: typing.List[EnvironmentUsagePointResponseData] + trait_definition_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/environment_usage_point_response_data.py b/src/schematic/types/environment_usage_point_response_data.py new file mode 100644 index 0000000..ec99ab2 --- /dev/null +++ b/src/schematic/types/environment_usage_point_response_data.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class EnvironmentUsagePointResponseData(UniversalBaseModel): + timestamp: dt.datetime + usage: int + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/event_detail_response_data.py b/src/schematic/types/event_detail_response_data.py index e33657d..fa127c0 100644 --- a/src/schematic/types/event_detail_response_data.py +++ b/src/schematic/types/event_detail_response_data.py @@ -5,6 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .api_key_response_data import ApiKeyResponseData from .event_status import EventStatus from .event_type import EventType from .preview_object import PreviewObject @@ -12,6 +13,7 @@ class EventDetailResponseData(UniversalBaseModel): api_key: typing.Optional[str] = None + api_key_view: typing.Optional[ApiKeyResponseData] = None body: typing.Dict[str, typing.Any] body_preview: str captured_at: dt.datetime @@ -23,6 +25,7 @@ class EventDetailResponseData(UniversalBaseModel): feature_ids: typing.List[str] features: typing.List[PreviewObject] id: str + idempotency_key: typing.Optional[str] = None loaded_at: typing.Optional[dt.datetime] = None processed_at: typing.Optional[dt.datetime] = None quantity: int diff --git a/src/schematic/types/event_response_data.py b/src/schematic/types/event_response_data.py index e0c533c..a1cd727 100644 --- a/src/schematic/types/event_response_data.py +++ b/src/schematic/types/event_response_data.py @@ -20,6 +20,7 @@ class EventResponseData(UniversalBaseModel): error_message: typing.Optional[str] = None feature_ids: typing.List[str] id: str + idempotency_key: typing.Optional[str] = None loaded_at: typing.Optional[dt.datetime] = None processed_at: typing.Optional[dt.datetime] = None quantity: int diff --git a/src/schematic/types/feature_company_response_data.py b/src/schematic/types/feature_company_response_data.py index 921a743..61e5eba 100644 --- a/src/schematic/types/feature_company_response_data.py +++ b/src/schematic/types/feature_company_response_data.py @@ -128,6 +128,7 @@ class FeatureCompanyResponseData(UniversalBaseModel): plan: typing.Optional[PlanResponseData] = None plan_entitlement: typing.Optional[PlanEntitlementResponseData] = None price_behavior: typing.Optional[EntitlementPriceBehavior] = None + quarterly_usage_based_price: typing.Optional[BillingPriceView] = None soft_limit: typing.Optional[int] = pydantic.Field(default=None) """ The soft limit for the feature usage. Available only for overage price behavior diff --git a/src/schematic/types/feature_usage_response_data.py b/src/schematic/types/feature_usage_response_data.py index 16d7ee8..f49f83b 100644 --- a/src/schematic/types/feature_usage_response_data.py +++ b/src/schematic/types/feature_usage_response_data.py @@ -124,6 +124,7 @@ class FeatureUsageResponseData(UniversalBaseModel): plan: typing.Optional[PlanResponseData] = None plan_entitlement: typing.Optional[PlanEntitlementResponseData] = None price_behavior: typing.Optional[EntitlementPriceBehavior] = None + quarterly_usage_based_price: typing.Optional[BillingPriceView] = None soft_limit: typing.Optional[int] = pydantic.Field(default=None) """ The soft limit for the feature usage. Available only for overage price behavior diff --git a/src/schematic/types/insights_summary_response_data.py b/src/schematic/types/insights_summary_response_data.py new file mode 100644 index 0000000..345da1f --- /dev/null +++ b/src/schematic/types/insights_summary_response_data.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .mrr_response_data import MrrResponseData + + +class InsightsSummaryResponseData(UniversalBaseModel): + active_credits: float + mrr: typing.List[MrrResponseData] + paid_companies: int + total_companies: int + total_features: int + total_plans: 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/integration_capabilities.py b/src/schematic/types/integration_capabilities.py new file mode 100644 index 0000000..9bce367 --- /dev/null +++ b/src/schematic/types/integration_capabilities.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class IntegrationCapabilities(UniversalBaseModel): + author_plans: bool + checkout: bool + edit_billing: bool + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/integration_config.py b/src/schematic/types/integration_config.py new file mode 100644 index 0000000..69c8bf9 --- /dev/null +++ b/src/schematic/types/integration_config.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class IntegrationConfig_Clerk(UniversalBaseModel): + type: typing.Literal["clerk"] = "clerk" + first_events_received: typing.Optional[bool] = None + webhook_url: 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 + + +class IntegrationConfig_Orb(UniversalBaseModel): + type: typing.Literal["orb"] = "orb" + external_customer_id_key: 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 + + +class IntegrationConfig_Stripe(UniversalBaseModel): + type: typing.Literal["stripe"] = "stripe" + account_id: typing.Optional[str] = None + account_name: typing.Optional[str] = None + company_update_only: typing.Optional[bool] = None + is_sandbox: bool + live_mode: bool + onboard_url: typing.Optional[str] = None + version: int + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +IntegrationConfig = typing_extensions.Annotated[ + typing.Union[IntegrationConfig_Clerk, IntegrationConfig_Orb, IntegrationConfig_Stripe], + pydantic.Field(discriminator="type"), +] diff --git a/src/schematic/types/integration_response_data.py b/src/schematic/types/integration_response_data.py new file mode 100644 index 0000000..aae8458 --- /dev/null +++ b/src/schematic/types/integration_response_data.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .integration_state import IntegrationState +from .integration_type import IntegrationType + + +class IntegrationResponseData(UniversalBaseModel): + created_at: dt.datetime + id: str + state: IntegrationState + type: IntegrationType + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/integration_state.py b/src/schematic/types/integration_state.py new file mode 100644 index 0000000..46a4da2 --- /dev/null +++ b/src/schematic/types/integration_state.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +IntegrationState = typing.Union[typing.Literal["active", "created", "pending"], typing.Any] diff --git a/src/schematic/types/integrations_data_set_response_data.py b/src/schematic/types/integrations_data_set_response_data.py new file mode 100644 index 0000000..ad7a520 --- /dev/null +++ b/src/schematic/types/integrations_data_set_response_data.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class IntegrationsDataSetResponseData(UniversalBaseModel): + keys: typing.List[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/integrations_list_response_data.py b/src/schematic/types/integrations_list_response_data.py new file mode 100644 index 0000000..121ba84 --- /dev/null +++ b/src/schematic/types/integrations_list_response_data.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .integration_capabilities import IntegrationCapabilities +from .integration_config import IntegrationConfig +from .integration_state import IntegrationState +from .integration_type import IntegrationType + + +class IntegrationsListResponseData(UniversalBaseModel): + capabilities: IntegrationCapabilities + config: typing.Optional[IntegrationConfig] = None + id: str + is_app_install: bool + is_connect_install: bool + state: IntegrationState + type: IntegrationType + + 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/integrations_response_data.py b/src/schematic/types/integrations_response_data.py new file mode 100644 index 0000000..ea85a0e --- /dev/null +++ b/src/schematic/types/integrations_response_data.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .integration_state import IntegrationState +from .integration_type import IntegrationType + + +class IntegrationsResponseData(UniversalBaseModel): + created_at: dt.datetime + id: str + state: IntegrationState + type: IntegrationType + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/mrr_response_data.py b/src/schematic/types/mrr_response_data.py new file mode 100644 index 0000000..5e2743e --- /dev/null +++ b/src/schematic/types/mrr_response_data.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class MrrResponseData(UniversalBaseModel): + amount: int + currency: 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/orb_integration_config.py b/src/schematic/types/orb_integration_config.py new file mode 100644 index 0000000..c175846 --- /dev/null +++ b/src/schematic/types/orb_integration_config.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class OrbIntegrationConfig(UniversalBaseModel): + external_customer_id_key: typing.Optional[str] = pydantic.Field(default=None) + """ + Schematic company key used to store Orb's external_customer_id; when unset, defaults to orb_external_customer_id + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_credit_grant_view.py b/src/schematic/types/plan_credit_grant_view.py index 790f0a7..fe9d9a0 100644 --- a/src/schematic/types/plan_credit_grant_view.py +++ b/src/schematic/types/plan_credit_grant_view.py @@ -21,6 +21,7 @@ class PlanCreditGrantView(UniversalBaseModel): billing_credit_auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = None billing_credit_auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None billing_credit_auto_topup_expiry_unit_count: typing.Optional[int] = None + billing_credit_auto_topup_self_service: bool billing_credit_auto_topup_threshold_credits: typing.Optional[int] = None billing_credit_auto_topup_threshold_percent: typing.Optional[int] = None created_at: dt.datetime diff --git a/src/schematic/types/plan_currency_price_request_body.py b/src/schematic/types/plan_currency_price_request_body.py index 4ec2193..54346cf 100644 --- a/src/schematic/types/plan_currency_price_request_body.py +++ b/src/schematic/types/plan_currency_price_request_body.py @@ -10,6 +10,7 @@ class PlanCurrencyPriceRequestBody(UniversalBaseModel): currency: str monthly_price: typing.Optional[int] = None one_time_price: typing.Optional[int] = None + quarterly_price: typing.Optional[int] = None yearly_price: typing.Optional[int] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/plan_currency_prices_response_data.py b/src/schematic/types/plan_currency_prices_response_data.py index b6c4e27..b924029 100644 --- a/src/schematic/types/plan_currency_prices_response_data.py +++ b/src/schematic/types/plan_currency_prices_response_data.py @@ -11,6 +11,7 @@ class PlanCurrencyPricesResponseData(UniversalBaseModel): currency: str monthly_price: typing.Optional[BillingPriceResponseData] = None one_time_price: typing.Optional[BillingPriceResponseData] = None + quarterly_price: typing.Optional[BillingPriceResponseData] = None yearly_price: typing.Optional[BillingPriceResponseData] = None if IS_PYDANTIC_V2: diff --git a/src/schematic/types/plan_detail_response_data.py b/src/schematic/types/plan_detail_response_data.py index 7fe468c..3a1f015 100644 --- a/src/schematic/types/plan_detail_response_data.py +++ b/src/schematic/types/plan_detail_response_data.py @@ -44,6 +44,7 @@ class PlanDetailResponseData(UniversalBaseModel): name: str one_time_price: typing.Optional[BillingPriceResponseData] = None plan_type: PlanType + quarterly_price: typing.Optional[BillingPriceResponseData] = None trial_days: typing.Optional[int] = None updated_at: dt.datetime versions: typing.List[PlanVersionResponseData] diff --git a/src/schematic/types/plan_entitlement_response_data.py b/src/schematic/types/plan_entitlement_response_data.py index a1991c1..846db8c 100644 --- a/src/schematic/types/plan_entitlement_response_data.py +++ b/src/schematic/types/plan_entitlement_response_data.py @@ -30,6 +30,7 @@ class PlanEntitlementResponseData(UniversalBaseModel): feature_id: str id: str metered_monthly_price: typing.Optional[BillingPriceView] = None + metered_quarterly_price: typing.Optional[BillingPriceView] = None metered_yearly_price: typing.Optional[BillingPriceView] = None metric_period: typing.Optional[MetricPeriod] = None metric_period_month_reset: typing.Optional[MetricPeriodMonthReset] = None diff --git a/src/schematic/types/plan_group_plan_detail_response_data.py b/src/schematic/types/plan_group_plan_detail_response_data.py index b3a10d9..4a48976 100644 --- a/src/schematic/types/plan_group_plan_detail_response_data.py +++ b/src/schematic/types/plan_group_plan_detail_response_data.py @@ -50,6 +50,7 @@ class PlanGroupPlanDetailResponseData(UniversalBaseModel): name: str one_time_price: typing.Optional[BillingPriceResponseData] = None plan_type: PlanType + quarterly_price: typing.Optional[BillingPriceResponseData] = None trial_days: typing.Optional[int] = None updated_at: dt.datetime versions: typing.List[PlanVersionResponseData] diff --git a/src/schematic/types/plan_growth_point_response_data.py b/src/schematic/types/plan_growth_point_response_data.py new file mode 100644 index 0000000..bdb217b --- /dev/null +++ b/src/schematic/types/plan_growth_point_response_data.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class PlanGrowthPointResponseData(UniversalBaseModel): + month: dt.datetime + plan_id: str + plan_name: str + subscribers: int + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_growth_response_data.py b/src/schematic/types/plan_growth_response_data.py new file mode 100644 index 0000000..e37209e --- /dev/null +++ b/src/schematic/types/plan_growth_response_data.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .plan_growth_point_response_data import PlanGrowthPointResponseData + + +class PlanGrowthResponseData(UniversalBaseModel): + points: typing.List[PlanGrowthPointResponseData] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/plan_view_public_response_data.py b/src/schematic/types/plan_view_public_response_data.py index 0aeb1d2..102c64c 100644 --- a/src/schematic/types/plan_view_public_response_data.py +++ b/src/schematic/types/plan_view_public_response_data.py @@ -51,6 +51,7 @@ class PlanViewPublicResponseData(UniversalBaseModel): name: str one_time_price: typing.Optional[BillingPriceResponseData] = None plan_type: PlanType + quarterly_price: typing.Optional[BillingPriceResponseData] = None trial_days: typing.Optional[int] = None updated_at: dt.datetime versions: typing.List[PlanVersionResponseData] diff --git a/src/schematic/types/rules_engine_schema_version.py b/src/schematic/types/rules_engine_schema_version.py index 8038eb4..9cca674 100644 --- a/src/schematic/types/rules_engine_schema_version.py +++ b/src/schematic/types/rules_engine_schema_version.py @@ -2,4 +2,4 @@ import typing -RulesEngineSchemaVersion = typing.Union[typing.Literal["vf05bf5da", "placeholder-for-fern-compatibility"], typing.Any] +RulesEngineSchemaVersion = typing.Union[typing.Literal["v97288f60", "placeholder-for-fern-compatibility"], typing.Any] diff --git a/src/schematic/types/stripe_integration_config.py b/src/schematic/types/stripe_integration_config.py new file mode 100644 index 0000000..b5268bc --- /dev/null +++ b/src/schematic/types/stripe_integration_config.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class StripeIntegrationConfig(UniversalBaseModel): + account_id: typing.Optional[str] = pydantic.Field(default=None) + """ + Connected Stripe account ID (acct_*) + """ + + account_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Display name of the connected Stripe account + """ + + company_update_only: typing.Optional[bool] = pydantic.Field(default=None) + """ + When importing Stripe customers, only update existing companies, do not create new companies + """ + + is_sandbox: bool = pydantic.Field() + """ + Whether the integration is connected to a Stripe sandbox account + """ + + live_mode: bool = pydantic.Field() + """ + Whether the integration is connected to a live Stripe account + """ + + onboard_url: typing.Optional[str] = pydantic.Field(default=None) + """ + Onboarding URL returned during the v2 (Connect) install flow before activation + """ + + version: int = pydantic.Field() + """ + Stripe integration config version (1 = legacy API key install, 2 = Connect/App install) + """ + + 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/top_feature_by_usage_response_data.py b/src/schematic/types/top_feature_by_usage_response_data.py new file mode 100644 index 0000000..0302779 --- /dev/null +++ b/src/schematic/types/top_feature_by_usage_response_data.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class TopFeatureByUsageResponseData(UniversalBaseModel): + change_pct: typing.Optional[float] = None + feature_id: str + feature_name: str + plural_name: typing.Optional[str] = None + prior_usage: int + usage: int + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/schematic/types/top_features_by_usage_response_data.py b/src/schematic/types/top_features_by_usage_response_data.py new file mode 100644 index 0000000..08c4152 --- /dev/null +++ b/src/schematic/types/top_features_by_usage_response_data.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .top_feature_by_usage_response_data import TopFeatureByUsageResponseData + + +class TopFeaturesByUsageResponseData(UniversalBaseModel): + features: typing.List[TopFeatureByUsageResponseData] + + 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_auto_topup_override_request_body.py b/src/schematic/types/update_auto_topup_override_request_body.py new file mode 100644 index 0000000..74f4fa2 --- /dev/null +++ b/src/schematic/types/update_auto_topup_override_request_body.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class UpdateAutoTopupOverrideRequestBody(UniversalBaseModel): + auto_topup_amount: typing.Optional[int] = None + auto_topup_enabled: typing.Optional[bool] = None + auto_topup_threshold_credits: typing.Optional[int] = None + plan_credit_grant_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_billing_plan_credit_grant_request_body.py b/src/schematic/types/update_billing_plan_credit_grant_request_body.py index 4f83d35..0a755d4 100644 --- a/src/schematic/types/update_billing_plan_credit_grant_request_body.py +++ b/src/schematic/types/update_billing_plan_credit_grant_request_body.py @@ -20,6 +20,7 @@ class UpdateBillingPlanCreditGrantRequestBody(UniversalBaseModel): auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = None auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None auto_topup_expiry_unit_count: typing.Optional[int] = None + auto_topup_self_service: typing.Optional[bool] = None auto_topup_threshold_credits: typing.Optional[int] = None auto_topup_threshold_percent: typing.Optional[int] = None credit_amount: typing.Optional[int] = None diff --git a/src/schematic/types/upsert_billing_product_request_body.py b/src/schematic/types/upsert_billing_product_request_body.py index 42bb7e5..7599f07 100644 --- a/src/schematic/types/upsert_billing_product_request_body.py +++ b/src/schematic/types/upsert_billing_product_request_body.py @@ -18,6 +18,8 @@ class UpsertBillingProductRequestBody(UniversalBaseModel): monthly_price_id: typing.Optional[str] = None one_time_price: typing.Optional[int] = None one_time_price_id: typing.Optional[str] = None + quarterly_price: typing.Optional[int] = None + quarterly_price_id: typing.Optional[str] = None trial_days: typing.Optional[int] = None yearly_price: typing.Optional[int] = None yearly_price_id: typing.Optional[str] = None diff --git a/src/schematic/types/usage_based_entitlement_request_body.py b/src/schematic/types/usage_based_entitlement_request_body.py index 5ff8f85..9339c66 100644 --- a/src/schematic/types/usage_based_entitlement_request_body.py +++ b/src/schematic/types/usage_based_entitlement_request_body.py @@ -26,6 +26,10 @@ class UsageBasedEntitlementRequestBody(UniversalBaseModel): Use MonthlyPriceTiers or YearlyPriceTiers instead """ + quarterly_metered_price_id: typing.Optional[str] = None + quarterly_price_tiers: typing.Optional[typing.List[CreatePriceTierRequestBody]] = None + quarterly_unit_price: typing.Optional[int] = None + quarterly_unit_price_decimal: typing.Optional[str] = None soft_limit: typing.Optional[int] = None tier_mode: typing.Optional[BillingTiersMode] = None yearly_metered_price_id: typing.Optional[str] = None diff --git a/src/schematic/types/usage_based_entitlement_response_data.py b/src/schematic/types/usage_based_entitlement_response_data.py index d645323..28386c6 100644 --- a/src/schematic/types/usage_based_entitlement_response_data.py +++ b/src/schematic/types/usage_based_entitlement_response_data.py @@ -20,6 +20,7 @@ class UsageBasedEntitlementResponseData(UniversalBaseModel): metric_period_month_reset: typing.Optional[MetricPeriodMonthReset] = None monthly_usage_based_price: typing.Optional[BillingPriceView] = None price_behavior: typing.Optional[EntitlementPriceBehavior] = None + quarterly_usage_based_price: typing.Optional[BillingPriceView] = None value_bool: typing.Optional[bool] = None value_numeric: typing.Optional[int] = None value_type: EntitlementValueType