diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cdc6f7..2ee47b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/orb-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -44,7 +44,7 @@ jobs: id-token: write runs-on: ${{ github.repository == 'stainless-sdks/orb-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -63,7 +63,7 @@ jobs: - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/orb-python' id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -81,7 +81,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/orb-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 0000000..a978bc8 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,31 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to PyPI in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/orbcorp/orb-python/actions/workflows/publish-pypi.yml +name: Publish PyPI +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Publish to PyPI + run: | + bash ./bin/publish-pypi + env: + PYPI_TOKEN: ${{ secrets.ORB_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..c791ea6 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,21 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'orbcorp/orb-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v6 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + PYPI_TOKEN: ${{ secrets.ORB_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 537b8e0..c3d8acd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.43.1" + ".": "4.55.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 9629af6..c80eee4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0ab0946487d1ee971683d894554494d9940010403874c0be724ffc3a82d696db.yml -openapi_spec_hash: 66b792328a4faee3c7659185accc3f0e -config_hash: e6db17547fe854b1c240407cf4c6dc9e +configured_endpoints: 139 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c92fb451e13f157b3735f188acc8d57aa3adfbaac1683645e1ba4f432dd7a4f8.yml +openapi_spec_hash: dbcd87ecfbd3976eb3b99ec6f9fbc606 +config_hash: 3279841440b02d4e8303c961d6983492 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d82b41..6c03365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,169 @@ # Changelog +## 4.55.0 (2026-02-12) + +Full Changelog: [v4.54.0...v4.55.0](https://github.com/orbcorp/orb-python/compare/v4.54.0...v4.55.0) + +### Features + +* **api:** manual updates ([1e311d0](https://github.com/orbcorp/orb-python/commit/1e311d0f910abcc60dddaf50fa7a2d13ebc73927)) + +## 4.54.0 (2026-02-12) + +Full Changelog: [v4.53.0...v4.54.0](https://github.com/orbcorp/orb-python/compare/v4.53.0...v4.54.0) + +### Features + +* **api:** api update ([e19d0dd](https://github.com/orbcorp/orb-python/commit/e19d0dd64cbdd35e4df9a865863f27f4dbbaa947)) + + +### Chores + +* format all `api.md` files ([814eda2](https://github.com/orbcorp/orb-python/commit/814eda22555fe97fe641823f61389c2a673e913d)) +* **internal:** codegen related update ([98c5208](https://github.com/orbcorp/orb-python/commit/98c5208b72deeb740f0e548fb89c61239f4b7492)) +* **internal:** fix lint error on Python 3.14 ([ca05c35](https://github.com/orbcorp/orb-python/commit/ca05c357163d78a443aadc1648bf848ab7e6b9f0)) + +## 4.53.0 (2026-02-10) + +Full Changelog: [v4.52.0...v4.53.0](https://github.com/orbcorp/orb-python/compare/v4.52.0...v4.53.0) + +### Features + +* **api:** api update ([09030b5](https://github.com/orbcorp/orb-python/commit/09030b54fbd1787c8b53a66f1d1f82f34ff6ed7f)) + + +### Chores + +* **internal:** bump dependencies ([8408c34](https://github.com/orbcorp/orb-python/commit/8408c34ef4bc900ad843f945283c9ad3a7e39ebe)) + +## 4.52.0 (2026-02-03) + +Full Changelog: [v4.51.0...v4.52.0](https://github.com/orbcorp/orb-python/compare/v4.51.0...v4.52.0) + +### Features + +* **api:** api update ([6e955d0](https://github.com/orbcorp/orb-python/commit/6e955d040735eca89ab38fcae425478a410313eb)) + +## 4.51.0 (2026-01-29) + +Full Changelog: [v4.50.0...v4.51.0](https://github.com/orbcorp/orb-python/compare/v4.50.0...v4.51.0) + +### Features + +* **client:** add custom JSON encoder for extended type support ([223e84e](https://github.com/orbcorp/orb-python/commit/223e84e59076bc26023a5c66121396bbdccf368f)) + +## 4.50.0 (2026-01-23) + +Full Changelog: [v4.49.0...v4.50.0](https://github.com/orbcorp/orb-python/compare/v4.49.0...v4.50.0) + +### Features + +* **api:** api update ([7ca6606](https://github.com/orbcorp/orb-python/commit/7ca6606e01b7b05801ae85817a067513a4427442)) + + +### Chores + +* **ci:** upgrade `actions/github-script` ([e2dc8e2](https://github.com/orbcorp/orb-python/commit/e2dc8e2a6beee09ee4fbd80952b0623abc7708bf)) + +## 4.49.0 (2026-01-21) + +Full Changelog: [v4.48.0...v4.49.0](https://github.com/orbcorp/orb-python/compare/v4.48.0...v4.49.0) + +### Features + +* **api:** api update ([5b5c348](https://github.com/orbcorp/orb-python/commit/5b5c348e954f79937614e47481e3a91dc8692751)) + + +### Chores + +* **internal:** codegen related update ([9f74fa5](https://github.com/orbcorp/orb-python/commit/9f74fa57c3d4bfebf2d5b4765d100f0e663b4ed6)) + +## 4.48.0 (2026-01-08) + +Full Changelog: [v4.47.0...v4.48.0](https://github.com/orbcorp/orb-python/compare/v4.47.0...v4.48.0) + +### Features + +* **api:** manual updates ([19e971e](https://github.com/orbcorp/orb-python/commit/19e971ed6f2da625b7d29101aa3ae8aab99e4401)) + +## 4.47.0 (2026-01-06) + +Full Changelog: [v4.46.3...v4.47.0](https://github.com/orbcorp/orb-python/compare/v4.46.3...v4.47.0) + +### Features + +* **api:** api update ([3685f1a](https://github.com/orbcorp/orb-python/commit/3685f1a5eb5e9d43c96eb0b253c79be02ba32285)) + + +### Chores + +* **internal:** add `--fix` argument to lint script ([a63545c](https://github.com/orbcorp/orb-python/commit/a63545cbdd128e08ca89cdbb9050d28c56e4022f)) +* **internal:** codegen related update ([e46bd76](https://github.com/orbcorp/orb-python/commit/e46bd7631ded1045eedc100118e5329600c3fd7e)) + +## 4.46.3 (2025-12-17) + +Full Changelog: [v4.46.2...v4.46.3](https://github.com/orbcorp/orb-python/compare/v4.46.2...v4.46.3) + +### Bug Fixes + +* use async_to_httpx_files in patch method ([25a4f49](https://github.com/orbcorp/orb-python/commit/25a4f49c670676bb82daf89deb18657bca7e2973)) + + +### Chores + +* **internal:** add missing files argument to base client ([770853a](https://github.com/orbcorp/orb-python/commit/770853af542db967e769efe1d371c51495fb0553)) + +## 4.46.2 (2025-12-09) + +Full Changelog: [v4.46.1...v4.46.2](https://github.com/orbcorp/orb-python/compare/v4.46.1...v4.46.2) + +### Chores + +* add missing docstrings ([073bfcb](https://github.com/orbcorp/orb-python/commit/073bfcb247316e483dc732908e7c0ab0d42a3551)) + +## 4.46.1 (2025-12-08) + +Full Changelog: [v4.46.0...v4.46.1](https://github.com/orbcorp/orb-python/compare/v4.46.0...v4.46.1) + +### Bug Fixes + +* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([4d0910a](https://github.com/orbcorp/orb-python/commit/4d0910a183bb2435b91cfecd4c643e50e23eff67)) + +## 4.46.0 (2025-12-06) + +Full Changelog: [v4.45.0...v4.46.0](https://github.com/orbcorp/orb-python/compare/v4.45.0...v4.46.0) + +### Features + +* **api:** api update ([a0222a2](https://github.com/orbcorp/orb-python/commit/a0222a2406664b664a79f094c35dcb5af8ace149)) + +## 4.45.0 (2025-12-03) + +Full Changelog: [v4.44.0...v4.45.0](https://github.com/orbcorp/orb-python/compare/v4.44.0...v4.45.0) + +### Features + +* **api:** api update ([3959281](https://github.com/orbcorp/orb-python/commit/3959281daeb67e4c41bade06590d66a246659d86)) + + +### Chores + +* **docs:** use environment variables for authentication in code snippets ([5527cac](https://github.com/orbcorp/orb-python/commit/5527cac85f39a9178e2ea77203bbc8141f1bbca5)) +* update lockfile ([b78de8a](https://github.com/orbcorp/orb-python/commit/b78de8a33d1cea6a7de2c018ba98b8014e8f3e68)) + +## 4.44.0 (2025-12-02) + +Full Changelog: [v4.43.1...v4.44.0](https://github.com/orbcorp/orb-python/compare/v4.43.1...v4.44.0) + +### Features + +* **api:** api update ([d05cd59](https://github.com/orbcorp/orb-python/commit/d05cd599518f89f531ddb4588e8bbf9ae4c9b6bb)) + + +### Chores + +* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([fe99db5](https://github.com/orbcorp/orb-python/commit/fe99db5c9904f9a83fe60cf6738316226510d839)) + ## 4.43.1 (2025-11-27) Full Changelog: [v4.43.0...v4.43.1](https://github.com/orbcorp/orb-python/compare/v4.43.0...v4.43.1) diff --git a/LICENSE b/LICENSE index 00b1f9c..7434159 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Orb + Copyright 2026 Orb Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 2947856..c1c329d 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ pip install orb-billing[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python +import os import asyncio from orb import DefaultAioHttpClient from orb import AsyncOrb @@ -90,7 +91,7 @@ from orb import AsyncOrb async def main() -> None: async with AsyncOrb( - api_key="My API Key", + api_key=os.environ.get("ORB_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: customer = await client.customers.create( diff --git a/api.md b/api.md index 5081e82..b50a14f 100644 --- a/api.md +++ b/api.md @@ -389,7 +389,11 @@ Methods: Types: ```python -from orb.types import InvoiceFetchUpcomingResponse +from orb.types import ( + InvoiceFetchUpcomingResponse, + InvoiceIssueSummaryResponse, + InvoiceListSummaryResponse, +) ``` Methods: @@ -397,9 +401,12 @@ Methods: - client.invoices.create(\*\*params) -> Invoice - client.invoices.update(invoice_id, \*\*params) -> Invoice - client.invoices.list(\*\*params) -> SyncPage[Invoice] +- client.invoices.delete_line_item(line_item_id, \*, invoice_id) -> None - client.invoices.fetch(invoice_id) -> Invoice - client.invoices.fetch_upcoming(\*\*params) -> InvoiceFetchUpcomingResponse - client.invoices.issue(invoice_id, \*\*params) -> Invoice +- client.invoices.issue_summary(invoice_id, \*\*params) -> InvoiceIssueSummaryResponse +- client.invoices.list_summary(\*\*params) -> SyncPage[InvoiceListSummaryResponse] - client.invoices.mark_paid(invoice_id, \*\*params) -> Invoice - client.invoices.pay(invoice_id) -> Invoice - client.invoices.void(invoice_id) -> Invoice @@ -457,6 +464,24 @@ Methods: - client.plans.external_plan_id.update(other_external_plan_id, \*\*params) -> Plan - client.plans.external_plan_id.fetch(external_plan_id) -> Plan +## Migrations + +Types: + +```python +from orb.types.plans import ( + MigrationRetrieveResponse, + MigrationListResponse, + MigrationCancelResponse, +) +``` + +Methods: + +- client.plans.migrations.retrieve(migration_id, \*, plan_id) -> MigrationRetrieveResponse +- client.plans.migrations.list(plan_id, \*\*params) -> SyncPage[MigrationListResponse] +- client.plans.migrations.cancel(migration_id, \*, plan_id) -> MigrationCancelResponse + # Prices Types: @@ -603,6 +628,7 @@ Types: from orb.types import ( MutatedSubscription, SubscriptionChangeRetrieveResponse, + SubscriptionChangeListResponse, SubscriptionChangeApplyResponse, SubscriptionChangeCancelResponse, ) @@ -611,5 +637,85 @@ from orb.types import ( Methods: - client.subscription_changes.retrieve(subscription_change_id) -> SubscriptionChangeRetrieveResponse +- client.subscription_changes.list(\*\*params) -> SyncPage[SubscriptionChangeListResponse] - client.subscription_changes.apply(subscription_change_id, \*\*params) -> SubscriptionChangeApplyResponse - client.subscription_changes.cancel(subscription_change_id) -> SubscriptionChangeCancelResponse + +# CreditBlocks + +Types: + +```python +from orb.types import CreditBlockRetrieveResponse, CreditBlockListInvoicesResponse +``` + +Methods: + +- client.credit_blocks.retrieve(block_id) -> CreditBlockRetrieveResponse +- client.credit_blocks.delete(block_id) -> None +- client.credit_blocks.list_invoices(block_id) -> CreditBlockListInvoicesResponse + +# LicenseTypes + +Types: + +```python +from orb.types import ( + LicenseTypeCreateResponse, + LicenseTypeRetrieveResponse, + LicenseTypeListResponse, +) +``` + +Methods: + +- client.license_types.create(\*\*params) -> LicenseTypeCreateResponse +- client.license_types.retrieve(license_type_id) -> LicenseTypeRetrieveResponse +- client.license_types.list(\*\*params) -> SyncPage[LicenseTypeListResponse] + +# Licenses + +Types: + +```python +from orb.types import ( + LicenseCreateResponse, + LicenseRetrieveResponse, + LicenseListResponse, + LicenseDeactivateResponse, + LicenseRetrieveByExternalIDResponse, +) +``` + +Methods: + +- client.licenses.create(\*\*params) -> LicenseCreateResponse +- client.licenses.retrieve(license_id) -> LicenseRetrieveResponse +- client.licenses.list(\*\*params) -> SyncPage[LicenseListResponse] +- client.licenses.deactivate(license_id, \*\*params) -> LicenseDeactivateResponse +- client.licenses.retrieve_by_external_id(external_license_id, \*\*params) -> LicenseRetrieveByExternalIDResponse + +## ExternalLicenses + +Types: + +```python +from orb.types.licenses import ExternalLicenseGetUsageResponse +``` + +Methods: + +- client.licenses.external_licenses.get_usage(external_license_id, \*\*params) -> ExternalLicenseGetUsageResponse + +## Usage + +Types: + +```python +from orb.types.licenses import UsageGetAllUsageResponse, UsageGetUsageResponse +``` + +Methods: + +- client.licenses.usage.get_all_usage(\*\*params) -> UsageGetAllUsageResponse +- client.licenses.usage.get_usage(license_id, \*\*params) -> UsageGetUsageResponse diff --git a/pyproject.toml b/pyproject.toml index 77f0722..454a137 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,22 @@ [project] name = "orb_sdk" -version = "4.43.1" +version = "4.55.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" authors = [ { name = "Orb", email = "team@withorb.com" }, ] + dependencies = [ - "httpx>=0.23.0, <1", - "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", - "anyio>=3.5.0, <5", - "distro>=1.7.0, <2", - "sniffio", + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.10, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", ] + requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", @@ -46,7 +48,7 @@ managed = true # version pins are in requirements-dev.lock dev-dependencies = [ "pyright==1.1.399", - "mypy", + "mypy==1.17", "respx", "pytest", "pytest-asyncio", @@ -67,7 +69,7 @@ format = { chain = [ # run formatting again to fix any inconsistencies when imports are stripped "format:ruff", ]} -"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" +"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'" "format:ruff" = "ruff format" "lint" = { chain = [ @@ -239,6 +241,8 @@ select = [ "TID251", ] ignore = [ + # import sorting - disabled because orb->orb_sdk rename changes sort order + "I001", # mutable defaults "B006", # import sorting - disabled because orb->orb_sdk rename changes sort order diff --git a/requirements-dev.lock b/requirements-dev.lock index 637ed60..d92f7a5 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,40 +12,45 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.3 # via httpx-aiohttp # via orb-billing -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.1 # via httpx # via orb-billing -argcomplete==3.1.2 +argcomplete==3.6.3 # via nox async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 + # via nox +backports-asyncio-runner==1.2.0 + # via pytest-asyncio +certifi==2026.1.4 # via httpcore # via httpx -colorlog==6.7.0 +colorlog==6.10.1 + # via nox +dependency-groups==1.3.1 # via nox -dirty-equals==0.6.0 -distlib==0.3.7 +dirty-equals==0.11 +distlib==0.4.0 # via virtualenv -distro==1.8.0 +distro==1.9.0 # via orb-billing -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio # via pytest -execnet==2.1.1 +execnet==2.1.2 # via pytest-xdist -filelock==3.12.4 +filelock==3.19.1 # via virtualenv -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -56,82 +61,89 @@ httpx==0.28.1 # via httpx-aiohttp # via orb-billing # via respx -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via orb-billing -idna==3.4 +humanize==4.13.0 + # via nox +idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==7.0.0 -iniconfig==2.0.0 +importlib-metadata==8.7.1 +iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -mypy==1.14.1 -mypy-extensions==1.0.0 +mypy==1.17.0 +mypy-extensions==1.1.0 # via mypy -nodeenv==1.8.0 +nodeenv==1.10.0 # via pyright -nox==2023.4.22 -packaging==23.2 +nox==2025.11.12 +packaging==25.0 + # via dependency-groups # via nox # via pytest -platformdirs==3.11.0 +pathspec==1.0.3 + # via mypy +platformdirs==4.4.0 # via virtualenv -pluggy==1.5.0 +pluggy==1.6.0 # via pytest -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via orb-billing -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -pygments==2.18.0 +pygments==2.19.2 + # via pytest # via rich pyright==1.1.399 -pytest==8.3.3 +pytest==8.4.2 # via pytest-asyncio # via pytest-xdist -pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.8.2 +pytest-asyncio==1.2.0 +pytest-xdist==3.8.0 +python-dateutil==2.9.0.post0 # via time-machine -pytz==2023.3.post1 - # via dirty-equals respx==0.22.0 -rich==13.7.1 -ruff==0.9.4 -setuptools==68.2.2 - # via nodeenv -six==1.16.0 +rich==14.2.0 +ruff==0.14.13 +six==1.17.0 # via python-dateutil -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via orb-billing -time-machine==2.9.0 -tomli==2.0.2 +time-machine==2.19.0 +tomli==2.4.0 + # via dependency-groups # via mypy + # via nox # via pytest -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via multidict # via mypy # via orb-billing # via pydantic # via pydantic-core # via pyright + # via pytest-asyncio # via typing-inspection -typing-inspection==0.4.1 + # via virtualenv +typing-inspection==0.4.2 # via pydantic -virtualenv==20.24.5 +virtualenv==20.36.1 # via nox -yarl==1.20.0 +yarl==1.22.0 # via aiohttp -zipp==3.17.0 +zipp==3.23.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index a71568f..57cb0bc 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,28 +12,28 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.3 # via httpx-aiohttp # via orb-billing -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.1 # via httpx # via orb-billing async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 +certifi==2026.1.4 # via httpcore # via httpx -distro==1.8.0 +distro==1.9.0 # via orb-billing -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -43,33 +43,34 @@ httpcore==1.0.9 httpx==0.28.1 # via httpx-aiohttp # via orb-billing -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via orb-billing -idna==3.4 +idna==3.11 # via anyio # via httpx # via yarl -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via orb-billing -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via orb-billing -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via multidict # via orb-billing # via pydantic # via pydantic-core # via typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic -yarl==1.20.0 +yarl==1.22.0 # via aiohttp diff --git a/scripts/lint b/scripts/lint index ee17e57..4887a27 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,13 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running lints" -rye run lint +if [ "$1" = "--fix" ]; then + echo "==> Running lints with --fix" + rye run fix:ruff +else + echo "==> Running lints" + rye run lint +fi echo "==> Making sure it imports" rye run python -c 'import orb_sdk' diff --git a/src/orb_sdk/_base_client.py b/src/orb_sdk/_base_client.py index 57fd87d..80ec2d7 100644 --- a/src/orb_sdk/_base_client.py +++ b/src/orb_sdk/_base_client.py @@ -9,6 +9,7 @@ import inspect import logging import platform +import warnings import email.utils from types import TracebackType from random import random @@ -51,9 +52,11 @@ ResponseT, AnyMapping, PostParser, + BinaryTypes, RequestFiles, HttpxSendArgs, RequestOptions, + AsyncBinaryTypes, HttpxRequestFiles, ModelBuilderProtocol, not_given, @@ -83,6 +86,7 @@ APIConnectionError, APIResponseValidationError, ) +from ._utils._json import openapi_dumps from ._legacy_response import LegacyAPIResponse log: logging.Logger = logging.getLogger(__name__) @@ -478,8 +482,19 @@ def _build_request( retries_taken: int = 0, ) -> httpx.Request: if log.isEnabledFor(logging.DEBUG): - log.debug("Request options: %s", model_dump(options, exclude_unset=True)) - + log.debug( + "Request options: %s", + model_dump( + options, + exclude_unset=True, + # Pydantic v1 can't dump every type we support in content, so we exclude it for now. + exclude={ + "content", + } + if PYDANTIC_V1 + else {}, + ), + ) kwargs: dict[str, Any] = {} json_data = options.json_data @@ -533,10 +548,18 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - if isinstance(json_data, bytes): + if options.content is not None and json_data is not None: + raise TypeError("Passing both `content` and `json_data` is not supported") + if options.content is not None and files is not None: + raise TypeError("Passing both `content` and `files` is not supported") + if options.content is not None: + kwargs["content"] = options.content + elif isinstance(json_data, bytes): kwargs["content"] = json_data - else: - kwargs["json"] = json_data if is_given(json_data) else None + elif not files: + # Don't set content when JSON is sent as multipart/form-data, + # since httpx's content param overrides other body arguments + kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None kwargs["files"] = files else: headers.pop("Content-Type", None) @@ -1209,6 +1232,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[False] = False, @@ -1221,6 +1245,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[True], @@ -1234,6 +1259,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool, @@ -1246,13 +1272,25 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool = False, stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=to_httpx_files(files), **options + method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) @@ -1262,9 +1300,24 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1273,11 +1326,23 @@ def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=to_httpx_files(files), **options + method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return self.request(cast_to, opts) @@ -1287,9 +1352,19 @@ def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return self.request(cast_to, opts) def get_api_list( @@ -1743,6 +1818,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[False] = False, @@ -1755,6 +1831,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[True], @@ -1768,6 +1845,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool, @@ -1780,13 +1858,25 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool = False, stream_cls: type[_AsyncStreamT] | None = None, ) -> ResponseT | _AsyncStreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) @@ -1796,9 +1886,29 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct( + method="patch", + url=path, + json_data=body, + content=content, + files=await async_to_httpx_files(files), + **options, + ) return await self.request(cast_to, opts) async def put( @@ -1807,11 +1917,23 @@ async def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) @@ -1821,9 +1943,19 @@ async def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return await self.request(cast_to, opts) def get_api_list( diff --git a/src/orb_sdk/_client.py b/src/orb_sdk/_client.py index 988bde1..d1f4078 100644 --- a/src/orb_sdk/_client.py +++ b/src/orb_sdk/_client.py @@ -46,9 +46,12 @@ metrics, invoices, webhooks, + licenses, customers, top_level, credit_notes, + credit_blocks, + license_types, subscriptions, invoice_line_items, subscription_changes, @@ -62,10 +65,13 @@ from .resources.top_level import TopLevel, AsyncTopLevel from .resources.plans.plans import Plans, AsyncPlans from .resources.credit_notes import CreditNotes, AsyncCreditNotes + from .resources.credit_blocks import CreditBlocks, AsyncCreditBlocks from .resources.events.events import Events, AsyncEvents + from .resources.license_types import LicenseTypes, AsyncLicenseTypes from .resources.prices.prices import Prices, AsyncPrices from .resources.subscriptions import Subscriptions, AsyncSubscriptions from .resources.coupons.coupons import Coupons, AsyncCoupons + from .resources.licenses.licenses import Licenses, AsyncLicenses from .resources.invoice_line_items import InvoiceLineItems, AsyncInvoiceLineItems from .resources.customers.customers import Customers, AsyncCustomers from .resources.subscription_changes import SubscriptionChanges, AsyncSubscriptionChanges @@ -244,6 +250,24 @@ def webhooks(self) -> webhooks.Webhooks: return Webhooks(self) + @cached_property + def credit_blocks(self) -> CreditBlocks: + from .resources.credit_blocks import CreditBlocks + + return CreditBlocks(self) + + @cached_property + def license_types(self) -> LicenseTypes: + from .resources.license_types import LicenseTypes + + return LicenseTypes(self) + + @cached_property + def licenses(self) -> Licenses: + from .resources.licenses import Licenses + + return Licenses(self) + @cached_property def with_raw_response(self) -> OrbWithRawResponse: return OrbWithRawResponse(self) @@ -574,6 +598,24 @@ def webhooks(self) -> webhooks.AsyncWebhooks: return AsyncWebhooks(self) + @cached_property + def credit_blocks(self) -> AsyncCreditBlocks: + from .resources.credit_blocks import AsyncCreditBlocks + + return AsyncCreditBlocks(self) + + @cached_property + def license_types(self) -> AsyncLicenseTypes: + from .resources.license_types import AsyncLicenseTypes + + return AsyncLicenseTypes(self) + + @cached_property + def licenses(self) -> AsyncLicenses: + from .resources.licenses import AsyncLicenses + + return AsyncLicenses(self) + @cached_property def with_raw_response(self) -> AsyncOrbWithRawResponse: return AsyncOrbWithRawResponse(self) @@ -839,6 +881,24 @@ def subscription_changes(self) -> subscription_changes.SubscriptionChangesWithRa return SubscriptionChangesWithRawResponse(self._client.subscription_changes) + @cached_property + def credit_blocks(self) -> credit_blocks.CreditBlocksWithRawResponse: + from .resources.credit_blocks import CreditBlocksWithRawResponse + + return CreditBlocksWithRawResponse(self._client.credit_blocks) + + @cached_property + def license_types(self) -> license_types.LicenseTypesWithRawResponse: + from .resources.license_types import LicenseTypesWithRawResponse + + return LicenseTypesWithRawResponse(self._client.license_types) + + @cached_property + def licenses(self) -> licenses.LicensesWithRawResponse: + from .resources.licenses import LicensesWithRawResponse + + return LicensesWithRawResponse(self._client.licenses) + class AsyncOrbWithRawResponse: _client: AsyncOrb @@ -942,6 +1002,24 @@ def subscription_changes(self) -> subscription_changes.AsyncSubscriptionChangesW return AsyncSubscriptionChangesWithRawResponse(self._client.subscription_changes) + @cached_property + def credit_blocks(self) -> credit_blocks.AsyncCreditBlocksWithRawResponse: + from .resources.credit_blocks import AsyncCreditBlocksWithRawResponse + + return AsyncCreditBlocksWithRawResponse(self._client.credit_blocks) + + @cached_property + def license_types(self) -> license_types.AsyncLicenseTypesWithRawResponse: + from .resources.license_types import AsyncLicenseTypesWithRawResponse + + return AsyncLicenseTypesWithRawResponse(self._client.license_types) + + @cached_property + def licenses(self) -> licenses.AsyncLicensesWithRawResponse: + from .resources.licenses import AsyncLicensesWithRawResponse + + return AsyncLicensesWithRawResponse(self._client.licenses) + class OrbWithStreamedResponse: _client: Orb @@ -1045,6 +1123,24 @@ def subscription_changes(self) -> subscription_changes.SubscriptionChangesWithSt return SubscriptionChangesWithStreamingResponse(self._client.subscription_changes) + @cached_property + def credit_blocks(self) -> credit_blocks.CreditBlocksWithStreamingResponse: + from .resources.credit_blocks import CreditBlocksWithStreamingResponse + + return CreditBlocksWithStreamingResponse(self._client.credit_blocks) + + @cached_property + def license_types(self) -> license_types.LicenseTypesWithStreamingResponse: + from .resources.license_types import LicenseTypesWithStreamingResponse + + return LicenseTypesWithStreamingResponse(self._client.license_types) + + @cached_property + def licenses(self) -> licenses.LicensesWithStreamingResponse: + from .resources.licenses import LicensesWithStreamingResponse + + return LicensesWithStreamingResponse(self._client.licenses) + class AsyncOrbWithStreamedResponse: _client: AsyncOrb @@ -1148,6 +1244,24 @@ def subscription_changes(self) -> subscription_changes.AsyncSubscriptionChangesW return AsyncSubscriptionChangesWithStreamingResponse(self._client.subscription_changes) + @cached_property + def credit_blocks(self) -> credit_blocks.AsyncCreditBlocksWithStreamingResponse: + from .resources.credit_blocks import AsyncCreditBlocksWithStreamingResponse + + return AsyncCreditBlocksWithStreamingResponse(self._client.credit_blocks) + + @cached_property + def license_types(self) -> license_types.AsyncLicenseTypesWithStreamingResponse: + from .resources.license_types import AsyncLicenseTypesWithStreamingResponse + + return AsyncLicenseTypesWithStreamingResponse(self._client.license_types) + + @cached_property + def licenses(self) -> licenses.AsyncLicensesWithStreamingResponse: + from .resources.licenses import AsyncLicensesWithStreamingResponse + + return AsyncLicensesWithStreamingResponse(self._client.licenses) + Client = Orb diff --git a/src/orb_sdk/_compat.py b/src/orb_sdk/_compat.py index bdef67f..786ff42 100644 --- a/src/orb_sdk/_compat.py +++ b/src/orb_sdk/_compat.py @@ -139,6 +139,7 @@ def model_dump( exclude_defaults: bool = False, warnings: bool = True, mode: Literal["json", "python"] = "python", + by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( @@ -148,13 +149,12 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, + by_alias=by_alias, ) return cast( "dict[str, Any]", model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - exclude=exclude, - exclude_unset=exclude_unset, - exclude_defaults=exclude_defaults, + exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias) ), ) diff --git a/src/orb_sdk/_models.py b/src/orb_sdk/_models.py index ca9500b..29070e0 100644 --- a/src/orb_sdk/_models.py +++ b/src/orb_sdk/_models.py @@ -3,7 +3,20 @@ import os import inspect import weakref -from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast +from typing import ( + IO, + TYPE_CHECKING, + Any, + Type, + Union, + Generic, + TypeVar, + Callable, + Iterable, + Optional, + AsyncIterable, + cast, +) from datetime import date, datetime from typing_extensions import ( List, @@ -787,6 +800,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): timeout: float | Timeout | None files: HttpxRequestFiles | None idempotency_key: str + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] json_data: Body extra_json: AnyMapping follow_redirects: bool @@ -805,6 +819,7 @@ class FinalRequestOptions(pydantic.BaseModel): post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() follow_redirects: Union[bool, None] = None + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] = None # It should be noted that we cannot use `json` here as that would override # a BaseModel method in an incompatible fashion. json_data: Union[Body, None] = None diff --git a/src/orb_sdk/_types.py b/src/orb_sdk/_types.py index 7d823cb..3b284fa 100644 --- a/src/orb_sdk/_types.py +++ b/src/orb_sdk/_types.py @@ -13,9 +13,11 @@ Mapping, TypeVar, Callable, + Iterable, Iterator, Optional, Sequence, + AsyncIterable, ) from typing_extensions import ( Set, @@ -57,6 +59,13 @@ else: Base64FileInput = Union[IO[bytes], PathLike] FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. + + +# Used for sending raw binary data / streaming data in request bodies +# e.g. for file uploads without multipart encoding +BinaryTypes = Union[bytes, bytearray, IO[bytes], Iterable[bytes]] +AsyncBinaryTypes = Union[bytes, bytearray, IO[bytes], AsyncIterable[bytes]] + FileTypes = Union[ # file (or bytes) FileContent, @@ -245,6 +254,9 @@ class HttpxSendArgs(TypedDict, total=False): if TYPE_CHECKING: # This works because str.__contains__ does not accept object (either in typeshed or at runtime) # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + # + # Note: index() and count() methods are intentionally omitted to allow pyright to properly + # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr. class SequenceNotStr(Protocol[_T_co]): @overload def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... @@ -253,8 +265,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... def __contains__(self, value: object, /) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T_co]: ... - def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... - def count(self, value: Any, /) -> int: ... def __reversed__(self) -> Iterator[_T_co]: ... else: # just point this to a normal `Sequence` at runtime to avoid having to special case diff --git a/src/orb_sdk/_utils/_compat.py b/src/orb_sdk/_utils/_compat.py index dd70323..2c70b29 100644 --- a/src/orb_sdk/_utils/_compat.py +++ b/src/orb_sdk/_utils/_compat.py @@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool: else: import types - return tp is Union or tp is types.UnionType + return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap] def is_typeddict(tp: Type[Any]) -> bool: diff --git a/src/orb_sdk/_utils/_json.py b/src/orb_sdk/_utils/_json.py new file mode 100644 index 0000000..6058421 --- /dev/null +++ b/src/orb_sdk/_utils/_json.py @@ -0,0 +1,35 @@ +import json +from typing import Any +from datetime import datetime +from typing_extensions import override + +import pydantic + +from .._compat import model_dump + + +def openapi_dumps(obj: Any) -> bytes: + """ + Serialize an object to UTF-8 encoded JSON bytes. + + Extends the standard json.dumps with support for additional types + commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc. + """ + return json.dumps( + obj, + cls=_CustomEncoder, + # Uses the same defaults as httpx's JSON serialization + ensure_ascii=False, + separators=(",", ":"), + allow_nan=False, + ).encode() + + +class _CustomEncoder(json.JSONEncoder): + @override + def default(self, o: Any) -> Any: + if isinstance(o, datetime): + return o.isoformat() + if isinstance(o, pydantic.BaseModel): + return model_dump(o, exclude_unset=True, mode="json", by_alias=True) + return super().default(o) diff --git a/src/orb_sdk/_version.py b/src/orb_sdk/_version.py index 3274afc..0b43c07 100644 --- a/src/orb_sdk/_version.py +++ b/src/orb_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "orb_sdk" -__version__ = "4.43.1" # x-release-please-version +__version__ = "4.55.0" # x-release-please-version diff --git a/src/orb_sdk/resources/__init__.py b/src/orb_sdk/resources/__init__.py index 09ab61d..09c6d23 100644 --- a/src/orb_sdk/resources/__init__.py +++ b/src/orb_sdk/resources/__init__.py @@ -76,6 +76,14 @@ Webhooks, AsyncWebhooks, ) +from .licenses import ( + Licenses, + AsyncLicenses, + LicensesWithRawResponse, + AsyncLicensesWithRawResponse, + LicensesWithStreamingResponse, + AsyncLicensesWithStreamingResponse, +) from .customers import ( Customers, AsyncCustomers, @@ -100,6 +108,22 @@ CreditNotesWithStreamingResponse, AsyncCreditNotesWithStreamingResponse, ) +from .credit_blocks import ( + CreditBlocks, + AsyncCreditBlocks, + CreditBlocksWithRawResponse, + AsyncCreditBlocksWithRawResponse, + CreditBlocksWithStreamingResponse, + AsyncCreditBlocksWithStreamingResponse, +) +from .license_types import ( + LicenseTypes, + AsyncLicenseTypes, + LicenseTypesWithRawResponse, + AsyncLicenseTypesWithRawResponse, + LicenseTypesWithStreamingResponse, + AsyncLicenseTypesWithStreamingResponse, +) from .subscriptions import ( Subscriptions, AsyncSubscriptions, @@ -232,4 +256,22 @@ "AsyncSubscriptionChangesWithRawResponse", "SubscriptionChangesWithStreamingResponse", "AsyncSubscriptionChangesWithStreamingResponse", + "CreditBlocks", + "AsyncCreditBlocks", + "CreditBlocksWithRawResponse", + "AsyncCreditBlocksWithRawResponse", + "CreditBlocksWithStreamingResponse", + "AsyncCreditBlocksWithStreamingResponse", + "LicenseTypes", + "AsyncLicenseTypes", + "LicenseTypesWithRawResponse", + "AsyncLicenseTypesWithRawResponse", + "LicenseTypesWithStreamingResponse", + "AsyncLicenseTypesWithStreamingResponse", + "Licenses", + "AsyncLicenses", + "LicensesWithRawResponse", + "AsyncLicensesWithRawResponse", + "LicensesWithStreamingResponse", + "AsyncLicensesWithStreamingResponse", ] diff --git a/src/orb_sdk/resources/credit_blocks.py b/src/orb_sdk/resources/credit_blocks.py new file mode 100644 index 0000000..dbba382 --- /dev/null +++ b/src/orb_sdk/resources/credit_blocks.py @@ -0,0 +1,386 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from .. import _legacy_response +from .._types import Body, Query, Headers, NoneType, NotGiven, not_given +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from .._base_client import make_request_options +from ..types.credit_block_retrieve_response import CreditBlockRetrieveResponse +from ..types.credit_block_list_invoices_response import CreditBlockListInvoicesResponse + +__all__ = ["CreditBlocks", "AsyncCreditBlocks"] + + +class CreditBlocks(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CreditBlocksWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return CreditBlocksWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CreditBlocksWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return CreditBlocksWithStreamingResponse(self) + + def retrieve( + self, + block_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CreditBlockRetrieveResponse: + """ + This endpoint returns a credit block identified by its block_id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not block_id: + raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}") + return self._get( + f"/credit_blocks/{block_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CreditBlockRetrieveResponse, + ) + + def delete( + self, + block_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> None: + """ + This endpoint deletes a credit block by its ID. + + When a credit block is deleted: + + - The block is removed from the customer's credit ledger. + - Any usage of the credit block is reversed, and the ledger is replayed as if + the block never existed. + - If invoices were generated from the purchase of the credit block, they will be + deleted if in draft status, voided if issued, or a credit note will be issued + if the invoice is paid. + + + Issued invoices that had credits applied from this block will not be regenerated, but the ledger will + reflect the state as if credits from the deleted block were never applied. + + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not block_id: + raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/credit_blocks/{block_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NoneType, + ) + + def list_invoices( + self, + block_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CreditBlockListInvoicesResponse: + """ + This endpoint returns the credit block and its associated purchasing invoices. + + If a credit block was purchased (as opposed to being manually added or allocated + from a subscription), this endpoint returns the invoices that were created to + charge the customer for the credit block. For credit blocks with payment + schedules spanning multiple periods (e.g., monthly payments over 12 months), + multiple invoices will be returned. + + If the credit block was not purchased (e.g., manual increment, allocation), an + empty invoices list is returned. + + **Note: This endpoint is currently experimental and its interface may change in + future releases. Please contact support before building production integrations + against this endpoint.** + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not block_id: + raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}") + return self._get( + f"/credit_blocks/{block_id}/invoices", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CreditBlockListInvoicesResponse, + ) + + +class AsyncCreditBlocks(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCreditBlocksWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return AsyncCreditBlocksWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCreditBlocksWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return AsyncCreditBlocksWithStreamingResponse(self) + + async def retrieve( + self, + block_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CreditBlockRetrieveResponse: + """ + This endpoint returns a credit block identified by its block_id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not block_id: + raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}") + return await self._get( + f"/credit_blocks/{block_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CreditBlockRetrieveResponse, + ) + + async def delete( + self, + block_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> None: + """ + This endpoint deletes a credit block by its ID. + + When a credit block is deleted: + + - The block is removed from the customer's credit ledger. + - Any usage of the credit block is reversed, and the ledger is replayed as if + the block never existed. + - If invoices were generated from the purchase of the credit block, they will be + deleted if in draft status, voided if issued, or a credit note will be issued + if the invoice is paid. + + + Issued invoices that had credits applied from this block will not be regenerated, but the ledger will + reflect the state as if credits from the deleted block were never applied. + + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not block_id: + raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/credit_blocks/{block_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NoneType, + ) + + async def list_invoices( + self, + block_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CreditBlockListInvoicesResponse: + """ + This endpoint returns the credit block and its associated purchasing invoices. + + If a credit block was purchased (as opposed to being manually added or allocated + from a subscription), this endpoint returns the invoices that were created to + charge the customer for the credit block. For credit blocks with payment + schedules spanning multiple periods (e.g., monthly payments over 12 months), + multiple invoices will be returned. + + If the credit block was not purchased (e.g., manual increment, allocation), an + empty invoices list is returned. + + **Note: This endpoint is currently experimental and its interface may change in + future releases. Please contact support before building production integrations + against this endpoint.** + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not block_id: + raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}") + return await self._get( + f"/credit_blocks/{block_id}/invoices", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CreditBlockListInvoicesResponse, + ) + + +class CreditBlocksWithRawResponse: + def __init__(self, credit_blocks: CreditBlocks) -> None: + self._credit_blocks = credit_blocks + + self.retrieve = _legacy_response.to_raw_response_wrapper( + credit_blocks.retrieve, + ) + self.delete = _legacy_response.to_raw_response_wrapper( + credit_blocks.delete, + ) + self.list_invoices = _legacy_response.to_raw_response_wrapper( + credit_blocks.list_invoices, + ) + + +class AsyncCreditBlocksWithRawResponse: + def __init__(self, credit_blocks: AsyncCreditBlocks) -> None: + self._credit_blocks = credit_blocks + + self.retrieve = _legacy_response.async_to_raw_response_wrapper( + credit_blocks.retrieve, + ) + self.delete = _legacy_response.async_to_raw_response_wrapper( + credit_blocks.delete, + ) + self.list_invoices = _legacy_response.async_to_raw_response_wrapper( + credit_blocks.list_invoices, + ) + + +class CreditBlocksWithStreamingResponse: + def __init__(self, credit_blocks: CreditBlocks) -> None: + self._credit_blocks = credit_blocks + + self.retrieve = to_streamed_response_wrapper( + credit_blocks.retrieve, + ) + self.delete = to_streamed_response_wrapper( + credit_blocks.delete, + ) + self.list_invoices = to_streamed_response_wrapper( + credit_blocks.list_invoices, + ) + + +class AsyncCreditBlocksWithStreamingResponse: + def __init__(self, credit_blocks: AsyncCreditBlocks) -> None: + self._credit_blocks = credit_blocks + + self.retrieve = async_to_streamed_response_wrapper( + credit_blocks.retrieve, + ) + self.delete = async_to_streamed_response_wrapper( + credit_blocks.delete, + ) + self.list_invoices = async_to_streamed_response_wrapper( + credit_blocks.list_invoices, + ) diff --git a/src/orb_sdk/resources/customers/credits/credits.py b/src/orb_sdk/resources/customers/credits/credits.py index b0df1ee..bd4f7c3 100644 --- a/src/orb_sdk/resources/customers/credits/credits.py +++ b/src/orb_sdk/resources/customers/credits/credits.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import Optional +from typing import Union, Optional +from datetime import datetime import httpx @@ -71,6 +72,10 @@ def list( *, currency: Optional[str] | Omit = omit, cursor: Optional[str] | Omit = omit, + effective_date_gt: Union[str, datetime, None] | Omit = omit, + effective_date_gte: Union[str, datetime, None] | Omit = omit, + effective_date_lt: Union[str, datetime, None] | Omit = omit, + effective_date_lte: Union[str, datetime, None] | Omit = omit, include_all_blocks: bool | Omit = omit, limit: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -89,6 +94,11 @@ def list( Note that `currency` defaults to credits if not specified. To use a real world currency, set `currency` to an ISO 4217 string. + Results can be filtered by the block's `effective_date` using the + `effective_date[gte]`, `effective_date[gt]`, `effective_date[lt]`, and + `effective_date[lte]` query parameters. This filters on when the credit block + becomes effective, which may differ from creation time for backdated credits. + Args: currency: The ledger currency or custom pricing unit to use. @@ -122,6 +132,10 @@ def list( { "currency": currency, "cursor": cursor, + "effective_date_gt": effective_date_gt, + "effective_date_gte": effective_date_gte, + "effective_date_lt": effective_date_lt, + "effective_date_lte": effective_date_lte, "include_all_blocks": include_all_blocks, "limit": limit, }, @@ -137,6 +151,10 @@ def list_by_external_id( *, currency: Optional[str] | Omit = omit, cursor: Optional[str] | Omit = omit, + effective_date_gt: Union[str, datetime, None] | Omit = omit, + effective_date_gte: Union[str, datetime, None] | Omit = omit, + effective_date_lt: Union[str, datetime, None] | Omit = omit, + effective_date_lte: Union[str, datetime, None] | Omit = omit, include_all_blocks: bool | Omit = omit, limit: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -155,6 +173,11 @@ def list_by_external_id( Note that `currency` defaults to credits if not specified. To use a real world currency, set `currency` to an ISO 4217 string. + Results can be filtered by the block's `effective_date` using the + `effective_date[gte]`, `effective_date[gt]`, `effective_date[lt]`, and + `effective_date[lte]` query parameters. This filters on when the credit block + becomes effective, which may differ from creation time for backdated credits. + Args: currency: The ledger currency or custom pricing unit to use. @@ -190,6 +213,10 @@ def list_by_external_id( { "currency": currency, "cursor": cursor, + "effective_date_gt": effective_date_gt, + "effective_date_gte": effective_date_gte, + "effective_date_lt": effective_date_lt, + "effective_date_lte": effective_date_lte, "include_all_blocks": include_all_blocks, "limit": limit, }, @@ -234,6 +261,10 @@ def list( *, currency: Optional[str] | Omit = omit, cursor: Optional[str] | Omit = omit, + effective_date_gt: Union[str, datetime, None] | Omit = omit, + effective_date_gte: Union[str, datetime, None] | Omit = omit, + effective_date_lt: Union[str, datetime, None] | Omit = omit, + effective_date_lte: Union[str, datetime, None] | Omit = omit, include_all_blocks: bool | Omit = omit, limit: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -252,6 +283,11 @@ def list( Note that `currency` defaults to credits if not specified. To use a real world currency, set `currency` to an ISO 4217 string. + Results can be filtered by the block's `effective_date` using the + `effective_date[gte]`, `effective_date[gt]`, `effective_date[lt]`, and + `effective_date[lte]` query parameters. This filters on when the credit block + becomes effective, which may differ from creation time for backdated credits. + Args: currency: The ledger currency or custom pricing unit to use. @@ -285,6 +321,10 @@ def list( { "currency": currency, "cursor": cursor, + "effective_date_gt": effective_date_gt, + "effective_date_gte": effective_date_gte, + "effective_date_lt": effective_date_lt, + "effective_date_lte": effective_date_lte, "include_all_blocks": include_all_blocks, "limit": limit, }, @@ -300,6 +340,10 @@ def list_by_external_id( *, currency: Optional[str] | Omit = omit, cursor: Optional[str] | Omit = omit, + effective_date_gt: Union[str, datetime, None] | Omit = omit, + effective_date_gte: Union[str, datetime, None] | Omit = omit, + effective_date_lt: Union[str, datetime, None] | Omit = omit, + effective_date_lte: Union[str, datetime, None] | Omit = omit, include_all_blocks: bool | Omit = omit, limit: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -318,6 +362,11 @@ def list_by_external_id( Note that `currency` defaults to credits if not specified. To use a real world currency, set `currency` to an ISO 4217 string. + Results can be filtered by the block's `effective_date` using the + `effective_date[gte]`, `effective_date[gt]`, `effective_date[lt]`, and + `effective_date[lte]` query parameters. This filters on when the credit block + becomes effective, which may differ from creation time for backdated credits. + Args: currency: The ledger currency or custom pricing unit to use. @@ -353,6 +402,10 @@ def list_by_external_id( { "currency": currency, "cursor": cursor, + "effective_date_gt": effective_date_gt, + "effective_date_gte": effective_date_gte, + "effective_date_lt": effective_date_lt, + "effective_date_lte": effective_date_lte, "include_all_blocks": include_all_blocks, "limit": limit, }, diff --git a/src/orb_sdk/resources/customers/credits/ledger.py b/src/orb_sdk/resources/customers/credits/ledger.py index 2434b9d..4ae2e04 100644 --- a/src/orb_sdk/resources/customers/credits/ledger.py +++ b/src/orb_sdk/resources/customers/credits/ledger.py @@ -110,11 +110,9 @@ def list( As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan configuration. An automated deduction of this type will - result in a ledger entry, also with a starting and ending balance. In order to - provide better tracing capabilities for automatic deductions, Orb always - associates each automatic deduction with the `event_id` at the time of - ingestion, used to pinpoint _why_ credit deduction took place and to ensure that - credits are never deducted without an associated usage event. + result in a ledger entry, also with a starting and ending balance. Each day's + usage for a particular price, invoice, and block will be grouped into a single + entry. By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit block_ first in order to ensure that all credits are utilized @@ -288,7 +286,8 @@ def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -461,7 +460,8 @@ def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -621,7 +621,8 @@ def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -789,7 +790,8 @@ def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -951,7 +953,8 @@ def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -1190,7 +1193,8 @@ def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -1363,7 +1367,8 @@ def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -1523,7 +1528,8 @@ def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -1691,7 +1697,8 @@ def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -1853,7 +1860,8 @@ def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -2076,11 +2084,9 @@ def list_by_external_id( As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan configuration. An automated deduction of this type will - result in a ledger entry, also with a starting and ending balance. In order to - provide better tracing capabilities for automatic deductions, Orb always - associates each automatic deduction with the `event_id` at the time of - ingestion, used to pinpoint _why_ credit deduction took place and to ensure that - credits are never deducted without an associated usage event. + result in a ledger entry, also with a starting and ending balance. Each day's + usage for a particular price, invoice, and block will be grouped into a single + entry. By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit block_ first in order to ensure that all credits are utilized @@ -2261,11 +2267,9 @@ def list( As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan configuration. An automated deduction of this type will - result in a ledger entry, also with a starting and ending balance. In order to - provide better tracing capabilities for automatic deductions, Orb always - associates each automatic deduction with the `event_id` at the time of - ingestion, used to pinpoint _why_ credit deduction took place and to ensure that - credits are never deducted without an associated usage event. + result in a ledger entry, also with a starting and ending balance. Each day's + usage for a particular price, invoice, and block will be grouped into a single + entry. By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit block_ first in order to ensure that all credits are utilized @@ -2439,7 +2443,8 @@ async def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -2612,7 +2617,8 @@ async def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -2772,7 +2778,8 @@ async def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -2940,7 +2947,8 @@ async def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -3102,7 +3110,8 @@ async def create_entry( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -3341,7 +3350,8 @@ async def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -3514,7 +3524,8 @@ async def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -3674,7 +3685,8 @@ async def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -3842,7 +3854,8 @@ async def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -4004,7 +4017,8 @@ async def create_entry_by_external_id( also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of - credit units added. + credit units added. Additionally, Orb also enforces invoice generation when a + non-zero `per_unit_cost_basis` value is provided. ## Deducting Credits @@ -4227,11 +4241,9 @@ def list_by_external_id( As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan configuration. An automated deduction of this type will - result in a ledger entry, also with a starting and ending balance. In order to - provide better tracing capabilities for automatic deductions, Orb always - associates each automatic deduction with the `event_id` at the time of - ingestion, used to pinpoint _why_ credit deduction took place and to ensure that - credits are never deducted without an associated usage event. + result in a ledger entry, also with a starting and ending balance. Each day's + usage for a particular price, invoice, and block will be grouped into a single + entry. By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit block_ first in order to ensure that all credits are utilized diff --git a/src/orb_sdk/resources/customers/customers.py b/src/orb_sdk/resources/customers/customers.py index 4c82a67..20ae377 100644 --- a/src/orb_sdk/resources/customers/customers.py +++ b/src/orb_sdk/resources/customers/customers.py @@ -103,6 +103,7 @@ def create( external_customer_id: Optional[str] | Omit = omit, hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, + payment_configuration: Optional[customer_create_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -166,6 +167,9 @@ def create( by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp. @@ -279,6 +283,7 @@ def create( | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -348,6 +353,7 @@ def create( "external_customer_id": external_customer_id, "hierarchy": hierarchy, "metadata": metadata, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -384,6 +390,7 @@ def update( hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, name: Optional[str] | Omit = omit, + payment_configuration: Optional[customer_update_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -439,6 +446,9 @@ def update( name: The full name of the customer + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -556,6 +566,7 @@ def update( | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -623,6 +634,7 @@ def update( "hierarchy": hierarchy, "metadata": metadata, "name": name, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -944,6 +956,7 @@ def update_by_external_id( hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, name: Optional[str] | Omit = omit, + payment_configuration: Optional[customer_update_by_external_id_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -998,6 +1011,9 @@ def update_by_external_id( name: The full name of the customer + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -1115,6 +1131,7 @@ def update_by_external_id( | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -1182,6 +1199,7 @@ def update_by_external_id( "hierarchy": hierarchy, "metadata": metadata, "name": name, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -1249,6 +1267,7 @@ async def create( external_customer_id: Optional[str] | Omit = omit, hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, + payment_configuration: Optional[customer_create_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -1312,6 +1331,9 @@ async def create( by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp. @@ -1425,6 +1447,7 @@ async def create( | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -1494,6 +1517,7 @@ async def create( "external_customer_id": external_customer_id, "hierarchy": hierarchy, "metadata": metadata, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -1530,6 +1554,7 @@ async def update( hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, name: Optional[str] | Omit = omit, + payment_configuration: Optional[customer_update_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -1585,6 +1610,9 @@ async def update( name: The full name of the customer + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -1702,6 +1730,7 @@ async def update( | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -1769,6 +1798,7 @@ async def update( "hierarchy": hierarchy, "metadata": metadata, "name": name, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, @@ -2090,6 +2120,7 @@ async def update_by_external_id( hierarchy: Optional[CustomerHierarchyConfigParam] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, name: Optional[str] | Omit = omit, + payment_configuration: Optional[customer_update_by_external_id_params.PaymentConfiguration] | Omit = omit, payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, @@ -2144,6 +2175,9 @@ async def update_by_external_id( name: The full name of the customer + payment_configuration: Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + payment_provider: This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -2261,6 +2295,7 @@ async def update_by_external_id( | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -2328,6 +2363,7 @@ async def update_by_external_id( "hierarchy": hierarchy, "metadata": metadata, "name": name, + "payment_configuration": payment_configuration, "payment_provider": payment_provider, "payment_provider_id": payment_provider_id, "reporting_configuration": reporting_configuration, diff --git a/src/orb_sdk/resources/invoices.py b/src/orb_sdk/resources/invoices.py index 6ac4f58..6660d1f 100644 --- a/src/orb_sdk/resources/invoices.py +++ b/src/orb_sdk/resources/invoices.py @@ -15,9 +15,11 @@ invoice_create_params, invoice_update_params, invoice_mark_paid_params, + invoice_list_summary_params, + invoice_issue_summary_params, invoice_fetch_upcoming_params, ) -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -26,6 +28,8 @@ from .._base_client import AsyncPaginator, make_request_options from ..types.shared.invoice import Invoice from ..types.shared_params.discount import Discount +from ..types.invoice_list_summary_response import InvoiceListSummaryResponse +from ..types.invoice_issue_summary_response import InvoiceIssueSummaryResponse from ..types.invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse __all__ = ["Invoices", "AsyncInvoices"] @@ -322,6 +326,54 @@ def list( model=Invoice, ) + def delete_line_item( + self, + line_item_id: str, + *, + invoice_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> None: + """ + This endpoint deletes an invoice line item from a draft invoice. + + This endpoint only allows deletion of one-off line items (not subscription-based + line items). The invoice must be in a draft status for this operation to + succeed. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not invoice_id: + raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") + if not line_item_id: + raise ValueError(f"Expected a non-empty value for `line_item_id` but received {line_item_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/invoices/{invoice_id}/invoice_line_items/{line_item_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NoneType, + ) + def fetch( self, invoice_id: str, @@ -449,6 +501,165 @@ def issue( cast_to=Invoice, ) + def issue_summary( + self, + invoice_id: str, + *, + synchronous: bool | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> InvoiceIssueSummaryResponse: + """This endpoint allows an eligible invoice to be issued manually. + + This is only + possible with invoices where status is `draft`, `will_auto_issue` is false, and + an `eligible_to_issue_at` is a time in the past. Issuing an invoice could + possibly trigger side effects, some of which could be customer-visible (e.g. + sending emails, auto-collecting payment, syncing the invoice to external + providers, etc). + + This is a lighter-weight alternative to the issue invoice endpoint, returning an + invoice summary without any line item details. + + Args: + synchronous: If true, the invoice will be issued synchronously. If false, the invoice will be + issued asynchronously. The synchronous option is only available for invoices + that have no usage fees. If the invoice is configured to sync to an external + provider, a successful response from this endpoint guarantees the invoice is + present in the provider. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not invoice_id: + raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") + return self._post( + f"/invoices/summary/{invoice_id}/issue", + body=maybe_transform({"synchronous": synchronous}, invoice_issue_summary_params.InvoiceIssueSummaryParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=InvoiceIssueSummaryResponse, + ) + + def list_summary( + self, + *, + amount: Optional[str] | Omit = omit, + amount_gt: Optional[str] | Omit = omit, + amount_lt: Optional[str] | Omit = omit, + cursor: Optional[str] | Omit = omit, + customer_id: Optional[str] | Omit = omit, + date_type: Optional[Literal["due_date", "invoice_date"]] | Omit = omit, + due_date: Union[str, date, None] | Omit = omit, + due_date_window: Optional[str] | Omit = omit, + due_date_gt: Union[str, date, None] | Omit = omit, + due_date_lt: Union[str, date, None] | Omit = omit, + external_customer_id: Optional[str] | Omit = omit, + invoice_date_gt: Union[str, datetime, None] | Omit = omit, + invoice_date_gte: Union[str, datetime, None] | Omit = omit, + invoice_date_lt: Union[str, datetime, None] | Omit = omit, + invoice_date_lte: Union[str, datetime, None] | Omit = omit, + is_recurring: Optional[bool] | Omit = omit, + limit: int | Omit = omit, + status: Optional[Literal["draft", "issued", "paid", "synced", "void"]] | Omit = omit, + subscription_id: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPage[InvoiceListSummaryResponse]: + """ + This is a lighter-weight endpoint that returns a list of all + [`Invoice`](/core-concepts#invoice) summaries for an account in a list format. + + These invoice summaries do not include line item details, minimums, maximums, + and discounts, making this endpoint more efficient. + + The list of invoices is ordered starting from the most recently issued invoice + date. The response also includes + [`pagination_metadata`](/api-reference/pagination), which lets the caller + retrieve the next page of results if they exist. + + By default, this only returns invoices that are `issued`, `paid`, or `synced`. + + When fetching any `draft` invoices, this returns the last-computed invoice + values for each draft invoice, which may not always be up-to-date since Orb + regularly refreshes invoices asynchronously. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + due_date_window: Filters invoices by their due dates within a specific time range in the past. + Specify the range as a number followed by 'd' (days) or 'm' (months). For + example, '7d' filters invoices due in the last 7 days, and '2m' filters those + due in the last 2 months. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/invoices/summary", + page=SyncPage[InvoiceListSummaryResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "amount": amount, + "amount_gt": amount_gt, + "amount_lt": amount_lt, + "cursor": cursor, + "customer_id": customer_id, + "date_type": date_type, + "due_date": due_date, + "due_date_window": due_date_window, + "due_date_gt": due_date_gt, + "due_date_lt": due_date_lt, + "external_customer_id": external_customer_id, + "invoice_date_gt": invoice_date_gt, + "invoice_date_gte": invoice_date_gte, + "invoice_date_lt": invoice_date_lt, + "invoice_date_lte": invoice_date_lte, + "is_recurring": is_recurring, + "limit": limit, + "status": status, + "subscription_id": subscription_id, + }, + invoice_list_summary_params.InvoiceListSummaryParams, + ), + ), + model=InvoiceListSummaryResponse, + ) + def mark_paid( self, invoice_id: str, @@ -892,6 +1103,54 @@ def list( model=Invoice, ) + async def delete_line_item( + self, + line_item_id: str, + *, + invoice_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> None: + """ + This endpoint deletes an invoice line item from a draft invoice. + + This endpoint only allows deletion of one-off line items (not subscription-based + line items). The invoice must be in a draft status for this operation to + succeed. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not invoice_id: + raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") + if not line_item_id: + raise ValueError(f"Expected a non-empty value for `line_item_id` but received {line_item_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/invoices/{invoice_id}/invoice_line_items/{line_item_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NoneType, + ) + async def fetch( self, invoice_id: str, @@ -1019,6 +1278,167 @@ async def issue( cast_to=Invoice, ) + async def issue_summary( + self, + invoice_id: str, + *, + synchronous: bool | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> InvoiceIssueSummaryResponse: + """This endpoint allows an eligible invoice to be issued manually. + + This is only + possible with invoices where status is `draft`, `will_auto_issue` is false, and + an `eligible_to_issue_at` is a time in the past. Issuing an invoice could + possibly trigger side effects, some of which could be customer-visible (e.g. + sending emails, auto-collecting payment, syncing the invoice to external + providers, etc). + + This is a lighter-weight alternative to the issue invoice endpoint, returning an + invoice summary without any line item details. + + Args: + synchronous: If true, the invoice will be issued synchronously. If false, the invoice will be + issued asynchronously. The synchronous option is only available for invoices + that have no usage fees. If the invoice is configured to sync to an external + provider, a successful response from this endpoint guarantees the invoice is + present in the provider. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not invoice_id: + raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") + return await self._post( + f"/invoices/summary/{invoice_id}/issue", + body=await async_maybe_transform( + {"synchronous": synchronous}, invoice_issue_summary_params.InvoiceIssueSummaryParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=InvoiceIssueSummaryResponse, + ) + + def list_summary( + self, + *, + amount: Optional[str] | Omit = omit, + amount_gt: Optional[str] | Omit = omit, + amount_lt: Optional[str] | Omit = omit, + cursor: Optional[str] | Omit = omit, + customer_id: Optional[str] | Omit = omit, + date_type: Optional[Literal["due_date", "invoice_date"]] | Omit = omit, + due_date: Union[str, date, None] | Omit = omit, + due_date_window: Optional[str] | Omit = omit, + due_date_gt: Union[str, date, None] | Omit = omit, + due_date_lt: Union[str, date, None] | Omit = omit, + external_customer_id: Optional[str] | Omit = omit, + invoice_date_gt: Union[str, datetime, None] | Omit = omit, + invoice_date_gte: Union[str, datetime, None] | Omit = omit, + invoice_date_lt: Union[str, datetime, None] | Omit = omit, + invoice_date_lte: Union[str, datetime, None] | Omit = omit, + is_recurring: Optional[bool] | Omit = omit, + limit: int | Omit = omit, + status: Optional[Literal["draft", "issued", "paid", "synced", "void"]] | Omit = omit, + subscription_id: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[InvoiceListSummaryResponse, AsyncPage[InvoiceListSummaryResponse]]: + """ + This is a lighter-weight endpoint that returns a list of all + [`Invoice`](/core-concepts#invoice) summaries for an account in a list format. + + These invoice summaries do not include line item details, minimums, maximums, + and discounts, making this endpoint more efficient. + + The list of invoices is ordered starting from the most recently issued invoice + date. The response also includes + [`pagination_metadata`](/api-reference/pagination), which lets the caller + retrieve the next page of results if they exist. + + By default, this only returns invoices that are `issued`, `paid`, or `synced`. + + When fetching any `draft` invoices, this returns the last-computed invoice + values for each draft invoice, which may not always be up-to-date since Orb + regularly refreshes invoices asynchronously. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + due_date_window: Filters invoices by their due dates within a specific time range in the past. + Specify the range as a number followed by 'd' (days) or 'm' (months). For + example, '7d' filters invoices due in the last 7 days, and '2m' filters those + due in the last 2 months. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/invoices/summary", + page=AsyncPage[InvoiceListSummaryResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "amount": amount, + "amount_gt": amount_gt, + "amount_lt": amount_lt, + "cursor": cursor, + "customer_id": customer_id, + "date_type": date_type, + "due_date": due_date, + "due_date_window": due_date_window, + "due_date_gt": due_date_gt, + "due_date_lt": due_date_lt, + "external_customer_id": external_customer_id, + "invoice_date_gt": invoice_date_gt, + "invoice_date_gte": invoice_date_gte, + "invoice_date_lt": invoice_date_lt, + "invoice_date_lte": invoice_date_lte, + "is_recurring": is_recurring, + "limit": limit, + "status": status, + "subscription_id": subscription_id, + }, + invoice_list_summary_params.InvoiceListSummaryParams, + ), + ), + model=InvoiceListSummaryResponse, + ) + async def mark_paid( self, invoice_id: str, @@ -1184,6 +1604,9 @@ def __init__(self, invoices: Invoices) -> None: self.list = _legacy_response.to_raw_response_wrapper( invoices.list, ) + self.delete_line_item = _legacy_response.to_raw_response_wrapper( + invoices.delete_line_item, + ) self.fetch = _legacy_response.to_raw_response_wrapper( invoices.fetch, ) @@ -1193,6 +1616,12 @@ def __init__(self, invoices: Invoices) -> None: self.issue = _legacy_response.to_raw_response_wrapper( invoices.issue, ) + self.issue_summary = _legacy_response.to_raw_response_wrapper( + invoices.issue_summary, + ) + self.list_summary = _legacy_response.to_raw_response_wrapper( + invoices.list_summary, + ) self.mark_paid = _legacy_response.to_raw_response_wrapper( invoices.mark_paid, ) @@ -1217,6 +1646,9 @@ def __init__(self, invoices: AsyncInvoices) -> None: self.list = _legacy_response.async_to_raw_response_wrapper( invoices.list, ) + self.delete_line_item = _legacy_response.async_to_raw_response_wrapper( + invoices.delete_line_item, + ) self.fetch = _legacy_response.async_to_raw_response_wrapper( invoices.fetch, ) @@ -1226,6 +1658,12 @@ def __init__(self, invoices: AsyncInvoices) -> None: self.issue = _legacy_response.async_to_raw_response_wrapper( invoices.issue, ) + self.issue_summary = _legacy_response.async_to_raw_response_wrapper( + invoices.issue_summary, + ) + self.list_summary = _legacy_response.async_to_raw_response_wrapper( + invoices.list_summary, + ) self.mark_paid = _legacy_response.async_to_raw_response_wrapper( invoices.mark_paid, ) @@ -1250,6 +1688,9 @@ def __init__(self, invoices: Invoices) -> None: self.list = to_streamed_response_wrapper( invoices.list, ) + self.delete_line_item = to_streamed_response_wrapper( + invoices.delete_line_item, + ) self.fetch = to_streamed_response_wrapper( invoices.fetch, ) @@ -1259,6 +1700,12 @@ def __init__(self, invoices: Invoices) -> None: self.issue = to_streamed_response_wrapper( invoices.issue, ) + self.issue_summary = to_streamed_response_wrapper( + invoices.issue_summary, + ) + self.list_summary = to_streamed_response_wrapper( + invoices.list_summary, + ) self.mark_paid = to_streamed_response_wrapper( invoices.mark_paid, ) @@ -1283,6 +1730,9 @@ def __init__(self, invoices: AsyncInvoices) -> None: self.list = async_to_streamed_response_wrapper( invoices.list, ) + self.delete_line_item = async_to_streamed_response_wrapper( + invoices.delete_line_item, + ) self.fetch = async_to_streamed_response_wrapper( invoices.fetch, ) @@ -1292,6 +1742,12 @@ def __init__(self, invoices: AsyncInvoices) -> None: self.issue = async_to_streamed_response_wrapper( invoices.issue, ) + self.issue_summary = async_to_streamed_response_wrapper( + invoices.issue_summary, + ) + self.list_summary = async_to_streamed_response_wrapper( + invoices.list_summary, + ) self.mark_paid = async_to_streamed_response_wrapper( invoices.mark_paid, ) diff --git a/src/orb_sdk/resources/license_types.py b/src/orb_sdk/resources/license_types.py new file mode 100644 index 0000000..0809c64 --- /dev/null +++ b/src/orb_sdk/resources/license_types.py @@ -0,0 +1,412 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from .. import _legacy_response +from ..types import license_type_list_params, license_type_create_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.license_type_list_response import LicenseTypeListResponse +from ..types.license_type_create_response import LicenseTypeCreateResponse +from ..types.license_type_retrieve_response import LicenseTypeRetrieveResponse + +__all__ = ["LicenseTypes", "AsyncLicenseTypes"] + + +class LicenseTypes(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LicenseTypesWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return LicenseTypesWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LicenseTypesWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return LicenseTypesWithStreamingResponse(self) + + def create( + self, + *, + grouping_key: str, + name: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> LicenseTypeCreateResponse: + """ + This endpoint is used to create a new license type. + + License types are used to group licenses and define billing behavior. Each + license type has a name and a grouping key that determines how metrics are + aggregated for billing purposes. + + Args: + grouping_key: The key used for grouping licenses of this type. This is typically a user + identifier field. + + name: The name of the license type. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/license_types", + body=maybe_transform( + { + "grouping_key": grouping_key, + "name": name, + }, + license_type_create_params.LicenseTypeCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LicenseTypeCreateResponse, + ) + + def retrieve( + self, + license_type_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LicenseTypeRetrieveResponse: + """ + This endpoint returns a license type identified by its license_type_id. + + Use this endpoint to retrieve details about a specific license type, including + its name and grouping key. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not license_type_id: + raise ValueError(f"Expected a non-empty value for `license_type_id` but received {license_type_id!r}") + return self._get( + f"/license_types/{license_type_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LicenseTypeRetrieveResponse, + ) + + def list( + self, + *, + cursor: Optional[str] | Omit = omit, + limit: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPage[LicenseTypeListResponse]: + """ + This endpoint returns a list of all license types configured for the account, + ordered in ascending order by creation time. + + License types are used to group licenses and define billing behavior. Each + license type has a name and a grouping key that determines how metrics are + aggregated for billing purposes. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/license_types", + page=SyncPage[LicenseTypeListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "limit": limit, + }, + license_type_list_params.LicenseTypeListParams, + ), + ), + model=LicenseTypeListResponse, + ) + + +class AsyncLicenseTypes(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLicenseTypesWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return AsyncLicenseTypesWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLicenseTypesWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return AsyncLicenseTypesWithStreamingResponse(self) + + async def create( + self, + *, + grouping_key: str, + name: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> LicenseTypeCreateResponse: + """ + This endpoint is used to create a new license type. + + License types are used to group licenses and define billing behavior. Each + license type has a name and a grouping key that determines how metrics are + aggregated for billing purposes. + + Args: + grouping_key: The key used for grouping licenses of this type. This is typically a user + identifier field. + + name: The name of the license type. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/license_types", + body=await async_maybe_transform( + { + "grouping_key": grouping_key, + "name": name, + }, + license_type_create_params.LicenseTypeCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LicenseTypeCreateResponse, + ) + + async def retrieve( + self, + license_type_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LicenseTypeRetrieveResponse: + """ + This endpoint returns a license type identified by its license_type_id. + + Use this endpoint to retrieve details about a specific license type, including + its name and grouping key. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not license_type_id: + raise ValueError(f"Expected a non-empty value for `license_type_id` but received {license_type_id!r}") + return await self._get( + f"/license_types/{license_type_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LicenseTypeRetrieveResponse, + ) + + def list( + self, + *, + cursor: Optional[str] | Omit = omit, + limit: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[LicenseTypeListResponse, AsyncPage[LicenseTypeListResponse]]: + """ + This endpoint returns a list of all license types configured for the account, + ordered in ascending order by creation time. + + License types are used to group licenses and define billing behavior. Each + license type has a name and a grouping key that determines how metrics are + aggregated for billing purposes. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/license_types", + page=AsyncPage[LicenseTypeListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "limit": limit, + }, + license_type_list_params.LicenseTypeListParams, + ), + ), + model=LicenseTypeListResponse, + ) + + +class LicenseTypesWithRawResponse: + def __init__(self, license_types: LicenseTypes) -> None: + self._license_types = license_types + + self.create = _legacy_response.to_raw_response_wrapper( + license_types.create, + ) + self.retrieve = _legacy_response.to_raw_response_wrapper( + license_types.retrieve, + ) + self.list = _legacy_response.to_raw_response_wrapper( + license_types.list, + ) + + +class AsyncLicenseTypesWithRawResponse: + def __init__(self, license_types: AsyncLicenseTypes) -> None: + self._license_types = license_types + + self.create = _legacy_response.async_to_raw_response_wrapper( + license_types.create, + ) + self.retrieve = _legacy_response.async_to_raw_response_wrapper( + license_types.retrieve, + ) + self.list = _legacy_response.async_to_raw_response_wrapper( + license_types.list, + ) + + +class LicenseTypesWithStreamingResponse: + def __init__(self, license_types: LicenseTypes) -> None: + self._license_types = license_types + + self.create = to_streamed_response_wrapper( + license_types.create, + ) + self.retrieve = to_streamed_response_wrapper( + license_types.retrieve, + ) + self.list = to_streamed_response_wrapper( + license_types.list, + ) + + +class AsyncLicenseTypesWithStreamingResponse: + def __init__(self, license_types: AsyncLicenseTypes) -> None: + self._license_types = license_types + + self.create = async_to_streamed_response_wrapper( + license_types.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + license_types.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + license_types.list, + ) diff --git a/src/orb_sdk/resources/licenses/__init__.py b/src/orb_sdk/resources/licenses/__init__.py new file mode 100644 index 0000000..0bc5c53 --- /dev/null +++ b/src/orb_sdk/resources/licenses/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .usage import ( + Usage, + AsyncUsage, + UsageWithRawResponse, + AsyncUsageWithRawResponse, + UsageWithStreamingResponse, + AsyncUsageWithStreamingResponse, +) +from .licenses import ( + Licenses, + AsyncLicenses, + LicensesWithRawResponse, + AsyncLicensesWithRawResponse, + LicensesWithStreamingResponse, + AsyncLicensesWithStreamingResponse, +) +from .external_licenses import ( + ExternalLicenses, + AsyncExternalLicenses, + ExternalLicensesWithRawResponse, + AsyncExternalLicensesWithRawResponse, + ExternalLicensesWithStreamingResponse, + AsyncExternalLicensesWithStreamingResponse, +) + +__all__ = [ + "ExternalLicenses", + "AsyncExternalLicenses", + "ExternalLicensesWithRawResponse", + "AsyncExternalLicensesWithRawResponse", + "ExternalLicensesWithStreamingResponse", + "AsyncExternalLicensesWithStreamingResponse", + "Usage", + "AsyncUsage", + "UsageWithRawResponse", + "AsyncUsageWithRawResponse", + "UsageWithStreamingResponse", + "AsyncUsageWithStreamingResponse", + "Licenses", + "AsyncLicenses", + "LicensesWithRawResponse", + "AsyncLicensesWithRawResponse", + "LicensesWithStreamingResponse", + "AsyncLicensesWithStreamingResponse", +] diff --git a/src/orb_sdk/resources/licenses/external_licenses.py b/src/orb_sdk/resources/licenses/external_licenses.py new file mode 100644 index 0000000..5d5468f --- /dev/null +++ b/src/orb_sdk/resources/licenses/external_licenses.py @@ -0,0 +1,252 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from datetime import date + +import httpx + +from ... import _legacy_response +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..._base_client import make_request_options +from ...types.licenses import external_license_get_usage_params +from ...types.licenses.external_license_get_usage_response import ExternalLicenseGetUsageResponse + +__all__ = ["ExternalLicenses", "AsyncExternalLicenses"] + + +class ExternalLicenses(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ExternalLicensesWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return ExternalLicensesWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ExternalLicensesWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return ExternalLicensesWithStreamingResponse(self) + + def get_usage( + self, + external_license_id: str, + *, + license_type_id: str, + subscription_id: str, + cursor: Optional[str] | Omit = omit, + end_date: Union[str, date, None] | Omit = omit, + group_by: Optional[SequenceNotStr[str]] | Omit = omit, + limit: int | Omit = omit, + start_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ExternalLicenseGetUsageResponse: + """ + Returns usage and remaining credits for a license identified by its external + license ID. + + Date range defaults to the current billing period if not specified. + + Args: + license_type_id: The license type ID to filter licenses by. + + subscription_id: The subscription ID to get license usage for. + + cursor: Pagination cursor from a previous request. + + end_date: End date for the usage period (YYYY-MM-DD). Defaults to end of current billing + period. + + group_by: How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + 'license,day'). + + limit: Maximum number of rows in the response data (default 20, max 100). + + start_date: Start date for the usage period (YYYY-MM-DD). Defaults to start of current + billing period. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not external_license_id: + raise ValueError( + f"Expected a non-empty value for `external_license_id` but received {external_license_id!r}" + ) + return self._get( + f"/licenses/external_licenses/{external_license_id}/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "license_type_id": license_type_id, + "subscription_id": subscription_id, + "cursor": cursor, + "end_date": end_date, + "group_by": group_by, + "limit": limit, + "start_date": start_date, + }, + external_license_get_usage_params.ExternalLicenseGetUsageParams, + ), + ), + cast_to=ExternalLicenseGetUsageResponse, + ) + + +class AsyncExternalLicenses(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncExternalLicensesWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return AsyncExternalLicensesWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncExternalLicensesWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return AsyncExternalLicensesWithStreamingResponse(self) + + async def get_usage( + self, + external_license_id: str, + *, + license_type_id: str, + subscription_id: str, + cursor: Optional[str] | Omit = omit, + end_date: Union[str, date, None] | Omit = omit, + group_by: Optional[SequenceNotStr[str]] | Omit = omit, + limit: int | Omit = omit, + start_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ExternalLicenseGetUsageResponse: + """ + Returns usage and remaining credits for a license identified by its external + license ID. + + Date range defaults to the current billing period if not specified. + + Args: + license_type_id: The license type ID to filter licenses by. + + subscription_id: The subscription ID to get license usage for. + + cursor: Pagination cursor from a previous request. + + end_date: End date for the usage period (YYYY-MM-DD). Defaults to end of current billing + period. + + group_by: How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + 'license,day'). + + limit: Maximum number of rows in the response data (default 20, max 100). + + start_date: Start date for the usage period (YYYY-MM-DD). Defaults to start of current + billing period. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not external_license_id: + raise ValueError( + f"Expected a non-empty value for `external_license_id` but received {external_license_id!r}" + ) + return await self._get( + f"/licenses/external_licenses/{external_license_id}/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "license_type_id": license_type_id, + "subscription_id": subscription_id, + "cursor": cursor, + "end_date": end_date, + "group_by": group_by, + "limit": limit, + "start_date": start_date, + }, + external_license_get_usage_params.ExternalLicenseGetUsageParams, + ), + ), + cast_to=ExternalLicenseGetUsageResponse, + ) + + +class ExternalLicensesWithRawResponse: + def __init__(self, external_licenses: ExternalLicenses) -> None: + self._external_licenses = external_licenses + + self.get_usage = _legacy_response.to_raw_response_wrapper( + external_licenses.get_usage, + ) + + +class AsyncExternalLicensesWithRawResponse: + def __init__(self, external_licenses: AsyncExternalLicenses) -> None: + self._external_licenses = external_licenses + + self.get_usage = _legacy_response.async_to_raw_response_wrapper( + external_licenses.get_usage, + ) + + +class ExternalLicensesWithStreamingResponse: + def __init__(self, external_licenses: ExternalLicenses) -> None: + self._external_licenses = external_licenses + + self.get_usage = to_streamed_response_wrapper( + external_licenses.get_usage, + ) + + +class AsyncExternalLicensesWithStreamingResponse: + def __init__(self, external_licenses: AsyncExternalLicenses) -> None: + self._external_licenses = external_licenses + + self.get_usage = async_to_streamed_response_wrapper( + external_licenses.get_usage, + ) diff --git a/src/orb_sdk/resources/licenses/licenses.py b/src/orb_sdk/resources/licenses/licenses.py new file mode 100644 index 0000000..14a70f7 --- /dev/null +++ b/src/orb_sdk/resources/licenses/licenses.py @@ -0,0 +1,727 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from datetime import date +from typing_extensions import Literal + +import httpx + +from ... import _legacy_response +from .usage import ( + Usage, + AsyncUsage, + UsageWithRawResponse, + AsyncUsageWithRawResponse, + UsageWithStreamingResponse, + AsyncUsageWithStreamingResponse, +) +from ...types import ( + license_list_params, + license_create_params, + license_deactivate_params, + license_retrieve_by_external_id_params, +) +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...pagination import SyncPage, AsyncPage +from ..._base_client import AsyncPaginator, make_request_options +from .external_licenses import ( + ExternalLicenses, + AsyncExternalLicenses, + ExternalLicensesWithRawResponse, + AsyncExternalLicensesWithRawResponse, + ExternalLicensesWithStreamingResponse, + AsyncExternalLicensesWithStreamingResponse, +) +from ...types.license_list_response import LicenseListResponse +from ...types.license_create_response import LicenseCreateResponse +from ...types.license_retrieve_response import LicenseRetrieveResponse +from ...types.license_deactivate_response import LicenseDeactivateResponse +from ...types.license_retrieve_by_external_id_response import LicenseRetrieveByExternalIDResponse + +__all__ = ["Licenses", "AsyncLicenses"] + + +class Licenses(SyncAPIResource): + @cached_property + def external_licenses(self) -> ExternalLicenses: + return ExternalLicenses(self._client) + + @cached_property + def usage(self) -> Usage: + return Usage(self._client) + + @cached_property + def with_raw_response(self) -> LicensesWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return LicensesWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LicensesWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return LicensesWithStreamingResponse(self) + + def create( + self, + *, + external_license_id: str, + license_type_id: str, + subscription_id: str, + end_date: Union[str, date, None] | Omit = omit, + start_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> LicenseCreateResponse: + """ + This endpoint is used to create a new license for a user. + + If a start date is provided, the license will be activated at the **start** of + the specified date in the customer's timezone. Otherwise, the activation time + will default to the **start** of the current day in the customer's timezone. + + Args: + external_license_id: The external identifier for the license. + + end_date: The end date of the license. If not provided, the license will remain active + until deactivated. + + start_date: The start date of the license. If not provided, defaults to start of day today + in the customer's timezone. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/licenses", + body=maybe_transform( + { + "external_license_id": external_license_id, + "license_type_id": license_type_id, + "subscription_id": subscription_id, + "end_date": end_date, + "start_date": start_date, + }, + license_create_params.LicenseCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LicenseCreateResponse, + ) + + def retrieve( + self, + license_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LicenseRetrieveResponse: + """ + This endpoint is used to fetch a license given an identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not license_id: + raise ValueError(f"Expected a non-empty value for `license_id` but received {license_id!r}") + return self._get( + f"/licenses/{license_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LicenseRetrieveResponse, + ) + + def list( + self, + *, + subscription_id: str, + cursor: Optional[str] | Omit = omit, + external_license_id: Optional[str] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, + limit: int | Omit = omit, + status: Optional[Literal["active", "inactive"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPage[LicenseListResponse]: + """ + This endpoint returns a list of all licenses for a subscription. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/licenses", + page=SyncPage[LicenseListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "subscription_id": subscription_id, + "cursor": cursor, + "external_license_id": external_license_id, + "license_type_id": license_type_id, + "limit": limit, + "status": status, + }, + license_list_params.LicenseListParams, + ), + ), + model=LicenseListResponse, + ) + + def deactivate( + self, + license_id: str, + *, + end_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> LicenseDeactivateResponse: + """ + This endpoint is used to deactivate an existing license. + + If an end date is provided, the license will be deactivated at the **start** of + the specified date in the customer's timezone. Otherwise, the deactivation time + will default to the **end** of the current day in the customer's timezone. + + Args: + end_date: The date to deactivate the license. If not provided, defaults to end of day + today in the customer's timezone. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not license_id: + raise ValueError(f"Expected a non-empty value for `license_id` but received {license_id!r}") + return self._post( + f"/licenses/{license_id}/deactivate", + body=maybe_transform({"end_date": end_date}, license_deactivate_params.LicenseDeactivateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LicenseDeactivateResponse, + ) + + def retrieve_by_external_id( + self, + external_license_id: str, + *, + license_type_id: str, + subscription_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LicenseRetrieveByExternalIDResponse: + """ + This endpoint is used to fetch a license given an external license identifier. + + Args: + license_type_id: The ID of the license type to fetch the license for. + + subscription_id: The ID of the subscription to fetch the license for. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not external_license_id: + raise ValueError( + f"Expected a non-empty value for `external_license_id` but received {external_license_id!r}" + ) + return self._get( + f"/licenses/external_license_id/{external_license_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "license_type_id": license_type_id, + "subscription_id": subscription_id, + }, + license_retrieve_by_external_id_params.LicenseRetrieveByExternalIDParams, + ), + ), + cast_to=LicenseRetrieveByExternalIDResponse, + ) + + +class AsyncLicenses(AsyncAPIResource): + @cached_property + def external_licenses(self) -> AsyncExternalLicenses: + return AsyncExternalLicenses(self._client) + + @cached_property + def usage(self) -> AsyncUsage: + return AsyncUsage(self._client) + + @cached_property + def with_raw_response(self) -> AsyncLicensesWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return AsyncLicensesWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLicensesWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return AsyncLicensesWithStreamingResponse(self) + + async def create( + self, + *, + external_license_id: str, + license_type_id: str, + subscription_id: str, + end_date: Union[str, date, None] | Omit = omit, + start_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> LicenseCreateResponse: + """ + This endpoint is used to create a new license for a user. + + If a start date is provided, the license will be activated at the **start** of + the specified date in the customer's timezone. Otherwise, the activation time + will default to the **start** of the current day in the customer's timezone. + + Args: + external_license_id: The external identifier for the license. + + end_date: The end date of the license. If not provided, the license will remain active + until deactivated. + + start_date: The start date of the license. If not provided, defaults to start of day today + in the customer's timezone. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/licenses", + body=await async_maybe_transform( + { + "external_license_id": external_license_id, + "license_type_id": license_type_id, + "subscription_id": subscription_id, + "end_date": end_date, + "start_date": start_date, + }, + license_create_params.LicenseCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LicenseCreateResponse, + ) + + async def retrieve( + self, + license_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LicenseRetrieveResponse: + """ + This endpoint is used to fetch a license given an identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not license_id: + raise ValueError(f"Expected a non-empty value for `license_id` but received {license_id!r}") + return await self._get( + f"/licenses/{license_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LicenseRetrieveResponse, + ) + + def list( + self, + *, + subscription_id: str, + cursor: Optional[str] | Omit = omit, + external_license_id: Optional[str] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, + limit: int | Omit = omit, + status: Optional[Literal["active", "inactive"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[LicenseListResponse, AsyncPage[LicenseListResponse]]: + """ + This endpoint returns a list of all licenses for a subscription. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/licenses", + page=AsyncPage[LicenseListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "subscription_id": subscription_id, + "cursor": cursor, + "external_license_id": external_license_id, + "license_type_id": license_type_id, + "limit": limit, + "status": status, + }, + license_list_params.LicenseListParams, + ), + ), + model=LicenseListResponse, + ) + + async def deactivate( + self, + license_id: str, + *, + end_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> LicenseDeactivateResponse: + """ + This endpoint is used to deactivate an existing license. + + If an end date is provided, the license will be deactivated at the **start** of + the specified date in the customer's timezone. Otherwise, the deactivation time + will default to the **end** of the current day in the customer's timezone. + + Args: + end_date: The date to deactivate the license. If not provided, defaults to end of day + today in the customer's timezone. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not license_id: + raise ValueError(f"Expected a non-empty value for `license_id` but received {license_id!r}") + return await self._post( + f"/licenses/{license_id}/deactivate", + body=await async_maybe_transform({"end_date": end_date}, license_deactivate_params.LicenseDeactivateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LicenseDeactivateResponse, + ) + + async def retrieve_by_external_id( + self, + external_license_id: str, + *, + license_type_id: str, + subscription_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LicenseRetrieveByExternalIDResponse: + """ + This endpoint is used to fetch a license given an external license identifier. + + Args: + license_type_id: The ID of the license type to fetch the license for. + + subscription_id: The ID of the subscription to fetch the license for. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not external_license_id: + raise ValueError( + f"Expected a non-empty value for `external_license_id` but received {external_license_id!r}" + ) + return await self._get( + f"/licenses/external_license_id/{external_license_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "license_type_id": license_type_id, + "subscription_id": subscription_id, + }, + license_retrieve_by_external_id_params.LicenseRetrieveByExternalIDParams, + ), + ), + cast_to=LicenseRetrieveByExternalIDResponse, + ) + + +class LicensesWithRawResponse: + def __init__(self, licenses: Licenses) -> None: + self._licenses = licenses + + self.create = _legacy_response.to_raw_response_wrapper( + licenses.create, + ) + self.retrieve = _legacy_response.to_raw_response_wrapper( + licenses.retrieve, + ) + self.list = _legacy_response.to_raw_response_wrapper( + licenses.list, + ) + self.deactivate = _legacy_response.to_raw_response_wrapper( + licenses.deactivate, + ) + self.retrieve_by_external_id = _legacy_response.to_raw_response_wrapper( + licenses.retrieve_by_external_id, + ) + + @cached_property + def external_licenses(self) -> ExternalLicensesWithRawResponse: + return ExternalLicensesWithRawResponse(self._licenses.external_licenses) + + @cached_property + def usage(self) -> UsageWithRawResponse: + return UsageWithRawResponse(self._licenses.usage) + + +class AsyncLicensesWithRawResponse: + def __init__(self, licenses: AsyncLicenses) -> None: + self._licenses = licenses + + self.create = _legacy_response.async_to_raw_response_wrapper( + licenses.create, + ) + self.retrieve = _legacy_response.async_to_raw_response_wrapper( + licenses.retrieve, + ) + self.list = _legacy_response.async_to_raw_response_wrapper( + licenses.list, + ) + self.deactivate = _legacy_response.async_to_raw_response_wrapper( + licenses.deactivate, + ) + self.retrieve_by_external_id = _legacy_response.async_to_raw_response_wrapper( + licenses.retrieve_by_external_id, + ) + + @cached_property + def external_licenses(self) -> AsyncExternalLicensesWithRawResponse: + return AsyncExternalLicensesWithRawResponse(self._licenses.external_licenses) + + @cached_property + def usage(self) -> AsyncUsageWithRawResponse: + return AsyncUsageWithRawResponse(self._licenses.usage) + + +class LicensesWithStreamingResponse: + def __init__(self, licenses: Licenses) -> None: + self._licenses = licenses + + self.create = to_streamed_response_wrapper( + licenses.create, + ) + self.retrieve = to_streamed_response_wrapper( + licenses.retrieve, + ) + self.list = to_streamed_response_wrapper( + licenses.list, + ) + self.deactivate = to_streamed_response_wrapper( + licenses.deactivate, + ) + self.retrieve_by_external_id = to_streamed_response_wrapper( + licenses.retrieve_by_external_id, + ) + + @cached_property + def external_licenses(self) -> ExternalLicensesWithStreamingResponse: + return ExternalLicensesWithStreamingResponse(self._licenses.external_licenses) + + @cached_property + def usage(self) -> UsageWithStreamingResponse: + return UsageWithStreamingResponse(self._licenses.usage) + + +class AsyncLicensesWithStreamingResponse: + def __init__(self, licenses: AsyncLicenses) -> None: + self._licenses = licenses + + self.create = async_to_streamed_response_wrapper( + licenses.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + licenses.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + licenses.list, + ) + self.deactivate = async_to_streamed_response_wrapper( + licenses.deactivate, + ) + self.retrieve_by_external_id = async_to_streamed_response_wrapper( + licenses.retrieve_by_external_id, + ) + + @cached_property + def external_licenses(self) -> AsyncExternalLicensesWithStreamingResponse: + return AsyncExternalLicensesWithStreamingResponse(self._licenses.external_licenses) + + @cached_property + def usage(self) -> AsyncUsageWithStreamingResponse: + return AsyncUsageWithStreamingResponse(self._licenses.usage) diff --git a/src/orb_sdk/resources/licenses/usage.py b/src/orb_sdk/resources/licenses/usage.py new file mode 100644 index 0000000..c58214f --- /dev/null +++ b/src/orb_sdk/resources/licenses/usage.py @@ -0,0 +1,387 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from datetime import date + +import httpx + +from ... import _legacy_response +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..._base_client import make_request_options +from ...types.licenses import usage_get_usage_params, usage_get_all_usage_params +from ...types.licenses.usage_get_usage_response import UsageGetUsageResponse +from ...types.licenses.usage_get_all_usage_response import UsageGetAllUsageResponse + +__all__ = ["Usage", "AsyncUsage"] + + +class Usage(SyncAPIResource): + @cached_property + def with_raw_response(self) -> UsageWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return UsageWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> UsageWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return UsageWithStreamingResponse(self) + + def get_all_usage( + self, + *, + license_type_id: str, + subscription_id: str, + cursor: Optional[str] | Omit = omit, + end_date: Union[str, date, None] | Omit = omit, + group_by: Optional[SequenceNotStr[str]] | Omit = omit, + limit: int | Omit = omit, + start_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> UsageGetAllUsageResponse: + """ + Returns usage and remaining credits for all licenses of a given type on a + subscription. + + Date range defaults to the current billing period if not specified. + + Args: + license_type_id: The license type ID to filter licenses by. + + subscription_id: The subscription ID to get license usage for. + + cursor: Pagination cursor from a previous request. + + end_date: End date for the usage period (YYYY-MM-DD). Defaults to end of current billing + period. + + group_by: How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + 'license,day'). + + limit: Maximum number of rows in the response data (default 20, max 100). + + start_date: Start date for the usage period (YYYY-MM-DD). Defaults to start of current + billing period. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/licenses/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "license_type_id": license_type_id, + "subscription_id": subscription_id, + "cursor": cursor, + "end_date": end_date, + "group_by": group_by, + "limit": limit, + "start_date": start_date, + }, + usage_get_all_usage_params.UsageGetAllUsageParams, + ), + ), + cast_to=UsageGetAllUsageResponse, + ) + + def get_usage( + self, + license_id: str, + *, + cursor: Optional[str] | Omit = omit, + end_date: Union[str, date, None] | Omit = omit, + group_by: Optional[SequenceNotStr[str]] | Omit = omit, + limit: int | Omit = omit, + start_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> UsageGetUsageResponse: + """ + Returns usage and remaining credits for a specific license over a date range. + + Date range defaults to the current billing period if not specified. + + Args: + cursor: Pagination cursor from a previous request. + + end_date: End date for the usage period (YYYY-MM-DD). Defaults to end of current billing + period. + + group_by: How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + 'license,day'). + + limit: Maximum number of rows in the response data (default 20, max 100). + + start_date: Start date for the usage period (YYYY-MM-DD). Defaults to start of current + billing period. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not license_id: + raise ValueError(f"Expected a non-empty value for `license_id` but received {license_id!r}") + return self._get( + f"/licenses/{license_id}/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "end_date": end_date, + "group_by": group_by, + "limit": limit, + "start_date": start_date, + }, + usage_get_usage_params.UsageGetUsageParams, + ), + ), + cast_to=UsageGetUsageResponse, + ) + + +class AsyncUsage(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncUsageWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return AsyncUsageWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncUsageWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return AsyncUsageWithStreamingResponse(self) + + async def get_all_usage( + self, + *, + license_type_id: str, + subscription_id: str, + cursor: Optional[str] | Omit = omit, + end_date: Union[str, date, None] | Omit = omit, + group_by: Optional[SequenceNotStr[str]] | Omit = omit, + limit: int | Omit = omit, + start_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> UsageGetAllUsageResponse: + """ + Returns usage and remaining credits for all licenses of a given type on a + subscription. + + Date range defaults to the current billing period if not specified. + + Args: + license_type_id: The license type ID to filter licenses by. + + subscription_id: The subscription ID to get license usage for. + + cursor: Pagination cursor from a previous request. + + end_date: End date for the usage period (YYYY-MM-DD). Defaults to end of current billing + period. + + group_by: How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + 'license,day'). + + limit: Maximum number of rows in the response data (default 20, max 100). + + start_date: Start date for the usage period (YYYY-MM-DD). Defaults to start of current + billing period. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/licenses/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "license_type_id": license_type_id, + "subscription_id": subscription_id, + "cursor": cursor, + "end_date": end_date, + "group_by": group_by, + "limit": limit, + "start_date": start_date, + }, + usage_get_all_usage_params.UsageGetAllUsageParams, + ), + ), + cast_to=UsageGetAllUsageResponse, + ) + + async def get_usage( + self, + license_id: str, + *, + cursor: Optional[str] | Omit = omit, + end_date: Union[str, date, None] | Omit = omit, + group_by: Optional[SequenceNotStr[str]] | Omit = omit, + limit: int | Omit = omit, + start_date: Union[str, date, None] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> UsageGetUsageResponse: + """ + Returns usage and remaining credits for a specific license over a date range. + + Date range defaults to the current billing period if not specified. + + Args: + cursor: Pagination cursor from a previous request. + + end_date: End date for the usage period (YYYY-MM-DD). Defaults to end of current billing + period. + + group_by: How to group the results. Valid values: 'license', 'day'. Can be combined (e.g., + 'license,day'). + + limit: Maximum number of rows in the response data (default 20, max 100). + + start_date: Start date for the usage period (YYYY-MM-DD). Defaults to start of current + billing period. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not license_id: + raise ValueError(f"Expected a non-empty value for `license_id` but received {license_id!r}") + return await self._get( + f"/licenses/{license_id}/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "cursor": cursor, + "end_date": end_date, + "group_by": group_by, + "limit": limit, + "start_date": start_date, + }, + usage_get_usage_params.UsageGetUsageParams, + ), + ), + cast_to=UsageGetUsageResponse, + ) + + +class UsageWithRawResponse: + def __init__(self, usage: Usage) -> None: + self._usage = usage + + self.get_all_usage = _legacy_response.to_raw_response_wrapper( + usage.get_all_usage, + ) + self.get_usage = _legacy_response.to_raw_response_wrapper( + usage.get_usage, + ) + + +class AsyncUsageWithRawResponse: + def __init__(self, usage: AsyncUsage) -> None: + self._usage = usage + + self.get_all_usage = _legacy_response.async_to_raw_response_wrapper( + usage.get_all_usage, + ) + self.get_usage = _legacy_response.async_to_raw_response_wrapper( + usage.get_usage, + ) + + +class UsageWithStreamingResponse: + def __init__(self, usage: Usage) -> None: + self._usage = usage + + self.get_all_usage = to_streamed_response_wrapper( + usage.get_all_usage, + ) + self.get_usage = to_streamed_response_wrapper( + usage.get_usage, + ) + + +class AsyncUsageWithStreamingResponse: + def __init__(self, usage: AsyncUsage) -> None: + self._usage = usage + + self.get_all_usage = async_to_streamed_response_wrapper( + usage.get_all_usage, + ) + self.get_usage = async_to_streamed_response_wrapper( + usage.get_usage, + ) diff --git a/src/orb_sdk/resources/plans/__init__.py b/src/orb_sdk/resources/plans/__init__.py index fa46183..5af7462 100644 --- a/src/orb_sdk/resources/plans/__init__.py +++ b/src/orb_sdk/resources/plans/__init__.py @@ -8,6 +8,14 @@ PlansWithStreamingResponse, AsyncPlansWithStreamingResponse, ) +from .migrations import ( + Migrations, + AsyncMigrations, + MigrationsWithRawResponse, + AsyncMigrationsWithRawResponse, + MigrationsWithStreamingResponse, + AsyncMigrationsWithStreamingResponse, +) from .external_plan_id import ( ExternalPlanID, AsyncExternalPlanID, @@ -24,6 +32,12 @@ "AsyncExternalPlanIDWithRawResponse", "ExternalPlanIDWithStreamingResponse", "AsyncExternalPlanIDWithStreamingResponse", + "Migrations", + "AsyncMigrations", + "MigrationsWithRawResponse", + "AsyncMigrationsWithRawResponse", + "MigrationsWithStreamingResponse", + "AsyncMigrationsWithStreamingResponse", "Plans", "AsyncPlans", "PlansWithRawResponse", diff --git a/src/orb_sdk/resources/plans/migrations.py b/src/orb_sdk/resources/plans/migrations.py new file mode 100644 index 0000000..593a7e1 --- /dev/null +++ b/src/orb_sdk/resources/plans/migrations.py @@ -0,0 +1,392 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ... import _legacy_response +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...pagination import SyncPage, AsyncPage +from ...types.plans import migration_list_params +from ..._base_client import AsyncPaginator, make_request_options +from ...types.plans.migration_list_response import MigrationListResponse +from ...types.plans.migration_cancel_response import MigrationCancelResponse +from ...types.plans.migration_retrieve_response import MigrationRetrieveResponse + +__all__ = ["Migrations", "AsyncMigrations"] + + +class Migrations(SyncAPIResource): + @cached_property + def with_raw_response(self) -> MigrationsWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return MigrationsWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> MigrationsWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return MigrationsWithStreamingResponse(self) + + def retrieve( + self, + migration_id: str, + *, + plan_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MigrationRetrieveResponse: + """ + Fetch migration + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not plan_id: + raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + if not migration_id: + raise ValueError(f"Expected a non-empty value for `migration_id` but received {migration_id!r}") + return self._get( + f"/plans/{plan_id}/migrations/{migration_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MigrationRetrieveResponse, + ) + + def list( + self, + plan_id: str, + *, + cursor: Optional[str] | Omit = omit, + limit: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPage[MigrationListResponse]: + """This endpoint returns a list of all migrations for a plan. + + The list of + migrations is ordered starting from the most recently created migration. The + response also includes pagination_metadata, which lets the caller retrieve the + next page of results if they exist. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not plan_id: + raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + return self._get_api_list( + f"/plans/{plan_id}/migrations", + page=SyncPage[MigrationListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "limit": limit, + }, + migration_list_params.MigrationListParams, + ), + ), + model=MigrationListResponse, + ) + + def cancel( + self, + migration_id: str, + *, + plan_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> MigrationCancelResponse: + """ + This endpoint cancels a migration. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not plan_id: + raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + if not migration_id: + raise ValueError(f"Expected a non-empty value for `migration_id` but received {migration_id!r}") + return self._post( + f"/plans/{plan_id}/migrations/{migration_id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=MigrationCancelResponse, + ) + + +class AsyncMigrations(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncMigrationsWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/orbcorp/orb-python#accessing-raw-response-data-eg-headers + """ + return AsyncMigrationsWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncMigrationsWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/orbcorp/orb-python#with_streaming_response + """ + return AsyncMigrationsWithStreamingResponse(self) + + async def retrieve( + self, + migration_id: str, + *, + plan_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MigrationRetrieveResponse: + """ + Fetch migration + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not plan_id: + raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + if not migration_id: + raise ValueError(f"Expected a non-empty value for `migration_id` but received {migration_id!r}") + return await self._get( + f"/plans/{plan_id}/migrations/{migration_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=MigrationRetrieveResponse, + ) + + def list( + self, + plan_id: str, + *, + cursor: Optional[str] | Omit = omit, + limit: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[MigrationListResponse, AsyncPage[MigrationListResponse]]: + """This endpoint returns a list of all migrations for a plan. + + The list of + migrations is ordered starting from the most recently created migration. The + response also includes pagination_metadata, which lets the caller retrieve the + next page of results if they exist. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not plan_id: + raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + return self._get_api_list( + f"/plans/{plan_id}/migrations", + page=AsyncPage[MigrationListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "limit": limit, + }, + migration_list_params.MigrationListParams, + ), + ), + model=MigrationListResponse, + ) + + async def cancel( + self, + migration_id: str, + *, + plan_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> MigrationCancelResponse: + """ + This endpoint cancels a migration. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not plan_id: + raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") + if not migration_id: + raise ValueError(f"Expected a non-empty value for `migration_id` but received {migration_id!r}") + return await self._post( + f"/plans/{plan_id}/migrations/{migration_id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=MigrationCancelResponse, + ) + + +class MigrationsWithRawResponse: + def __init__(self, migrations: Migrations) -> None: + self._migrations = migrations + + self.retrieve = _legacy_response.to_raw_response_wrapper( + migrations.retrieve, + ) + self.list = _legacy_response.to_raw_response_wrapper( + migrations.list, + ) + self.cancel = _legacy_response.to_raw_response_wrapper( + migrations.cancel, + ) + + +class AsyncMigrationsWithRawResponse: + def __init__(self, migrations: AsyncMigrations) -> None: + self._migrations = migrations + + self.retrieve = _legacy_response.async_to_raw_response_wrapper( + migrations.retrieve, + ) + self.list = _legacy_response.async_to_raw_response_wrapper( + migrations.list, + ) + self.cancel = _legacy_response.async_to_raw_response_wrapper( + migrations.cancel, + ) + + +class MigrationsWithStreamingResponse: + def __init__(self, migrations: Migrations) -> None: + self._migrations = migrations + + self.retrieve = to_streamed_response_wrapper( + migrations.retrieve, + ) + self.list = to_streamed_response_wrapper( + migrations.list, + ) + self.cancel = to_streamed_response_wrapper( + migrations.cancel, + ) + + +class AsyncMigrationsWithStreamingResponse: + def __init__(self, migrations: AsyncMigrations) -> None: + self._migrations = migrations + + self.retrieve = async_to_streamed_response_wrapper( + migrations.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + migrations.list, + ) + self.cancel = async_to_streamed_response_wrapper( + migrations.cancel, + ) diff --git a/src/orb_sdk/resources/plans/plans.py b/src/orb_sdk/resources/plans/plans.py index 257f177..64d0bad 100644 --- a/src/orb_sdk/resources/plans/plans.py +++ b/src/orb_sdk/resources/plans/plans.py @@ -13,6 +13,14 @@ from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property +from .migrations import ( + Migrations, + AsyncMigrations, + MigrationsWithRawResponse, + AsyncMigrationsWithRawResponse, + MigrationsWithStreamingResponse, + AsyncMigrationsWithStreamingResponse, +) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ...pagination import SyncPage, AsyncPage @@ -35,6 +43,10 @@ class Plans(SyncAPIResource): def external_plan_id(self) -> ExternalPlanID: return ExternalPlanID(self._client) + @cached_property + def migrations(self) -> Migrations: + return Migrations(self._client) + @cached_property def with_raw_response(self) -> PlansWithRawResponse: """ @@ -320,6 +332,10 @@ class AsyncPlans(AsyncAPIResource): def external_plan_id(self) -> AsyncExternalPlanID: return AsyncExternalPlanID(self._client) + @cached_property + def migrations(self) -> AsyncMigrations: + return AsyncMigrations(self._client) + @cached_property def with_raw_response(self) -> AsyncPlansWithRawResponse: """ @@ -621,6 +637,10 @@ def __init__(self, plans: Plans) -> None: def external_plan_id(self) -> ExternalPlanIDWithRawResponse: return ExternalPlanIDWithRawResponse(self._plans.external_plan_id) + @cached_property + def migrations(self) -> MigrationsWithRawResponse: + return MigrationsWithRawResponse(self._plans.migrations) + class AsyncPlansWithRawResponse: def __init__(self, plans: AsyncPlans) -> None: @@ -643,6 +663,10 @@ def __init__(self, plans: AsyncPlans) -> None: def external_plan_id(self) -> AsyncExternalPlanIDWithRawResponse: return AsyncExternalPlanIDWithRawResponse(self._plans.external_plan_id) + @cached_property + def migrations(self) -> AsyncMigrationsWithRawResponse: + return AsyncMigrationsWithRawResponse(self._plans.migrations) + class PlansWithStreamingResponse: def __init__(self, plans: Plans) -> None: @@ -665,6 +689,10 @@ def __init__(self, plans: Plans) -> None: def external_plan_id(self) -> ExternalPlanIDWithStreamingResponse: return ExternalPlanIDWithStreamingResponse(self._plans.external_plan_id) + @cached_property + def migrations(self) -> MigrationsWithStreamingResponse: + return MigrationsWithStreamingResponse(self._plans.migrations) + class AsyncPlansWithStreamingResponse: def __init__(self, plans: AsyncPlans) -> None: @@ -686,3 +714,7 @@ def __init__(self, plans: AsyncPlans) -> None: @cached_property def external_plan_id(self) -> AsyncExternalPlanIDWithStreamingResponse: return AsyncExternalPlanIDWithStreamingResponse(self._plans.external_plan_id) + + @cached_property + def migrations(self) -> AsyncMigrationsWithStreamingResponse: + return AsyncMigrationsWithStreamingResponse(self._plans.migrations) diff --git a/src/orb_sdk/resources/prices/prices.py b/src/orb_sdk/resources/prices/prices.py index 970d9e1..1c568a1 100644 --- a/src/orb_sdk/resources/prices/prices.py +++ b/src/orb_sdk/resources/prices/prices.py @@ -92,6 +92,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -151,6 +152,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -187,6 +190,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -246,6 +250,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -282,6 +288,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -341,6 +348,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -378,6 +387,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -437,6 +447,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -473,6 +485,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -532,6 +545,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -568,6 +583,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -627,6 +643,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -664,6 +682,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -723,6 +742,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -760,6 +781,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -819,6 +841,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -856,6 +880,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -915,6 +940,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -952,6 +979,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1011,6 +1039,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1050,6 +1080,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1109,6 +1140,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1146,6 +1179,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1205,6 +1239,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1242,6 +1278,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1301,6 +1338,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1338,6 +1377,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1397,6 +1437,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1434,6 +1476,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1493,6 +1536,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1530,6 +1575,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1589,6 +1635,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1626,6 +1674,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1685,6 +1734,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1722,6 +1773,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1781,6 +1833,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1820,6 +1874,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1879,6 +1934,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1918,6 +1975,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1977,6 +2035,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2016,6 +2076,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2075,6 +2136,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2112,6 +2175,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2171,6 +2235,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2208,6 +2274,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2267,6 +2334,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2304,6 +2373,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2363,6 +2433,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2402,6 +2474,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2461,6 +2534,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2500,6 +2575,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2559,6 +2635,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2596,6 +2674,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2655,6 +2734,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2694,6 +2775,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2753,6 +2835,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2776,8 +2860,8 @@ def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig, - model_type: Literal["minimum"], + minimum_composite_config: price_create_params.NewFloatingMinimumCompositePriceMinimumCompositeConfig, + model_type: Literal["minimum_composite"], name: str, billable_metric_id: Optional[str] | Omit = omit, billed_in_advance: Optional[bool] | Omit = omit, @@ -2790,6 +2874,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2818,7 +2903,7 @@ def create( item_id: The id of the item the price will be associated with. - minimum_config: Configuration for minimum pricing + minimum_composite_config: Configuration for minimum_composite pricing model_type: The pricing model type @@ -2849,6 +2934,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2886,6 +2973,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2945,6 +3033,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2982,6 +3072,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3041,6 +3132,8 @@ def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3086,7 +3179,7 @@ def create( ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"], ["cadence", "cumulative_grouped_bulk_config", "currency", "item_id", "model_type", "name"], ["cadence", "cumulative_grouped_allocation_config", "currency", "item_id", "model_type", "name"], - ["cadence", "currency", "item_id", "minimum_config", "model_type", "name"], + ["cadence", "currency", "item_id", "minimum_composite_config", "model_type", "name"], ["cadence", "currency", "item_id", "model_type", "name", "percent_config"], ["cadence", "currency", "event_output_config", "item_id", "model_type", "name"], ) @@ -3124,7 +3217,7 @@ def create( | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"] | Literal["cumulative_grouped_allocation"] - | Literal["minimum"] + | Literal["minimum_composite"] | Literal["percent"] | Literal["event_output"], name: str, @@ -3170,6 +3263,7 @@ def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, tiered_config: TieredConfig | Omit = omit, bulk_config: BulkConfig | Omit = omit, @@ -3218,7 +3312,8 @@ def create( | Omit = omit, cumulative_grouped_allocation_config: price_create_params.NewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig | Omit = omit, - minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | Omit = omit, + minimum_composite_config: price_create_params.NewFloatingMinimumCompositePriceMinimumCompositeConfig + | Omit = omit, percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig | Omit = omit, event_output_config: price_create_params.NewFloatingEventOutputPriceEventOutputConfig | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3251,6 +3346,7 @@ def create( "fixed_price_quantity": fixed_price_quantity, "invoice_grouping_key": invoice_grouping_key, "invoicing_cycle_configuration": invoicing_cycle_configuration, + "license_type_id": license_type_id, "metadata": metadata, "tiered_config": tiered_config, "bulk_config": bulk_config, @@ -3279,7 +3375,7 @@ def create( "scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config, "cumulative_grouped_bulk_config": cumulative_grouped_bulk_config, "cumulative_grouped_allocation_config": cumulative_grouped_allocation_config, - "minimum_config": minimum_config, + "minimum_composite_config": minimum_composite_config, "percent_config": percent_config, "event_output_config": event_output_config, }, @@ -3748,6 +3844,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3807,6 +3904,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3843,6 +3942,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3902,6 +4002,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3938,6 +4040,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3997,6 +4100,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4034,6 +4139,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4093,6 +4199,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4129,6 +4237,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4188,6 +4297,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4224,6 +4335,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4283,6 +4395,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4320,6 +4434,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4379,6 +4494,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4416,6 +4533,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4475,6 +4593,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4512,6 +4632,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4571,6 +4692,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4608,6 +4731,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4667,6 +4791,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4706,6 +4832,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4765,6 +4892,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4802,6 +4931,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4861,6 +4991,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4898,6 +5030,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -4957,6 +5090,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -4994,6 +5129,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5053,6 +5189,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5090,6 +5228,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5149,6 +5288,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5186,6 +5327,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5245,6 +5387,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5282,6 +5426,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5341,6 +5486,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5378,6 +5525,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5437,6 +5585,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5476,6 +5626,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5535,6 +5686,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5574,6 +5727,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5633,6 +5787,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5672,6 +5828,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5731,6 +5888,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5768,6 +5927,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5827,6 +5987,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5864,6 +6026,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -5923,6 +6086,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -5960,6 +6125,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6019,6 +6185,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -6058,6 +6226,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6117,6 +6286,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -6156,6 +6327,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6215,6 +6387,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -6252,6 +6426,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6311,6 +6486,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -6350,6 +6527,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6409,6 +6587,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -6432,8 +6612,8 @@ async def create( cadence: Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"], currency: str, item_id: str, - minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig, - model_type: Literal["minimum"], + minimum_composite_config: price_create_params.NewFloatingMinimumCompositePriceMinimumCompositeConfig, + model_type: Literal["minimum_composite"], name: str, billable_metric_id: Optional[str] | Omit = omit, billed_in_advance: Optional[bool] | Omit = omit, @@ -6446,6 +6626,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6474,7 +6655,7 @@ async def create( item_id: The id of the item the price will be associated with. - minimum_config: Configuration for minimum pricing + minimum_composite_config: Configuration for minimum_composite pricing model_type: The pricing model type @@ -6505,6 +6686,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -6542,6 +6725,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6601,6 +6785,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -6638,6 +6824,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -6697,6 +6884,8 @@ async def create( invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. If unspecified, a single invoice is produced per billing cycle. + license_type_id: The ID of the license type to associate with this price. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -6742,7 +6931,7 @@ async def create( ["cadence", "currency", "item_id", "model_type", "name", "scalable_matrix_with_tiered_pricing_config"], ["cadence", "cumulative_grouped_bulk_config", "currency", "item_id", "model_type", "name"], ["cadence", "cumulative_grouped_allocation_config", "currency", "item_id", "model_type", "name"], - ["cadence", "currency", "item_id", "minimum_config", "model_type", "name"], + ["cadence", "currency", "item_id", "minimum_composite_config", "model_type", "name"], ["cadence", "currency", "item_id", "model_type", "name", "percent_config"], ["cadence", "currency", "event_output_config", "item_id", "model_type", "name"], ) @@ -6780,7 +6969,7 @@ async def create( | Literal["scalable_matrix_with_tiered_pricing"] | Literal["cumulative_grouped_bulk"] | Literal["cumulative_grouped_allocation"] - | Literal["minimum"] + | Literal["minimum_composite"] | Literal["percent"] | Literal["event_output"], name: str, @@ -6826,6 +7015,7 @@ async def create( fixed_price_quantity: Optional[float] | Omit = omit, invoice_grouping_key: Optional[str] | Omit = omit, invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] | Omit = omit, + license_type_id: Optional[str] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, tiered_config: TieredConfig | Omit = omit, bulk_config: BulkConfig | Omit = omit, @@ -6874,7 +7064,8 @@ async def create( | Omit = omit, cumulative_grouped_allocation_config: price_create_params.NewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig | Omit = omit, - minimum_config: price_create_params.NewFloatingMinimumCompositePriceMinimumConfig | Omit = omit, + minimum_composite_config: price_create_params.NewFloatingMinimumCompositePriceMinimumCompositeConfig + | Omit = omit, percent_config: price_create_params.NewFloatingPercentCompositePricePercentConfig | Omit = omit, event_output_config: price_create_params.NewFloatingEventOutputPriceEventOutputConfig | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -6907,6 +7098,7 @@ async def create( "fixed_price_quantity": fixed_price_quantity, "invoice_grouping_key": invoice_grouping_key, "invoicing_cycle_configuration": invoicing_cycle_configuration, + "license_type_id": license_type_id, "metadata": metadata, "tiered_config": tiered_config, "bulk_config": bulk_config, @@ -6935,7 +7127,7 @@ async def create( "scalable_matrix_with_tiered_pricing_config": scalable_matrix_with_tiered_pricing_config, "cumulative_grouped_bulk_config": cumulative_grouped_bulk_config, "cumulative_grouped_allocation_config": cumulative_grouped_allocation_config, - "minimum_config": minimum_config, + "minimum_composite_config": minimum_composite_config, "percent_config": percent_config, "event_output_config": event_output_config, }, diff --git a/src/orb_sdk/resources/subscription_changes.py b/src/orb_sdk/resources/subscription_changes.py index 0709fa5..5adbb9e 100644 --- a/src/orb_sdk/resources/subscription_changes.py +++ b/src/orb_sdk/resources/subscription_changes.py @@ -4,17 +4,20 @@ from typing import Union, Optional from datetime import date +from typing_extensions import Literal import httpx from .. import _legacy_response -from ..types import subscription_change_apply_params +from ..types import subscription_change_list_params, subscription_change_apply_params from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper -from .._base_client import make_request_options +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.subscription_change_list_response import SubscriptionChangeListResponse from ..types.subscription_change_apply_response import SubscriptionChangeApplyResponse from ..types.subscription_change_cancel_response import SubscriptionChangeCancelResponse from ..types.subscription_change_retrieve_response import SubscriptionChangeRetrieveResponse @@ -85,6 +88,63 @@ def retrieve( cast_to=SubscriptionChangeRetrieveResponse, ) + def list( + self, + *, + cursor: Optional[str] | Omit = omit, + customer_id: Optional[str] | Omit = omit, + external_customer_id: Optional[str] | Omit = omit, + limit: int | Omit = omit, + status: Optional[Literal["pending", "applied", "cancelled"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPage[SubscriptionChangeListResponse]: + """This endpoint returns a list of pending subscription changes for a customer. + + Use + the [Fetch Subscription Change](fetch-subscription-change) endpoint to retrieve + the expected subscription state after the pending change is applied. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/subscription_changes", + page=SyncPage[SubscriptionChangeListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "customer_id": customer_id, + "external_customer_id": external_customer_id, + "limit": limit, + "status": status, + }, + subscription_change_list_params.SubscriptionChangeListParams, + ), + ), + model=SubscriptionChangeListResponse, + ) + def apply( self, subscription_change_id: str, @@ -272,6 +332,63 @@ async def retrieve( cast_to=SubscriptionChangeRetrieveResponse, ) + def list( + self, + *, + cursor: Optional[str] | Omit = omit, + customer_id: Optional[str] | Omit = omit, + external_customer_id: Optional[str] | Omit = omit, + limit: int | Omit = omit, + status: Optional[Literal["pending", "applied", "cancelled"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[SubscriptionChangeListResponse, AsyncPage[SubscriptionChangeListResponse]]: + """This endpoint returns a list of pending subscription changes for a customer. + + Use + the [Fetch Subscription Change](fetch-subscription-change) endpoint to retrieve + the expected subscription state after the pending change is applied. + + Args: + cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned + from the initial request. + + limit: The number of items to fetch. Defaults to 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/subscription_changes", + page=AsyncPage[SubscriptionChangeListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "customer_id": customer_id, + "external_customer_id": external_customer_id, + "limit": limit, + "status": status, + }, + subscription_change_list_params.SubscriptionChangeListParams, + ), + ), + model=SubscriptionChangeListResponse, + ) + async def apply( self, subscription_change_id: str, @@ -403,6 +520,9 @@ def __init__(self, subscription_changes: SubscriptionChanges) -> None: self.retrieve = _legacy_response.to_raw_response_wrapper( subscription_changes.retrieve, ) + self.list = _legacy_response.to_raw_response_wrapper( + subscription_changes.list, + ) self.apply = _legacy_response.to_raw_response_wrapper( subscription_changes.apply, ) @@ -418,6 +538,9 @@ def __init__(self, subscription_changes: AsyncSubscriptionChanges) -> None: self.retrieve = _legacy_response.async_to_raw_response_wrapper( subscription_changes.retrieve, ) + self.list = _legacy_response.async_to_raw_response_wrapper( + subscription_changes.list, + ) self.apply = _legacy_response.async_to_raw_response_wrapper( subscription_changes.apply, ) @@ -433,6 +556,9 @@ def __init__(self, subscription_changes: SubscriptionChanges) -> None: self.retrieve = to_streamed_response_wrapper( subscription_changes.retrieve, ) + self.list = to_streamed_response_wrapper( + subscription_changes.list, + ) self.apply = to_streamed_response_wrapper( subscription_changes.apply, ) @@ -448,6 +574,9 @@ def __init__(self, subscription_changes: AsyncSubscriptionChanges) -> None: self.retrieve = async_to_streamed_response_wrapper( subscription_changes.retrieve, ) + self.list = async_to_streamed_response_wrapper( + subscription_changes.list, + ) self.apply = async_to_streamed_response_wrapper( subscription_changes.apply, ) diff --git a/src/orb_sdk/resources/subscriptions.py b/src/orb_sdk/resources/subscriptions.py index 14d6bc7..0f41dd9 100644 --- a/src/orb_sdk/resources/subscriptions.py +++ b/src/orb_sdk/resources/subscriptions.py @@ -365,6 +365,10 @@ def create( subscription. E.g. pass in `10.00` to issue an invoice when usage amounts hit \\$$10.00 for a subscription that invoices in USD. + ## Limits + + By default, Orb limits the number of subscriptions per customer to 100. + Args: add_adjustments: Additional adjustments to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) @@ -2456,6 +2460,10 @@ async def create( subscription. E.g. pass in `10.00` to issue an invoice when usage amounts hit \\$$10.00 for a subscription that invoices in USD. + ## Limits + + By default, Orb limits the number of subscriptions per customer to 100. + Args: add_adjustments: Additional adjustments to be added to the subscription. (Only available for accounts that have migrated off of legacy subscription overrides) diff --git a/src/orb_sdk/resources/webhooks.py b/src/orb_sdk/resources/webhooks.py index 2c5e9c7..48c321f 100644 --- a/src/orb_sdk/resources/webhooks.py +++ b/src/orb_sdk/resources/webhooks.py @@ -56,7 +56,11 @@ def verify_signature( now = datetime.now(tz=timezone.utc) try: - timestamp = datetime.fromisoformat(msg_timestamp).astimezone() + timestamp = datetime.fromisoformat(msg_timestamp) + # If the timestamp doesn't have timezone info, assume it's UTC + if timestamp.tzinfo is None: + timestamp = timestamp.replace(tzinfo=timezone.utc) + timestamp = timestamp.astimezone() except Exception as err: raise ValueError("Invalid signature headers. Could not convert to timestamp") from err @@ -140,7 +144,11 @@ def verify_signature( now = datetime.now(tz=timezone.utc) try: - timestamp = datetime.fromisoformat(msg_timestamp).astimezone() + timestamp = datetime.fromisoformat(msg_timestamp) + # If the timestamp doesn't have timezone info, assume it's UTC + if timestamp.tzinfo is None: + timestamp = timestamp.replace(tzinfo=timezone.utc) + timestamp = timestamp.astimezone() except Exception as err: raise ValueError("Invalid signature headers. Could not convert to timestamp") from err diff --git a/src/orb_sdk/types/__init__.py b/src/orb_sdk/types/__init__.py index 59ff1e6..fb4d096 100644 --- a/src/orb_sdk/types/__init__.py +++ b/src/orb_sdk/types/__init__.py @@ -164,6 +164,7 @@ from .event_search_params import EventSearchParams as EventSearchParams from .event_update_params import EventUpdateParams as EventUpdateParams from .invoice_list_params import InvoiceListParams as InvoiceListParams +from .license_list_params import LicenseListParams as LicenseListParams from .price_create_params import PriceCreateParams as PriceCreateParams from .price_update_params import PriceUpdateParams as PriceUpdateParams from .alert_disable_params import AlertDisableParams as AlertDisableParams @@ -179,23 +180,39 @@ from .event_update_response import EventUpdateResponse as EventUpdateResponse from .invoice_create_params import InvoiceCreateParams as InvoiceCreateParams from .invoice_update_params import InvoiceUpdateParams as InvoiceUpdateParams +from .license_create_params import LicenseCreateParams as LicenseCreateParams +from .license_list_response import LicenseListResponse as LicenseListResponse from .price_evaluate_params import PriceEvaluateParams as PriceEvaluateParams from .customer_create_params import CustomerCreateParams as CustomerCreateParams from .customer_update_params import CustomerUpdateParams as CustomerUpdateParams from .credit_note_list_params import CreditNoteListParams as CreditNoteListParams from .dimensional_price_group import DimensionalPriceGroup as DimensionalPriceGroup from .discount_override_param import DiscountOverrideParam as DiscountOverrideParam +from .license_create_response import LicenseCreateResponse as LicenseCreateResponse from .price_evaluate_response import PriceEvaluateResponse as PriceEvaluateResponse from .top_level_ping_response import TopLevelPingResponse as TopLevelPingResponse from .dimensional_price_groups import DimensionalPriceGroups as DimensionalPriceGroups from .event_deprecate_response import EventDeprecateResponse as EventDeprecateResponse from .invoice_mark_paid_params import InvoiceMarkPaidParams as InvoiceMarkPaidParams +from .license_type_list_params import LicenseTypeListParams as LicenseTypeListParams from .subscription_list_params import SubscriptionListParams as SubscriptionListParams from .credit_note_create_params import CreditNoteCreateParams as CreditNoteCreateParams +from .license_deactivate_params import LicenseDeactivateParams as LicenseDeactivateParams +from .license_retrieve_response import LicenseRetrieveResponse as LicenseRetrieveResponse +from .license_type_create_params import LicenseTypeCreateParams as LicenseTypeCreateParams +from .license_type_list_response import LicenseTypeListResponse as LicenseTypeListResponse from .subscription_cancel_params import SubscriptionCancelParams as SubscriptionCancelParams from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams +from .invoice_list_summary_params import InvoiceListSummaryParams as InvoiceListSummaryParams +from .license_deactivate_response import LicenseDeactivateResponse as LicenseDeactivateResponse +from .invoice_issue_summary_params import InvoiceIssueSummaryParams as InvoiceIssueSummaryParams +from .license_type_create_response import LicenseTypeCreateResponse as LicenseTypeCreateResponse from .invoice_fetch_upcoming_params import InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams +from .invoice_list_summary_response import InvoiceListSummaryResponse as InvoiceListSummaryResponse +from .credit_block_retrieve_response import CreditBlockRetrieveResponse as CreditBlockRetrieveResponse +from .invoice_issue_summary_response import InvoiceIssueSummaryResponse as InvoiceIssueSummaryResponse +from .license_type_retrieve_response import LicenseTypeRetrieveResponse as LicenseTypeRetrieveResponse from .new_sphere_configuration_param import NewSphereConfigurationParam as NewSphereConfigurationParam from .price_evaluate_multiple_params import PriceEvaluateMultipleParams as PriceEvaluateMultipleParams from .beta_create_plan_version_params import BetaCreatePlanVersionParams as BetaCreatePlanVersionParams @@ -203,6 +220,7 @@ from .invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse from .invoice_line_item_create_params import InvoiceLineItemCreateParams as InvoiceLineItemCreateParams from .new_tax_jar_configuration_param import NewTaxJarConfigurationParam as NewTaxJarConfigurationParam +from .subscription_change_list_params import SubscriptionChangeListParams as SubscriptionChangeListParams from .subscription_fetch_costs_params import SubscriptionFetchCostsParams as SubscriptionFetchCostsParams from .subscription_fetch_usage_params import SubscriptionFetchUsageParams as SubscriptionFetchUsageParams from .accounting_provider_config_param import AccountingProviderConfigParam as AccountingProviderConfigParam @@ -214,11 +232,13 @@ from .new_reporting_configuration_param import NewReportingConfigurationParam as NewReportingConfigurationParam from .new_subscription_bulk_price_param import NewSubscriptionBulkPriceParam as NewSubscriptionBulkPriceParam from .new_subscription_unit_price_param import NewSubscriptionUnitPriceParam as NewSubscriptionUnitPriceParam +from .subscription_change_list_response import SubscriptionChangeListResponse as SubscriptionChangeListResponse from .subscription_fetch_costs_response import SubscriptionFetchCostsResponse as SubscriptionFetchCostsResponse from .subscription_redeem_coupon_params import SubscriptionRedeemCouponParams as SubscriptionRedeemCouponParams from .subscription_trigger_phase_params import SubscriptionTriggerPhaseParams as SubscriptionTriggerPhaseParams from .subscription_change_apply_response import SubscriptionChangeApplyResponse as SubscriptionChangeApplyResponse from .subscription_fetch_schedule_params import SubscriptionFetchScheduleParams as SubscriptionFetchScheduleParams +from .credit_block_list_invoices_response import CreditBlockListInvoicesResponse as CreditBlockListInvoicesResponse from .dimensional_price_group_list_params import DimensionalPriceGroupListParams as DimensionalPriceGroupListParams from .new_avalara_tax_configuration_param import NewAvalaraTaxConfigurationParam as NewAvalaraTaxConfigurationParam from .new_subscription_matrix_price_param import NewSubscriptionMatrixPriceParam as NewSubscriptionMatrixPriceParam @@ -240,12 +260,18 @@ from .subscription_change_retrieve_response import ( SubscriptionChangeRetrieveResponse as SubscriptionChangeRetrieveResponse, ) +from .license_retrieve_by_external_id_params import ( + LicenseRetrieveByExternalIDParams as LicenseRetrieveByExternalIDParams, +) from .price_evaluate_preview_events_response import ( PriceEvaluatePreviewEventsResponse as PriceEvaluatePreviewEventsResponse, ) from .new_accounting_sync_configuration_param import ( NewAccountingSyncConfigurationParam as NewAccountingSyncConfigurationParam, ) +from .license_retrieve_by_external_id_response import ( + LicenseRetrieveByExternalIDResponse as LicenseRetrieveByExternalIDResponse, +) from .subscription_schedule_plan_change_params import ( SubscriptionSchedulePlanChangeParams as SubscriptionSchedulePlanChangeParams, ) diff --git a/src/orb_sdk/types/alert.py b/src/orb_sdk/types/alert.py index f6669b1..433daf3 100644 --- a/src/orb_sdk/types/alert.py +++ b/src/orb_sdk/types/alert.py @@ -9,14 +9,18 @@ from .shared.customer_minified import CustomerMinified from .shared.subscription_minified import SubscriptionMinified -__all__ = ["Alert", "Metric", "Plan", "BalanceAlertStatus"] +__all__ = ["Alert", "Metric", "Plan", "BalanceAlertStatus", "LicenseType"] class Metric(BaseModel): + """The metric the alert applies to.""" + id: str class Plan(BaseModel): + """The plan the alert applies to.""" + id: Optional[str] = None external_plan_id: Optional[str] = None @@ -32,6 +36,8 @@ class Plan(BaseModel): class BalanceAlertStatus(BaseModel): + """Alert status is used to determine if an alert is currently in-alert or not.""" + in_alert: bool """Whether the alert is currently in-alert or not.""" @@ -39,7 +45,20 @@ class BalanceAlertStatus(BaseModel): """The value of the threshold that defines the alert status.""" +class LicenseType(BaseModel): + """Minified license type for alert serialization.""" + + id: str + + class Alert(BaseModel): + """ + [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, + usage, or credit balance and trigger webhooks when a threshold is exceeded. + + Alerts created through the API can be scoped to either customers or subscriptions. + """ + id: str """Also referred to as alert_id in this documentation.""" @@ -76,6 +95,7 @@ class Alert(BaseModel): "credit_balance_recovered", "usage_exceeded", "cost_exceeded", + "license_balance_threshold_reached", ] """The type of alert. This must be a valid alert type.""" @@ -84,3 +104,6 @@ class Alert(BaseModel): This field is only present for credit balance alerts. """ + + license_type: Optional[LicenseType] = None + """Minified license type for alert serialization.""" diff --git a/src/orb_sdk/types/beta/external_plan_id_create_plan_version_params.py b/src/orb_sdk/types/beta/external_plan_id_create_plan_version_params.py index 6f22d13..6b31bed 100644 --- a/src/orb_sdk/types/beta/external_plan_id_create_plan_version_params.py +++ b/src/orb_sdk/types/beta/external_plan_id_create_plan_version_params.py @@ -140,6 +140,8 @@ class AddAdjustment(TypedDict, total=False): class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -148,6 +150,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedD class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -156,6 +160,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDic class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -235,6 +241,9 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -250,6 +259,8 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -258,6 +269,8 @@ class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier( class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -337,6 +350,9 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -352,6 +368,8 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -439,6 +457,9 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -454,6 +475,8 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals class AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -541,6 +564,9 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -556,6 +582,8 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -632,6 +660,9 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -647,6 +678,8 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -736,6 +769,9 @@ class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -829,6 +865,8 @@ class ReplaceAdjustment(TypedDict, total=False): class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -837,6 +875,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(Ty class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -845,6 +885,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(Type class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -924,6 +966,9 @@ class ReplacePricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -939,6 +984,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -947,6 +994,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigT class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1026,6 +1075,9 @@ class ReplacePricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1041,6 +1093,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -1128,6 +1182,9 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1143,6 +1200,8 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= class ReplacePricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -1230,6 +1289,9 @@ class ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total= If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1245,6 +1307,8 @@ class ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total= class ReplacePricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -1321,6 +1385,9 @@ class ReplacePricePriceNewPlanPercentCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1336,6 +1403,8 @@ class ReplacePricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -1425,6 +1494,9 @@ class ReplacePricePriceNewPlanEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/beta_create_plan_version_params.py b/src/orb_sdk/types/beta_create_plan_version_params.py index 3b12717..813cbba 100644 --- a/src/orb_sdk/types/beta_create_plan_version_params.py +++ b/src/orb_sdk/types/beta_create_plan_version_params.py @@ -140,6 +140,8 @@ class AddAdjustment(TypedDict, total=False): class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -148,6 +150,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedD class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -156,6 +160,8 @@ class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDic class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -235,6 +241,9 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -250,6 +259,8 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -258,6 +269,8 @@ class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier( class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -337,6 +350,9 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -352,6 +368,8 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -439,6 +457,9 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -454,6 +475,8 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals class AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -541,6 +564,9 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -556,6 +582,8 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -632,6 +660,9 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -647,6 +678,8 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -736,6 +769,9 @@ class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -829,6 +865,8 @@ class ReplaceAdjustment(TypedDict, total=False): class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -837,6 +875,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(Ty class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -845,6 +885,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(Type class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -924,6 +966,9 @@ class ReplacePricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -939,6 +984,8 @@ class ReplacePricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -947,6 +994,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigT class ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[ReplacePricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1026,6 +1075,9 @@ class ReplacePricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1041,6 +1093,8 @@ class ReplacePricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -1128,6 +1182,9 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1143,6 +1200,8 @@ class ReplacePricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total= class ReplacePricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -1230,6 +1289,9 @@ class ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total= If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1245,6 +1307,8 @@ class ReplacePricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total= class ReplacePricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -1321,6 +1385,9 @@ class ReplacePricePriceNewPlanPercentCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1336,6 +1403,8 @@ class ReplacePricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class ReplacePricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -1425,6 +1494,9 @@ class ReplacePricePriceNewPlanEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/billable_metric.py b/src/orb_sdk/types/billable_metric.py index ac70464..e618c40 100644 --- a/src/orb_sdk/types/billable_metric.py +++ b/src/orb_sdk/types/billable_metric.py @@ -10,6 +10,11 @@ class BillableMetric(BaseModel): + """ + The Metric resource represents a calculation of a quantity based on events. + Metrics are defined by the query that transforms raw usage events into meaningful values for your customers. + """ + id: str description: Optional[str] = None diff --git a/src/orb_sdk/types/coupon.py b/src/orb_sdk/types/coupon.py index c0ac61b..1e77708 100644 --- a/src/orb_sdk/types/coupon.py +++ b/src/orb_sdk/types/coupon.py @@ -15,6 +15,10 @@ class Coupon(BaseModel): + """ + A coupon represents a reusable discount configuration that can be applied either as a fixed or percentage amount to an invoice or subscription. Coupons are activated using a redemption code, which applies the discount to a subscription or invoice. The duration of a coupon determines how long it remains available for use by end users. + """ + id: str """Also referred to as coupon_id in this documentation.""" diff --git a/src/orb_sdk/types/credit_block_list_invoices_response.py b/src/orb_sdk/types/credit_block_list_invoices_response.py new file mode 100644 index 0000000..8627268 --- /dev/null +++ b/src/orb_sdk/types/credit_block_list_invoices_response.py @@ -0,0 +1,69 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel +from .shared.customer_minified import CustomerMinified +from .shared.subscription_minified import SubscriptionMinified + +__all__ = ["CreditBlockListInvoicesResponse", "Block", "BlockFilter", "Invoice"] + + +class BlockFilter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + +class Block(BaseModel): + """The Credit Block resource models prepaid credits within Orb.""" + + id: str + + balance: float + + effective_date: Optional[datetime] = None + + expiry_date: Optional[datetime] = None + + filters: List[BlockFilter] + + maximum_initial_balance: Optional[float] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + per_unit_cost_basis: Optional[str] = None + + status: Literal["active", "pending_payment"] + + +class Invoice(BaseModel): + id: str + + customer: CustomerMinified + + invoice_number: str + + status: Literal["issued", "paid", "synced", "void", "draft"] + + subscription: Optional[SubscriptionMinified] = None + + +class CreditBlockListInvoicesResponse(BaseModel): + block: Block + """The Credit Block resource models prepaid credits within Orb.""" + + invoices: List[Invoice] diff --git a/src/orb_sdk/types/credit_block_retrieve_response.py b/src/orb_sdk/types/credit_block_retrieve_response.py new file mode 100644 index 0000000..a9bbb22 --- /dev/null +++ b/src/orb_sdk/types/credit_block_retrieve_response.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["CreditBlockRetrieveResponse", "Filter"] + + +class Filter(BaseModel): + field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] + """The property of the price to filter on.""" + + operator: Literal["includes", "excludes"] + """Should prices that match the filter be included or excluded.""" + + values: List[str] + """The IDs or values that match this filter.""" + + +class CreditBlockRetrieveResponse(BaseModel): + """The Credit Block resource models prepaid credits within Orb.""" + + id: str + + balance: float + + effective_date: Optional[datetime] = None + + expiry_date: Optional[datetime] = None + + filters: List[Filter] + + maximum_initial_balance: Optional[float] = None + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + per_unit_cost_basis: Optional[str] = None + + status: Literal["active", "pending_payment"] diff --git a/src/orb_sdk/types/customer.py b/src/orb_sdk/types/customer.py index af140d3..4eccf4a 100644 --- a/src/orb_sdk/types/customer.py +++ b/src/orb_sdk/types/customer.py @@ -14,11 +14,15 @@ "Hierarchy", "AccountingSyncConfiguration", "AccountingSyncConfigurationAccountingProvider", + "PaymentConfiguration", + "PaymentConfigurationPaymentProvider", "ReportingConfiguration", ] class Hierarchy(BaseModel): + """The hierarchical relationships for this customer.""" + children: List[CustomerMinified] parent: Optional[CustomerMinified] = None @@ -36,11 +40,51 @@ class AccountingSyncConfiguration(BaseModel): excluded: bool +class PaymentConfigurationPaymentProvider(BaseModel): + provider_type: Literal["stripe"] + """The payment provider to configure.""" + + excluded_payment_method_types: Optional[List[str]] = None + """List of Stripe payment method types to exclude for this customer. + + Excluded payment methods will not be available for the customer to select during + payment, and will not be used for auto-collection. If a customer's default + payment method becomes excluded, Orb will attempt to use the next available + compatible payment method for auto-collection. + """ + + +class PaymentConfiguration(BaseModel): + """ + Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe. + """ + + payment_providers: Optional[List[PaymentConfigurationPaymentProvider]] = None + """Provider-specific payment configuration.""" + + class ReportingConfiguration(BaseModel): exempt: bool class Customer(BaseModel): + """ + A customer is a buyer of your products, and the other party to the billing relationship. + + In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these + match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an + `external_customer_id` with your own identifier. See + [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how these + aliases work in Orb. + + In addition to having an identifier in your system, a customer may exist in a payment provider solution like + Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping. + + A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which + defaults to your account's timezone. See [Timezone localization](/essentials/timezones) for + information on what this timezone parameter influences within Orb. + """ + id: str additional_emails: List[str] @@ -220,6 +264,7 @@ class Customer(BaseModel): | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -276,4 +321,10 @@ class Customer(BaseModel): boolean value. """ + payment_configuration: Optional[PaymentConfiguration] = None + """ + Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + """ + reporting_configuration: Optional[ReportingConfiguration] = None diff --git a/src/orb_sdk/types/customer_create_params.py b/src/orb_sdk/types/customer_create_params.py index beb6ca6..7d8e615 100644 --- a/src/orb_sdk/types/customer_create_params.py +++ b/src/orb_sdk/types/customer_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .._types import SequenceNotStr @@ -17,6 +17,8 @@ __all__ = [ "CustomerCreateParams", + "PaymentConfiguration", + "PaymentConfigurationPaymentProvider", "TaxConfiguration", "TaxConfigurationNewNumeralConfiguration", "TaxConfigurationNewAnrokConfiguration", @@ -87,6 +89,12 @@ class CustomerCreateParams(TypedDict, total=False): metadata mapping can be cleared by setting `metadata` to `null`. """ + payment_configuration: Optional[PaymentConfiguration] + """ + Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + """ + payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] """This is used for creating charges or invoices in an external system via Orb. @@ -214,6 +222,7 @@ class CustomerCreateParams(TypedDict, total=False): | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -262,6 +271,29 @@ class CustomerCreateParams(TypedDict, total=False): """ +class PaymentConfigurationPaymentProvider(TypedDict, total=False): + provider_type: Required[Literal["stripe"]] + """The payment provider to configure.""" + + excluded_payment_method_types: SequenceNotStr[str] + """List of Stripe payment method types to exclude for this customer. + + Excluded payment methods will not be available for the customer to select during + payment, and will not be used for auto-collection. If a customer's default + payment method becomes excluded, Orb will attempt to use the next available + compatible payment method for auto-collection. + """ + + +class PaymentConfiguration(TypedDict, total=False): + """ + Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe. + """ + + payment_providers: Iterable[PaymentConfigurationPaymentProvider] + """Provider-specific payment configuration.""" + + class TaxConfigurationNewNumeralConfiguration(TypedDict, total=False): tax_exempt: Required[bool] diff --git a/src/orb_sdk/types/customer_update_by_external_id_params.py b/src/orb_sdk/types/customer_update_by_external_id_params.py index 1738846..3d7a832 100644 --- a/src/orb_sdk/types/customer_update_by_external_id_params.py +++ b/src/orb_sdk/types/customer_update_by_external_id_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .._types import SequenceNotStr @@ -17,6 +17,8 @@ __all__ = [ "CustomerUpdateByExternalIDParams", + "PaymentConfiguration", + "PaymentConfigurationPaymentProvider", "TaxConfiguration", "TaxConfigurationNewNumeralConfiguration", "TaxConfigurationNewAnrokConfiguration", @@ -85,6 +87,12 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): name: Optional[str] """The full name of the customer""" + payment_configuration: Optional[PaymentConfiguration] + """ + Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + """ + payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] """This is used for creating charges or invoices in an external system via Orb. @@ -216,6 +224,7 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -257,6 +266,29 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): """ +class PaymentConfigurationPaymentProvider(TypedDict, total=False): + provider_type: Required[Literal["stripe"]] + """The payment provider to configure.""" + + excluded_payment_method_types: SequenceNotStr[str] + """List of Stripe payment method types to exclude for this customer. + + Excluded payment methods will not be available for the customer to select during + payment, and will not be used for auto-collection. If a customer's default + payment method becomes excluded, Orb will attempt to use the next available + compatible payment method for auto-collection. + """ + + +class PaymentConfiguration(TypedDict, total=False): + """ + Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe. + """ + + payment_providers: Iterable[PaymentConfigurationPaymentProvider] + """Provider-specific payment configuration.""" + + class TaxConfigurationNewNumeralConfiguration(TypedDict, total=False): tax_exempt: Required[bool] diff --git a/src/orb_sdk/types/customer_update_params.py b/src/orb_sdk/types/customer_update_params.py index af9e86c..13673f4 100644 --- a/src/orb_sdk/types/customer_update_params.py +++ b/src/orb_sdk/types/customer_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .._types import SequenceNotStr @@ -17,6 +17,8 @@ __all__ = [ "CustomerUpdateParams", + "PaymentConfiguration", + "PaymentConfigurationPaymentProvider", "TaxConfiguration", "TaxConfigurationNewNumeralConfiguration", "TaxConfigurationNewAnrokConfiguration", @@ -85,6 +87,12 @@ class CustomerUpdateParams(TypedDict, total=False): name: Optional[str] """The full name of the customer""" + payment_configuration: Optional[PaymentConfiguration] + """ + Payment configuration for the customer, applicable when using Orb Invoicing with + a supported payment provider such as Stripe. + """ + payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] """This is used for creating charges or invoices in an external system via Orb. @@ -216,6 +224,7 @@ class CustomerUpdateParams(TypedDict, total=False): | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | @@ -257,6 +266,29 @@ class CustomerUpdateParams(TypedDict, total=False): """ +class PaymentConfigurationPaymentProvider(TypedDict, total=False): + provider_type: Required[Literal["stripe"]] + """The payment provider to configure.""" + + excluded_payment_method_types: SequenceNotStr[str] + """List of Stripe payment method types to exclude for this customer. + + Excluded payment methods will not be available for the customer to select during + payment, and will not be used for auto-collection. If a customer's default + payment method becomes excluded, Orb will attempt to use the next available + compatible payment method for auto-collection. + """ + + +class PaymentConfiguration(TypedDict, total=False): + """ + Payment configuration for the customer, applicable when using Orb Invoicing with a supported payment provider such as Stripe. + """ + + payment_providers: Iterable[PaymentConfigurationPaymentProvider] + """Provider-specific payment configuration.""" + + class TaxConfigurationNewNumeralConfiguration(TypedDict, total=False): tax_exempt: Required[bool] diff --git a/src/orb_sdk/types/customers/credit_list_by_external_id_params.py b/src/orb_sdk/types/customers/credit_list_by_external_id_params.py index 4074c82..0d32d3c 100644 --- a/src/orb_sdk/types/customers/credit_list_by_external_id_params.py +++ b/src/orb_sdk/types/customers/credit_list_by_external_id_params.py @@ -2,8 +2,11 @@ from __future__ import annotations -from typing import Optional -from typing_extensions import TypedDict +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["CreditListByExternalIDParams"] @@ -19,6 +22,18 @@ class CreditListByExternalIDParams(TypedDict, total=False): request. """ + effective_date_gt: Annotated[Union[str, datetime, None], PropertyInfo(alias="effective_date[gt]", format="iso8601")] + + effective_date_gte: Annotated[ + Union[str, datetime, None], PropertyInfo(alias="effective_date[gte]", format="iso8601") + ] + + effective_date_lt: Annotated[Union[str, datetime, None], PropertyInfo(alias="effective_date[lt]", format="iso8601")] + + effective_date_lte: Annotated[ + Union[str, datetime, None], PropertyInfo(alias="effective_date[lte]", format="iso8601") + ] + include_all_blocks: bool """ If set to True, all expired and depleted blocks, as well as active block will be diff --git a/src/orb_sdk/types/customers/credit_list_by_external_id_response.py b/src/orb_sdk/types/customers/credit_list_by_external_id_response.py index aecee49..3b0de27 100644 --- a/src/orb_sdk/types/customers/credit_list_by_external_id_response.py +++ b/src/orb_sdk/types/customers/credit_list_by_external_id_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -10,6 +10,8 @@ class Filter(BaseModel): + """A PriceFilter that only allows item_id field for block filters.""" + field: Literal["item_id"] """The property of the price the block applies to. Only item_id is supported.""" @@ -33,6 +35,14 @@ class CreditListByExternalIDResponse(BaseModel): maximum_initial_balance: Optional[float] = None + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + per_unit_cost_basis: Optional[str] = None status: Literal["active", "pending_payment"] diff --git a/src/orb_sdk/types/customers/credit_list_params.py b/src/orb_sdk/types/customers/credit_list_params.py index cb3f767..80c44d5 100644 --- a/src/orb_sdk/types/customers/credit_list_params.py +++ b/src/orb_sdk/types/customers/credit_list_params.py @@ -2,8 +2,11 @@ from __future__ import annotations -from typing import Optional -from typing_extensions import TypedDict +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["CreditListParams"] @@ -19,6 +22,18 @@ class CreditListParams(TypedDict, total=False): request. """ + effective_date_gt: Annotated[Union[str, datetime, None], PropertyInfo(alias="effective_date[gt]", format="iso8601")] + + effective_date_gte: Annotated[ + Union[str, datetime, None], PropertyInfo(alias="effective_date[gte]", format="iso8601") + ] + + effective_date_lt: Annotated[Union[str, datetime, None], PropertyInfo(alias="effective_date[lt]", format="iso8601")] + + effective_date_lte: Annotated[ + Union[str, datetime, None], PropertyInfo(alias="effective_date[lte]", format="iso8601") + ] + include_all_blocks: bool """ If set to True, all expired and depleted blocks, as well as active block will be diff --git a/src/orb_sdk/types/customers/credit_list_response.py b/src/orb_sdk/types/customers/credit_list_response.py index 7de7e99..145e019 100644 --- a/src/orb_sdk/types/customers/credit_list_response.py +++ b/src/orb_sdk/types/customers/credit_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -10,6 +10,8 @@ class Filter(BaseModel): + """A PriceFilter that only allows item_id field for block filters.""" + field: Literal["item_id"] """The property of the price the block applies to. Only item_id is supported.""" @@ -33,6 +35,14 @@ class CreditListResponse(BaseModel): maximum_initial_balance: Optional[float] = None + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + per_unit_cost_basis: Optional[str] = None status: Literal["active", "pending_payment"] diff --git a/src/orb_sdk/types/customers/credits/ledger_create_entry_by_external_id_params.py b/src/orb_sdk/types/customers/credits/ledger_create_entry_by_external_id_params.py index 05d8b6e..598e681 100644 --- a/src/orb_sdk/types/customers/credits/ledger_create_entry_by_external_id_params.py +++ b/src/orb_sdk/types/customers/credits/ledger_create_entry_by_external_id_params.py @@ -83,6 +83,8 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False): + """A PriceFilter that only allows item_id field for block filters.""" + field: Required[Literal["item_id"]] """The property of the price the block applies to. Only item_id is supported.""" @@ -94,6 +96,10 @@ class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False): class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total=False): + """ + Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify per_unit_cost_basis, as the calculation of the invoice total is done on that basis. + """ + auto_collection: Required[bool] """ Whether the credits purchase invoice should auto collect with the customer's diff --git a/src/orb_sdk/types/customers/credits/ledger_create_entry_params.py b/src/orb_sdk/types/customers/credits/ledger_create_entry_params.py index 55843f6..b0b47f7 100644 --- a/src/orb_sdk/types/customers/credits/ledger_create_entry_params.py +++ b/src/orb_sdk/types/customers/credits/ledger_create_entry_params.py @@ -83,6 +83,8 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False): + """A PriceFilter that only allows item_id field for block filters.""" + field: Required[Literal["item_id"]] """The property of the price the block applies to. Only item_id is supported.""" @@ -94,6 +96,10 @@ class AddIncrementCreditLedgerEntryRequestParamsFilter(TypedDict, total=False): class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total=False): + """ + Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify per_unit_cost_basis, as the calculation of the invoice total is done on that basis. + """ + auto_collection: Required[bool] """ Whether the credits purchase invoice should auto collect with the customer's diff --git a/src/orb_sdk/types/customers/credits/top_up_create_by_external_id_params.py b/src/orb_sdk/types/customers/credits/top_up_create_by_external_id_params.py index 3683f42..189d8c6 100644 --- a/src/orb_sdk/types/customers/credits/top_up_create_by_external_id_params.py +++ b/src/orb_sdk/types/customers/credits/top_up_create_by_external_id_params.py @@ -52,6 +52,8 @@ class TopUpCreateByExternalIDParams(TypedDict, total=False): class InvoiceSettings(TypedDict, total=False): + """Settings for invoices generated by triggered top-ups.""" + auto_collection: Required[bool] """ Whether the credits purchase invoice should auto collect with the customer's diff --git a/src/orb_sdk/types/customers/credits/top_up_create_params.py b/src/orb_sdk/types/customers/credits/top_up_create_params.py index 6c7ee85..7ffef30 100644 --- a/src/orb_sdk/types/customers/credits/top_up_create_params.py +++ b/src/orb_sdk/types/customers/credits/top_up_create_params.py @@ -52,6 +52,8 @@ class TopUpCreateParams(TypedDict, total=False): class InvoiceSettings(TypedDict, total=False): + """Settings for invoices generated by triggered top-ups.""" + auto_collection: Required[bool] """ Whether the credits purchase invoice should auto collect with the customer's diff --git a/src/orb_sdk/types/dimensional_price_group.py b/src/orb_sdk/types/dimensional_price_group.py index da10312..5d196e0 100644 --- a/src/orb_sdk/types/dimensional_price_group.py +++ b/src/orb_sdk/types/dimensional_price_group.py @@ -8,6 +8,11 @@ class DimensionalPriceGroup(BaseModel): + """ + A dimensional price group is used to partition the result of a billable metric by a set of dimensions. Prices in a + price group must specify the parition used to derive their usage. + """ + id: str billable_metric_id: str diff --git a/src/orb_sdk/types/event_ingest_response.py b/src/orb_sdk/types/event_ingest_response.py index 933e18c..92fcf7d 100644 --- a/src/orb_sdk/types/event_ingest_response.py +++ b/src/orb_sdk/types/event_ingest_response.py @@ -19,6 +19,10 @@ class ValidationFailed(BaseModel): class Debug(BaseModel): + """ + Optional debug information (only present when debug=true is passed to the endpoint). Contains ingested and duplicate event idempotency keys. + """ + duplicate: List[str] ingested: List[str] diff --git a/src/orb_sdk/types/event_search_response.py b/src/orb_sdk/types/event_search_response.py index 7532454..9c252c4 100644 --- a/src/orb_sdk/types/event_search_response.py +++ b/src/orb_sdk/types/event_search_response.py @@ -9,6 +9,12 @@ class Data(BaseModel): + """ + The [Event](/core-concepts#event) resource represents a usage event that has been created for a + customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for + a given billing period. + """ + id: str """A unique value, generated by the client, that is used to de-duplicate events. diff --git a/src/orb_sdk/types/events/backfill_close_response.py b/src/orb_sdk/types/events/backfill_close_response.py index 058edeb..79725b6 100644 --- a/src/orb_sdk/types/events/backfill_close_response.py +++ b/src/orb_sdk/types/events/backfill_close_response.py @@ -10,6 +10,10 @@ class BackfillCloseResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb_sdk/types/events/backfill_create_response.py b/src/orb_sdk/types/events/backfill_create_response.py index 90e185d..0f74914 100644 --- a/src/orb_sdk/types/events/backfill_create_response.py +++ b/src/orb_sdk/types/events/backfill_create_response.py @@ -10,6 +10,10 @@ class BackfillCreateResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb_sdk/types/events/backfill_fetch_response.py b/src/orb_sdk/types/events/backfill_fetch_response.py index 2c25337..182bc20 100644 --- a/src/orb_sdk/types/events/backfill_fetch_response.py +++ b/src/orb_sdk/types/events/backfill_fetch_response.py @@ -10,6 +10,10 @@ class BackfillFetchResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb_sdk/types/events/backfill_list_response.py b/src/orb_sdk/types/events/backfill_list_response.py index b470ba1..2db0a72 100644 --- a/src/orb_sdk/types/events/backfill_list_response.py +++ b/src/orb_sdk/types/events/backfill_list_response.py @@ -10,6 +10,10 @@ class BackfillListResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb_sdk/types/events/backfill_revert_response.py b/src/orb_sdk/types/events/backfill_revert_response.py index 52ec131..949ac1b 100644 --- a/src/orb_sdk/types/events/backfill_revert_response.py +++ b/src/orb_sdk/types/events/backfill_revert_response.py @@ -10,6 +10,10 @@ class BackfillRevertResponse(BaseModel): + """ + A backfill represents an update to historical usage data, adding or replacing events in a timeframe. + """ + id: str close_time: Optional[datetime] = None diff --git a/src/orb_sdk/types/events/event_volumes.py b/src/orb_sdk/types/events/event_volumes.py index f9852aa..f9e84b3 100644 --- a/src/orb_sdk/types/events/event_volumes.py +++ b/src/orb_sdk/types/events/event_volumes.py @@ -9,6 +9,12 @@ class Data(BaseModel): + """An EventVolume contains the event volume ingested in an hourly window. + + The timestamp used + for the aggregation is the `timestamp` datetime field on events. + """ + count: int """The number of events ingested with a timestamp between the timeframe""" diff --git a/src/orb_sdk/types/invoice_fetch_upcoming_response.py b/src/orb_sdk/types/invoice_fetch_upcoming_response.py index 3b5338c..8c262e2 100644 --- a/src/orb_sdk/types/invoice_fetch_upcoming_response.py +++ b/src/orb_sdk/types/invoice_fetch_upcoming_response.py @@ -391,6 +391,7 @@ class InvoiceFetchUpcomingResponse(BaseModel): | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | diff --git a/src/orb_sdk/types/invoice_issue_summary_params.py b/src/orb_sdk/types/invoice_issue_summary_params.py new file mode 100644 index 0000000..2ef8061 --- /dev/null +++ b/src/orb_sdk/types/invoice_issue_summary_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["InvoiceIssueSummaryParams"] + + +class InvoiceIssueSummaryParams(TypedDict, total=False): + synchronous: bool + """If true, the invoice will be issued synchronously. + + If false, the invoice will be issued asynchronously. The synchronous option is + only available for invoices that have no usage fees. If the invoice is + configured to sync to an external provider, a successful response from this + endpoint guarantees the invoice is present in the provider. + """ diff --git a/src/orb_sdk/types/invoice_issue_summary_response.py b/src/orb_sdk/types/invoice_issue_summary_response.py new file mode 100644 index 0000000..50151a7 --- /dev/null +++ b/src/orb_sdk/types/invoice_issue_summary_response.py @@ -0,0 +1,432 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel +from .shared.address import Address +from .shared.invoice_tiny import InvoiceTiny +from .shared.customer_tax_id import CustomerTaxID +from .shared.credit_note_tiny import CreditNoteTiny +from .shared.customer_minified import CustomerMinified +from .shared.subscription_minified import SubscriptionMinified + +__all__ = [ + "InvoiceIssueSummaryResponse", + "AutoCollection", + "CreditNote", + "CustomerBalanceTransaction", + "PaymentAttempt", +] + + +class AutoCollection(BaseModel): + enabled: Optional[bool] = None + """True only if auto-collection is enabled for this invoice.""" + + next_attempt_at: Optional[datetime] = None + """ + If the invoice is scheduled for auto-collection, this field will reflect when + the next attempt will occur. If dunning has been exhausted, or auto-collection + is not enabled for this invoice, this field will be `null`. + """ + + num_attempts: Optional[int] = None + """Number of auto-collection payment attempts.""" + + previously_attempted_at: Optional[datetime] = None + """ + If Orb has ever attempted payment auto-collection for this invoice, this field + will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + this can be used to tell whether the invoice is currently in dunning (that is, + `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + if dunning has been exhausted (`previously_attempted_at` is non-null, but + `next_attempt_time` is null). + """ + + +class CreditNote(BaseModel): + id: str + + credit_note_number: str + + memo: Optional[str] = None + """An optional memo supplied on the credit note.""" + + reason: str + + total: str + + type: str + + voided_at: Optional[datetime] = None + """ + If the credit note has a status of `void`, this gives a timestamp when the + credit note was voided. + """ + + +class CustomerBalanceTransaction(BaseModel): + id: str + """A unique id for this transaction.""" + + action: Literal[ + "applied_to_invoice", + "manual_adjustment", + "prorated_refund", + "revert_prorated_refund", + "return_from_voiding", + "credit_note_applied", + "credit_note_voided", + "overpayment_refund", + "external_payment", + "small_invoice_carryover", + ] + + amount: str + """The value of the amount changed in the transaction.""" + + created_at: datetime + """The creation time of this transaction.""" + + credit_note: Optional[CreditNoteTiny] = None + + description: Optional[str] = None + """An optional description provided for manual customer balance adjustments.""" + + ending_balance: str + """ + The new value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + invoice: Optional[InvoiceTiny] = None + + starting_balance: str + """ + The original value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + type: Literal["increment", "decrement"] + + +class PaymentAttempt(BaseModel): + id: str + """The ID of the payment attempt.""" + + amount: str + """The amount of the payment attempt.""" + + created_at: datetime + """The time at which the payment attempt was created.""" + + payment_provider: Optional[Literal["stripe"]] = None + """The payment provider that attempted to collect the payment.""" + + payment_provider_id: Optional[str] = None + """The ID of the payment attempt in the payment provider.""" + + receipt_pdf: Optional[str] = None + """URL to the downloadable PDF version of the receipt. + + This field will be `null` for payment attempts that did not succeed. + """ + + succeeded: bool + """Whether the payment attempt succeeded.""" + + +class InvoiceIssueSummaryResponse(BaseModel): + """#InvoiceApiResourceWithoutLineItems""" + + id: str + + amount_due: str + """ + This is the final amount required to be charged to the customer and reflects the + application of the customer balance to the `total` of the invoice. + """ + + auto_collection: AutoCollection + + billing_address: Optional[Address] = None + + created_at: datetime + """The creation time of the resource in Orb.""" + + credit_notes: List[CreditNote] + """A list of credit notes associated with the invoice""" + + currency: str + """An ISO 4217 currency string or `credits`""" + + customer: CustomerMinified + + customer_balance_transactions: List[CustomerBalanceTransaction] + + customer_tax_id: Optional[CustomerTaxID] = None + """ + Tax IDs are commonly required to be displayed on customer invoices, which are + added to the headers of invoices. + + ### Supported Tax ID Countries and Types + + | Country | Type | Description | + | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Albania | `al_tin` | Albania Tax Identification Number | + | Andorra | `ad_nrt` | Andorran NRT Number | + | Angola | `ao_tin` | Angola Tax Identification Number | + | Argentina | `ar_cuit` | Argentinian Tax ID Number | + | Armenia | `am_tin` | Armenia Tax Identification Number | + | Aruba | `aw_tin` | Aruba Tax Identification Number | + | Australia | `au_abn` | Australian Business Number (AU ABN) | + | Australia | `au_arn` | Australian Taxation Office Reference Number | + | Austria | `eu_vat` | European VAT Number | + | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + | Bahrain | `bh_vat` | Bahraini VAT Number | + | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + | Barbados | `bb_tin` | Barbados Tax Identification Number | + | Belarus | `by_tin` | Belarus TIN Number | + | Belgium | `eu_vat` | European VAT Number | + | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + | Bolivia | `bo_tin` | Bolivian Tax ID | + | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + | Brazil | `br_cnpj` | Brazilian CNPJ Number | + | Brazil | `br_cpf` | Brazilian CPF Number | + | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + | Bulgaria | `eu_vat` | European VAT Number | + | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + | Canada | `ca_bn` | Canadian BN | + | Canada | `ca_gst_hst` | Canadian GST/HST Number | + | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + | Canada | `ca_qst` | Canadian QST Number (Québec) | + | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + | Chile | `cl_tin` | Chilean TIN | + | China | `cn_tin` | Chinese Tax ID | + | Colombia | `co_nit` | Colombian NIT Number | + | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + | Costa Rica | `cr_tin` | Costa Rican Tax ID | + | Croatia | `eu_vat` | European VAT Number | + | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + | Cyprus | `eu_vat` | European VAT Number | + | Czech Republic | `eu_vat` | European VAT Number | + | Denmark | `eu_vat` | European VAT Number | + | Dominican Republic | `do_rcn` | Dominican RCN Number | + | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + | Egypt | `eg_tin` | Egyptian Tax Identification Number | + | El Salvador | `sv_nit` | El Salvadorian NIT Number | + | Estonia | `eu_vat` | European VAT Number | + | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + | Finland | `eu_vat` | European VAT Number | + | France | `eu_vat` | European VAT Number | + | Georgia | `ge_vat` | Georgian VAT | + | Germany | `de_stn` | German Tax Number (Steuernummer) | + | Germany | `eu_vat` | European VAT Number | + | Greece | `eu_vat` | European VAT Number | + | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + | Hong Kong | `hk_br` | Hong Kong BR Number | + | Hungary | `eu_vat` | European VAT Number | + | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + | Iceland | `is_vat` | Icelandic VAT | + | India | `in_gst` | Indian GST Number | + | Indonesia | `id_npwp` | Indonesian NPWP Number | + | Ireland | `eu_vat` | European VAT Number | + | Israel | `il_vat` | Israel VAT | + | Italy | `eu_vat` | European VAT Number | + | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + | Laos | `la_tin` | Laos Tax Identification Number | + | Latvia | `eu_vat` | European VAT Number | + | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + | Lithuania | `eu_vat` | European VAT Number | + | Luxembourg | `eu_vat` | European VAT Number | + | Malaysia | `my_frp` | Malaysian FRP Number | + | Malaysia | `my_itn` | Malaysian ITN | + | Malaysia | `my_sst` | Malaysian SST Number | + | Malta | `eu_vat` | European VAT Number | + | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + | Mexico | `mx_rfc` | Mexican RFC Number | + | Moldova | `md_vat` | Moldova VAT Number | + | Montenegro | `me_pib` | Montenegro PIB Number | + | Morocco | `ma_vat` | Morocco VAT Number | + | Nepal | `np_pan` | Nepal PAN Number | + | Netherlands | `eu_vat` | European VAT Number | + | New Zealand | `nz_gst` | New Zealand GST Number | + | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + | North Macedonia | `mk_vat` | North Macedonia VAT Number | + | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + | Norway | `no_vat` | Norwegian VAT Number | + | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + | Oman | `om_vat` | Omani VAT Number | + | Peru | `pe_ruc` | Peruvian RUC Number | + | Philippines | `ph_tin` | Philippines Tax Identification Number | + | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | + | Portugal | `eu_vat` | European VAT Number | + | Romania | `eu_vat` | European VAT Number | + | Romania | `ro_tin` | Romanian Tax ID Number | + | Russia | `ru_inn` | Russian INN | + | Russia | `ru_kpp` | Russian KPP | + | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + | Senegal | `sn_ninea` | Senegal NINEA Number | + | Serbia | `rs_pib` | Serbian PIB Number | + | Singapore | `sg_gst` | Singaporean GST | + | Singapore | `sg_uen` | Singaporean UEN | + | Slovakia | `eu_vat` | European VAT Number | + | Slovenia | `eu_vat` | European VAT Number | + | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + | South Africa | `za_vat` | South African VAT Number | + | South Korea | `kr_brn` | Korean BRN | + | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + | Spain | `eu_vat` | European VAT Number | + | Suriname | `sr_fin` | Suriname FIN Number | + | Sweden | `eu_vat` | European VAT Number | + | Switzerland | `ch_uid` | Switzerland UID Number | + | Switzerland | `ch_vat` | Switzerland VAT Number | + | Taiwan | `tw_vat` | Taiwanese VAT | + | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + | Tanzania | `tz_vat` | Tanzania VAT Number | + | Thailand | `th_vat` | Thai VAT | + | Turkey | `tr_tin` | Turkish Tax Identification Number | + | Uganda | `ug_tin` | Uganda Tax Identification Number | + | Ukraine | `ua_vat` | Ukrainian VAT | + | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + | United Kingdom | `gb_vat` | United Kingdom VAT Number | + | United States | `us_ein` | United States EIN | + | Uruguay | `uy_ruc` | Uruguayan RUC Number | + | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + | Venezuela | `ve_rif` | Venezuelan RIF Number | + | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + | Zambia | `zm_tin` | Zambia Tax Identification Number | + | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + """ + + due_date: Optional[datetime] = None + """When the invoice payment is due. + + The due date is null if the invoice is not yet finalized. + """ + + eligible_to_issue_at: Optional[datetime] = None + """ + If the invoice has a status of `draft`, this will be the time that the invoice + will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is + true, the invoice will automatically begin issuing at this time. + """ + + hosted_invoice_url: Optional[str] = None + """A URL for the customer-facing invoice portal. + + This URL expires 30 days after the invoice's due date, or 60 days after being + re-generated through the UI. + """ + + invoice_date: datetime + """The scheduled date of the invoice""" + + invoice_number: str + """Automatically generated invoice number to help track and reconcile invoices. + + Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per + account or customer. + """ + + invoice_pdf: Optional[str] = None + """The link to download the PDF representation of the `Invoice`.""" + + invoice_source: Literal["subscription", "partial", "one_off"] + + issue_failed_at: Optional[datetime] = None + """ + If the invoice failed to issue, this will be the last time it failed to issue + (even if it is now in a different state.) + """ + + issued_at: Optional[datetime] = None + """ + If the invoice has been issued, this will be the time it transitioned to + `issued` (even if it is now in a different state.) + """ + + memo: Optional[str] = None + """ + Free-form text which is available on the invoice PDF and the Orb invoice portal. + """ + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + paid_at: Optional[datetime] = None + """ + If the invoice has a status of `paid`, this gives a timestamp when the invoice + was paid. + """ + + payment_attempts: List[PaymentAttempt] + """A list of payment attempts associated with the invoice""" + + payment_failed_at: Optional[datetime] = None + """ + If payment was attempted on this invoice but failed, this will be the time of + the most recent attempt. + """ + + payment_started_at: Optional[datetime] = None + """ + If payment was attempted on this invoice, this will be the start time of the + most recent attempt. This field is especially useful for delayed-notification + payment mechanisms (like bank transfers), where payment can take 3 days or more. + """ + + scheduled_issue_at: Optional[datetime] = None + """ + If the invoice is in draft, this timestamp will reflect when the invoice is + scheduled to be issued. + """ + + shipping_address: Optional[Address] = None + + status: Literal["issued", "paid", "synced", "void", "draft"] + + subscription: Optional[SubscriptionMinified] = None + + sync_failed_at: Optional[datetime] = None + """ + If the invoice failed to sync, this will be the last time an external invoicing + provider sync was attempted. This field will always be `null` for invoices using + Orb Invoicing. + """ + + total: str + """The total after any minimums and discounts have been applied.""" + + voided_at: Optional[datetime] = None + """ + If the invoice has a status of `void`, this gives a timestamp when the invoice + was voided. + """ + + will_auto_issue: bool + """ + This is true if the invoice will be automatically issued in the future, and + false otherwise. + """ diff --git a/src/orb_sdk/types/invoice_list_summary_params.py b/src/orb_sdk/types/invoice_list_summary_params.py new file mode 100644 index 0000000..41b86e6 --- /dev/null +++ b/src/orb_sdk/types/invoice_list_summary_params.py @@ -0,0 +1,63 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from datetime import date, datetime +from typing_extensions import Literal, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["InvoiceListSummaryParams"] + + +class InvoiceListSummaryParams(TypedDict, total=False): + amount: Optional[str] + + amount_gt: Annotated[Optional[str], PropertyInfo(alias="amount[gt]")] + + amount_lt: Annotated[Optional[str], PropertyInfo(alias="amount[lt]")] + + cursor: Optional[str] + """Cursor for pagination. + + This can be populated by the `next_cursor` value returned from the initial + request. + """ + + customer_id: Optional[str] + + date_type: Optional[Literal["due_date", "invoice_date"]] + + due_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + + due_date_window: Optional[str] + """Filters invoices by their due dates within a specific time range in the past. + + Specify the range as a number followed by 'd' (days) or 'm' (months). For + example, '7d' filters invoices due in the last 7 days, and '2m' filters those + due in the last 2 months. + """ + + due_date_gt: Annotated[Union[str, date, None], PropertyInfo(alias="due_date[gt]", format="iso8601")] + + due_date_lt: Annotated[Union[str, date, None], PropertyInfo(alias="due_date[lt]", format="iso8601")] + + external_customer_id: Optional[str] + + invoice_date_gt: Annotated[Union[str, datetime, None], PropertyInfo(alias="invoice_date[gt]", format="iso8601")] + + invoice_date_gte: Annotated[Union[str, datetime, None], PropertyInfo(alias="invoice_date[gte]", format="iso8601")] + + invoice_date_lt: Annotated[Union[str, datetime, None], PropertyInfo(alias="invoice_date[lt]", format="iso8601")] + + invoice_date_lte: Annotated[Union[str, datetime, None], PropertyInfo(alias="invoice_date[lte]", format="iso8601")] + + is_recurring: Optional[bool] + + limit: int + """The number of items to fetch. Defaults to 20.""" + + status: Optional[Literal["draft", "issued", "paid", "synced", "void"]] + + subscription_id: Optional[str] diff --git a/src/orb_sdk/types/invoice_list_summary_response.py b/src/orb_sdk/types/invoice_list_summary_response.py new file mode 100644 index 0000000..50d96be --- /dev/null +++ b/src/orb_sdk/types/invoice_list_summary_response.py @@ -0,0 +1,426 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel +from .shared.address import Address +from .shared.invoice_tiny import InvoiceTiny +from .shared.customer_tax_id import CustomerTaxID +from .shared.credit_note_tiny import CreditNoteTiny +from .shared.customer_minified import CustomerMinified +from .shared.subscription_minified import SubscriptionMinified + +__all__ = ["InvoiceListSummaryResponse", "AutoCollection", "CreditNote", "CustomerBalanceTransaction", "PaymentAttempt"] + + +class AutoCollection(BaseModel): + enabled: Optional[bool] = None + """True only if auto-collection is enabled for this invoice.""" + + next_attempt_at: Optional[datetime] = None + """ + If the invoice is scheduled for auto-collection, this field will reflect when + the next attempt will occur. If dunning has been exhausted, or auto-collection + is not enabled for this invoice, this field will be `null`. + """ + + num_attempts: Optional[int] = None + """Number of auto-collection payment attempts.""" + + previously_attempted_at: Optional[datetime] = None + """ + If Orb has ever attempted payment auto-collection for this invoice, this field + will reflect when that attempt occurred. In conjunction with `next_attempt_at`, + this can be used to tell whether the invoice is currently in dunning (that is, + `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or + if dunning has been exhausted (`previously_attempted_at` is non-null, but + `next_attempt_time` is null). + """ + + +class CreditNote(BaseModel): + id: str + + credit_note_number: str + + memo: Optional[str] = None + """An optional memo supplied on the credit note.""" + + reason: str + + total: str + + type: str + + voided_at: Optional[datetime] = None + """ + If the credit note has a status of `void`, this gives a timestamp when the + credit note was voided. + """ + + +class CustomerBalanceTransaction(BaseModel): + id: str + """A unique id for this transaction.""" + + action: Literal[ + "applied_to_invoice", + "manual_adjustment", + "prorated_refund", + "revert_prorated_refund", + "return_from_voiding", + "credit_note_applied", + "credit_note_voided", + "overpayment_refund", + "external_payment", + "small_invoice_carryover", + ] + + amount: str + """The value of the amount changed in the transaction.""" + + created_at: datetime + """The creation time of this transaction.""" + + credit_note: Optional[CreditNoteTiny] = None + + description: Optional[str] = None + """An optional description provided for manual customer balance adjustments.""" + + ending_balance: str + """ + The new value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + invoice: Optional[InvoiceTiny] = None + + starting_balance: str + """ + The original value of the customer's balance prior to the transaction, in the + customer's currency. + """ + + type: Literal["increment", "decrement"] + + +class PaymentAttempt(BaseModel): + id: str + """The ID of the payment attempt.""" + + amount: str + """The amount of the payment attempt.""" + + created_at: datetime + """The time at which the payment attempt was created.""" + + payment_provider: Optional[Literal["stripe"]] = None + """The payment provider that attempted to collect the payment.""" + + payment_provider_id: Optional[str] = None + """The ID of the payment attempt in the payment provider.""" + + receipt_pdf: Optional[str] = None + """URL to the downloadable PDF version of the receipt. + + This field will be `null` for payment attempts that did not succeed. + """ + + succeeded: bool + """Whether the payment attempt succeeded.""" + + +class InvoiceListSummaryResponse(BaseModel): + """#InvoiceApiResourceWithoutLineItems""" + + id: str + + amount_due: str + """ + This is the final amount required to be charged to the customer and reflects the + application of the customer balance to the `total` of the invoice. + """ + + auto_collection: AutoCollection + + billing_address: Optional[Address] = None + + created_at: datetime + """The creation time of the resource in Orb.""" + + credit_notes: List[CreditNote] + """A list of credit notes associated with the invoice""" + + currency: str + """An ISO 4217 currency string or `credits`""" + + customer: CustomerMinified + + customer_balance_transactions: List[CustomerBalanceTransaction] + + customer_tax_id: Optional[CustomerTaxID] = None + """ + Tax IDs are commonly required to be displayed on customer invoices, which are + added to the headers of invoices. + + ### Supported Tax ID Countries and Types + + | Country | Type | Description | + | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | + | Albania | `al_tin` | Albania Tax Identification Number | + | Andorra | `ad_nrt` | Andorran NRT Number | + | Angola | `ao_tin` | Angola Tax Identification Number | + | Argentina | `ar_cuit` | Argentinian Tax ID Number | + | Armenia | `am_tin` | Armenia Tax Identification Number | + | Aruba | `aw_tin` | Aruba Tax Identification Number | + | Australia | `au_abn` | Australian Business Number (AU ABN) | + | Australia | `au_arn` | Australian Taxation Office Reference Number | + | Austria | `eu_vat` | European VAT Number | + | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + | Bahrain | `bh_vat` | Bahraini VAT Number | + | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + | Barbados | `bb_tin` | Barbados Tax Identification Number | + | Belarus | `by_tin` | Belarus TIN Number | + | Belgium | `eu_vat` | European VAT Number | + | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + | Bolivia | `bo_tin` | Bolivian Tax ID | + | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + | Brazil | `br_cnpj` | Brazilian CNPJ Number | + | Brazil | `br_cpf` | Brazilian CPF Number | + | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + | Bulgaria | `eu_vat` | European VAT Number | + | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + | Canada | `ca_bn` | Canadian BN | + | Canada | `ca_gst_hst` | Canadian GST/HST Number | + | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + | Canada | `ca_qst` | Canadian QST Number (Québec) | + | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + | Chile | `cl_tin` | Chilean TIN | + | China | `cn_tin` | Chinese Tax ID | + | Colombia | `co_nit` | Colombian NIT Number | + | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + | Costa Rica | `cr_tin` | Costa Rican Tax ID | + | Croatia | `eu_vat` | European VAT Number | + | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + | Cyprus | `eu_vat` | European VAT Number | + | Czech Republic | `eu_vat` | European VAT Number | + | Denmark | `eu_vat` | European VAT Number | + | Dominican Republic | `do_rcn` | Dominican RCN Number | + | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + | Egypt | `eg_tin` | Egyptian Tax Identification Number | + | El Salvador | `sv_nit` | El Salvadorian NIT Number | + | Estonia | `eu_vat` | European VAT Number | + | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + | Finland | `eu_vat` | European VAT Number | + | France | `eu_vat` | European VAT Number | + | Georgia | `ge_vat` | Georgian VAT | + | Germany | `de_stn` | German Tax Number (Steuernummer) | + | Germany | `eu_vat` | European VAT Number | + | Greece | `eu_vat` | European VAT Number | + | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + | Hong Kong | `hk_br` | Hong Kong BR Number | + | Hungary | `eu_vat` | European VAT Number | + | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + | Iceland | `is_vat` | Icelandic VAT | + | India | `in_gst` | Indian GST Number | + | Indonesia | `id_npwp` | Indonesian NPWP Number | + | Ireland | `eu_vat` | European VAT Number | + | Israel | `il_vat` | Israel VAT | + | Italy | `eu_vat` | European VAT Number | + | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | + | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | + | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | + | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + | Laos | `la_tin` | Laos Tax Identification Number | + | Latvia | `eu_vat` | European VAT Number | + | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + | Lithuania | `eu_vat` | European VAT Number | + | Luxembourg | `eu_vat` | European VAT Number | + | Malaysia | `my_frp` | Malaysian FRP Number | + | Malaysia | `my_itn` | Malaysian ITN | + | Malaysia | `my_sst` | Malaysian SST Number | + | Malta | `eu_vat` | European VAT Number | + | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + | Mexico | `mx_rfc` | Mexican RFC Number | + | Moldova | `md_vat` | Moldova VAT Number | + | Montenegro | `me_pib` | Montenegro PIB Number | + | Morocco | `ma_vat` | Morocco VAT Number | + | Nepal | `np_pan` | Nepal PAN Number | + | Netherlands | `eu_vat` | European VAT Number | + | New Zealand | `nz_gst` | New Zealand GST Number | + | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + | North Macedonia | `mk_vat` | North Macedonia VAT Number | + | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + | Norway | `no_vat` | Norwegian VAT Number | + | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + | Oman | `om_vat` | Omani VAT Number | + | Peru | `pe_ruc` | Peruvian RUC Number | + | Philippines | `ph_tin` | Philippines Tax Identification Number | + | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | + | Portugal | `eu_vat` | European VAT Number | + | Romania | `eu_vat` | European VAT Number | + | Romania | `ro_tin` | Romanian Tax ID Number | + | Russia | `ru_inn` | Russian INN | + | Russia | `ru_kpp` | Russian KPP | + | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + | Senegal | `sn_ninea` | Senegal NINEA Number | + | Serbia | `rs_pib` | Serbian PIB Number | + | Singapore | `sg_gst` | Singaporean GST | + | Singapore | `sg_uen` | Singaporean UEN | + | Slovakia | `eu_vat` | European VAT Number | + | Slovenia | `eu_vat` | European VAT Number | + | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + | South Africa | `za_vat` | South African VAT Number | + | South Korea | `kr_brn` | Korean BRN | + | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + | Spain | `eu_vat` | European VAT Number | + | Suriname | `sr_fin` | Suriname FIN Number | + | Sweden | `eu_vat` | European VAT Number | + | Switzerland | `ch_uid` | Switzerland UID Number | + | Switzerland | `ch_vat` | Switzerland VAT Number | + | Taiwan | `tw_vat` | Taiwanese VAT | + | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + | Tanzania | `tz_vat` | Tanzania VAT Number | + | Thailand | `th_vat` | Thai VAT | + | Turkey | `tr_tin` | Turkish Tax Identification Number | + | Uganda | `ug_tin` | Uganda Tax Identification Number | + | Ukraine | `ua_vat` | Ukrainian VAT | + | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + | United Kingdom | `gb_vat` | United Kingdom VAT Number | + | United States | `us_ein` | United States EIN | + | Uruguay | `uy_ruc` | Uruguayan RUC Number | + | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + | Venezuela | `ve_rif` | Venezuelan RIF Number | + | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + | Zambia | `zm_tin` | Zambia Tax Identification Number | + | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + """ + + due_date: Optional[datetime] = None + """When the invoice payment is due. + + The due date is null if the invoice is not yet finalized. + """ + + eligible_to_issue_at: Optional[datetime] = None + """ + If the invoice has a status of `draft`, this will be the time that the invoice + will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is + true, the invoice will automatically begin issuing at this time. + """ + + hosted_invoice_url: Optional[str] = None + """A URL for the customer-facing invoice portal. + + This URL expires 30 days after the invoice's due date, or 60 days after being + re-generated through the UI. + """ + + invoice_date: datetime + """The scheduled date of the invoice""" + + invoice_number: str + """Automatically generated invoice number to help track and reconcile invoices. + + Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per + account or customer. + """ + + invoice_pdf: Optional[str] = None + """The link to download the PDF representation of the `Invoice`.""" + + invoice_source: Literal["subscription", "partial", "one_off"] + + issue_failed_at: Optional[datetime] = None + """ + If the invoice failed to issue, this will be the last time it failed to issue + (even if it is now in a different state.) + """ + + issued_at: Optional[datetime] = None + """ + If the invoice has been issued, this will be the time it transitioned to + `issued` (even if it is now in a different state.) + """ + + memo: Optional[str] = None + """ + Free-form text which is available on the invoice PDF and the Orb invoice portal. + """ + + metadata: Dict[str, str] + """User specified key-value pairs for the resource. + + If not present, this defaults to an empty dictionary. Individual keys can be + removed by setting the value to `null`, and the entire metadata mapping can be + cleared by setting `metadata` to `null`. + """ + + paid_at: Optional[datetime] = None + """ + If the invoice has a status of `paid`, this gives a timestamp when the invoice + was paid. + """ + + payment_attempts: List[PaymentAttempt] + """A list of payment attempts associated with the invoice""" + + payment_failed_at: Optional[datetime] = None + """ + If payment was attempted on this invoice but failed, this will be the time of + the most recent attempt. + """ + + payment_started_at: Optional[datetime] = None + """ + If payment was attempted on this invoice, this will be the start time of the + most recent attempt. This field is especially useful for delayed-notification + payment mechanisms (like bank transfers), where payment can take 3 days or more. + """ + + scheduled_issue_at: Optional[datetime] = None + """ + If the invoice is in draft, this timestamp will reflect when the invoice is + scheduled to be issued. + """ + + shipping_address: Optional[Address] = None + + status: Literal["issued", "paid", "synced", "void", "draft"] + + subscription: Optional[SubscriptionMinified] = None + + sync_failed_at: Optional[datetime] = None + """ + If the invoice failed to sync, this will be the last time an external invoicing + provider sync was attempted. This field will always be `null` for invoices using + Orb Invoicing. + """ + + total: str + """The total after any minimums and discounts have been applied.""" + + voided_at: Optional[datetime] = None + """ + If the invoice has a status of `void`, this gives a timestamp when the invoice + was voided. + """ + + will_auto_issue: bool + """ + This is true if the invoice will be automatically issued in the future, and + false otherwise. + """ diff --git a/src/orb_sdk/types/item.py b/src/orb_sdk/types/item.py index 14e1ee3..c25cd99 100644 --- a/src/orb_sdk/types/item.py +++ b/src/orb_sdk/types/item.py @@ -10,6 +10,10 @@ class ExternalConnection(BaseModel): + """ + Represents a connection between an Item and an external system for invoicing or tax calculation purposes. + """ + external_connection_name: Literal[ "stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral" ] @@ -20,6 +24,12 @@ class ExternalConnection(BaseModel): class Item(BaseModel): + """The Item resource represents a sellable product or good. + + Items are associated with all line items, billable metrics, + and prices and are used for defining external sync behavior for invoices and tax calculation purposes. + """ + id: str """The Orb-assigned unique identifier for the item.""" diff --git a/src/orb_sdk/types/item_update_params.py b/src/orb_sdk/types/item_update_params.py index 360eaca..d950484 100644 --- a/src/orb_sdk/types/item_update_params.py +++ b/src/orb_sdk/types/item_update_params.py @@ -22,6 +22,10 @@ class ItemUpdateParams(TypedDict, total=False): class ExternalConnection(TypedDict, total=False): + """ + Represents a connection between an Item and an external system for invoicing or tax calculation purposes. + """ + external_connection_name: Required[ Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral"] ] diff --git a/src/orb_sdk/types/license_create_params.py b/src/orb_sdk/types/license_create_params.py new file mode 100644 index 0000000..9af3d84 --- /dev/null +++ b/src/orb_sdk/types/license_create_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["LicenseCreateParams"] + + +class LicenseCreateParams(TypedDict, total=False): + external_license_id: Required[str] + """The external identifier for the license.""" + + license_type_id: Required[str] + + subscription_id: Required[str] + + end_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + """The end date of the license. + + If not provided, the license will remain active until deactivated. + """ + + start_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + """The start date of the license. + + If not provided, defaults to start of day today in the customer's timezone. + """ diff --git a/src/orb_sdk/types/license_create_response.py b/src/orb_sdk/types/license_create_response.py new file mode 100644 index 0000000..75190ad --- /dev/null +++ b/src/orb_sdk/types/license_create_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["LicenseCreateResponse"] + + +class LicenseCreateResponse(BaseModel): + id: str + + end_date: Optional[datetime] = None + + external_license_id: str + + license_type_id: str + + start_date: datetime + + status: Literal["active", "inactive"] + + subscription_id: str diff --git a/src/orb_sdk/types/license_deactivate_params.py b/src/orb_sdk/types/license_deactivate_params.py new file mode 100644 index 0000000..ef994d7 --- /dev/null +++ b/src/orb_sdk/types/license_deactivate_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["LicenseDeactivateParams"] + + +class LicenseDeactivateParams(TypedDict, total=False): + end_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + """The date to deactivate the license. + + If not provided, defaults to end of day today in the customer's timezone. + """ diff --git a/src/orb_sdk/types/license_deactivate_response.py b/src/orb_sdk/types/license_deactivate_response.py new file mode 100644 index 0000000..ae3cd8b --- /dev/null +++ b/src/orb_sdk/types/license_deactivate_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["LicenseDeactivateResponse"] + + +class LicenseDeactivateResponse(BaseModel): + id: str + + end_date: Optional[datetime] = None + + external_license_id: str + + license_type_id: str + + start_date: datetime + + status: Literal["active", "inactive"] + + subscription_id: str diff --git a/src/orb_sdk/types/license_list_params.py b/src/orb_sdk/types/license_list_params.py new file mode 100644 index 0000000..9d012a1 --- /dev/null +++ b/src/orb_sdk/types/license_list_params.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["LicenseListParams"] + + +class LicenseListParams(TypedDict, total=False): + subscription_id: Required[str] + + cursor: Optional[str] + """Cursor for pagination. + + This can be populated by the `next_cursor` value returned from the initial + request. + """ + + external_license_id: Optional[str] + + license_type_id: Optional[str] + + limit: int + """The number of items to fetch. Defaults to 20.""" + + status: Optional[Literal["active", "inactive"]] diff --git a/src/orb_sdk/types/license_list_response.py b/src/orb_sdk/types/license_list_response.py new file mode 100644 index 0000000..974882f --- /dev/null +++ b/src/orb_sdk/types/license_list_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["LicenseListResponse"] + + +class LicenseListResponse(BaseModel): + id: str + + end_date: Optional[datetime] = None + + external_license_id: str + + license_type_id: str + + start_date: datetime + + status: Literal["active", "inactive"] + + subscription_id: str diff --git a/src/orb_sdk/types/license_retrieve_by_external_id_params.py b/src/orb_sdk/types/license_retrieve_by_external_id_params.py new file mode 100644 index 0000000..5d88ba3 --- /dev/null +++ b/src/orb_sdk/types/license_retrieve_by_external_id_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LicenseRetrieveByExternalIDParams"] + + +class LicenseRetrieveByExternalIDParams(TypedDict, total=False): + license_type_id: Required[str] + """The ID of the license type to fetch the license for.""" + + subscription_id: Required[str] + """The ID of the subscription to fetch the license for.""" diff --git a/src/orb_sdk/types/license_retrieve_by_external_id_response.py b/src/orb_sdk/types/license_retrieve_by_external_id_response.py new file mode 100644 index 0000000..0c766a3 --- /dev/null +++ b/src/orb_sdk/types/license_retrieve_by_external_id_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["LicenseRetrieveByExternalIDResponse"] + + +class LicenseRetrieveByExternalIDResponse(BaseModel): + id: str + + end_date: Optional[datetime] = None + + external_license_id: str + + license_type_id: str + + start_date: datetime + + status: Literal["active", "inactive"] + + subscription_id: str diff --git a/src/orb_sdk/types/license_retrieve_response.py b/src/orb_sdk/types/license_retrieve_response.py new file mode 100644 index 0000000..b62f1f2 --- /dev/null +++ b/src/orb_sdk/types/license_retrieve_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["LicenseRetrieveResponse"] + + +class LicenseRetrieveResponse(BaseModel): + id: str + + end_date: Optional[datetime] = None + + external_license_id: str + + license_type_id: str + + start_date: datetime + + status: Literal["active", "inactive"] + + subscription_id: str diff --git a/src/orb_sdk/types/license_type_create_params.py b/src/orb_sdk/types/license_type_create_params.py new file mode 100644 index 0000000..978187a --- /dev/null +++ b/src/orb_sdk/types/license_type_create_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LicenseTypeCreateParams"] + + +class LicenseTypeCreateParams(TypedDict, total=False): + grouping_key: Required[str] + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: Required[str] + """The name of the license type.""" diff --git a/src/orb_sdk/types/license_type_create_response.py b/src/orb_sdk/types/license_type_create_response.py new file mode 100644 index 0000000..cd526aa --- /dev/null +++ b/src/orb_sdk/types/license_type_create_response.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["LicenseTypeCreateResponse"] + + +class LicenseTypeCreateResponse(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" diff --git a/src/orb_sdk/types/license_type_list_params.py b/src/orb_sdk/types/license_type_list_params.py new file mode 100644 index 0000000..9f31240 --- /dev/null +++ b/src/orb_sdk/types/license_type_list_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["LicenseTypeListParams"] + + +class LicenseTypeListParams(TypedDict, total=False): + cursor: Optional[str] + """Cursor for pagination. + + This can be populated by the `next_cursor` value returned from the initial + request. + """ + + limit: int + """The number of items to fetch. Defaults to 20.""" diff --git a/src/orb_sdk/types/license_type_list_response.py b/src/orb_sdk/types/license_type_list_response.py new file mode 100644 index 0000000..8e672e8 --- /dev/null +++ b/src/orb_sdk/types/license_type_list_response.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["LicenseTypeListResponse"] + + +class LicenseTypeListResponse(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" diff --git a/src/orb_sdk/types/license_type_retrieve_response.py b/src/orb_sdk/types/license_type_retrieve_response.py new file mode 100644 index 0000000..36b1cda --- /dev/null +++ b/src/orb_sdk/types/license_type_retrieve_response.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["LicenseTypeRetrieveResponse"] + + +class LicenseTypeRetrieveResponse(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" diff --git a/src/orb_sdk/types/licenses/__init__.py b/src/orb_sdk/types/licenses/__init__.py new file mode 100644 index 0000000..d87379d --- /dev/null +++ b/src/orb_sdk/types/licenses/__init__.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .usage_get_usage_params import UsageGetUsageParams as UsageGetUsageParams +from .usage_get_usage_response import UsageGetUsageResponse as UsageGetUsageResponse +from .usage_get_all_usage_params import UsageGetAllUsageParams as UsageGetAllUsageParams +from .usage_get_all_usage_response import UsageGetAllUsageResponse as UsageGetAllUsageResponse +from .external_license_get_usage_params import ExternalLicenseGetUsageParams as ExternalLicenseGetUsageParams +from .external_license_get_usage_response import ExternalLicenseGetUsageResponse as ExternalLicenseGetUsageResponse diff --git a/src/orb_sdk/types/licenses/external_license_get_usage_params.py b/src/orb_sdk/types/licenses/external_license_get_usage_params.py new file mode 100644 index 0000000..238029f --- /dev/null +++ b/src/orb_sdk/types/licenses/external_license_get_usage_params.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from datetime import date +from typing_extensions import Required, Annotated, TypedDict + +from ..._types import SequenceNotStr +from ..._utils import PropertyInfo + +__all__ = ["ExternalLicenseGetUsageParams"] + + +class ExternalLicenseGetUsageParams(TypedDict, total=False): + license_type_id: Required[str] + """The license type ID to filter licenses by.""" + + subscription_id: Required[str] + """The subscription ID to get license usage for.""" + + cursor: Optional[str] + """Pagination cursor from a previous request.""" + + end_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + """End date for the usage period (YYYY-MM-DD). + + Defaults to end of current billing period. + """ + + group_by: Optional[SequenceNotStr[str]] + """How to group the results. + + Valid values: 'license', 'day'. Can be combined (e.g., 'license,day'). + """ + + limit: int + """Maximum number of rows in the response data (default 20, max 100).""" + + start_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + """Start date for the usage period (YYYY-MM-DD). + + Defaults to start of current billing period. + """ diff --git a/src/orb_sdk/types/licenses/external_license_get_usage_response.py b/src/orb_sdk/types/licenses/external_license_get_usage_response.py new file mode 100644 index 0000000..d7c0d60 --- /dev/null +++ b/src/orb_sdk/types/licenses/external_license_get_usage_response.py @@ -0,0 +1,66 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import date + +from ..._models import BaseModel +from ..shared.pagination_metadata import PaginationMetadata + +__all__ = ["ExternalLicenseGetUsageResponse", "Data"] + + +class Data(BaseModel): + """ + The LicenseUsage resource represents usage and remaining credits for a license over a date range. + + When grouped by 'day' only, license_id and external_license_id will be null as the data + is aggregated across all licenses. + """ + + allocated_credits: float + """The total credits allocated to this license for the period.""" + + consumed_credits: float + """The credits consumed by this license for the period.""" + + end_date: date + """The end date of the usage period.""" + + license_type_id: str + """The unique identifier for the license type.""" + + pricing_unit: str + """The pricing unit for the credits (e.g., 'credits').""" + + remaining_credits: float + """The remaining credits available for this license (allocated - consumed).""" + + start_date: date + """The start date of the usage period.""" + + subscription_id: str + """The unique identifier for the subscription.""" + + allocation_eligible_credits: Optional[float] = None + """ + Credits consumed while the license was active (eligible for individual + allocation deduction). + """ + + external_license_id: Optional[str] = None + """The external identifier for the license. Null when grouped by day only.""" + + license_id: Optional[str] = None + """The unique identifier for the license. Null when grouped by day only.""" + + shared_pool_credits: Optional[float] = None + """ + Credits consumed while the license was inactive (draws from shared pool, not + individual allocation). + """ + + +class ExternalLicenseGetUsageResponse(BaseModel): + data: List[Data] + + pagination_metadata: PaginationMetadata diff --git a/src/orb_sdk/types/licenses/usage_get_all_usage_params.py b/src/orb_sdk/types/licenses/usage_get_all_usage_params.py new file mode 100644 index 0000000..b79c8da --- /dev/null +++ b/src/orb_sdk/types/licenses/usage_get_all_usage_params.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from datetime import date +from typing_extensions import Required, Annotated, TypedDict + +from ..._types import SequenceNotStr +from ..._utils import PropertyInfo + +__all__ = ["UsageGetAllUsageParams"] + + +class UsageGetAllUsageParams(TypedDict, total=False): + license_type_id: Required[str] + """The license type ID to filter licenses by.""" + + subscription_id: Required[str] + """The subscription ID to get license usage for.""" + + cursor: Optional[str] + """Pagination cursor from a previous request.""" + + end_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + """End date for the usage period (YYYY-MM-DD). + + Defaults to end of current billing period. + """ + + group_by: Optional[SequenceNotStr[str]] + """How to group the results. + + Valid values: 'license', 'day'. Can be combined (e.g., 'license,day'). + """ + + limit: int + """Maximum number of rows in the response data (default 20, max 100).""" + + start_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + """Start date for the usage period (YYYY-MM-DD). + + Defaults to start of current billing period. + """ diff --git a/src/orb_sdk/types/licenses/usage_get_all_usage_response.py b/src/orb_sdk/types/licenses/usage_get_all_usage_response.py new file mode 100644 index 0000000..ed6e9ad --- /dev/null +++ b/src/orb_sdk/types/licenses/usage_get_all_usage_response.py @@ -0,0 +1,66 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import date + +from ..._models import BaseModel +from ..shared.pagination_metadata import PaginationMetadata + +__all__ = ["UsageGetAllUsageResponse", "Data"] + + +class Data(BaseModel): + """ + The LicenseUsage resource represents usage and remaining credits for a license over a date range. + + When grouped by 'day' only, license_id and external_license_id will be null as the data + is aggregated across all licenses. + """ + + allocated_credits: float + """The total credits allocated to this license for the period.""" + + consumed_credits: float + """The credits consumed by this license for the period.""" + + end_date: date + """The end date of the usage period.""" + + license_type_id: str + """The unique identifier for the license type.""" + + pricing_unit: str + """The pricing unit for the credits (e.g., 'credits').""" + + remaining_credits: float + """The remaining credits available for this license (allocated - consumed).""" + + start_date: date + """The start date of the usage period.""" + + subscription_id: str + """The unique identifier for the subscription.""" + + allocation_eligible_credits: Optional[float] = None + """ + Credits consumed while the license was active (eligible for individual + allocation deduction). + """ + + external_license_id: Optional[str] = None + """The external identifier for the license. Null when grouped by day only.""" + + license_id: Optional[str] = None + """The unique identifier for the license. Null when grouped by day only.""" + + shared_pool_credits: Optional[float] = None + """ + Credits consumed while the license was inactive (draws from shared pool, not + individual allocation). + """ + + +class UsageGetAllUsageResponse(BaseModel): + data: List[Data] + + pagination_metadata: PaginationMetadata diff --git a/src/orb_sdk/types/licenses/usage_get_usage_params.py b/src/orb_sdk/types/licenses/usage_get_usage_params.py new file mode 100644 index 0000000..83b175b --- /dev/null +++ b/src/orb_sdk/types/licenses/usage_get_usage_params.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from datetime import date +from typing_extensions import Annotated, TypedDict + +from ..._types import SequenceNotStr +from ..._utils import PropertyInfo + +__all__ = ["UsageGetUsageParams"] + + +class UsageGetUsageParams(TypedDict, total=False): + cursor: Optional[str] + """Pagination cursor from a previous request.""" + + end_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + """End date for the usage period (YYYY-MM-DD). + + Defaults to end of current billing period. + """ + + group_by: Optional[SequenceNotStr[str]] + """How to group the results. + + Valid values: 'license', 'day'. Can be combined (e.g., 'license,day'). + """ + + limit: int + """Maximum number of rows in the response data (default 20, max 100).""" + + start_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + """Start date for the usage period (YYYY-MM-DD). + + Defaults to start of current billing period. + """ diff --git a/src/orb_sdk/types/licenses/usage_get_usage_response.py b/src/orb_sdk/types/licenses/usage_get_usage_response.py new file mode 100644 index 0000000..5e69870 --- /dev/null +++ b/src/orb_sdk/types/licenses/usage_get_usage_response.py @@ -0,0 +1,66 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import date + +from ..._models import BaseModel +from ..shared.pagination_metadata import PaginationMetadata + +__all__ = ["UsageGetUsageResponse", "Data"] + + +class Data(BaseModel): + """ + The LicenseUsage resource represents usage and remaining credits for a license over a date range. + + When grouped by 'day' only, license_id and external_license_id will be null as the data + is aggregated across all licenses. + """ + + allocated_credits: float + """The total credits allocated to this license for the period.""" + + consumed_credits: float + """The credits consumed by this license for the period.""" + + end_date: date + """The end date of the usage period.""" + + license_type_id: str + """The unique identifier for the license type.""" + + pricing_unit: str + """The pricing unit for the credits (e.g., 'credits').""" + + remaining_credits: float + """The remaining credits available for this license (allocated - consumed).""" + + start_date: date + """The start date of the usage period.""" + + subscription_id: str + """The unique identifier for the subscription.""" + + allocation_eligible_credits: Optional[float] = None + """ + Credits consumed while the license was active (eligible for individual + allocation deduction). + """ + + external_license_id: Optional[str] = None + """The external identifier for the license. Null when grouped by day only.""" + + license_id: Optional[str] = None + """The unique identifier for the license. Null when grouped by day only.""" + + shared_pool_credits: Optional[float] = None + """ + Credits consumed while the license was inactive (draws from shared pool, not + individual allocation). + """ + + +class UsageGetUsageResponse(BaseModel): + data: List[Data] + + pagination_metadata: PaginationMetadata diff --git a/src/orb_sdk/types/new_subscription_bulk_price_param.py b/src/orb_sdk/types/new_subscription_bulk_price_param.py index 6f4b474..7183b60 100644 --- a/src/orb_sdk/types/new_subscription_bulk_price_param.py +++ b/src/orb_sdk/types/new_subscription_bulk_price_param.py @@ -83,6 +83,9 @@ class NewSubscriptionBulkPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_bulk_with_proration_price_param.py b/src/orb_sdk/types/new_subscription_bulk_with_proration_price_param.py index 018b15f..12b1cc4 100644 --- a/src/orb_sdk/types/new_subscription_bulk_with_proration_price_param.py +++ b/src/orb_sdk/types/new_subscription_bulk_with_proration_price_param.py @@ -19,6 +19,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: Required[str] """Cost per unit""" @@ -27,6 +29,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): class BulkWithProrationConfig(TypedDict, total=False): + """Configuration for bulk_with_proration pricing""" + tiers: Required[Iterable[BulkWithProrationConfigTier]] """Bulk tiers for rating based on total usage volume""" @@ -101,6 +105,9 @@ class NewSubscriptionBulkWithProrationPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_cumulative_grouped_bulk_price_param.py b/src/orb_sdk/types/new_subscription_cumulative_grouped_bulk_price_param.py index 4b91391..8f37365 100644 --- a/src/orb_sdk/types/new_subscription_cumulative_grouped_bulk_price_param.py +++ b/src/orb_sdk/types/new_subscription_cumulative_grouped_bulk_price_param.py @@ -19,6 +19,8 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): + """Configuration for a dimension value entry""" + grouping_key: Required[str] """Grouping key value""" @@ -30,11 +32,12 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): class CumulativeGroupedBulkConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: Required[Iterable[CumulativeGroupedBulkConfigDimensionValue]] """Each tier lower bound must have the same group of values.""" group: Required[str] - """Grouping key name""" ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] @@ -107,6 +110,9 @@ class NewSubscriptionCumulativeGroupedBulkPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_grouped_allocation_price_param.py b/src/orb_sdk/types/new_subscription_grouped_allocation_price_param.py index 1c73bc8..c1ff296 100644 --- a/src/orb_sdk/types/new_subscription_grouped_allocation_price_param.py +++ b/src/orb_sdk/types/new_subscription_grouped_allocation_price_param.py @@ -14,6 +14,8 @@ class GroupedAllocationConfig(TypedDict, total=False): + """Configuration for grouped_allocation pricing""" + allocation: Required[str] """Usage allocation per group""" @@ -94,6 +96,9 @@ class NewSubscriptionGroupedAllocationPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_grouped_tiered_package_price_param.py b/src/orb_sdk/types/new_subscription_grouped_tiered_package_price_param.py index 8f1e0f9..c5421ac 100644 --- a/src/orb_sdk/types/new_subscription_grouped_tiered_package_price_param.py +++ b/src/orb_sdk/types/new_subscription_grouped_tiered_package_price_param.py @@ -19,19 +19,21 @@ class GroupedTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + per_unit: Required[str] - """Price per package""" + """Per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class GroupedTieredPackageConfig(TypedDict, total=False): + """Configuration for grouped_tiered_package pricing""" + grouping_key: Required[str] """The event property used to group before tiering""" package_size: Required[str] - """Package size""" tiers: Required[Iterable[GroupedTieredPackageConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -110,6 +112,9 @@ class NewSubscriptionGroupedTieredPackagePriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_grouped_tiered_price_param.py b/src/orb_sdk/types/new_subscription_grouped_tiered_price_param.py index 0e79dad..1b7e737 100644 --- a/src/orb_sdk/types/new_subscription_grouped_tiered_price_param.py +++ b/src/orb_sdk/types/new_subscription_grouped_tiered_price_param.py @@ -19,14 +19,17 @@ class GroupedTieredConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class GroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + grouping_key: Required[str] """The billable metric property used to group before tiering""" @@ -107,6 +110,9 @@ class NewSubscriptionGroupedTieredPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_grouped_with_metered_minimum_price_param.py b/src/orb_sdk/types/new_subscription_grouped_with_metered_minimum_price_param.py index 1652fe3..21e6043 100644 --- a/src/orb_sdk/types/new_subscription_grouped_with_metered_minimum_price_param.py +++ b/src/orb_sdk/types/new_subscription_grouped_with_metered_minimum_price_param.py @@ -20,22 +20,25 @@ class GroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): + """Configuration for a scaling factor""" + scaling_factor: Required[str] - """Scaling factor""" scaling_value: Required[str] - """Scaling value""" class GroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount""" + pricing_value: Required[str] - """Pricing value""" unit_amount: Required[str] """Per unit amount""" class GroupedWithMeteredMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: Required[str] """Used to partition the usage into groups. @@ -131,6 +134,9 @@ class NewSubscriptionGroupedWithMeteredMinimumPriceParam(TypedDict, total=False) If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_grouped_with_prorated_minimum_price_param.py b/src/orb_sdk/types/new_subscription_grouped_with_prorated_minimum_price_param.py index 9dbc811..533f193 100644 --- a/src/orb_sdk/types/new_subscription_grouped_with_prorated_minimum_price_param.py +++ b/src/orb_sdk/types/new_subscription_grouped_with_prorated_minimum_price_param.py @@ -18,6 +18,8 @@ class GroupedWithProratedMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: Required[str] """How to determine the groups that should each have a minimum""" @@ -98,6 +100,9 @@ class NewSubscriptionGroupedWithProratedMinimumPriceParam(TypedDict, total=False If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_matrix_price_param.py b/src/orb_sdk/types/new_subscription_matrix_price_param.py index 94188ad..09b1d87 100644 --- a/src/orb_sdk/types/new_subscription_matrix_price_param.py +++ b/src/orb_sdk/types/new_subscription_matrix_price_param.py @@ -83,6 +83,9 @@ class NewSubscriptionMatrixPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_matrix_with_allocation_price_param.py b/src/orb_sdk/types/new_subscription_matrix_with_allocation_price_param.py index 4bd592a..3c3bc12 100644 --- a/src/orb_sdk/types/new_subscription_matrix_with_allocation_price_param.py +++ b/src/orb_sdk/types/new_subscription_matrix_with_allocation_price_param.py @@ -83,6 +83,9 @@ class NewSubscriptionMatrixWithAllocationPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_matrix_with_display_name_price_param.py b/src/orb_sdk/types/new_subscription_matrix_with_display_name_price_param.py index 4a436e9..8d076d3 100644 --- a/src/orb_sdk/types/new_subscription_matrix_with_display_name_price_param.py +++ b/src/orb_sdk/types/new_subscription_matrix_with_display_name_price_param.py @@ -19,6 +19,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount item""" + dimension_value: Required[str] """The dimension value""" @@ -30,6 +32,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): class MatrixWithDisplayNameConfig(TypedDict, total=False): + """Configuration for matrix_with_display_name pricing""" + dimension: Required[str] """Used to determine the unit rate""" @@ -107,6 +111,9 @@ class NewSubscriptionMatrixWithDisplayNamePriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_max_group_tiered_package_price_param.py b/src/orb_sdk/types/new_subscription_max_group_tiered_package_price_param.py index 4849ba3..9b6048d 100644 --- a/src/orb_sdk/types/new_subscription_max_group_tiered_package_price_param.py +++ b/src/orb_sdk/types/new_subscription_max_group_tiered_package_price_param.py @@ -19,21 +19,23 @@ class MaxGroupTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class MaxGroupTieredPackageConfig(TypedDict, total=False): + """Configuration for max_group_tiered_package pricing""" + grouping_key: Required[str] """ The event property used to group before tiering the group with the highest value """ package_size: Required[str] - """Package size""" tiers: Required[Iterable[MaxGroupTieredPackageConfigTier]] """Apply tiered pricing to the largest group after grouping with the provided key.""" @@ -109,6 +111,9 @@ class NewSubscriptionMaxGroupTieredPackagePriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_minimum_composite_price_param.py b/src/orb_sdk/types/new_subscription_minimum_composite_price_param.py index 81a2924..dc4df40 100644 --- a/src/orb_sdk/types/new_subscription_minimum_composite_price_param.py +++ b/src/orb_sdk/types/new_subscription_minimum_composite_price_param.py @@ -10,10 +10,12 @@ from .shared_params.new_billing_cycle_configuration import NewBillingCycleConfiguration from .shared_params.new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewSubscriptionMinimumCompositePriceParam", "MinimumConfig", "ConversionRateConfig"] +__all__ = ["NewSubscriptionMinimumCompositePriceParam", "MinimumCompositeConfig", "ConversionRateConfig"] -class MinimumConfig(TypedDict, total=False): +class MinimumCompositeConfig(TypedDict, total=False): + """Configuration for minimum_composite pricing""" + minimum_amount: Required[str] """The minimum amount to apply""" @@ -31,10 +33,10 @@ class NewSubscriptionMinimumCompositePriceParam(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - minimum_config: Required[MinimumConfig] - """Configuration for minimum pricing""" + minimum_composite_config: Required[MinimumCompositeConfig] + """Configuration for minimum_composite pricing""" - model_type: Required[Literal["minimum"]] + model_type: Required[Literal["minimum_composite"]] """The pricing model type""" name: Required[str] @@ -91,6 +93,9 @@ class NewSubscriptionMinimumCompositePriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_package_price_param.py b/src/orb_sdk/types/new_subscription_package_price_param.py index a524363..bf9317a 100644 --- a/src/orb_sdk/types/new_subscription_package_price_param.py +++ b/src/orb_sdk/types/new_subscription_package_price_param.py @@ -83,6 +83,9 @@ class NewSubscriptionPackagePriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_package_with_allocation_price_param.py b/src/orb_sdk/types/new_subscription_package_with_allocation_price_param.py index c6f1d70..cc38d26 100644 --- a/src/orb_sdk/types/new_subscription_package_with_allocation_price_param.py +++ b/src/orb_sdk/types/new_subscription_package_with_allocation_price_param.py @@ -14,14 +14,13 @@ class PackageWithAllocationConfig(TypedDict, total=False): + """Configuration for package_with_allocation pricing""" + allocation: Required[str] - """Usage allocation""" package_amount: Required[str] - """Price per package""" package_size: Required[str] - """Package size""" ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] @@ -94,6 +93,9 @@ class NewSubscriptionPackageWithAllocationPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_scalable_matrix_with_tiered_pricing_price_param.py b/src/orb_sdk/types/new_subscription_scalable_matrix_with_tiered_pricing_price_param.py index 57a8793..cd46276 100644 --- a/src/orb_sdk/types/new_subscription_scalable_matrix_with_tiered_pricing_price_param.py +++ b/src/orb_sdk/types/new_subscription_scalable_matrix_with_tiered_pricing_price_param.py @@ -20,25 +20,26 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] - """First dimension value""" scaling_factor: Required[str] - """Scaling factor""" second_dimension_value: Optional[str] - """Second dimension value (optional)""" class ScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] - """Per unit amount""" class ScalableMatrixWithTieredPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: Required[str] """Used for the scalable matrix first dimension""" @@ -46,7 +47,6 @@ class ScalableMatrixWithTieredPricingConfig(TypedDict, total=False): """Apply a scaling factor to each dimension""" tiers: Required[Iterable[ScalableMatrixWithTieredPricingConfigTier]] - """Tier pricing structure""" second_dimension: Optional[str] """Used for the scalable matrix second dimension (optional)""" @@ -122,6 +122,9 @@ class NewSubscriptionScalableMatrixWithTieredPricingPriceParam(TypedDict, total= If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py b/src/orb_sdk/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py index 031d2b2..c0ea7c9 100644 --- a/src/orb_sdk/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py +++ b/src/orb_sdk/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py @@ -19,17 +19,18 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] - """First dimension value""" scaling_factor: Required[str] - """Scaling factor""" second_dimension_value: Optional[str] - """Second dimension value (optional)""" class ScalableMatrixWithUnitPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: Required[str] """Used to determine the unit rate""" @@ -116,6 +117,9 @@ class NewSubscriptionScalableMatrixWithUnitPricingPriceParam(TypedDict, total=Fa If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_threshold_total_amount_price_param.py b/src/orb_sdk/types/new_subscription_threshold_total_amount_price_param.py index eecc9c1..1345b77 100644 --- a/src/orb_sdk/types/new_subscription_threshold_total_amount_price_param.py +++ b/src/orb_sdk/types/new_subscription_threshold_total_amount_price_param.py @@ -19,14 +19,17 @@ class ThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): + """Configuration for a single threshold""" + threshold: Required[str] - """Quantity threshold""" total_amount: Required[str] """Total amount for this threshold""" class ThresholdTotalAmountConfig(TypedDict, total=False): + """Configuration for threshold_total_amount pricing""" + consumption_table: Required[Iterable[ThresholdTotalAmountConfigConsumptionTable]] """ When the quantity consumed passes a provided threshold, the configured total @@ -107,6 +110,9 @@ class NewSubscriptionThresholdTotalAmountPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_tiered_package_price_param.py b/src/orb_sdk/types/new_subscription_tiered_package_price_param.py index f217a5e..9a0385a 100644 --- a/src/orb_sdk/types/new_subscription_tiered_package_price_param.py +++ b/src/orb_sdk/types/new_subscription_tiered_package_price_param.py @@ -19,16 +19,18 @@ class TieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier with business logic""" + per_unit: Required[str] """Price per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class TieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + package_size: Required[str] - """Package size""" tiers: Required[Iterable[TieredPackageConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -109,6 +111,9 @@ class NewSubscriptionTieredPackagePriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_tiered_package_with_minimum_price_param.py b/src/orb_sdk/types/new_subscription_tiered_package_with_minimum_price_param.py index 6ab2239..9820fa6 100644 --- a/src/orb_sdk/types/new_subscription_tiered_package_with_minimum_price_param.py +++ b/src/orb_sdk/types/new_subscription_tiered_package_with_minimum_price_param.py @@ -19,19 +19,19 @@ class TieredPackageWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] - """Minimum amount""" per_unit: Required[str] - """Price per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class TieredPackageWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_package_with_minimum pricing""" + package_size: Required[float] - """Package size""" tiers: Required[Iterable[TieredPackageWithMinimumConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -110,6 +110,9 @@ class NewSubscriptionTieredPackageWithMinimumPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_tiered_price_param.py b/src/orb_sdk/types/new_subscription_tiered_price_param.py index e62c64d..77d7368 100644 --- a/src/orb_sdk/types/new_subscription_tiered_price_param.py +++ b/src/orb_sdk/types/new_subscription_tiered_price_param.py @@ -83,6 +83,9 @@ class NewSubscriptionTieredPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_tiered_with_minimum_price_param.py b/src/orb_sdk/types/new_subscription_tiered_with_minimum_price_param.py index 9c7dfbe..2ebcf5e 100644 --- a/src/orb_sdk/types/new_subscription_tiered_with_minimum_price_param.py +++ b/src/orb_sdk/types/new_subscription_tiered_with_minimum_price_param.py @@ -19,17 +19,19 @@ class TieredWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] - """Minimum amount""" tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class TieredWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_with_minimum pricing""" + tiers: Required[Iterable[TieredWithMinimumConfigTier]] """Tiered pricing with a minimum amount dependent on the volume tier. @@ -113,6 +115,9 @@ class NewSubscriptionTieredWithMinimumPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_unit_price_param.py b/src/orb_sdk/types/new_subscription_unit_price_param.py index b4da6fb..1259881 100644 --- a/src/orb_sdk/types/new_subscription_unit_price_param.py +++ b/src/orb_sdk/types/new_subscription_unit_price_param.py @@ -83,6 +83,9 @@ class NewSubscriptionUnitPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_unit_with_percent_price_param.py b/src/orb_sdk/types/new_subscription_unit_with_percent_price_param.py index 2a0d1c6..254ede6 100644 --- a/src/orb_sdk/types/new_subscription_unit_with_percent_price_param.py +++ b/src/orb_sdk/types/new_subscription_unit_with_percent_price_param.py @@ -14,6 +14,8 @@ class UnitWithPercentConfig(TypedDict, total=False): + """Configuration for unit_with_percent pricing""" + percent: Required[str] """What percent, out of 100, of the calculated total to charge""" @@ -91,6 +93,9 @@ class NewSubscriptionUnitWithPercentPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/new_subscription_unit_with_proration_price_param.py b/src/orb_sdk/types/new_subscription_unit_with_proration_price_param.py index 30220c0..55d0883 100644 --- a/src/orb_sdk/types/new_subscription_unit_with_proration_price_param.py +++ b/src/orb_sdk/types/new_subscription_unit_with_proration_price_param.py @@ -14,6 +14,8 @@ class UnitWithProrationConfig(TypedDict, total=False): + """Configuration for unit_with_proration pricing""" + unit_amount: Required[str] """Rate per unit of usage""" @@ -88,6 +90,9 @@ class NewSubscriptionUnitWithProrationPriceParam(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/plan.py b/src/orb_sdk/types/plan.py index 25eb312..27c4a19 100644 --- a/src/orb_sdk/types/plan.py +++ b/src/orb_sdk/types/plan.py @@ -31,6 +31,10 @@ class BasePlan(BaseModel): + """ + Legacy field representing the parent plan if the current plan is a 'child plan', overriding prices from the parent. + """ + id: Optional[str] = None external_plan_id: Optional[str] = None @@ -87,6 +91,12 @@ class TrialConfig(BaseModel): class Plan(BaseModel): + """ + The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by a + customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices + in the [Price resource](/reference/price). + """ + id: str adjustments: List[Adjustment] diff --git a/src/orb_sdk/types/plan_create_params.py b/src/orb_sdk/types/plan_create_params.py index 23b6675..ff20826 100644 --- a/src/orb_sdk/types/plan_create_params.py +++ b/src/orb_sdk/types/plan_create_params.py @@ -130,6 +130,8 @@ class PlanCreateParams(TypedDict, total=False): class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -138,6 +140,8 @@ class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -146,6 +150,8 @@ class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -225,6 +231,9 @@ class PricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -240,6 +249,8 @@ class PricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): class PricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -248,6 +259,8 @@ class PricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(Typ class PricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[PricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -327,6 +340,9 @@ class PricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -342,6 +358,8 @@ class PricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): class PricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -429,6 +447,9 @@ class PricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -444,6 +465,8 @@ class PricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): class PricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -531,6 +554,9 @@ class PricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -546,6 +572,8 @@ class PricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=False): class PricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -622,6 +650,9 @@ class PricePriceNewPlanPercentCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -637,6 +668,8 @@ class PricePriceNewPlanPercentCompositePrice(TypedDict, total=False): class PricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -726,6 +759,9 @@ class PricePriceNewPlanEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/plan_version.py b/src/orb_sdk/types/plan_version.py index 42e944a..ce10f08 100644 --- a/src/orb_sdk/types/plan_version.py +++ b/src/orb_sdk/types/plan_version.py @@ -29,6 +29,10 @@ class PlanVersion(BaseModel): + """ + The PlanVersion resource represents the prices and adjustments present on a specific version of a plan. + """ + adjustments: List[Adjustment] """Adjustments for this plan. diff --git a/src/orb_sdk/types/plans/__init__.py b/src/orb_sdk/types/plans/__init__.py index 6108b59..37f6dbd 100644 --- a/src/orb_sdk/types/plans/__init__.py +++ b/src/orb_sdk/types/plans/__init__.py @@ -2,4 +2,8 @@ from __future__ import annotations +from .migration_list_params import MigrationListParams as MigrationListParams +from .migration_list_response import MigrationListResponse as MigrationListResponse +from .migration_cancel_response import MigrationCancelResponse as MigrationCancelResponse +from .migration_retrieve_response import MigrationRetrieveResponse as MigrationRetrieveResponse from .external_plan_id_update_params import ExternalPlanIDUpdateParams as ExternalPlanIDUpdateParams diff --git a/src/orb_sdk/types/plans/migration_cancel_response.py b/src/orb_sdk/types/plans/migration_cancel_response.py new file mode 100644 index 0000000..e95010c --- /dev/null +++ b/src/orb_sdk/types/plans/migration_cancel_response.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from datetime import date, datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["MigrationCancelResponse"] + + +class MigrationCancelResponse(BaseModel): + id: str + + effective_time: Union[date, datetime, Literal["end_of_term"], None] = None + + plan_id: str + + status: Literal["not_started", "in_progress", "completed", "action_needed", "canceled"] diff --git a/src/orb_sdk/types/plans/migration_list_params.py b/src/orb_sdk/types/plans/migration_list_params.py new file mode 100644 index 0000000..aecb3f1 --- /dev/null +++ b/src/orb_sdk/types/plans/migration_list_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["MigrationListParams"] + + +class MigrationListParams(TypedDict, total=False): + cursor: Optional[str] + """Cursor for pagination. + + This can be populated by the `next_cursor` value returned from the initial + request. + """ + + limit: int + """The number of items to fetch. Defaults to 20.""" diff --git a/src/orb_sdk/types/plans/migration_list_response.py b/src/orb_sdk/types/plans/migration_list_response.py new file mode 100644 index 0000000..3ebf0fc --- /dev/null +++ b/src/orb_sdk/types/plans/migration_list_response.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from datetime import date, datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["MigrationListResponse"] + + +class MigrationListResponse(BaseModel): + id: str + + effective_time: Union[date, datetime, Literal["end_of_term"], None] = None + + plan_id: str + + status: Literal["not_started", "in_progress", "completed", "action_needed", "canceled"] diff --git a/src/orb_sdk/types/plans/migration_retrieve_response.py b/src/orb_sdk/types/plans/migration_retrieve_response.py new file mode 100644 index 0000000..aed370c --- /dev/null +++ b/src/orb_sdk/types/plans/migration_retrieve_response.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from datetime import date, datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["MigrationRetrieveResponse"] + + +class MigrationRetrieveResponse(BaseModel): + id: str + + effective_time: Union[date, datetime, Literal["end_of_term"], None] = None + + plan_id: str + + status: Literal["not_started", "in_progress", "completed", "action_needed", "canceled"] diff --git a/src/orb_sdk/types/price_create_params.py b/src/orb_sdk/types/price_create_params.py index ff714f4..e114775 100644 --- a/src/orb_sdk/types/price_create_params.py +++ b/src/orb_sdk/types/price_create_params.py @@ -115,7 +115,7 @@ "NewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig", "NewFloatingCumulativeGroupedAllocationPriceConversionRateConfig", "NewFloatingMinimumCompositePrice", - "NewFloatingMinimumCompositePriceMinimumConfig", + "NewFloatingMinimumCompositePriceMinimumCompositeConfig", "NewFloatingMinimumCompositePriceConversionRateConfig", "NewFloatingPercentCompositePrice", "NewFloatingPercentCompositePricePercentConfig", @@ -190,6 +190,9 @@ class NewFloatingUnitPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -265,6 +268,9 @@ class NewFloatingTieredPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -340,6 +346,9 @@ class NewFloatingBulkPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -415,6 +424,9 @@ class NewFloatingBulkWithFiltersPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -424,6 +436,8 @@ class NewFloatingBulkWithFiltersPrice(TypedDict, total=False): class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -432,6 +446,8 @@ class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, tota class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -440,6 +456,8 @@ class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total= class NewFloatingBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[NewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -516,6 +534,9 @@ class NewFloatingPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -591,6 +612,9 @@ class NewFloatingMatrixPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -666,6 +690,9 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -675,14 +702,17 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): class NewFloatingThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): + """Configuration for a single threshold""" + threshold: Required[str] - """Quantity threshold""" total_amount: Required[str] """Total amount for this threshold""" class NewFloatingThresholdTotalAmountPriceThresholdTotalAmountConfig(TypedDict, total=False): + """Configuration for threshold_total_amount pricing""" + consumption_table: Required[ Iterable[NewFloatingThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable] ] @@ -764,6 +794,9 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -773,16 +806,18 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): class NewFloatingTieredPackagePriceTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier with business logic""" + per_unit: Required[str] """Price per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class NewFloatingTieredPackagePriceTieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + package_size: Required[str] - """Package size""" tiers: Required[Iterable[NewFloatingTieredPackagePriceTieredPackageConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -862,6 +897,9 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -871,17 +909,19 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): class NewFloatingTieredWithMinimumPriceTieredWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] - """Minimum amount""" tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class NewFloatingTieredWithMinimumPriceTieredWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_with_minimum pricing""" + tiers: Required[Iterable[NewFloatingTieredWithMinimumPriceTieredWithMinimumConfigTier]] """Tiered pricing with a minimum amount dependent on the volume tier. @@ -964,6 +1004,9 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -973,14 +1016,17 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): class NewFloatingGroupedTieredPriceGroupedTieredConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class NewFloatingGroupedTieredPriceGroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + grouping_key: Required[str] """The billable metric property used to group before tiering""" @@ -1060,6 +1106,9 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1069,19 +1118,19 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): class NewFloatingTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] - """Minimum amount""" per_unit: Required[str] - """Price per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class NewFloatingTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_package_with_minimum pricing""" + package_size: Required[float] - """Package size""" tiers: Required[Iterable[NewFloatingTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -1159,6 +1208,9 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1168,14 +1220,13 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): class NewFloatingPackageWithAllocationPricePackageWithAllocationConfig(TypedDict, total=False): + """Configuration for package_with_allocation pricing""" + allocation: Required[str] - """Usage allocation""" package_amount: Required[str] - """Price per package""" package_size: Required[str] - """Package size""" NewFloatingPackageWithAllocationPriceConversionRateConfig: TypeAlias = Union[ @@ -1247,6 +1298,9 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1256,6 +1310,8 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): class NewFloatingUnitWithPercentPriceUnitWithPercentConfig(TypedDict, total=False): + """Configuration for unit_with_percent pricing""" + percent: Required[str] """What percent, out of 100, of the calculated total to charge""" @@ -1332,6 +1388,9 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1409,6 +1468,9 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1418,6 +1480,8 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): class NewFloatingTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -1426,6 +1490,8 @@ class NewFloatingTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict class NewFloatingTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[NewFloatingTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1502,6 +1568,9 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1511,6 +1580,8 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): class NewFloatingUnitWithProrationPriceUnitWithProrationConfig(TypedDict, total=False): + """Configuration for unit_with_proration pricing""" + unit_amount: Required[str] """Rate per unit of usage""" @@ -1584,6 +1655,9 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1593,6 +1667,8 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): class NewFloatingGroupedAllocationPriceGroupedAllocationConfig(TypedDict, total=False): + """Configuration for grouped_allocation pricing""" + allocation: Required[str] """Usage allocation per group""" @@ -1672,6 +1748,9 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1681,6 +1760,8 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): class NewFloatingBulkWithProrationPriceBulkWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: Required[str] """Cost per unit""" @@ -1689,6 +1770,8 @@ class NewFloatingBulkWithProrationPriceBulkWithProrationConfigTier(TypedDict, to class NewFloatingBulkWithProrationPriceBulkWithProrationConfig(TypedDict, total=False): + """Configuration for bulk_with_proration pricing""" + tiers: Required[Iterable[NewFloatingBulkWithProrationPriceBulkWithProrationConfigTier]] """Bulk tiers for rating based on total usage volume""" @@ -1764,6 +1847,9 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1773,6 +1859,8 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): class NewFloatingGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: Required[str] """How to determine the groups that should each have a minimum""" @@ -1854,6 +1942,9 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1863,22 +1954,25 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): class NewFloatingGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): + """Configuration for a scaling factor""" + scaling_factor: Required[str] - """Scaling factor""" scaling_value: Required[str] - """Scaling value""" class NewFloatingGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount""" + pricing_value: Required[str] - """Pricing value""" unit_amount: Required[str] """Per unit amount""" class NewFloatingGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: Required[str] """Used to partition the usage into groups. @@ -1977,6 +2071,9 @@ class NewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1986,6 +2083,8 @@ class NewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): class NewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -2068,6 +2167,9 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2077,6 +2179,8 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): class NewFloatingMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount item""" + dimension_value: Required[str] """The dimension value""" @@ -2088,6 +2192,8 @@ class NewFloatingMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount class NewFloatingMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig(TypedDict, total=False): + """Configuration for matrix_with_display_name pricing""" + dimension: Required[str] """Used to determine the unit rate""" @@ -2164,6 +2270,9 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2173,19 +2282,21 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): class NewFloatingGroupedTieredPackagePriceGroupedTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + per_unit: Required[str] - """Price per package""" + """Per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class NewFloatingGroupedTieredPackagePriceGroupedTieredPackageConfig(TypedDict, total=False): + """Configuration for grouped_tiered_package pricing""" + grouping_key: Required[str] """The event property used to group before tiering""" package_size: Required[str] - """Package size""" tiers: Required[Iterable[NewFloatingGroupedTieredPackagePriceGroupedTieredPackageConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -2263,6 +2374,9 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2272,21 +2386,23 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): class NewFloatingMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class NewFloatingMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig(TypedDict, total=False): + """Configuration for max_group_tiered_package pricing""" + grouping_key: Required[str] """ The event property used to group before tiering the group with the highest value """ package_size: Required[str] - """Package size""" tiers: Required[Iterable[NewFloatingMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier]] """Apply tiered pricing to the largest group after grouping with the provided key.""" @@ -2363,6 +2479,9 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2374,17 +2493,18 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): class NewFloatingScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor( TypedDict, total=False ): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] - """First dimension value""" scaling_factor: Required[str] - """Scaling factor""" second_dimension_value: Optional[str] - """Second dimension value (optional)""" class NewFloatingScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: Required[str] """Used to determine the unit rate""" @@ -2474,6 +2594,9 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2485,25 +2608,26 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): class NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor( TypedDict, total=False ): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] - """First dimension value""" scaling_factor: Required[str] - """Scaling factor""" second_dimension_value: Optional[str] - """Second dimension value (optional)""" class NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] - """Per unit amount""" class NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: Required[str] """Used for the scalable matrix first dimension""" @@ -2515,7 +2639,6 @@ class NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPri """Apply a scaling factor to each dimension""" tiers: Required[Iterable[NewFloatingScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier]] - """Tier pricing structure""" second_dimension: Optional[str] """Used for the scalable matrix second dimension (optional)""" @@ -2590,6 +2713,9 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2599,6 +2725,8 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): class NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): + """Configuration for a dimension value entry""" + grouping_key: Required[str] """Grouping key value""" @@ -2610,11 +2738,12 @@ class NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionV class NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: Required[Iterable[NewFloatingCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue]] """Each tier lower bound must have the same group of values.""" group: Required[str] - """Grouping key name""" NewFloatingCumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Union[ @@ -2688,6 +2817,9 @@ class NewFloatingCumulativeGroupedAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2697,6 +2829,8 @@ class NewFloatingCumulativeGroupedAllocationPrice(TypedDict, total=False): class NewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -2725,10 +2859,10 @@ class NewFloatingMinimumCompositePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - minimum_config: Required[NewFloatingMinimumCompositePriceMinimumConfig] - """Configuration for minimum pricing""" + minimum_composite_config: Required[NewFloatingMinimumCompositePriceMinimumCompositeConfig] + """Configuration for minimum_composite pricing""" - model_type: Required[Literal["minimum"]] + model_type: Required[Literal["minimum_composite"]] """The pricing model type""" name: Required[str] @@ -2779,6 +2913,9 @@ class NewFloatingMinimumCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2787,7 +2924,9 @@ class NewFloatingMinimumCompositePrice(TypedDict, total=False): """ -class NewFloatingMinimumCompositePriceMinimumConfig(TypedDict, total=False): +class NewFloatingMinimumCompositePriceMinimumCompositeConfig(TypedDict, total=False): + """Configuration for minimum_composite pricing""" + minimum_amount: Required[str] """The minimum amount to apply""" @@ -2864,6 +3003,9 @@ class NewFloatingPercentCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2873,6 +3015,8 @@ class NewFloatingPercentCompositePrice(TypedDict, total=False): class NewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -2946,6 +3090,9 @@ class NewFloatingEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -2955,6 +3102,8 @@ class NewFloatingEventOutputPrice(TypedDict, total=False): class NewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" diff --git a/src/orb_sdk/types/price_evaluate_multiple_params.py b/src/orb_sdk/types/price_evaluate_multiple_params.py index 331a102..90cd75d 100644 --- a/src/orb_sdk/types/price_evaluate_multiple_params.py +++ b/src/orb_sdk/types/price_evaluate_multiple_params.py @@ -85,6 +85,8 @@ class PriceEvaluateMultipleParams(TypedDict, total=False): class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -93,6 +95,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFi class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -101,6 +105,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTi class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -177,6 +183,9 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPrice(TypedDict, total=False If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -188,6 +197,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPrice(TypedDict, total=False class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -274,6 +285,9 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -285,6 +299,8 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -371,6 +387,9 @@ class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPrice(TypedDict, If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -380,6 +399,8 @@ class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPrice(TypedDict, class PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -453,6 +474,9 @@ class PriceEvaluationPriceNewFloatingPercentCompositePrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -462,6 +486,8 @@ class PriceEvaluationPriceNewFloatingPercentCompositePrice(TypedDict, total=Fals class PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -548,6 +574,9 @@ class PriceEvaluationPriceNewFloatingEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/price_evaluate_preview_events_params.py b/src/orb_sdk/types/price_evaluate_preview_events_params.py index a490430..ec48715 100644 --- a/src/orb_sdk/types/price_evaluate_preview_events_params.py +++ b/src/orb_sdk/types/price_evaluate_preview_events_params.py @@ -117,6 +117,8 @@ class Event(TypedDict, total=False): class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -125,6 +127,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFi class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -133,6 +137,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTi class PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[PriceEvaluationPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -209,6 +215,9 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPrice(TypedDict, total=False If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -220,6 +229,8 @@ class PriceEvaluationPriceNewFloatingBulkWithFiltersPrice(TypedDict, total=False class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -306,6 +317,9 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -317,6 +331,8 @@ class PriceEvaluationPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -403,6 +419,9 @@ class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPrice(TypedDict, If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -412,6 +431,8 @@ class PriceEvaluationPriceNewFloatingCumulativeGroupedAllocationPrice(TypedDict, class PriceEvaluationPriceNewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -485,6 +506,9 @@ class PriceEvaluationPriceNewFloatingPercentCompositePrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -494,6 +518,8 @@ class PriceEvaluationPriceNewFloatingPercentCompositePrice(TypedDict, total=Fals class PriceEvaluationPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -580,6 +606,9 @@ class PriceEvaluationPriceNewFloatingEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/allocation.py b/src/orb_sdk/types/shared/allocation.py index a7f0525..69c1cde 100644 --- a/src/orb_sdk/types/shared/allocation.py +++ b/src/orb_sdk/types/shared/allocation.py @@ -28,3 +28,5 @@ class Allocation(BaseModel): custom_expiration: Optional[CustomExpiration] = None filters: Optional[List[Filter]] = None + + license_type_id: Optional[str] = None diff --git a/src/orb_sdk/types/shared/bulk_config.py b/src/orb_sdk/types/shared/bulk_config.py index cc95e5c..1bba554 100644 --- a/src/orb_sdk/types/shared/bulk_config.py +++ b/src/orb_sdk/types/shared/bulk_config.py @@ -9,5 +9,7 @@ class BulkConfig(BaseModel): + """Configuration for bulk pricing""" + tiers: List[BulkTier] """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb_sdk/types/shared/bulk_tier.py b/src/orb_sdk/types/shared/bulk_tier.py index 993a07e..bd514c2 100644 --- a/src/orb_sdk/types/shared/bulk_tier.py +++ b/src/orb_sdk/types/shared/bulk_tier.py @@ -8,6 +8,8 @@ class BulkTier(BaseModel): + """Configuration for a single bulk pricing tier""" + unit_amount: str """Amount per unit""" diff --git a/src/orb_sdk/types/shared/changed_subscription_resources.py b/src/orb_sdk/types/shared/changed_subscription_resources.py index 402f8aa..6db4d6b 100644 --- a/src/orb_sdk/types/shared/changed_subscription_resources.py +++ b/src/orb_sdk/types/shared/changed_subscription_resources.py @@ -394,6 +394,7 @@ class CreatedInvoice(BaseModel): | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | diff --git a/src/orb_sdk/types/shared/credit_note.py b/src/orb_sdk/types/shared/credit_note.py index 4c7e6f2..b728b6a 100644 --- a/src/orb_sdk/types/shared/credit_note.py +++ b/src/orb_sdk/types/shared/credit_note.py @@ -74,6 +74,8 @@ class MaximumAmountAdjustmentAppliesToPrice(BaseModel): class MaximumAmountAdjustment(BaseModel): + """The maximum amount applied on the original invoice""" + amount_applied: str discount_type: Literal["percentage"] @@ -104,6 +106,11 @@ class Discount(BaseModel): class CreditNote(BaseModel): + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ + id: str """The Orb id of this credit note.""" diff --git a/src/orb_sdk/types/shared/customer_tax_id.py b/src/orb_sdk/types/shared/customer_tax_id.py index 916e27d..e311225 100644 --- a/src/orb_sdk/types/shared/customer_tax_id.py +++ b/src/orb_sdk/types/shared/customer_tax_id.py @@ -8,6 +8,155 @@ class CustomerTaxID(BaseModel): + """ + Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. + + + ### Supported Tax ID Countries and Types + + + | Country | Type | Description | + |---------|------|-------------| + | Albania | `al_tin` | Albania Tax Identification Number | + | Andorra | `ad_nrt` | Andorran NRT Number | + | Angola | `ao_tin` | Angola Tax Identification Number | + | Argentina | `ar_cuit` | Argentinian Tax ID Number | + | Armenia | `am_tin` | Armenia Tax Identification Number | + | Aruba | `aw_tin` | Aruba Tax Identification Number | + | Australia | `au_abn` | Australian Business Number (AU ABN) | + | Australia | `au_arn` | Australian Taxation Office Reference Number | + | Austria | `eu_vat` | European VAT Number | + | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + | Bahrain | `bh_vat` | Bahraini VAT Number | + | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + | Barbados | `bb_tin` | Barbados Tax Identification Number | + | Belarus | `by_tin` | Belarus TIN Number | + | Belgium | `eu_vat` | European VAT Number | + | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + | Bolivia | `bo_tin` | Bolivian Tax ID | + | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + | Brazil | `br_cnpj` | Brazilian CNPJ Number | + | Brazil | `br_cpf` | Brazilian CPF Number | + | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + | Bulgaria | `eu_vat` | European VAT Number | + | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + | Canada | `ca_bn` | Canadian BN | + | Canada | `ca_gst_hst` | Canadian GST/HST Number | + | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + | Canada | `ca_qst` | Canadian QST Number (Québec) | + | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + | Chile | `cl_tin` | Chilean TIN | + | China | `cn_tin` | Chinese Tax ID | + | Colombia | `co_nit` | Colombian NIT Number | + | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + | Costa Rica | `cr_tin` | Costa Rican Tax ID | + | Croatia | `eu_vat` | European VAT Number | + | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + | Cyprus | `eu_vat` | European VAT Number | + | Czech Republic | `eu_vat` | European VAT Number | + | Denmark | `eu_vat` | European VAT Number | + | Dominican Republic | `do_rcn` | Dominican RCN Number | + | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + | Egypt | `eg_tin` | Egyptian Tax Identification Number | + | El Salvador | `sv_nit` | El Salvadorian NIT Number | + | Estonia | `eu_vat` | European VAT Number | + | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + | Finland | `eu_vat` | European VAT Number | + | France | `eu_vat` | European VAT Number | + | Georgia | `ge_vat` | Georgian VAT | + | Germany | `de_stn` | German Tax Number (Steuernummer) | + | Germany | `eu_vat` | European VAT Number | + | Greece | `eu_vat` | European VAT Number | + | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + | Hong Kong | `hk_br` | Hong Kong BR Number | + | Hungary | `eu_vat` | European VAT Number | + | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + | Iceland | `is_vat` | Icelandic VAT | + | India | `in_gst` | Indian GST Number | + | Indonesia | `id_npwp` | Indonesian NPWP Number | + | Ireland | `eu_vat` | European VAT Number | + | Israel | `il_vat` | Israel VAT | + | Italy | `eu_vat` | European VAT Number | + | Japan | `jp_cn` | Japanese Corporate Number (*Hōjin Bangō*) | + | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (*Tōroku Kokugai Jigyōsha no Tōroku Bangō*) | + | Japan | `jp_trn` | Japanese Tax Registration Number (*Tōroku Bangō*) | + | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + | Laos | `la_tin` | Laos Tax Identification Number | + | Latvia | `eu_vat` | European VAT Number | + | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + | Lithuania | `eu_vat` | European VAT Number | + | Luxembourg | `eu_vat` | European VAT Number | + | Malaysia | `my_frp` | Malaysian FRP Number | + | Malaysia | `my_itn` | Malaysian ITN | + | Malaysia | `my_sst` | Malaysian SST Number | + | Malta | `eu_vat` | European VAT Number | + | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + | Mexico | `mx_rfc` | Mexican RFC Number | + | Moldova | `md_vat` | Moldova VAT Number | + | Montenegro | `me_pib` | Montenegro PIB Number | + | Morocco | `ma_vat` | Morocco VAT Number | + | Nepal | `np_pan` | Nepal PAN Number | + | Netherlands | `eu_vat` | European VAT Number | + | New Zealand | `nz_gst` | New Zealand GST Number | + | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + | North Macedonia | `mk_vat` | North Macedonia VAT Number | + | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + | Norway | `no_vat` | Norwegian VAT Number | + | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + | Oman | `om_vat` | Omani VAT Number | + | Peru | `pe_ruc` | Peruvian RUC Number | + | Philippines | `ph_tin` | Philippines Tax Identification Number | + | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | + | Portugal | `eu_vat` | European VAT Number | + | Romania | `eu_vat` | European VAT Number | + | Romania | `ro_tin` | Romanian Tax ID Number | + | Russia | `ru_inn` | Russian INN | + | Russia | `ru_kpp` | Russian KPP | + | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + | Senegal | `sn_ninea` | Senegal NINEA Number | + | Serbia | `rs_pib` | Serbian PIB Number | + | Singapore | `sg_gst` | Singaporean GST | + | Singapore | `sg_uen` | Singaporean UEN | + | Slovakia | `eu_vat` | European VAT Number | + | Slovenia | `eu_vat` | European VAT Number | + | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + | South Africa | `za_vat` | South African VAT Number | + | South Korea | `kr_brn` | Korean BRN | + | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + | Spain | `eu_vat` | European VAT Number | + | Suriname | `sr_fin` | Suriname FIN Number | + | Sweden | `eu_vat` | European VAT Number | + | Switzerland | `ch_uid` | Switzerland UID Number | + | Switzerland | `ch_vat` | Switzerland VAT Number | + | Taiwan | `tw_vat` | Taiwanese VAT | + | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + | Tanzania | `tz_vat` | Tanzania VAT Number | + | Thailand | `th_vat` | Thai VAT | + | Turkey | `tr_tin` | Turkish Tax Identification Number | + | Uganda | `ug_tin` | Uganda Tax Identification Number | + | Ukraine | `ua_vat` | Ukrainian VAT | + | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + | United Kingdom | `gb_vat` | United Kingdom VAT Number | + | United States | `us_ein` | United States EIN | + | Uruguay | `uy_ruc` | Uruguayan RUC Number | + | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + | Venezuela | `ve_rif` | Venezuelan RIF Number | + | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + | Zambia | `zm_tin` | Zambia Tax Identification Number | + | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + """ + country: Literal[ "AD", "AE", @@ -207,6 +356,7 @@ class CustomerTaxID(BaseModel): "om_vat", "pe_ruc", "ph_tin", + "pl_nip", "ro_tin", "rs_pib", "ru_inn", diff --git a/src/orb_sdk/types/shared/invoice.py b/src/orb_sdk/types/shared/invoice.py index 958244d..5ca12b9 100644 --- a/src/orb_sdk/types/shared/invoice.py +++ b/src/orb_sdk/types/shared/invoice.py @@ -258,6 +258,13 @@ class PaymentAttempt(BaseModel): class Invoice(BaseModel): + """ + An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for + a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and + can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as + the result of an action, such as a cancellation. + """ + id: str amount_due: str @@ -391,6 +398,7 @@ class Invoice(BaseModel): | Peru | `pe_ruc` | Peruvian RUC Number | | Philippines | `ph_tin` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | | Portugal | `eu_vat` | European VAT Number | | Romania | `eu_vat` | European VAT Number | | Romania | `ro_tin` | Romanian Tax ID Number | diff --git a/src/orb_sdk/types/shared/item_slim.py b/src/orb_sdk/types/shared/item_slim.py index 8997633..7d8cce6 100644 --- a/src/orb_sdk/types/shared/item_slim.py +++ b/src/orb_sdk/types/shared/item_slim.py @@ -6,6 +6,10 @@ class ItemSlim(BaseModel): + """ + A minimal representation of an Item containing only the essential identifying information. + """ + id: str """The Orb-assigned unique identifier for the item.""" diff --git a/src/orb_sdk/types/shared/matrix_config.py b/src/orb_sdk/types/shared/matrix_config.py index 718ab94..4cafc22 100644 --- a/src/orb_sdk/types/shared/matrix_config.py +++ b/src/orb_sdk/types/shared/matrix_config.py @@ -9,6 +9,8 @@ class MatrixConfig(BaseModel): + """Configuration for matrix pricing""" + default_unit_amount: str """Default per unit rate for any usage not bucketed into a specified matrix_value""" diff --git a/src/orb_sdk/types/shared/matrix_value.py b/src/orb_sdk/types/shared/matrix_value.py index 1f80889..c905043 100644 --- a/src/orb_sdk/types/shared/matrix_value.py +++ b/src/orb_sdk/types/shared/matrix_value.py @@ -8,6 +8,8 @@ class MatrixValue(BaseModel): + """Configuration for a single matrix value""" + dimension_values: List[Optional[str]] """One or two matrix keys to filter usage to this Matrix value by""" diff --git a/src/orb_sdk/types/shared/matrix_with_allocation_config.py b/src/orb_sdk/types/shared/matrix_with_allocation_config.py index bc935fe..e632f98 100644 --- a/src/orb_sdk/types/shared/matrix_with_allocation_config.py +++ b/src/orb_sdk/types/shared/matrix_with_allocation_config.py @@ -8,6 +8,8 @@ class MatrixValue(BaseModel): + """Configuration for a single matrix value""" + dimension_values: List[Optional[str]] """One or two matrix keys to filter usage to this Matrix value by. @@ -20,6 +22,8 @@ class MatrixValue(BaseModel): class MatrixWithAllocationConfig(BaseModel): + """Configuration for matrix pricing with usage allocation""" + allocation: str """Usage allocation""" diff --git a/src/orb_sdk/types/shared/new_allocation_price.py b/src/orb_sdk/types/shared/new_allocation_price.py index c2234fb..afaf82c 100644 --- a/src/orb_sdk/types/shared/new_allocation_price.py +++ b/src/orb_sdk/types/shared/new_allocation_price.py @@ -10,6 +10,8 @@ class Filter(BaseModel): + """A PriceFilter that only allows item_id field for block filters.""" + field: Literal["item_id"] """The property of the price the block applies to. Only item_id is supported.""" @@ -52,6 +54,9 @@ class NewAllocationPrice(BaseModel): will be used (e.g. 'Included Allocation (USD)'). """ + license_type_id: Optional[str] = None + """The license type ID to associate the price with license allocation.""" + per_unit_cost_basis: Optional[str] = None """The (per-unit) cost basis of each created block. diff --git a/src/orb_sdk/types/shared/new_floating_bulk_price.py b/src/orb_sdk/types/shared/new_floating_bulk_price.py index cdeb808..b9a72b3 100644 --- a/src/orb_sdk/types/shared/new_floating_bulk_price.py +++ b/src/orb_sdk/types/shared/new_floating_bulk_price.py @@ -84,6 +84,9 @@ class NewFloatingBulkPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_bulk_with_proration_price.py b/src/orb_sdk/types/shared/new_floating_bulk_with_proration_price.py index 3925342..024f31a 100644 --- a/src/orb_sdk/types/shared/new_floating_bulk_with_proration_price.py +++ b/src/orb_sdk/types/shared/new_floating_bulk_with_proration_price.py @@ -21,6 +21,8 @@ class BulkWithProrationConfigTier(BaseModel): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: str """Cost per unit""" @@ -29,6 +31,8 @@ class BulkWithProrationConfigTier(BaseModel): class BulkWithProrationConfig(BaseModel): + """Configuration for bulk_with_proration pricing""" + tiers: List[BulkWithProrationConfigTier] """Bulk tiers for rating based on total usage volume""" @@ -102,6 +106,9 @@ class NewFloatingBulkWithProrationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_cumulative_grouped_bulk_price.py b/src/orb_sdk/types/shared/new_floating_cumulative_grouped_bulk_price.py index 21bdd4f..dbdb311 100644 --- a/src/orb_sdk/types/shared/new_floating_cumulative_grouped_bulk_price.py +++ b/src/orb_sdk/types/shared/new_floating_cumulative_grouped_bulk_price.py @@ -21,6 +21,8 @@ class CumulativeGroupedBulkConfigDimensionValue(BaseModel): + """Configuration for a dimension value entry""" + grouping_key: str """Grouping key value""" @@ -32,11 +34,12 @@ class CumulativeGroupedBulkConfigDimensionValue(BaseModel): class CumulativeGroupedBulkConfig(BaseModel): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: List[CumulativeGroupedBulkConfigDimensionValue] """Each tier lower bound must have the same group of values.""" group: str - """Grouping key name""" ConversionRateConfig: TypeAlias = Annotated[ @@ -108,6 +111,9 @@ class NewFloatingCumulativeGroupedBulkPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_grouped_allocation_price.py b/src/orb_sdk/types/shared/new_floating_grouped_allocation_price.py index 66b0ab8..065750e 100644 --- a/src/orb_sdk/types/shared/new_floating_grouped_allocation_price.py +++ b/src/orb_sdk/types/shared/new_floating_grouped_allocation_price.py @@ -16,6 +16,8 @@ class GroupedAllocationConfig(BaseModel): + """Configuration for grouped_allocation pricing""" + allocation: str """Usage allocation per group""" @@ -95,6 +97,9 @@ class NewFloatingGroupedAllocationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_grouped_tiered_package_price.py b/src/orb_sdk/types/shared/new_floating_grouped_tiered_package_price.py index 559fd9e..27584cf 100644 --- a/src/orb_sdk/types/shared/new_floating_grouped_tiered_package_price.py +++ b/src/orb_sdk/types/shared/new_floating_grouped_tiered_package_price.py @@ -21,19 +21,21 @@ class GroupedTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + per_unit: str - """Price per package""" + """Per package""" tier_lower_bound: str - """Tier lower bound""" class GroupedTieredPackageConfig(BaseModel): + """Configuration for grouped_tiered_package pricing""" + grouping_key: str """The event property used to group before tiering""" package_size: str - """Package size""" tiers: List[GroupedTieredPackageConfigTier] """Apply tiered pricing after rounding up the quantity to the package size. @@ -111,6 +113,9 @@ class NewFloatingGroupedTieredPackagePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_grouped_tiered_price.py b/src/orb_sdk/types/shared/new_floating_grouped_tiered_price.py index 9082141..39c48cc 100644 --- a/src/orb_sdk/types/shared/new_floating_grouped_tiered_price.py +++ b/src/orb_sdk/types/shared/new_floating_grouped_tiered_price.py @@ -16,14 +16,17 @@ class GroupedTieredConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str - """Tier lower bound""" unit_amount: str """Per unit amount""" class GroupedTieredConfig(BaseModel): + """Configuration for grouped_tiered pricing""" + grouping_key: str """The billable metric property used to group before tiering""" @@ -103,6 +106,9 @@ class NewFloatingGroupedTieredPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_grouped_with_metered_minimum_price.py b/src/orb_sdk/types/shared/new_floating_grouped_with_metered_minimum_price.py index da6d97d..1c757dd 100644 --- a/src/orb_sdk/types/shared/new_floating_grouped_with_metered_minimum_price.py +++ b/src/orb_sdk/types/shared/new_floating_grouped_with_metered_minimum_price.py @@ -22,22 +22,25 @@ class GroupedWithMeteredMinimumConfigScalingFactor(BaseModel): + """Configuration for a scaling factor""" + scaling_factor: str - """Scaling factor""" scaling_value: str - """Scaling value""" class GroupedWithMeteredMinimumConfigUnitAmount(BaseModel): + """Configuration for a unit amount""" + pricing_value: str - """Pricing value""" unit_amount: str """Per unit amount""" class GroupedWithMeteredMinimumConfig(BaseModel): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: str """Used to partition the usage into groups. @@ -132,6 +135,9 @@ class NewFloatingGroupedWithMeteredMinimumPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_grouped_with_prorated_minimum_price.py b/src/orb_sdk/types/shared/new_floating_grouped_with_prorated_minimum_price.py index e3705b2..236611b 100644 --- a/src/orb_sdk/types/shared/new_floating_grouped_with_prorated_minimum_price.py +++ b/src/orb_sdk/types/shared/new_floating_grouped_with_prorated_minimum_price.py @@ -16,6 +16,8 @@ class GroupedWithProratedMinimumConfig(BaseModel): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: str """How to determine the groups that should each have a minimum""" @@ -95,6 +97,9 @@ class NewFloatingGroupedWithProratedMinimumPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_matrix_price.py b/src/orb_sdk/types/shared/new_floating_matrix_price.py index 7eea795..ff12bc1 100644 --- a/src/orb_sdk/types/shared/new_floating_matrix_price.py +++ b/src/orb_sdk/types/shared/new_floating_matrix_price.py @@ -84,6 +84,9 @@ class NewFloatingMatrixPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_matrix_with_allocation_price.py b/src/orb_sdk/types/shared/new_floating_matrix_with_allocation_price.py index 78a1cb0..688793a 100644 --- a/src/orb_sdk/types/shared/new_floating_matrix_with_allocation_price.py +++ b/src/orb_sdk/types/shared/new_floating_matrix_with_allocation_price.py @@ -84,6 +84,9 @@ class NewFloatingMatrixWithAllocationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_matrix_with_display_name_price.py b/src/orb_sdk/types/shared/new_floating_matrix_with_display_name_price.py index 2ccdbcc..8748b1f 100644 --- a/src/orb_sdk/types/shared/new_floating_matrix_with_display_name_price.py +++ b/src/orb_sdk/types/shared/new_floating_matrix_with_display_name_price.py @@ -21,6 +21,8 @@ class MatrixWithDisplayNameConfigUnitAmount(BaseModel): + """Configuration for a unit amount item""" + dimension_value: str """The dimension value""" @@ -32,6 +34,8 @@ class MatrixWithDisplayNameConfigUnitAmount(BaseModel): class MatrixWithDisplayNameConfig(BaseModel): + """Configuration for matrix_with_display_name pricing""" + dimension: str """Used to determine the unit rate""" @@ -108,6 +112,9 @@ class NewFloatingMatrixWithDisplayNamePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_max_group_tiered_package_price.py b/src/orb_sdk/types/shared/new_floating_max_group_tiered_package_price.py index abf1995..9603e11 100644 --- a/src/orb_sdk/types/shared/new_floating_max_group_tiered_package_price.py +++ b/src/orb_sdk/types/shared/new_floating_max_group_tiered_package_price.py @@ -21,21 +21,23 @@ class MaxGroupTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str - """Tier lower bound""" unit_amount: str """Per unit amount""" class MaxGroupTieredPackageConfig(BaseModel): + """Configuration for max_group_tiered_package pricing""" + grouping_key: str """ The event property used to group before tiering the group with the highest value """ package_size: str - """Package size""" tiers: List[MaxGroupTieredPackageConfigTier] """Apply tiered pricing to the largest group after grouping with the provided key.""" @@ -110,6 +112,9 @@ class NewFloatingMaxGroupTieredPackagePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_minimum_composite_price.py b/src/orb_sdk/types/shared/new_floating_minimum_composite_price.py index b8d1db2..4c210ac 100644 --- a/src/orb_sdk/types/shared/new_floating_minimum_composite_price.py +++ b/src/orb_sdk/types/shared/new_floating_minimum_composite_price.py @@ -12,10 +12,12 @@ from .new_billing_cycle_configuration import NewBillingCycleConfiguration from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewFloatingMinimumCompositePrice", "MinimumConfig", "ConversionRateConfig"] +__all__ = ["NewFloatingMinimumCompositePrice", "MinimumCompositeConfig", "ConversionRateConfig"] -class MinimumConfig(BaseModel): +class MinimumCompositeConfig(BaseModel): + """Configuration for minimum_composite pricing""" + minimum_amount: str """The minimum amount to apply""" @@ -38,10 +40,10 @@ class NewFloatingMinimumCompositePrice(BaseModel): item_id: str """The id of the item the price will be associated with.""" - minimum_config: MinimumConfig - """Configuration for minimum pricing""" + minimum_composite_config: MinimumCompositeConfig + """Configuration for minimum_composite pricing""" - price_model_type: Literal["minimum"] = FieldInfo(alias="model_type") + price_model_type: Literal["minimum_composite"] = FieldInfo(alias="model_type") """The pricing model type""" name: str @@ -92,6 +94,9 @@ class NewFloatingMinimumCompositePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_package_price.py b/src/orb_sdk/types/shared/new_floating_package_price.py index 3548de3..e0ccf47 100644 --- a/src/orb_sdk/types/shared/new_floating_package_price.py +++ b/src/orb_sdk/types/shared/new_floating_package_price.py @@ -84,6 +84,9 @@ class NewFloatingPackagePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_package_with_allocation_price.py b/src/orb_sdk/types/shared/new_floating_package_with_allocation_price.py index a0aadb9..07c5a9e 100644 --- a/src/orb_sdk/types/shared/new_floating_package_with_allocation_price.py +++ b/src/orb_sdk/types/shared/new_floating_package_with_allocation_price.py @@ -16,14 +16,13 @@ class PackageWithAllocationConfig(BaseModel): + """Configuration for package_with_allocation pricing""" + allocation: str - """Usage allocation""" package_amount: str - """Price per package""" package_size: str - """Package size""" ConversionRateConfig: TypeAlias = Annotated[ @@ -95,6 +94,9 @@ class NewFloatingPackageWithAllocationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py b/src/orb_sdk/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py index 6278f0b..2a13555 100644 --- a/src/orb_sdk/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb_sdk/types/shared/new_floating_scalable_matrix_with_tiered_pricing_price.py @@ -22,25 +22,26 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str - """First dimension value""" scaling_factor: str - """Scaling factor""" second_dimension_value: Optional[str] = None - """Second dimension value (optional)""" class ScalableMatrixWithTieredPricingConfigTier(BaseModel): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: str - """Tier lower bound""" unit_amount: str - """Per unit amount""" class ScalableMatrixWithTieredPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: str """Used for the scalable matrix first dimension""" @@ -48,7 +49,6 @@ class ScalableMatrixWithTieredPricingConfig(BaseModel): """Apply a scaling factor to each dimension""" tiers: List[ScalableMatrixWithTieredPricingConfigTier] - """Tier pricing structure""" second_dimension: Optional[str] = None """Used for the scalable matrix second dimension (optional)""" @@ -123,6 +123,9 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py b/src/orb_sdk/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py index 37e6d75..afeb9a2 100644 --- a/src/orb_sdk/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb_sdk/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py @@ -21,17 +21,18 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str - """First dimension value""" scaling_factor: str - """Scaling factor""" second_dimension_value: Optional[str] = None - """Second dimension value (optional)""" class ScalableMatrixWithUnitPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: str """Used to determine the unit rate""" @@ -117,6 +118,9 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_threshold_total_amount_price.py b/src/orb_sdk/types/shared/new_floating_threshold_total_amount_price.py index 66ed6c6..be1c122 100644 --- a/src/orb_sdk/types/shared/new_floating_threshold_total_amount_price.py +++ b/src/orb_sdk/types/shared/new_floating_threshold_total_amount_price.py @@ -21,14 +21,17 @@ class ThresholdTotalAmountConfigConsumptionTable(BaseModel): + """Configuration for a single threshold""" + threshold: str - """Quantity threshold""" total_amount: str """Total amount for this threshold""" class ThresholdTotalAmountConfig(BaseModel): + """Configuration for threshold_total_amount pricing""" + consumption_table: List[ThresholdTotalAmountConfigConsumptionTable] """ When the quantity consumed passes a provided threshold, the configured total @@ -108,6 +111,9 @@ class NewFloatingThresholdTotalAmountPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_tiered_package_price.py b/src/orb_sdk/types/shared/new_floating_tiered_package_price.py index 1a216cc..4509b66 100644 --- a/src/orb_sdk/types/shared/new_floating_tiered_package_price.py +++ b/src/orb_sdk/types/shared/new_floating_tiered_package_price.py @@ -16,16 +16,18 @@ class TieredPackageConfigTier(BaseModel): + """Configuration for a single tier with business logic""" + per_unit: str """Price per package""" tier_lower_bound: str - """Tier lower bound""" class TieredPackageConfig(BaseModel): + """Configuration for tiered_package pricing""" + package_size: str - """Package size""" tiers: List[TieredPackageConfigTier] """Apply tiered pricing after rounding up the quantity to the package size. @@ -105,6 +107,9 @@ class NewFloatingTieredPackagePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_tiered_package_with_minimum_price.py b/src/orb_sdk/types/shared/new_floating_tiered_package_with_minimum_price.py index 0341231..6d753c3 100644 --- a/src/orb_sdk/types/shared/new_floating_tiered_package_with_minimum_price.py +++ b/src/orb_sdk/types/shared/new_floating_tiered_package_with_minimum_price.py @@ -21,19 +21,19 @@ class TieredPackageWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str - """Minimum amount""" per_unit: str - """Price per package""" tier_lower_bound: str - """Tier lower bound""" class TieredPackageWithMinimumConfig(BaseModel): + """Configuration for tiered_package_with_minimum pricing""" + package_size: float - """Package size""" tiers: List[TieredPackageWithMinimumConfigTier] """Apply tiered pricing after rounding up the quantity to the package size. @@ -111,6 +111,9 @@ class NewFloatingTieredPackageWithMinimumPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_tiered_price.py b/src/orb_sdk/types/shared/new_floating_tiered_price.py index 54b6d85..6fafe7f 100644 --- a/src/orb_sdk/types/shared/new_floating_tiered_price.py +++ b/src/orb_sdk/types/shared/new_floating_tiered_price.py @@ -84,6 +84,9 @@ class NewFloatingTieredPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_tiered_with_minimum_price.py b/src/orb_sdk/types/shared/new_floating_tiered_with_minimum_price.py index 5be0fdb..4f1b96f 100644 --- a/src/orb_sdk/types/shared/new_floating_tiered_with_minimum_price.py +++ b/src/orb_sdk/types/shared/new_floating_tiered_with_minimum_price.py @@ -21,17 +21,19 @@ class TieredWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str - """Minimum amount""" tier_lower_bound: str - """Tier lower bound""" unit_amount: str """Per unit amount""" class TieredWithMinimumConfig(BaseModel): + """Configuration for tiered_with_minimum pricing""" + tiers: List[TieredWithMinimumConfigTier] """Tiered pricing with a minimum amount dependent on the volume tier. @@ -114,6 +116,9 @@ class NewFloatingTieredWithMinimumPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_tiered_with_proration_price.py b/src/orb_sdk/types/shared/new_floating_tiered_with_proration_price.py index 7122a96..4b6caab 100644 --- a/src/orb_sdk/types/shared/new_floating_tiered_with_proration_price.py +++ b/src/orb_sdk/types/shared/new_floating_tiered_with_proration_price.py @@ -21,6 +21,8 @@ class TieredWithProrationConfigTier(BaseModel): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: str """Inclusive tier starting value""" @@ -29,6 +31,8 @@ class TieredWithProrationConfigTier(BaseModel): class TieredWithProrationConfig(BaseModel): + """Configuration for tiered_with_proration pricing""" + tiers: List[TieredWithProrationConfigTier] """ Tiers for rating based on total usage quantities into the specified tier with @@ -105,6 +109,9 @@ class NewFloatingTieredWithProrationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_unit_price.py b/src/orb_sdk/types/shared/new_floating_unit_price.py index cbba540..852121c 100644 --- a/src/orb_sdk/types/shared/new_floating_unit_price.py +++ b/src/orb_sdk/types/shared/new_floating_unit_price.py @@ -84,6 +84,9 @@ class NewFloatingUnitPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_unit_with_percent_price.py b/src/orb_sdk/types/shared/new_floating_unit_with_percent_price.py index 1d00c9c..4d91d40 100644 --- a/src/orb_sdk/types/shared/new_floating_unit_with_percent_price.py +++ b/src/orb_sdk/types/shared/new_floating_unit_with_percent_price.py @@ -16,6 +16,8 @@ class UnitWithPercentConfig(BaseModel): + """Configuration for unit_with_percent pricing""" + percent: str """What percent, out of 100, of the calculated total to charge""" @@ -92,6 +94,9 @@ class NewFloatingUnitWithPercentPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_floating_unit_with_proration_price.py b/src/orb_sdk/types/shared/new_floating_unit_with_proration_price.py index ced5474..2c6425a 100644 --- a/src/orb_sdk/types/shared/new_floating_unit_with_proration_price.py +++ b/src/orb_sdk/types/shared/new_floating_unit_with_proration_price.py @@ -16,6 +16,8 @@ class UnitWithProrationConfig(BaseModel): + """Configuration for unit_with_proration pricing""" + unit_amount: str """Rate per unit of usage""" @@ -89,6 +91,9 @@ class NewFloatingUnitWithProrationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_bulk_price.py b/src/orb_sdk/types/shared/new_plan_bulk_price.py index 8a3ffd7..06d31df 100644 --- a/src/orb_sdk/types/shared/new_plan_bulk_price.py +++ b/src/orb_sdk/types/shared/new_plan_bulk_price.py @@ -87,6 +87,9 @@ class NewPlanBulkPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_bulk_with_proration_price.py b/src/orb_sdk/types/shared/new_plan_bulk_with_proration_price.py index 67d53ef..0710cdf 100644 --- a/src/orb_sdk/types/shared/new_plan_bulk_with_proration_price.py +++ b/src/orb_sdk/types/shared/new_plan_bulk_with_proration_price.py @@ -21,6 +21,8 @@ class BulkWithProrationConfigTier(BaseModel): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: str """Cost per unit""" @@ -29,6 +31,8 @@ class BulkWithProrationConfigTier(BaseModel): class BulkWithProrationConfig(BaseModel): + """Configuration for bulk_with_proration pricing""" + tiers: List[BulkWithProrationConfigTier] """Bulk tiers for rating based on total usage volume""" @@ -105,6 +109,9 @@ class NewPlanBulkWithProrationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_cumulative_grouped_bulk_price.py b/src/orb_sdk/types/shared/new_plan_cumulative_grouped_bulk_price.py index 0a0903f..bdf7585 100644 --- a/src/orb_sdk/types/shared/new_plan_cumulative_grouped_bulk_price.py +++ b/src/orb_sdk/types/shared/new_plan_cumulative_grouped_bulk_price.py @@ -21,6 +21,8 @@ class CumulativeGroupedBulkConfigDimensionValue(BaseModel): + """Configuration for a dimension value entry""" + grouping_key: str """Grouping key value""" @@ -32,11 +34,12 @@ class CumulativeGroupedBulkConfigDimensionValue(BaseModel): class CumulativeGroupedBulkConfig(BaseModel): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: List[CumulativeGroupedBulkConfigDimensionValue] """Each tier lower bound must have the same group of values.""" group: str - """Grouping key name""" ConversionRateConfig: TypeAlias = Annotated[ @@ -111,6 +114,9 @@ class NewPlanCumulativeGroupedBulkPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_grouped_allocation_price.py b/src/orb_sdk/types/shared/new_plan_grouped_allocation_price.py index 9dab4cd..1ef99fa 100644 --- a/src/orb_sdk/types/shared/new_plan_grouped_allocation_price.py +++ b/src/orb_sdk/types/shared/new_plan_grouped_allocation_price.py @@ -16,6 +16,8 @@ class GroupedAllocationConfig(BaseModel): + """Configuration for grouped_allocation pricing""" + allocation: str """Usage allocation per group""" @@ -98,6 +100,9 @@ class NewPlanGroupedAllocationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_grouped_tiered_package_price.py b/src/orb_sdk/types/shared/new_plan_grouped_tiered_package_price.py index 73b62d2..81b6a8c 100644 --- a/src/orb_sdk/types/shared/new_plan_grouped_tiered_package_price.py +++ b/src/orb_sdk/types/shared/new_plan_grouped_tiered_package_price.py @@ -21,19 +21,21 @@ class GroupedTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + per_unit: str - """Price per package""" + """Per package""" tier_lower_bound: str - """Tier lower bound""" class GroupedTieredPackageConfig(BaseModel): + """Configuration for grouped_tiered_package pricing""" + grouping_key: str """The event property used to group before tiering""" package_size: str - """Package size""" tiers: List[GroupedTieredPackageConfigTier] """Apply tiered pricing after rounding up the quantity to the package size. @@ -114,6 +116,9 @@ class NewPlanGroupedTieredPackagePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_grouped_tiered_price.py b/src/orb_sdk/types/shared/new_plan_grouped_tiered_price.py index 43d4be8..769794f 100644 --- a/src/orb_sdk/types/shared/new_plan_grouped_tiered_price.py +++ b/src/orb_sdk/types/shared/new_plan_grouped_tiered_price.py @@ -16,14 +16,17 @@ class GroupedTieredConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str - """Tier lower bound""" unit_amount: str """Per unit amount""" class GroupedTieredConfig(BaseModel): + """Configuration for grouped_tiered pricing""" + grouping_key: str """The billable metric property used to group before tiering""" @@ -106,6 +109,9 @@ class NewPlanGroupedTieredPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_grouped_with_metered_minimum_price.py b/src/orb_sdk/types/shared/new_plan_grouped_with_metered_minimum_price.py index a668c08..e3a2472 100644 --- a/src/orb_sdk/types/shared/new_plan_grouped_with_metered_minimum_price.py +++ b/src/orb_sdk/types/shared/new_plan_grouped_with_metered_minimum_price.py @@ -22,22 +22,25 @@ class GroupedWithMeteredMinimumConfigScalingFactor(BaseModel): + """Configuration for a scaling factor""" + scaling_factor: str - """Scaling factor""" scaling_value: str - """Scaling value""" class GroupedWithMeteredMinimumConfigUnitAmount(BaseModel): + """Configuration for a unit amount""" + pricing_value: str - """Pricing value""" unit_amount: str """Per unit amount""" class GroupedWithMeteredMinimumConfig(BaseModel): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: str """Used to partition the usage into groups. @@ -135,6 +138,9 @@ class NewPlanGroupedWithMeteredMinimumPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_grouped_with_prorated_minimum_price.py b/src/orb_sdk/types/shared/new_plan_grouped_with_prorated_minimum_price.py index 8a24180..f8d62cf 100644 --- a/src/orb_sdk/types/shared/new_plan_grouped_with_prorated_minimum_price.py +++ b/src/orb_sdk/types/shared/new_plan_grouped_with_prorated_minimum_price.py @@ -16,6 +16,8 @@ class GroupedWithProratedMinimumConfig(BaseModel): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: str """How to determine the groups that should each have a minimum""" @@ -98,6 +100,9 @@ class NewPlanGroupedWithProratedMinimumPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_matrix_price.py b/src/orb_sdk/types/shared/new_plan_matrix_price.py index 5c7538e..c2df14b 100644 --- a/src/orb_sdk/types/shared/new_plan_matrix_price.py +++ b/src/orb_sdk/types/shared/new_plan_matrix_price.py @@ -87,6 +87,9 @@ class NewPlanMatrixPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_matrix_with_allocation_price.py b/src/orb_sdk/types/shared/new_plan_matrix_with_allocation_price.py index 07d73a1..be33b0c 100644 --- a/src/orb_sdk/types/shared/new_plan_matrix_with_allocation_price.py +++ b/src/orb_sdk/types/shared/new_plan_matrix_with_allocation_price.py @@ -87,6 +87,9 @@ class NewPlanMatrixWithAllocationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_matrix_with_display_name_price.py b/src/orb_sdk/types/shared/new_plan_matrix_with_display_name_price.py index 53c1649..639391b 100644 --- a/src/orb_sdk/types/shared/new_plan_matrix_with_display_name_price.py +++ b/src/orb_sdk/types/shared/new_plan_matrix_with_display_name_price.py @@ -21,6 +21,8 @@ class MatrixWithDisplayNameConfigUnitAmount(BaseModel): + """Configuration for a unit amount item""" + dimension_value: str """The dimension value""" @@ -32,6 +34,8 @@ class MatrixWithDisplayNameConfigUnitAmount(BaseModel): class MatrixWithDisplayNameConfig(BaseModel): + """Configuration for matrix_with_display_name pricing""" + dimension: str """Used to determine the unit rate""" @@ -111,6 +115,9 @@ class NewPlanMatrixWithDisplayNamePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_max_group_tiered_package_price.py b/src/orb_sdk/types/shared/new_plan_max_group_tiered_package_price.py index cf0ff3f..06124ce 100644 --- a/src/orb_sdk/types/shared/new_plan_max_group_tiered_package_price.py +++ b/src/orb_sdk/types/shared/new_plan_max_group_tiered_package_price.py @@ -21,21 +21,23 @@ class MaxGroupTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str - """Tier lower bound""" unit_amount: str """Per unit amount""" class MaxGroupTieredPackageConfig(BaseModel): + """Configuration for max_group_tiered_package pricing""" + grouping_key: str """ The event property used to group before tiering the group with the highest value """ package_size: str - """Package size""" tiers: List[MaxGroupTieredPackageConfigTier] """Apply tiered pricing to the largest group after grouping with the provided key.""" @@ -113,6 +115,9 @@ class NewPlanMaxGroupTieredPackagePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_minimum_composite_price.py b/src/orb_sdk/types/shared/new_plan_minimum_composite_price.py index 7888c81..e573086 100644 --- a/src/orb_sdk/types/shared/new_plan_minimum_composite_price.py +++ b/src/orb_sdk/types/shared/new_plan_minimum_composite_price.py @@ -12,10 +12,12 @@ from .new_billing_cycle_configuration import NewBillingCycleConfiguration from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewPlanMinimumCompositePrice", "MinimumConfig", "ConversionRateConfig"] +__all__ = ["NewPlanMinimumCompositePrice", "MinimumCompositeConfig", "ConversionRateConfig"] -class MinimumConfig(BaseModel): +class MinimumCompositeConfig(BaseModel): + """Configuration for minimum_composite pricing""" + minimum_amount: str """The minimum amount to apply""" @@ -35,10 +37,10 @@ class NewPlanMinimumCompositePrice(BaseModel): item_id: str """The id of the item the price will be associated with.""" - minimum_config: MinimumConfig - """Configuration for minimum pricing""" + minimum_composite_config: MinimumCompositeConfig + """Configuration for minimum_composite pricing""" - price_model_type: Literal["minimum"] = FieldInfo(alias="model_type") + price_model_type: Literal["minimum_composite"] = FieldInfo(alias="model_type") """The pricing model type""" name: str @@ -95,6 +97,9 @@ class NewPlanMinimumCompositePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_package_price.py b/src/orb_sdk/types/shared/new_plan_package_price.py index a14a5c9..b597ef6 100644 --- a/src/orb_sdk/types/shared/new_plan_package_price.py +++ b/src/orb_sdk/types/shared/new_plan_package_price.py @@ -87,6 +87,9 @@ class NewPlanPackagePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_package_with_allocation_price.py b/src/orb_sdk/types/shared/new_plan_package_with_allocation_price.py index 86fa147..c323d9d 100644 --- a/src/orb_sdk/types/shared/new_plan_package_with_allocation_price.py +++ b/src/orb_sdk/types/shared/new_plan_package_with_allocation_price.py @@ -16,14 +16,13 @@ class PackageWithAllocationConfig(BaseModel): + """Configuration for package_with_allocation pricing""" + allocation: str - """Usage allocation""" package_amount: str - """Price per package""" package_size: str - """Package size""" ConversionRateConfig: TypeAlias = Annotated[ @@ -98,6 +97,9 @@ class NewPlanPackageWithAllocationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py b/src/orb_sdk/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py index 69b0a53..a530a99 100644 --- a/src/orb_sdk/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb_sdk/types/shared/new_plan_scalable_matrix_with_tiered_pricing_price.py @@ -22,25 +22,26 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str - """First dimension value""" scaling_factor: str - """Scaling factor""" second_dimension_value: Optional[str] = None - """Second dimension value (optional)""" class ScalableMatrixWithTieredPricingConfigTier(BaseModel): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: str - """Tier lower bound""" unit_amount: str - """Per unit amount""" class ScalableMatrixWithTieredPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: str """Used for the scalable matrix first dimension""" @@ -48,7 +49,6 @@ class ScalableMatrixWithTieredPricingConfig(BaseModel): """Apply a scaling factor to each dimension""" tiers: List[ScalableMatrixWithTieredPricingConfigTier] - """Tier pricing structure""" second_dimension: Optional[str] = None """Used for the scalable matrix second dimension (optional)""" @@ -126,6 +126,9 @@ class NewPlanScalableMatrixWithTieredPricingPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py b/src/orb_sdk/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py index 91608c5..9927a55 100644 --- a/src/orb_sdk/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb_sdk/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py @@ -21,17 +21,18 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str - """First dimension value""" scaling_factor: str - """Scaling factor""" second_dimension_value: Optional[str] = None - """Second dimension value (optional)""" class ScalableMatrixWithUnitPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: str """Used to determine the unit rate""" @@ -120,6 +121,9 @@ class NewPlanScalableMatrixWithUnitPricingPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_threshold_total_amount_price.py b/src/orb_sdk/types/shared/new_plan_threshold_total_amount_price.py index d66b222..735438f 100644 --- a/src/orb_sdk/types/shared/new_plan_threshold_total_amount_price.py +++ b/src/orb_sdk/types/shared/new_plan_threshold_total_amount_price.py @@ -21,14 +21,17 @@ class ThresholdTotalAmountConfigConsumptionTable(BaseModel): + """Configuration for a single threshold""" + threshold: str - """Quantity threshold""" total_amount: str """Total amount for this threshold""" class ThresholdTotalAmountConfig(BaseModel): + """Configuration for threshold_total_amount pricing""" + consumption_table: List[ThresholdTotalAmountConfigConsumptionTable] """ When the quantity consumed passes a provided threshold, the configured total @@ -111,6 +114,9 @@ class NewPlanThresholdTotalAmountPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_tiered_package_price.py b/src/orb_sdk/types/shared/new_plan_tiered_package_price.py index 4bfebae..7acbb48 100644 --- a/src/orb_sdk/types/shared/new_plan_tiered_package_price.py +++ b/src/orb_sdk/types/shared/new_plan_tiered_package_price.py @@ -16,16 +16,18 @@ class TieredPackageConfigTier(BaseModel): + """Configuration for a single tier with business logic""" + per_unit: str """Price per package""" tier_lower_bound: str - """Tier lower bound""" class TieredPackageConfig(BaseModel): + """Configuration for tiered_package pricing""" + package_size: str - """Package size""" tiers: List[TieredPackageConfigTier] """Apply tiered pricing after rounding up the quantity to the package size. @@ -108,6 +110,9 @@ class NewPlanTieredPackagePrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_tiered_package_with_minimum_price.py b/src/orb_sdk/types/shared/new_plan_tiered_package_with_minimum_price.py index 1f06310..eadcb1b 100644 --- a/src/orb_sdk/types/shared/new_plan_tiered_package_with_minimum_price.py +++ b/src/orb_sdk/types/shared/new_plan_tiered_package_with_minimum_price.py @@ -21,19 +21,19 @@ class TieredPackageWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str - """Minimum amount""" per_unit: str - """Price per package""" tier_lower_bound: str - """Tier lower bound""" class TieredPackageWithMinimumConfig(BaseModel): + """Configuration for tiered_package_with_minimum pricing""" + package_size: float - """Package size""" tiers: List[TieredPackageWithMinimumConfigTier] """Apply tiered pricing after rounding up the quantity to the package size. @@ -114,6 +114,9 @@ class NewPlanTieredPackageWithMinimumPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_tiered_price.py b/src/orb_sdk/types/shared/new_plan_tiered_price.py index 0923106..432552a 100644 --- a/src/orb_sdk/types/shared/new_plan_tiered_price.py +++ b/src/orb_sdk/types/shared/new_plan_tiered_price.py @@ -87,6 +87,9 @@ class NewPlanTieredPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_tiered_with_minimum_price.py b/src/orb_sdk/types/shared/new_plan_tiered_with_minimum_price.py index 36bafb4..85db8e1 100644 --- a/src/orb_sdk/types/shared/new_plan_tiered_with_minimum_price.py +++ b/src/orb_sdk/types/shared/new_plan_tiered_with_minimum_price.py @@ -21,17 +21,19 @@ class TieredWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str - """Minimum amount""" tier_lower_bound: str - """Tier lower bound""" unit_amount: str """Per unit amount""" class TieredWithMinimumConfig(BaseModel): + """Configuration for tiered_with_minimum pricing""" + tiers: List[TieredWithMinimumConfigTier] """Tiered pricing with a minimum amount dependent on the volume tier. @@ -117,6 +119,9 @@ class NewPlanTieredWithMinimumPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_unit_price.py b/src/orb_sdk/types/shared/new_plan_unit_price.py index 32f8d78..6eb148d 100644 --- a/src/orb_sdk/types/shared/new_plan_unit_price.py +++ b/src/orb_sdk/types/shared/new_plan_unit_price.py @@ -87,6 +87,9 @@ class NewPlanUnitPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_unit_with_percent_price.py b/src/orb_sdk/types/shared/new_plan_unit_with_percent_price.py index b7f2fcb..6e58e90 100644 --- a/src/orb_sdk/types/shared/new_plan_unit_with_percent_price.py +++ b/src/orb_sdk/types/shared/new_plan_unit_with_percent_price.py @@ -16,6 +16,8 @@ class UnitWithPercentConfig(BaseModel): + """Configuration for unit_with_percent pricing""" + percent: str """What percent, out of 100, of the calculated total to charge""" @@ -95,6 +97,9 @@ class NewPlanUnitWithPercentPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/new_plan_unit_with_proration_price.py b/src/orb_sdk/types/shared/new_plan_unit_with_proration_price.py index dadd791..9afdc03 100644 --- a/src/orb_sdk/types/shared/new_plan_unit_with_proration_price.py +++ b/src/orb_sdk/types/shared/new_plan_unit_with_proration_price.py @@ -16,6 +16,8 @@ class UnitWithProrationConfig(BaseModel): + """Configuration for unit_with_proration pricing""" + unit_amount: str """Rate per unit of usage""" @@ -92,6 +94,9 @@ class NewPlanUnitWithProrationPrice(BaseModel): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] = None + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] = None """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared/package_config.py b/src/orb_sdk/types/shared/package_config.py index 1ae628b..fc4f100 100644 --- a/src/orb_sdk/types/shared/package_config.py +++ b/src/orb_sdk/types/shared/package_config.py @@ -6,6 +6,8 @@ class PackageConfig(BaseModel): + """Configuration for package pricing""" + package_amount: str """A currency amount to rate usage by""" diff --git a/src/orb_sdk/types/shared/price.py b/src/orb_sdk/types/shared/price.py index e6dcb4f..68a9a5a 100644 --- a/src/orb_sdk/types/shared/price.py +++ b/src/orb_sdk/types/shared/price.py @@ -30,139 +30,170 @@ "UnitPrice", "UnitPriceCompositePriceFilter", "UnitPriceConversionRateConfig", + "UnitPriceLicenseType", "TieredPrice", "TieredPriceCompositePriceFilter", "TieredPriceConversionRateConfig", + "TieredPriceLicenseType", "BulkPrice", "BulkPriceCompositePriceFilter", "BulkPriceConversionRateConfig", + "BulkPriceLicenseType", "BulkWithFiltersPrice", "BulkWithFiltersPriceBulkWithFiltersConfig", "BulkWithFiltersPriceBulkWithFiltersConfigFilter", "BulkWithFiltersPriceBulkWithFiltersConfigTier", "BulkWithFiltersPriceCompositePriceFilter", "BulkWithFiltersPriceConversionRateConfig", + "BulkWithFiltersPriceLicenseType", "PackagePrice", "PackagePriceCompositePriceFilter", "PackagePriceConversionRateConfig", + "PackagePriceLicenseType", "MatrixPrice", "MatrixPriceCompositePriceFilter", "MatrixPriceConversionRateConfig", + "MatrixPriceLicenseType", "ThresholdTotalAmountPrice", "ThresholdTotalAmountPriceCompositePriceFilter", "ThresholdTotalAmountPriceConversionRateConfig", "ThresholdTotalAmountPriceThresholdTotalAmountConfig", "ThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable", + "ThresholdTotalAmountPriceLicenseType", "TieredPackagePrice", "TieredPackagePriceCompositePriceFilter", "TieredPackagePriceConversionRateConfig", "TieredPackagePriceTieredPackageConfig", "TieredPackagePriceTieredPackageConfigTier", + "TieredPackagePriceLicenseType", "TieredWithMinimumPrice", "TieredWithMinimumPriceCompositePriceFilter", "TieredWithMinimumPriceConversionRateConfig", "TieredWithMinimumPriceTieredWithMinimumConfig", "TieredWithMinimumPriceTieredWithMinimumConfigTier", + "TieredWithMinimumPriceLicenseType", "GroupedTieredPrice", "GroupedTieredPriceCompositePriceFilter", "GroupedTieredPriceConversionRateConfig", "GroupedTieredPriceGroupedTieredConfig", "GroupedTieredPriceGroupedTieredConfigTier", + "GroupedTieredPriceLicenseType", "TieredPackageWithMinimumPrice", "TieredPackageWithMinimumPriceCompositePriceFilter", "TieredPackageWithMinimumPriceConversionRateConfig", "TieredPackageWithMinimumPriceTieredPackageWithMinimumConfig", "TieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier", + "TieredPackageWithMinimumPriceLicenseType", "PackageWithAllocationPrice", "PackageWithAllocationPriceCompositePriceFilter", "PackageWithAllocationPriceConversionRateConfig", "PackageWithAllocationPricePackageWithAllocationConfig", + "PackageWithAllocationPriceLicenseType", "UnitWithPercentPrice", "UnitWithPercentPriceCompositePriceFilter", "UnitWithPercentPriceConversionRateConfig", "UnitWithPercentPriceUnitWithPercentConfig", + "UnitWithPercentPriceLicenseType", "MatrixWithAllocationPrice", "MatrixWithAllocationPriceCompositePriceFilter", "MatrixWithAllocationPriceConversionRateConfig", + "MatrixWithAllocationPriceLicenseType", "TieredWithProrationPrice", "TieredWithProrationPriceCompositePriceFilter", "TieredWithProrationPriceConversionRateConfig", "TieredWithProrationPriceTieredWithProrationConfig", "TieredWithProrationPriceTieredWithProrationConfigTier", + "TieredWithProrationPriceLicenseType", "UnitWithProrationPrice", "UnitWithProrationPriceCompositePriceFilter", "UnitWithProrationPriceConversionRateConfig", "UnitWithProrationPriceUnitWithProrationConfig", + "UnitWithProrationPriceLicenseType", "GroupedAllocationPrice", "GroupedAllocationPriceCompositePriceFilter", "GroupedAllocationPriceConversionRateConfig", "GroupedAllocationPriceGroupedAllocationConfig", + "GroupedAllocationPriceLicenseType", "BulkWithProrationPrice", "BulkWithProrationPriceBulkWithProrationConfig", "BulkWithProrationPriceBulkWithProrationConfigTier", "BulkWithProrationPriceCompositePriceFilter", "BulkWithProrationPriceConversionRateConfig", + "BulkWithProrationPriceLicenseType", "GroupedWithProratedMinimumPrice", "GroupedWithProratedMinimumPriceCompositePriceFilter", "GroupedWithProratedMinimumPriceConversionRateConfig", "GroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig", + "GroupedWithProratedMinimumPriceLicenseType", "GroupedWithMeteredMinimumPrice", "GroupedWithMeteredMinimumPriceCompositePriceFilter", "GroupedWithMeteredMinimumPriceConversionRateConfig", "GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig", "GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor", "GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount", + "GroupedWithMeteredMinimumPriceLicenseType", "GroupedWithMinMaxThresholdsPrice", "GroupedWithMinMaxThresholdsPriceCompositePriceFilter", "GroupedWithMinMaxThresholdsPriceConversionRateConfig", "GroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", + "GroupedWithMinMaxThresholdsPriceLicenseType", "MatrixWithDisplayNamePrice", "MatrixWithDisplayNamePriceCompositePriceFilter", "MatrixWithDisplayNamePriceConversionRateConfig", "MatrixWithDisplayNamePriceMatrixWithDisplayNameConfig", "MatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount", + "MatrixWithDisplayNamePriceLicenseType", "GroupedTieredPackagePrice", "GroupedTieredPackagePriceCompositePriceFilter", "GroupedTieredPackagePriceConversionRateConfig", "GroupedTieredPackagePriceGroupedTieredPackageConfig", "GroupedTieredPackagePriceGroupedTieredPackageConfigTier", + "GroupedTieredPackagePriceLicenseType", "MaxGroupTieredPackagePrice", "MaxGroupTieredPackagePriceCompositePriceFilter", "MaxGroupTieredPackagePriceConversionRateConfig", "MaxGroupTieredPackagePriceMaxGroupTieredPackageConfig", "MaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier", + "MaxGroupTieredPackagePriceLicenseType", "ScalableMatrixWithUnitPricingPrice", "ScalableMatrixWithUnitPricingPriceCompositePriceFilter", "ScalableMatrixWithUnitPricingPriceConversionRateConfig", "ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig", "ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor", + "ScalableMatrixWithUnitPricingPriceLicenseType", "ScalableMatrixWithTieredPricingPrice", "ScalableMatrixWithTieredPricingPriceCompositePriceFilter", "ScalableMatrixWithTieredPricingPriceConversionRateConfig", "ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig", "ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor", "ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier", + "ScalableMatrixWithTieredPricingPriceLicenseType", "CumulativeGroupedBulkPrice", "CumulativeGroupedBulkPriceCompositePriceFilter", "CumulativeGroupedBulkPriceConversionRateConfig", "CumulativeGroupedBulkPriceCumulativeGroupedBulkConfig", "CumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue", + "CumulativeGroupedBulkPriceLicenseType", "CumulativeGroupedAllocationPrice", "CumulativeGroupedAllocationPriceCompositePriceFilter", "CumulativeGroupedAllocationPriceConversionRateConfig", "CumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig", + "CumulativeGroupedAllocationPriceLicenseType", "MinimumCompositePrice", "MinimumCompositePriceCompositePriceFilter", "MinimumCompositePriceConversionRateConfig", - "MinimumCompositePriceMinimumConfig", + "MinimumCompositePriceMinimumCompositeConfig", + "MinimumCompositePriceLicenseType", "PercentCompositePrice", "PercentCompositePriceCompositePriceFilter", "PercentCompositePriceConversionRateConfig", "PercentCompositePricePercentConfig", + "PercentCompositePriceLicenseType", "EventOutputPrice", "EventOutputPriceCompositePriceFilter", "EventOutputPriceConversionRateConfig", "EventOutputPriceEventOutputConfig", + "EventOutputPriceLicenseType", ] @@ -182,6 +213,25 @@ class UnitPriceCompositePriceFilter(BaseModel): ] +class UnitPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class UnitPrice(BaseModel): id: str @@ -255,6 +305,13 @@ class UnitPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[UnitPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class TieredPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -272,6 +329,25 @@ class TieredPriceCompositePriceFilter(BaseModel): ] +class TieredPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class TieredPrice(BaseModel): id: str @@ -345,6 +421,13 @@ class TieredPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[TieredPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class BulkPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -362,6 +445,25 @@ class BulkPriceCompositePriceFilter(BaseModel): ] +class BulkPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class BulkPrice(BaseModel): id: str @@ -435,8 +537,17 @@ class BulkPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[BulkPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class BulkWithFiltersPriceBulkWithFiltersConfigFilter(BaseModel): + """Configuration for a single property filter""" + property_key: str """Event property key to filter on""" @@ -445,6 +556,8 @@ class BulkWithFiltersPriceBulkWithFiltersConfigFilter(BaseModel): class BulkWithFiltersPriceBulkWithFiltersConfigTier(BaseModel): + """Configuration for a single bulk pricing tier""" + unit_amount: str """Amount per unit""" @@ -453,6 +566,8 @@ class BulkWithFiltersPriceBulkWithFiltersConfigTier(BaseModel): class BulkWithFiltersPriceBulkWithFiltersConfig(BaseModel): + """Configuration for bulk_with_filters pricing""" + filters: List[BulkWithFiltersPriceBulkWithFiltersConfigFilter] """Property filters to apply (all must match)""" @@ -476,6 +591,25 @@ class BulkWithFiltersPriceCompositePriceFilter(BaseModel): ] +class BulkWithFiltersPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class BulkWithFiltersPrice(BaseModel): id: str @@ -549,6 +683,13 @@ class BulkWithFiltersPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[BulkWithFiltersPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class PackagePriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -566,6 +707,25 @@ class PackagePriceCompositePriceFilter(BaseModel): ] +class PackagePriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class PackagePrice(BaseModel): id: str @@ -639,6 +799,13 @@ class PackagePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[PackagePriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class MatrixPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -656,6 +823,25 @@ class MatrixPriceCompositePriceFilter(BaseModel): ] +class MatrixPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class MatrixPrice(BaseModel): id: str @@ -729,6 +915,13 @@ class MatrixPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[MatrixPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class ThresholdTotalAmountPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -747,14 +940,17 @@ class ThresholdTotalAmountPriceCompositePriceFilter(BaseModel): class ThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable(BaseModel): + """Configuration for a single threshold""" + threshold: str - """Quantity threshold""" total_amount: str """Total amount for this threshold""" class ThresholdTotalAmountPriceThresholdTotalAmountConfig(BaseModel): + """Configuration for threshold_total_amount pricing""" + consumption_table: List[ThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable] """ When the quantity consumed passes a provided threshold, the configured total @@ -765,6 +961,25 @@ class ThresholdTotalAmountPriceThresholdTotalAmountConfig(BaseModel): """If true, the unit price will be prorated to the billing period""" +class ThresholdTotalAmountPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class ThresholdTotalAmountPrice(BaseModel): id: str @@ -838,6 +1053,13 @@ class ThresholdTotalAmountPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[ThresholdTotalAmountPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class TieredPackagePriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -856,16 +1078,18 @@ class TieredPackagePriceCompositePriceFilter(BaseModel): class TieredPackagePriceTieredPackageConfigTier(BaseModel): + """Configuration for a single tier with business logic""" + per_unit: str """Price per package""" tier_lower_bound: str - """Tier lower bound""" class TieredPackagePriceTieredPackageConfig(BaseModel): + """Configuration for tiered_package pricing""" + package_size: str - """Package size""" tiers: List[TieredPackagePriceTieredPackageConfigTier] """Apply tiered pricing after rounding up the quantity to the package size. @@ -876,6 +1100,25 @@ class TieredPackagePriceTieredPackageConfig(BaseModel): """ +class TieredPackagePriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class TieredPackagePrice(BaseModel): id: str @@ -949,6 +1192,13 @@ class TieredPackagePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[TieredPackagePriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class TieredWithMinimumPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -967,17 +1217,19 @@ class TieredWithMinimumPriceCompositePriceFilter(BaseModel): class TieredWithMinimumPriceTieredWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str - """Minimum amount""" tier_lower_bound: str - """Tier lower bound""" unit_amount: str """Per unit amount""" class TieredWithMinimumPriceTieredWithMinimumConfig(BaseModel): + """Configuration for tiered_with_minimum pricing""" + tiers: List[TieredWithMinimumPriceTieredWithMinimumConfigTier] """Tiered pricing with a minimum amount dependent on the volume tier. @@ -991,6 +1243,25 @@ class TieredWithMinimumPriceTieredWithMinimumConfig(BaseModel): """If true, the unit price will be prorated to the billing period""" +class TieredWithMinimumPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class TieredWithMinimumPrice(BaseModel): id: str @@ -1064,6 +1335,13 @@ class TieredWithMinimumPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[TieredWithMinimumPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class GroupedTieredPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -1082,14 +1360,17 @@ class GroupedTieredPriceCompositePriceFilter(BaseModel): class GroupedTieredPriceGroupedTieredConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str - """Tier lower bound""" unit_amount: str """Per unit amount""" class GroupedTieredPriceGroupedTieredConfig(BaseModel): + """Configuration for grouped_tiered pricing""" + grouping_key: str """The billable metric property used to group before tiering""" @@ -1100,6 +1381,25 @@ class GroupedTieredPriceGroupedTieredConfig(BaseModel): """ +class GroupedTieredPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class GroupedTieredPrice(BaseModel): id: str @@ -1173,6 +1473,13 @@ class GroupedTieredPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[GroupedTieredPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class TieredPackageWithMinimumPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -1191,19 +1498,19 @@ class TieredPackageWithMinimumPriceCompositePriceFilter(BaseModel): class TieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier(BaseModel): + """Configuration for a single tier""" + minimum_amount: str - """Minimum amount""" per_unit: str - """Price per package""" tier_lower_bound: str - """Tier lower bound""" class TieredPackageWithMinimumPriceTieredPackageWithMinimumConfig(BaseModel): + """Configuration for tiered_package_with_minimum pricing""" + package_size: float - """Package size""" tiers: List[TieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier] """Apply tiered pricing after rounding up the quantity to the package size. @@ -1212,6 +1519,25 @@ class TieredPackageWithMinimumPriceTieredPackageWithMinimumConfig(BaseModel): """ +class TieredPackageWithMinimumPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class TieredPackageWithMinimumPrice(BaseModel): id: str @@ -1285,6 +1611,13 @@ class TieredPackageWithMinimumPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[TieredPackageWithMinimumPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class PackageWithAllocationPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -1303,14 +1636,32 @@ class PackageWithAllocationPriceCompositePriceFilter(BaseModel): class PackageWithAllocationPricePackageWithAllocationConfig(BaseModel): + """Configuration for package_with_allocation pricing""" + allocation: str - """Usage allocation""" package_amount: str - """Price per package""" package_size: str - """Package size""" + + +class PackageWithAllocationPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" class PackageWithAllocationPrice(BaseModel): @@ -1386,6 +1737,13 @@ class PackageWithAllocationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[PackageWithAllocationPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class UnitWithPercentPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -1404,6 +1762,8 @@ class UnitWithPercentPriceCompositePriceFilter(BaseModel): class UnitWithPercentPriceUnitWithPercentConfig(BaseModel): + """Configuration for unit_with_percent pricing""" + percent: str """What percent, out of 100, of the calculated total to charge""" @@ -1411,6 +1771,25 @@ class UnitWithPercentPriceUnitWithPercentConfig(BaseModel): """Rate per unit of usage""" +class UnitWithPercentPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class UnitWithPercentPrice(BaseModel): id: str @@ -1484,6 +1863,13 @@ class UnitWithPercentPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[UnitWithPercentPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class MatrixWithAllocationPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -1501,6 +1887,25 @@ class MatrixWithAllocationPriceCompositePriceFilter(BaseModel): ] +class MatrixWithAllocationPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class MatrixWithAllocationPrice(BaseModel): id: str @@ -1574,6 +1979,13 @@ class MatrixWithAllocationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[MatrixWithAllocationPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class TieredWithProrationPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -1592,6 +2004,8 @@ class TieredWithProrationPriceCompositePriceFilter(BaseModel): class TieredWithProrationPriceTieredWithProrationConfigTier(BaseModel): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: str """Inclusive tier starting value""" @@ -1600,6 +2014,8 @@ class TieredWithProrationPriceTieredWithProrationConfigTier(BaseModel): class TieredWithProrationPriceTieredWithProrationConfig(BaseModel): + """Configuration for tiered_with_proration pricing""" + tiers: List[TieredWithProrationPriceTieredWithProrationConfigTier] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1607,6 +2023,25 @@ class TieredWithProrationPriceTieredWithProrationConfig(BaseModel): """ +class TieredWithProrationPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class TieredWithProrationPrice(BaseModel): id: str @@ -1680,6 +2115,13 @@ class TieredWithProrationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[TieredWithProrationPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class UnitWithProrationPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -1698,10 +2140,31 @@ class UnitWithProrationPriceCompositePriceFilter(BaseModel): class UnitWithProrationPriceUnitWithProrationConfig(BaseModel): + """Configuration for unit_with_proration pricing""" + unit_amount: str """Rate per unit of usage""" +class UnitWithProrationPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class UnitWithProrationPrice(BaseModel): id: str @@ -1775,6 +2238,13 @@ class UnitWithProrationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[UnitWithProrationPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class GroupedAllocationPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -1793,6 +2263,8 @@ class GroupedAllocationPriceCompositePriceFilter(BaseModel): class GroupedAllocationPriceGroupedAllocationConfig(BaseModel): + """Configuration for grouped_allocation pricing""" + allocation: str """Usage allocation per group""" @@ -1803,6 +2275,25 @@ class GroupedAllocationPriceGroupedAllocationConfig(BaseModel): """Unit rate for post-allocation""" +class GroupedAllocationPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class GroupedAllocationPrice(BaseModel): id: str @@ -1876,8 +2367,17 @@ class GroupedAllocationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[GroupedAllocationPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class BulkWithProrationPriceBulkWithProrationConfigTier(BaseModel): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: str """Cost per unit""" @@ -1886,6 +2386,8 @@ class BulkWithProrationPriceBulkWithProrationConfigTier(BaseModel): class BulkWithProrationPriceBulkWithProrationConfig(BaseModel): + """Configuration for bulk_with_proration pricing""" + tiers: List[BulkWithProrationPriceBulkWithProrationConfigTier] """Bulk tiers for rating based on total usage volume""" @@ -1906,6 +2408,25 @@ class BulkWithProrationPriceCompositePriceFilter(BaseModel): ] +class BulkWithProrationPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class BulkWithProrationPrice(BaseModel): id: str @@ -1979,6 +2500,13 @@ class BulkWithProrationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[BulkWithProrationPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class GroupedWithProratedMinimumPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -1997,6 +2525,8 @@ class GroupedWithProratedMinimumPriceCompositePriceFilter(BaseModel): class GroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig(BaseModel): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: str """How to determine the groups that should each have a minimum""" @@ -2007,6 +2537,25 @@ class GroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig(BaseModel) """The amount to charge per unit""" +class GroupedWithProratedMinimumPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class GroupedWithProratedMinimumPrice(BaseModel): id: str @@ -2080,6 +2629,13 @@ class GroupedWithProratedMinimumPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[GroupedWithProratedMinimumPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class GroupedWithMeteredMinimumPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -2098,22 +2654,25 @@ class GroupedWithMeteredMinimumPriceCompositePriceFilter(BaseModel): class GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor(BaseModel): + """Configuration for a scaling factor""" + scaling_factor: str - """Scaling factor""" scaling_value: str - """Scaling value""" class GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount(BaseModel): + """Configuration for a unit amount""" + pricing_value: str - """Pricing value""" unit_amount: str """Per unit amount""" class GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig(BaseModel): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: str """Used to partition the usage into groups. @@ -2139,6 +2698,25 @@ class GroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig(BaseModel): """ +class GroupedWithMeteredMinimumPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class GroupedWithMeteredMinimumPrice(BaseModel): id: str @@ -2212,6 +2790,13 @@ class GroupedWithMeteredMinimumPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[GroupedWithMeteredMinimumPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class GroupedWithMinMaxThresholdsPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -2230,6 +2815,8 @@ class GroupedWithMinMaxThresholdsPriceCompositePriceFilter(BaseModel): class GroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(BaseModel): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: str """The event property used to group before applying thresholds""" @@ -2243,6 +2830,25 @@ class GroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(BaseMode """The base price charged per group""" +class GroupedWithMinMaxThresholdsPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class GroupedWithMinMaxThresholdsPrice(BaseModel): id: str @@ -2316,6 +2922,13 @@ class GroupedWithMinMaxThresholdsPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[GroupedWithMinMaxThresholdsPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class MatrixWithDisplayNamePriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -2334,6 +2947,8 @@ class MatrixWithDisplayNamePriceCompositePriceFilter(BaseModel): class MatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount(BaseModel): + """Configuration for a unit amount item""" + dimension_value: str """The dimension value""" @@ -2345,6 +2960,8 @@ class MatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount(BaseModel) class MatrixWithDisplayNamePriceMatrixWithDisplayNameConfig(BaseModel): + """Configuration for matrix_with_display_name pricing""" + dimension: str """Used to determine the unit rate""" @@ -2352,6 +2969,25 @@ class MatrixWithDisplayNamePriceMatrixWithDisplayNameConfig(BaseModel): """Apply per unit pricing to each dimension value""" +class MatrixWithDisplayNamePriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class MatrixWithDisplayNamePrice(BaseModel): id: str @@ -2425,6 +3061,13 @@ class MatrixWithDisplayNamePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[MatrixWithDisplayNamePriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class GroupedTieredPackagePriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -2443,19 +3086,21 @@ class GroupedTieredPackagePriceCompositePriceFilter(BaseModel): class GroupedTieredPackagePriceGroupedTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + per_unit: str - """Price per package""" + """Per package""" tier_lower_bound: str - """Tier lower bound""" class GroupedTieredPackagePriceGroupedTieredPackageConfig(BaseModel): + """Configuration for grouped_tiered_package pricing""" + grouping_key: str """The event property used to group before tiering""" package_size: str - """Package size""" tiers: List[GroupedTieredPackagePriceGroupedTieredPackageConfigTier] """Apply tiered pricing after rounding up the quantity to the package size. @@ -2464,6 +3109,25 @@ class GroupedTieredPackagePriceGroupedTieredPackageConfig(BaseModel): """ +class GroupedTieredPackagePriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class GroupedTieredPackagePrice(BaseModel): id: str @@ -2537,6 +3201,13 @@ class GroupedTieredPackagePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[GroupedTieredPackagePriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class MaxGroupTieredPackagePriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -2555,26 +3226,47 @@ class MaxGroupTieredPackagePriceCompositePriceFilter(BaseModel): class MaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier(BaseModel): + """Configuration for a single tier""" + tier_lower_bound: str - """Tier lower bound""" unit_amount: str """Per unit amount""" class MaxGroupTieredPackagePriceMaxGroupTieredPackageConfig(BaseModel): + """Configuration for max_group_tiered_package pricing""" + grouping_key: str """ The event property used to group before tiering the group with the highest value """ package_size: str - """Package size""" tiers: List[MaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier] """Apply tiered pricing to the largest group after grouping with the provided key.""" +class MaxGroupTieredPackagePriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class MaxGroupTieredPackagePrice(BaseModel): id: str @@ -2648,6 +3340,13 @@ class MaxGroupTieredPackagePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[MaxGroupTieredPackagePriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class ScalableMatrixWithUnitPricingPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -2666,17 +3365,18 @@ class ScalableMatrixWithUnitPricingPriceCompositePriceFilter(BaseModel): class ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str - """First dimension value""" scaling_factor: str - """Scaling factor""" second_dimension_value: Optional[str] = None - """Second dimension value (optional)""" class ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: str """Used to determine the unit rate""" @@ -2695,6 +3395,25 @@ class ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig(Base """Used to determine the unit rate (optional)""" +class ScalableMatrixWithUnitPricingPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class ScalableMatrixWithUnitPricingPrice(BaseModel): id: str @@ -2768,6 +3487,13 @@ class ScalableMatrixWithUnitPricingPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[ScalableMatrixWithUnitPricingPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class ScalableMatrixWithTieredPricingPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -2786,25 +3512,26 @@ class ScalableMatrixWithTieredPricingPriceCompositePriceFilter(BaseModel): class ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor(BaseModel): + """Configuration for a single matrix scaling factor""" + first_dimension_value: str - """First dimension value""" scaling_factor: str - """Scaling factor""" second_dimension_value: Optional[str] = None - """Second dimension value (optional)""" class ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier(BaseModel): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: str - """Tier lower bound""" unit_amount: str - """Per unit amount""" class ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig(BaseModel): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: str """Used for the scalable matrix first dimension""" @@ -2814,12 +3541,30 @@ class ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig( """Apply a scaling factor to each dimension""" tiers: List[ScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier] - """Tier pricing structure""" second_dimension: Optional[str] = None """Used for the scalable matrix second dimension (optional)""" +class ScalableMatrixWithTieredPricingPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class ScalableMatrixWithTieredPricingPrice(BaseModel): id: str @@ -2895,6 +3640,13 @@ class ScalableMatrixWithTieredPricingPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[ScalableMatrixWithTieredPricingPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class CumulativeGroupedBulkPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -2913,6 +3665,8 @@ class CumulativeGroupedBulkPriceCompositePriceFilter(BaseModel): class CumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue(BaseModel): + """Configuration for a dimension value entry""" + grouping_key: str """Grouping key value""" @@ -2924,11 +3678,31 @@ class CumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue(BaseMo class CumulativeGroupedBulkPriceCumulativeGroupedBulkConfig(BaseModel): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: List[CumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue] """Each tier lower bound must have the same group of values.""" group: str - """Grouping key name""" + + +class CumulativeGroupedBulkPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" class CumulativeGroupedBulkPrice(BaseModel): @@ -3004,6 +3778,13 @@ class CumulativeGroupedBulkPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[CumulativeGroupedBulkPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class CumulativeGroupedAllocationPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -3022,6 +3803,8 @@ class CumulativeGroupedAllocationPriceCompositePriceFilter(BaseModel): class CumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(BaseModel): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: str """The overall allocation across all groups""" @@ -3035,6 +3818,25 @@ class CumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(BaseMode """The amount to charge for each unit outside of the allocation""" +class CumulativeGroupedAllocationPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class CumulativeGroupedAllocationPrice(BaseModel): id: str @@ -3108,6 +3910,13 @@ class CumulativeGroupedAllocationPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[CumulativeGroupedAllocationPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class MinimumCompositePriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -3125,7 +3934,9 @@ class MinimumCompositePriceCompositePriceFilter(BaseModel): ] -class MinimumCompositePriceMinimumConfig(BaseModel): +class MinimumCompositePriceMinimumCompositeConfig(BaseModel): + """Configuration for minimum_composite pricing""" + minimum_amount: str """The minimum amount to apply""" @@ -3133,6 +3944,25 @@ class MinimumCompositePriceMinimumConfig(BaseModel): """If true, subtotals from this price are prorated based on the service period""" +class MinimumCompositePriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class MinimumCompositePrice(BaseModel): id: str @@ -3186,10 +4016,10 @@ class MinimumCompositePrice(BaseModel): minimum_amount: Optional[str] = None - minimum_config: MinimumCompositePriceMinimumConfig - """Configuration for minimum pricing""" + minimum_composite_config: MinimumCompositePriceMinimumCompositeConfig + """Configuration for minimum_composite pricing""" - price_model_type: Literal["minimum"] = FieldInfo(alias="model_type") + price_model_type: Literal["minimum_composite"] = FieldInfo(alias="model_type") """The pricing model type""" name: str @@ -3206,6 +4036,13 @@ class MinimumCompositePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[MinimumCompositePriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class PercentCompositePriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -3224,10 +4061,31 @@ class PercentCompositePriceCompositePriceFilter(BaseModel): class PercentCompositePricePercentConfig(BaseModel): + """Configuration for percent pricing""" + percent: float """What percent of the component subtotals to charge""" +class PercentCompositePriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class PercentCompositePrice(BaseModel): id: str @@ -3301,6 +4159,13 @@ class PercentCompositePrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[PercentCompositePriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + class EventOutputPriceCompositePriceFilter(BaseModel): field: Literal["price_id", "item_id", "price_type", "currency", "pricing_unit_id"] @@ -3319,6 +4184,8 @@ class EventOutputPriceCompositePriceFilter(BaseModel): class EventOutputPriceEventOutputConfig(BaseModel): + """Configuration for event_output pricing""" + unit_rating_key: str """The key in the event data to extract the unit rate from.""" @@ -3336,6 +4203,25 @@ class EventOutputPriceEventOutputConfig(BaseModel): """ +class EventOutputPriceLicenseType(BaseModel): + """ + The LicenseType resource represents a type of license that can be assigned to users. + License types are used during billing by grouping metrics on the configured grouping key. + """ + + id: str + """The Orb-assigned unique identifier for the license type.""" + + grouping_key: str + """The key used for grouping licenses of this type. + + This is typically a user identifier field. + """ + + name: str + """The name of the license type.""" + + class EventOutputPrice(BaseModel): id: str @@ -3409,6 +4295,13 @@ class EventOutputPrice(BaseModel): dimensional_price_configuration: Optional[DimensionalPriceConfiguration] = None + license_type: Optional[EventOutputPriceLicenseType] = None + """ + The LicenseType resource represents a type of license that can be assigned to + users. License types are used during billing by grouping metrics on the + configured grouping key. + """ + Price: TypeAlias = Annotated[ Union[ diff --git a/src/orb_sdk/types/shared/price_interval.py b/src/orb_sdk/types/shared/price_interval.py index f280539..6240931 100644 --- a/src/orb_sdk/types/shared/price_interval.py +++ b/src/orb_sdk/types/shared/price_interval.py @@ -11,6 +11,11 @@ class PriceInterval(BaseModel): + """ + The Price Interval resource represents a period of time for which a price will bill on a subscription. A + subscription’s price intervals define its billing behavior. + """ + id: str billing_cycle_day: int diff --git a/src/orb_sdk/types/shared/tier.py b/src/orb_sdk/types/shared/tier.py index f087455..b17676a 100644 --- a/src/orb_sdk/types/shared/tier.py +++ b/src/orb_sdk/types/shared/tier.py @@ -8,6 +8,8 @@ class Tier(BaseModel): + """Configuration for a single tier""" + first_unit: float """Exclusive tier starting value""" diff --git a/src/orb_sdk/types/shared/tiered_config.py b/src/orb_sdk/types/shared/tiered_config.py index fa173f2..ac4c2e4 100644 --- a/src/orb_sdk/types/shared/tiered_config.py +++ b/src/orb_sdk/types/shared/tiered_config.py @@ -9,6 +9,8 @@ class TieredConfig(BaseModel): + """Configuration for tiered pricing""" + tiers: List[Tier] """Tiers for rating based on total usage quantities into the specified tier""" diff --git a/src/orb_sdk/types/shared/unit_config.py b/src/orb_sdk/types/shared/unit_config.py index b8b1565..04fae25 100644 --- a/src/orb_sdk/types/shared/unit_config.py +++ b/src/orb_sdk/types/shared/unit_config.py @@ -8,6 +8,8 @@ class UnitConfig(BaseModel): + """Configuration for unit pricing""" + unit_amount: str """Rate per unit of usage""" diff --git a/src/orb_sdk/types/shared_params/bulk_config.py b/src/orb_sdk/types/shared_params/bulk_config.py index b4ca090..6c7bdb2 100644 --- a/src/orb_sdk/types/shared_params/bulk_config.py +++ b/src/orb_sdk/types/shared_params/bulk_config.py @@ -11,5 +11,7 @@ class BulkConfig(TypedDict, total=False): + """Configuration for bulk pricing""" + tiers: Required[Iterable[BulkTier]] """Bulk tiers for rating based on total usage volume""" diff --git a/src/orb_sdk/types/shared_params/bulk_tier.py b/src/orb_sdk/types/shared_params/bulk_tier.py index 15dd5d0..1bac9c5 100644 --- a/src/orb_sdk/types/shared_params/bulk_tier.py +++ b/src/orb_sdk/types/shared_params/bulk_tier.py @@ -9,6 +9,8 @@ class BulkTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" diff --git a/src/orb_sdk/types/shared_params/customer_tax_id.py b/src/orb_sdk/types/shared_params/customer_tax_id.py index 170e64f..af47d84 100644 --- a/src/orb_sdk/types/shared_params/customer_tax_id.py +++ b/src/orb_sdk/types/shared_params/customer_tax_id.py @@ -8,6 +8,155 @@ class CustomerTaxID(TypedDict, total=False): + """ + Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices. + + + ### Supported Tax ID Countries and Types + + + | Country | Type | Description | + |---------|------|-------------| + | Albania | `al_tin` | Albania Tax Identification Number | + | Andorra | `ad_nrt` | Andorran NRT Number | + | Angola | `ao_tin` | Angola Tax Identification Number | + | Argentina | `ar_cuit` | Argentinian Tax ID Number | + | Armenia | `am_tin` | Armenia Tax Identification Number | + | Aruba | `aw_tin` | Aruba Tax Identification Number | + | Australia | `au_abn` | Australian Business Number (AU ABN) | + | Australia | `au_arn` | Australian Taxation Office Reference Number | + | Austria | `eu_vat` | European VAT Number | + | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number | + | Bahamas | `bs_tin` | Bahamas Tax Identification Number | + | Bahrain | `bh_vat` | Bahraini VAT Number | + | Bangladesh | `bd_bin` | Bangladesh Business Identification Number | + | Barbados | `bb_tin` | Barbados Tax Identification Number | + | Belarus | `by_tin` | Belarus TIN Number | + | Belgium | `eu_vat` | European VAT Number | + | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) | + | Bolivia | `bo_tin` | Bolivian Tax ID | + | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number | + | Brazil | `br_cnpj` | Brazilian CNPJ Number | + | Brazil | `br_cpf` | Brazilian CPF Number | + | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | + | Bulgaria | `eu_vat` | European VAT Number | + | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) | + | Cambodia | `kh_tin` | Cambodia Tax Identification Number | + | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) | + | Canada | `ca_bn` | Canadian BN | + | Canada | `ca_gst_hst` | Canadian GST/HST Number | + | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) | + | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) | + | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) | + | Canada | `ca_qst` | Canadian QST Number (Québec) | + | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) | + | Chile | `cl_tin` | Chilean TIN | + | China | `cn_tin` | Chinese Tax ID | + | Colombia | `co_nit` | Colombian NIT Number | + | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) | + | Costa Rica | `cr_tin` | Costa Rican Tax ID | + | Croatia | `eu_vat` | European VAT Number | + | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) | + | Cyprus | `eu_vat` | European VAT Number | + | Czech Republic | `eu_vat` | European VAT Number | + | Denmark | `eu_vat` | European VAT Number | + | Dominican Republic | `do_rcn` | Dominican RCN Number | + | Ecuador | `ec_ruc` | Ecuadorian RUC Number | + | Egypt | `eg_tin` | Egyptian Tax Identification Number | + | El Salvador | `sv_nit` | El Salvadorian NIT Number | + | Estonia | `eu_vat` | European VAT Number | + | Ethiopia | `et_tin` | Ethiopia Tax Identification Number | + | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme | + | Finland | `eu_vat` | European VAT Number | + | France | `eu_vat` | European VAT Number | + | Georgia | `ge_vat` | Georgian VAT | + | Germany | `de_stn` | German Tax Number (Steuernummer) | + | Germany | `eu_vat` | European VAT Number | + | Greece | `eu_vat` | European VAT Number | + | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) | + | Hong Kong | `hk_br` | Hong Kong BR Number | + | Hungary | `eu_vat` | European VAT Number | + | Hungary | `hu_tin` | Hungary Tax Number (adószám) | + | Iceland | `is_vat` | Icelandic VAT | + | India | `in_gst` | Indian GST Number | + | Indonesia | `id_npwp` | Indonesian NPWP Number | + | Ireland | `eu_vat` | European VAT Number | + | Israel | `il_vat` | Israel VAT | + | Italy | `eu_vat` | European VAT Number | + | Japan | `jp_cn` | Japanese Corporate Number (*Hōjin Bangō*) | + | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (*Tōroku Kokugai Jigyōsha no Tōroku Bangō*) | + | Japan | `jp_trn` | Japanese Tax Registration Number (*Tōroku Bangō*) | + | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number | + | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | + | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number | + | Laos | `la_tin` | Laos Tax Identification Number | + | Latvia | `eu_vat` | European VAT Number | + | Liechtenstein | `li_uid` | Liechtensteinian UID Number | + | Liechtenstein | `li_vat` | Liechtenstein VAT Number | + | Lithuania | `eu_vat` | European VAT Number | + | Luxembourg | `eu_vat` | European VAT Number | + | Malaysia | `my_frp` | Malaysian FRP Number | + | Malaysia | `my_itn` | Malaysian ITN | + | Malaysia | `my_sst` | Malaysian SST Number | + | Malta | `eu_vat` | European VAT Number | + | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) | + | Mexico | `mx_rfc` | Mexican RFC Number | + | Moldova | `md_vat` | Moldova VAT Number | + | Montenegro | `me_pib` | Montenegro PIB Number | + | Morocco | `ma_vat` | Morocco VAT Number | + | Nepal | `np_pan` | Nepal PAN Number | + | Netherlands | `eu_vat` | European VAT Number | + | New Zealand | `nz_gst` | New Zealand GST Number | + | Nigeria | `ng_tin` | Nigerian Tax Identification Number | + | North Macedonia | `mk_vat` | North Macedonia VAT Number | + | Northern Ireland | `eu_vat` | Northern Ireland VAT Number | + | Norway | `no_vat` | Norwegian VAT Number | + | Norway | `no_voec` | Norwegian VAT on e-commerce Number | + | Oman | `om_vat` | Omani VAT Number | + | Peru | `pe_ruc` | Peruvian RUC Number | + | Philippines | `ph_tin` | Philippines Tax Identification Number | + | Poland | `eu_vat` | European VAT Number | + | Poland | `pl_nip` | Polish Tax ID Number | + | Portugal | `eu_vat` | European VAT Number | + | Romania | `eu_vat` | European VAT Number | + | Romania | `ro_tin` | Romanian Tax ID Number | + | Russia | `ru_inn` | Russian INN | + | Russia | `ru_kpp` | Russian KPP | + | Saudi Arabia | `sa_vat` | Saudi Arabia VAT | + | Senegal | `sn_ninea` | Senegal NINEA Number | + | Serbia | `rs_pib` | Serbian PIB Number | + | Singapore | `sg_gst` | Singaporean GST | + | Singapore | `sg_uen` | Singaporean UEN | + | Slovakia | `eu_vat` | European VAT Number | + | Slovenia | `eu_vat` | European VAT Number | + | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) | + | South Africa | `za_vat` | South African VAT Number | + | South Korea | `kr_brn` | Korean BRN | + | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) | + | Spain | `eu_vat` | European VAT Number | + | Suriname | `sr_fin` | Suriname FIN Number | + | Sweden | `eu_vat` | European VAT Number | + | Switzerland | `ch_uid` | Switzerland UID Number | + | Switzerland | `ch_vat` | Switzerland VAT Number | + | Taiwan | `tw_vat` | Taiwanese VAT | + | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number | + | Tanzania | `tz_vat` | Tanzania VAT Number | + | Thailand | `th_vat` | Thai VAT | + | Turkey | `tr_tin` | Turkish Tax Identification Number | + | Uganda | `ug_tin` | Uganda Tax Identification Number | + | Ukraine | `ua_vat` | Ukrainian VAT | + | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | + | United Kingdom | `gb_vat` | United Kingdom VAT Number | + | United States | `us_ein` | United States EIN | + | Uruguay | `uy_ruc` | Uruguayan RUC Number | + | Uzbekistan | `uz_tin` | Uzbekistan TIN Number | + | Uzbekistan | `uz_vat` | Uzbekistan VAT Number | + | Venezuela | `ve_rif` | Venezuelan RIF Number | + | Vietnam | `vn_tin` | Vietnamese Tax ID Number | + | Zambia | `zm_tin` | Zambia Tax Identification Number | + | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number | + """ + country: Required[ Literal[ "AD", @@ -210,6 +359,7 @@ class CustomerTaxID(TypedDict, total=False): "om_vat", "pe_ruc", "ph_tin", + "pl_nip", "ro_tin", "rs_pib", "ru_inn", diff --git a/src/orb_sdk/types/shared_params/matrix_config.py b/src/orb_sdk/types/shared_params/matrix_config.py index 1a182af..94ba879 100644 --- a/src/orb_sdk/types/shared_params/matrix_config.py +++ b/src/orb_sdk/types/shared_params/matrix_config.py @@ -12,6 +12,8 @@ class MatrixConfig(TypedDict, total=False): + """Configuration for matrix pricing""" + default_unit_amount: Required[str] """Default per unit rate for any usage not bucketed into a specified matrix_value""" diff --git a/src/orb_sdk/types/shared_params/matrix_value.py b/src/orb_sdk/types/shared_params/matrix_value.py index 8c01e7b..b6879ac 100644 --- a/src/orb_sdk/types/shared_params/matrix_value.py +++ b/src/orb_sdk/types/shared_params/matrix_value.py @@ -11,6 +11,8 @@ class MatrixValue(TypedDict, total=False): + """Configuration for a single matrix value""" + dimension_values: Required[SequenceNotStr[Optional[str]]] """One or two matrix keys to filter usage to this Matrix value by""" diff --git a/src/orb_sdk/types/shared_params/matrix_with_allocation_config.py b/src/orb_sdk/types/shared_params/matrix_with_allocation_config.py index 4da9383..30af0b0 100644 --- a/src/orb_sdk/types/shared_params/matrix_with_allocation_config.py +++ b/src/orb_sdk/types/shared_params/matrix_with_allocation_config.py @@ -11,6 +11,8 @@ class MatrixValue(TypedDict, total=False): + """Configuration for a single matrix value""" + dimension_values: Required[SequenceNotStr[Optional[str]]] """One or two matrix keys to filter usage to this Matrix value by. @@ -23,6 +25,8 @@ class MatrixValue(TypedDict, total=False): class MatrixWithAllocationConfig(TypedDict, total=False): + """Configuration for matrix pricing with usage allocation""" + allocation: Required[str] """Usage allocation""" diff --git a/src/orb_sdk/types/shared_params/new_allocation_price.py b/src/orb_sdk/types/shared_params/new_allocation_price.py index 8d42e88..22331d9 100644 --- a/src/orb_sdk/types/shared_params/new_allocation_price.py +++ b/src/orb_sdk/types/shared_params/new_allocation_price.py @@ -12,6 +12,8 @@ class Filter(TypedDict, total=False): + """A PriceFilter that only allows item_id field for block filters.""" + field: Required[Literal["item_id"]] """The property of the price the block applies to. Only item_id is supported.""" @@ -54,6 +56,9 @@ class NewAllocationPrice(TypedDict, total=False): will be used (e.g. 'Included Allocation (USD)'). """ + license_type_id: Optional[str] + """The license type ID to associate the price with license allocation.""" + per_unit_cost_basis: str """The (per-unit) cost basis of each created block. diff --git a/src/orb_sdk/types/shared_params/new_floating_bulk_price.py b/src/orb_sdk/types/shared_params/new_floating_bulk_price.py index 22b80af..da009a9 100644 --- a/src/orb_sdk/types/shared_params/new_floating_bulk_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_bulk_price.py @@ -80,6 +80,9 @@ class NewFloatingBulkPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_bulk_with_proration_price.py b/src/orb_sdk/types/shared_params/new_floating_bulk_with_proration_price.py index d558b2c..14152f7 100644 --- a/src/orb_sdk/types/shared_params/new_floating_bulk_with_proration_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_bulk_with_proration_price.py @@ -19,6 +19,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: Required[str] """Cost per unit""" @@ -27,6 +29,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): class BulkWithProrationConfig(TypedDict, total=False): + """Configuration for bulk_with_proration pricing""" + tiers: Required[Iterable[BulkWithProrationConfigTier]] """Bulk tiers for rating based on total usage volume""" @@ -98,6 +102,9 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_cumulative_grouped_bulk_price.py b/src/orb_sdk/types/shared_params/new_floating_cumulative_grouped_bulk_price.py index c366e61..7c13aea 100644 --- a/src/orb_sdk/types/shared_params/new_floating_cumulative_grouped_bulk_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_cumulative_grouped_bulk_price.py @@ -19,6 +19,8 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): + """Configuration for a dimension value entry""" + grouping_key: Required[str] """Grouping key value""" @@ -30,11 +32,12 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): class CumulativeGroupedBulkConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: Required[Iterable[CumulativeGroupedBulkConfigDimensionValue]] """Each tier lower bound must have the same group of values.""" group: Required[str] - """Grouping key name""" ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] @@ -104,6 +107,9 @@ class NewFloatingCumulativeGroupedBulkPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_grouped_allocation_price.py b/src/orb_sdk/types/shared_params/new_floating_grouped_allocation_price.py index f4eab38..b1d570b 100644 --- a/src/orb_sdk/types/shared_params/new_floating_grouped_allocation_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_grouped_allocation_price.py @@ -14,6 +14,8 @@ class GroupedAllocationConfig(TypedDict, total=False): + """Configuration for grouped_allocation pricing""" + allocation: Required[str] """Usage allocation per group""" @@ -91,6 +93,9 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_grouped_tiered_package_price.py b/src/orb_sdk/types/shared_params/new_floating_grouped_tiered_package_price.py index b13138e..2d7fbd5 100644 --- a/src/orb_sdk/types/shared_params/new_floating_grouped_tiered_package_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_grouped_tiered_package_price.py @@ -19,19 +19,21 @@ class GroupedTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + per_unit: Required[str] - """Price per package""" + """Per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class GroupedTieredPackageConfig(TypedDict, total=False): + """Configuration for grouped_tiered_package pricing""" + grouping_key: Required[str] """The event property used to group before tiering""" package_size: Required[str] - """Package size""" tiers: Required[Iterable[GroupedTieredPackageConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -107,6 +109,9 @@ class NewFloatingGroupedTieredPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_grouped_tiered_price.py b/src/orb_sdk/types/shared_params/new_floating_grouped_tiered_price.py index 2f2d7c9..14fd31d 100644 --- a/src/orb_sdk/types/shared_params/new_floating_grouped_tiered_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_grouped_tiered_price.py @@ -14,14 +14,17 @@ class GroupedTieredConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class GroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + grouping_key: Required[str] """The billable metric property used to group before tiering""" @@ -99,6 +102,9 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_grouped_with_metered_minimum_price.py b/src/orb_sdk/types/shared_params/new_floating_grouped_with_metered_minimum_price.py index 09cc4af..d722c98 100644 --- a/src/orb_sdk/types/shared_params/new_floating_grouped_with_metered_minimum_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_grouped_with_metered_minimum_price.py @@ -20,22 +20,25 @@ class GroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): + """Configuration for a scaling factor""" + scaling_factor: Required[str] - """Scaling factor""" scaling_value: Required[str] - """Scaling value""" class GroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount""" + pricing_value: Required[str] - """Pricing value""" unit_amount: Required[str] """Per unit amount""" class GroupedWithMeteredMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: Required[str] """Used to partition the usage into groups. @@ -128,6 +131,9 @@ class NewFloatingGroupedWithMeteredMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_grouped_with_prorated_minimum_price.py b/src/orb_sdk/types/shared_params/new_floating_grouped_with_prorated_minimum_price.py index 489dcaa..fd79316 100644 --- a/src/orb_sdk/types/shared_params/new_floating_grouped_with_prorated_minimum_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_grouped_with_prorated_minimum_price.py @@ -14,6 +14,8 @@ class GroupedWithProratedMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: Required[str] """How to determine the groups that should each have a minimum""" @@ -91,6 +93,9 @@ class NewFloatingGroupedWithProratedMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_matrix_price.py b/src/orb_sdk/types/shared_params/new_floating_matrix_price.py index 86f0856..23d131c 100644 --- a/src/orb_sdk/types/shared_params/new_floating_matrix_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_matrix_price.py @@ -80,6 +80,9 @@ class NewFloatingMatrixPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_matrix_with_allocation_price.py b/src/orb_sdk/types/shared_params/new_floating_matrix_with_allocation_price.py index a5e7e7d..7a625e3 100644 --- a/src/orb_sdk/types/shared_params/new_floating_matrix_with_allocation_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_matrix_with_allocation_price.py @@ -80,6 +80,9 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_matrix_with_display_name_price.py b/src/orb_sdk/types/shared_params/new_floating_matrix_with_display_name_price.py index 3afbf5a..de083d0 100644 --- a/src/orb_sdk/types/shared_params/new_floating_matrix_with_display_name_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_matrix_with_display_name_price.py @@ -19,6 +19,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount item""" + dimension_value: Required[str] """The dimension value""" @@ -30,6 +32,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): class MatrixWithDisplayNameConfig(TypedDict, total=False): + """Configuration for matrix_with_display_name pricing""" + dimension: Required[str] """Used to determine the unit rate""" @@ -104,6 +108,9 @@ class NewFloatingMatrixWithDisplayNamePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_max_group_tiered_package_price.py b/src/orb_sdk/types/shared_params/new_floating_max_group_tiered_package_price.py index 6fce2b5..d5e6fe1 100644 --- a/src/orb_sdk/types/shared_params/new_floating_max_group_tiered_package_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_max_group_tiered_package_price.py @@ -19,21 +19,23 @@ class MaxGroupTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class MaxGroupTieredPackageConfig(TypedDict, total=False): + """Configuration for max_group_tiered_package pricing""" + grouping_key: Required[str] """ The event property used to group before tiering the group with the highest value """ package_size: Required[str] - """Package size""" tiers: Required[Iterable[MaxGroupTieredPackageConfigTier]] """Apply tiered pricing to the largest group after grouping with the provided key.""" @@ -106,6 +108,9 @@ class NewFloatingMaxGroupTieredPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_minimum_composite_price.py b/src/orb_sdk/types/shared_params/new_floating_minimum_composite_price.py index 1c8e4bc..286cc7c 100644 --- a/src/orb_sdk/types/shared_params/new_floating_minimum_composite_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_minimum_composite_price.py @@ -10,10 +10,12 @@ from .new_billing_cycle_configuration import NewBillingCycleConfiguration from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewFloatingMinimumCompositePrice", "MinimumConfig", "ConversionRateConfig"] +__all__ = ["NewFloatingMinimumCompositePrice", "MinimumCompositeConfig", "ConversionRateConfig"] -class MinimumConfig(TypedDict, total=False): +class MinimumCompositeConfig(TypedDict, total=False): + """Configuration for minimum_composite pricing""" + minimum_amount: Required[str] """The minimum amount to apply""" @@ -34,10 +36,10 @@ class NewFloatingMinimumCompositePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - minimum_config: Required[MinimumConfig] - """Configuration for minimum pricing""" + minimum_composite_config: Required[MinimumCompositeConfig] + """Configuration for minimum_composite pricing""" - model_type: Required[Literal["minimum"]] + model_type: Required[Literal["minimum_composite"]] """The pricing model type""" name: Required[str] @@ -88,6 +90,9 @@ class NewFloatingMinimumCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_package_price.py b/src/orb_sdk/types/shared_params/new_floating_package_price.py index e35b049..80bda54 100644 --- a/src/orb_sdk/types/shared_params/new_floating_package_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_package_price.py @@ -80,6 +80,9 @@ class NewFloatingPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_package_with_allocation_price.py b/src/orb_sdk/types/shared_params/new_floating_package_with_allocation_price.py index 7728b3d..fd11087 100644 --- a/src/orb_sdk/types/shared_params/new_floating_package_with_allocation_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_package_with_allocation_price.py @@ -14,14 +14,13 @@ class PackageWithAllocationConfig(TypedDict, total=False): + """Configuration for package_with_allocation pricing""" + allocation: Required[str] - """Usage allocation""" package_amount: Required[str] - """Price per package""" package_size: Required[str] - """Package size""" ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] @@ -91,6 +90,9 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_scalable_matrix_with_tiered_pricing_price.py b/src/orb_sdk/types/shared_params/new_floating_scalable_matrix_with_tiered_pricing_price.py index 02ec608..3d77020 100644 --- a/src/orb_sdk/types/shared_params/new_floating_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_scalable_matrix_with_tiered_pricing_price.py @@ -20,25 +20,26 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] - """First dimension value""" scaling_factor: Required[str] - """Scaling factor""" second_dimension_value: Optional[str] - """Second dimension value (optional)""" class ScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] - """Per unit amount""" class ScalableMatrixWithTieredPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: Required[str] """Used for the scalable matrix first dimension""" @@ -46,7 +47,6 @@ class ScalableMatrixWithTieredPricingConfig(TypedDict, total=False): """Apply a scaling factor to each dimension""" tiers: Required[Iterable[ScalableMatrixWithTieredPricingConfigTier]] - """Tier pricing structure""" second_dimension: Optional[str] """Used for the scalable matrix second dimension (optional)""" @@ -119,6 +119,9 @@ class NewFloatingScalableMatrixWithTieredPricingPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py b/src/orb_sdk/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py index 03f0bde..374f11e 100644 --- a/src/orb_sdk/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py @@ -19,17 +19,18 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] - """First dimension value""" scaling_factor: Required[str] - """Scaling factor""" second_dimension_value: Optional[str] - """Second dimension value (optional)""" class ScalableMatrixWithUnitPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: Required[str] """Used to determine the unit rate""" @@ -113,6 +114,9 @@ class NewFloatingScalableMatrixWithUnitPricingPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_threshold_total_amount_price.py b/src/orb_sdk/types/shared_params/new_floating_threshold_total_amount_price.py index dd2407c..a6eadaa 100644 --- a/src/orb_sdk/types/shared_params/new_floating_threshold_total_amount_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_threshold_total_amount_price.py @@ -19,14 +19,17 @@ class ThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): + """Configuration for a single threshold""" + threshold: Required[str] - """Quantity threshold""" total_amount: Required[str] """Total amount for this threshold""" class ThresholdTotalAmountConfig(TypedDict, total=False): + """Configuration for threshold_total_amount pricing""" + consumption_table: Required[Iterable[ThresholdTotalAmountConfigConsumptionTable]] """ When the quantity consumed passes a provided threshold, the configured total @@ -104,6 +107,9 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_tiered_package_price.py b/src/orb_sdk/types/shared_params/new_floating_tiered_package_price.py index 9ee2dc6..f4e0fb2 100644 --- a/src/orb_sdk/types/shared_params/new_floating_tiered_package_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_tiered_package_price.py @@ -14,16 +14,18 @@ class TieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier with business logic""" + per_unit: Required[str] """Price per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class TieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + package_size: Required[str] - """Package size""" tiers: Required[Iterable[TieredPackageConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -101,6 +103,9 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_tiered_package_with_minimum_price.py b/src/orb_sdk/types/shared_params/new_floating_tiered_package_with_minimum_price.py index 192557d..9f873b9 100644 --- a/src/orb_sdk/types/shared_params/new_floating_tiered_package_with_minimum_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_tiered_package_with_minimum_price.py @@ -19,19 +19,19 @@ class TieredPackageWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] - """Minimum amount""" per_unit: Required[str] - """Price per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class TieredPackageWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_package_with_minimum pricing""" + package_size: Required[float] - """Package size""" tiers: Required[Iterable[TieredPackageWithMinimumConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -107,6 +107,9 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_tiered_price.py b/src/orb_sdk/types/shared_params/new_floating_tiered_price.py index 5444fb7..66e2ae8 100644 --- a/src/orb_sdk/types/shared_params/new_floating_tiered_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_tiered_price.py @@ -80,6 +80,9 @@ class NewFloatingTieredPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_tiered_with_minimum_price.py b/src/orb_sdk/types/shared_params/new_floating_tiered_with_minimum_price.py index b7af73e..c1ebb6c 100644 --- a/src/orb_sdk/types/shared_params/new_floating_tiered_with_minimum_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_tiered_with_minimum_price.py @@ -19,17 +19,19 @@ class TieredWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] - """Minimum amount""" tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class TieredWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_with_minimum pricing""" + tiers: Required[Iterable[TieredWithMinimumConfigTier]] """Tiered pricing with a minimum amount dependent on the volume tier. @@ -110,6 +112,9 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_tiered_with_proration_price.py b/src/orb_sdk/types/shared_params/new_floating_tiered_with_proration_price.py index 6a668ab..815c98d 100644 --- a/src/orb_sdk/types/shared_params/new_floating_tiered_with_proration_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_tiered_with_proration_price.py @@ -19,6 +19,8 @@ class TieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -27,6 +29,8 @@ class TieredWithProrationConfigTier(TypedDict, total=False): class TieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[TieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -101,6 +105,9 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_unit_price.py b/src/orb_sdk/types/shared_params/new_floating_unit_price.py index 9680510..8a7cfc6 100644 --- a/src/orb_sdk/types/shared_params/new_floating_unit_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_unit_price.py @@ -80,6 +80,9 @@ class NewFloatingUnitPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_unit_with_percent_price.py b/src/orb_sdk/types/shared_params/new_floating_unit_with_percent_price.py index f4c3f97..a325cfa 100644 --- a/src/orb_sdk/types/shared_params/new_floating_unit_with_percent_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_unit_with_percent_price.py @@ -14,6 +14,8 @@ class UnitWithPercentConfig(TypedDict, total=False): + """Configuration for unit_with_percent pricing""" + percent: Required[str] """What percent, out of 100, of the calculated total to charge""" @@ -88,6 +90,9 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_floating_unit_with_proration_price.py b/src/orb_sdk/types/shared_params/new_floating_unit_with_proration_price.py index 9be1a23..737d7d1 100644 --- a/src/orb_sdk/types/shared_params/new_floating_unit_with_proration_price.py +++ b/src/orb_sdk/types/shared_params/new_floating_unit_with_proration_price.py @@ -14,6 +14,8 @@ class UnitWithProrationConfig(TypedDict, total=False): + """Configuration for unit_with_proration pricing""" + unit_amount: Required[str] """Rate per unit of usage""" @@ -85,6 +87,9 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_bulk_price.py b/src/orb_sdk/types/shared_params/new_plan_bulk_price.py index 05e8b90..1836595 100644 --- a/src/orb_sdk/types/shared_params/new_plan_bulk_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_bulk_price.py @@ -83,6 +83,9 @@ class NewPlanBulkPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_bulk_with_proration_price.py b/src/orb_sdk/types/shared_params/new_plan_bulk_with_proration_price.py index a64dd3a..98c8147 100644 --- a/src/orb_sdk/types/shared_params/new_plan_bulk_with_proration_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_bulk_with_proration_price.py @@ -19,6 +19,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier with proration""" + unit_amount: Required[str] """Cost per unit""" @@ -27,6 +29,8 @@ class BulkWithProrationConfigTier(TypedDict, total=False): class BulkWithProrationConfig(TypedDict, total=False): + """Configuration for bulk_with_proration pricing""" + tiers: Required[Iterable[BulkWithProrationConfigTier]] """Bulk tiers for rating based on total usage volume""" @@ -101,6 +105,9 @@ class NewPlanBulkWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_cumulative_grouped_bulk_price.py b/src/orb_sdk/types/shared_params/new_plan_cumulative_grouped_bulk_price.py index 52e6ec6..8f85525 100644 --- a/src/orb_sdk/types/shared_params/new_plan_cumulative_grouped_bulk_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_cumulative_grouped_bulk_price.py @@ -19,6 +19,8 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): + """Configuration for a dimension value entry""" + grouping_key: Required[str] """Grouping key value""" @@ -30,11 +32,12 @@ class CumulativeGroupedBulkConfigDimensionValue(TypedDict, total=False): class CumulativeGroupedBulkConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_bulk pricing""" + dimension_values: Required[Iterable[CumulativeGroupedBulkConfigDimensionValue]] """Each tier lower bound must have the same group of values.""" group: Required[str] - """Grouping key name""" ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] @@ -107,6 +110,9 @@ class NewPlanCumulativeGroupedBulkPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_grouped_allocation_price.py b/src/orb_sdk/types/shared_params/new_plan_grouped_allocation_price.py index 67b7c72..69d606d 100644 --- a/src/orb_sdk/types/shared_params/new_plan_grouped_allocation_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_grouped_allocation_price.py @@ -14,6 +14,8 @@ class GroupedAllocationConfig(TypedDict, total=False): + """Configuration for grouped_allocation pricing""" + allocation: Required[str] """Usage allocation per group""" @@ -94,6 +96,9 @@ class NewPlanGroupedAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_grouped_tiered_package_price.py b/src/orb_sdk/types/shared_params/new_plan_grouped_tiered_package_price.py index 26d663e..c0ef157 100644 --- a/src/orb_sdk/types/shared_params/new_plan_grouped_tiered_package_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_grouped_tiered_package_price.py @@ -19,19 +19,21 @@ class GroupedTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + per_unit: Required[str] - """Price per package""" + """Per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class GroupedTieredPackageConfig(TypedDict, total=False): + """Configuration for grouped_tiered_package pricing""" + grouping_key: Required[str] """The event property used to group before tiering""" package_size: Required[str] - """Package size""" tiers: Required[Iterable[GroupedTieredPackageConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -110,6 +112,9 @@ class NewPlanGroupedTieredPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_grouped_tiered_price.py b/src/orb_sdk/types/shared_params/new_plan_grouped_tiered_price.py index 3bc086e..dbbed5b 100644 --- a/src/orb_sdk/types/shared_params/new_plan_grouped_tiered_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_grouped_tiered_price.py @@ -14,14 +14,17 @@ class GroupedTieredConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class GroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + grouping_key: Required[str] """The billable metric property used to group before tiering""" @@ -102,6 +105,9 @@ class NewPlanGroupedTieredPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_grouped_with_metered_minimum_price.py b/src/orb_sdk/types/shared_params/new_plan_grouped_with_metered_minimum_price.py index 27dbc41..3d5ea79 100644 --- a/src/orb_sdk/types/shared_params/new_plan_grouped_with_metered_minimum_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_grouped_with_metered_minimum_price.py @@ -20,22 +20,25 @@ class GroupedWithMeteredMinimumConfigScalingFactor(TypedDict, total=False): + """Configuration for a scaling factor""" + scaling_factor: Required[str] - """Scaling factor""" scaling_value: Required[str] - """Scaling value""" class GroupedWithMeteredMinimumConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount""" + pricing_value: Required[str] - """Pricing value""" unit_amount: Required[str] """Per unit amount""" class GroupedWithMeteredMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_metered_minimum pricing""" + grouping_key: Required[str] """Used to partition the usage into groups. @@ -131,6 +134,9 @@ class NewPlanGroupedWithMeteredMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_grouped_with_prorated_minimum_price.py b/src/orb_sdk/types/shared_params/new_plan_grouped_with_prorated_minimum_price.py index b358bad..aa1e841 100644 --- a/src/orb_sdk/types/shared_params/new_plan_grouped_with_prorated_minimum_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_grouped_with_prorated_minimum_price.py @@ -14,6 +14,8 @@ class GroupedWithProratedMinimumConfig(TypedDict, total=False): + """Configuration for grouped_with_prorated_minimum pricing""" + grouping_key: Required[str] """How to determine the groups that should each have a minimum""" @@ -94,6 +96,9 @@ class NewPlanGroupedWithProratedMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_matrix_price.py b/src/orb_sdk/types/shared_params/new_plan_matrix_price.py index e0d8d2a..fdbdd18 100644 --- a/src/orb_sdk/types/shared_params/new_plan_matrix_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_matrix_price.py @@ -83,6 +83,9 @@ class NewPlanMatrixPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_matrix_with_allocation_price.py b/src/orb_sdk/types/shared_params/new_plan_matrix_with_allocation_price.py index 2a70435..4c5eb62 100644 --- a/src/orb_sdk/types/shared_params/new_plan_matrix_with_allocation_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_matrix_with_allocation_price.py @@ -83,6 +83,9 @@ class NewPlanMatrixWithAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_matrix_with_display_name_price.py b/src/orb_sdk/types/shared_params/new_plan_matrix_with_display_name_price.py index 7822f6e..960e52f 100644 --- a/src/orb_sdk/types/shared_params/new_plan_matrix_with_display_name_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_matrix_with_display_name_price.py @@ -19,6 +19,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): + """Configuration for a unit amount item""" + dimension_value: Required[str] """The dimension value""" @@ -30,6 +32,8 @@ class MatrixWithDisplayNameConfigUnitAmount(TypedDict, total=False): class MatrixWithDisplayNameConfig(TypedDict, total=False): + """Configuration for matrix_with_display_name pricing""" + dimension: Required[str] """Used to determine the unit rate""" @@ -107,6 +111,9 @@ class NewPlanMatrixWithDisplayNamePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_max_group_tiered_package_price.py b/src/orb_sdk/types/shared_params/new_plan_max_group_tiered_package_price.py index 4c57423..5aa4915 100644 --- a/src/orb_sdk/types/shared_params/new_plan_max_group_tiered_package_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_max_group_tiered_package_price.py @@ -19,21 +19,23 @@ class MaxGroupTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class MaxGroupTieredPackageConfig(TypedDict, total=False): + """Configuration for max_group_tiered_package pricing""" + grouping_key: Required[str] """ The event property used to group before tiering the group with the highest value """ package_size: Required[str] - """Package size""" tiers: Required[Iterable[MaxGroupTieredPackageConfigTier]] """Apply tiered pricing to the largest group after grouping with the provided key.""" @@ -109,6 +111,9 @@ class NewPlanMaxGroupTieredPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_minimum_composite_price.py b/src/orb_sdk/types/shared_params/new_plan_minimum_composite_price.py index 45fe6b8..e5e3d72 100644 --- a/src/orb_sdk/types/shared_params/new_plan_minimum_composite_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_minimum_composite_price.py @@ -10,10 +10,12 @@ from .new_billing_cycle_configuration import NewBillingCycleConfiguration from .new_dimensional_price_configuration import NewDimensionalPriceConfiguration -__all__ = ["NewPlanMinimumCompositePrice", "MinimumConfig", "ConversionRateConfig"] +__all__ = ["NewPlanMinimumCompositePrice", "MinimumCompositeConfig", "ConversionRateConfig"] -class MinimumConfig(TypedDict, total=False): +class MinimumCompositeConfig(TypedDict, total=False): + """Configuration for minimum_composite pricing""" + minimum_amount: Required[str] """The minimum amount to apply""" @@ -31,10 +33,10 @@ class NewPlanMinimumCompositePrice(TypedDict, total=False): item_id: Required[str] """The id of the item the price will be associated with.""" - minimum_config: Required[MinimumConfig] - """Configuration for minimum pricing""" + minimum_composite_config: Required[MinimumCompositeConfig] + """Configuration for minimum_composite pricing""" - model_type: Required[Literal["minimum"]] + model_type: Required[Literal["minimum_composite"]] """The pricing model type""" name: Required[str] @@ -91,6 +93,9 @@ class NewPlanMinimumCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_package_price.py b/src/orb_sdk/types/shared_params/new_plan_package_price.py index ad018a1..1641929 100644 --- a/src/orb_sdk/types/shared_params/new_plan_package_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_package_price.py @@ -83,6 +83,9 @@ class NewPlanPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_package_with_allocation_price.py b/src/orb_sdk/types/shared_params/new_plan_package_with_allocation_price.py index 430f586..f878fae 100644 --- a/src/orb_sdk/types/shared_params/new_plan_package_with_allocation_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_package_with_allocation_price.py @@ -14,14 +14,13 @@ class PackageWithAllocationConfig(TypedDict, total=False): + """Configuration for package_with_allocation pricing""" + allocation: Required[str] - """Usage allocation""" package_amount: Required[str] - """Price per package""" package_size: Required[str] - """Package size""" ConversionRateConfig: TypeAlias = Union[UnitConversionRateConfig, TieredConversionRateConfig] @@ -94,6 +93,9 @@ class NewPlanPackageWithAllocationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_scalable_matrix_with_tiered_pricing_price.py b/src/orb_sdk/types/shared_params/new_plan_scalable_matrix_with_tiered_pricing_price.py index 4d02a54..4219103 100644 --- a/src/orb_sdk/types/shared_params/new_plan_scalable_matrix_with_tiered_pricing_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_scalable_matrix_with_tiered_pricing_price.py @@ -20,25 +20,26 @@ class ScalableMatrixWithTieredPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] - """First dimension value""" scaling_factor: Required[str] - """Scaling factor""" second_dimension_value: Optional[str] - """Second dimension value (optional)""" class ScalableMatrixWithTieredPricingConfigTier(TypedDict, total=False): + """Configuration for a single tier entry with business logic""" + tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] - """Per unit amount""" class ScalableMatrixWithTieredPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + first_dimension: Required[str] """Used for the scalable matrix first dimension""" @@ -46,7 +47,6 @@ class ScalableMatrixWithTieredPricingConfig(TypedDict, total=False): """Apply a scaling factor to each dimension""" tiers: Required[Iterable[ScalableMatrixWithTieredPricingConfigTier]] - """Tier pricing structure""" second_dimension: Optional[str] """Used for the scalable matrix second dimension (optional)""" @@ -122,6 +122,9 @@ class NewPlanScalableMatrixWithTieredPricingPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py b/src/orb_sdk/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py index 6fd976c..f9bee34 100644 --- a/src/orb_sdk/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py @@ -19,17 +19,18 @@ class ScalableMatrixWithUnitPricingConfigMatrixScalingFactor(TypedDict, total=False): + """Configuration for a single matrix scaling factor""" + first_dimension_value: Required[str] - """First dimension value""" scaling_factor: Required[str] - """Scaling factor""" second_dimension_value: Optional[str] - """Second dimension value (optional)""" class ScalableMatrixWithUnitPricingConfig(TypedDict, total=False): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + first_dimension: Required[str] """Used to determine the unit rate""" @@ -116,6 +117,9 @@ class NewPlanScalableMatrixWithUnitPricingPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_threshold_total_amount_price.py b/src/orb_sdk/types/shared_params/new_plan_threshold_total_amount_price.py index ef1e933..86cb1ef 100644 --- a/src/orb_sdk/types/shared_params/new_plan_threshold_total_amount_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_threshold_total_amount_price.py @@ -19,14 +19,17 @@ class ThresholdTotalAmountConfigConsumptionTable(TypedDict, total=False): + """Configuration for a single threshold""" + threshold: Required[str] - """Quantity threshold""" total_amount: Required[str] """Total amount for this threshold""" class ThresholdTotalAmountConfig(TypedDict, total=False): + """Configuration for threshold_total_amount pricing""" + consumption_table: Required[Iterable[ThresholdTotalAmountConfigConsumptionTable]] """ When the quantity consumed passes a provided threshold, the configured total @@ -107,6 +110,9 @@ class NewPlanThresholdTotalAmountPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_tiered_package_price.py b/src/orb_sdk/types/shared_params/new_plan_tiered_package_price.py index 72696ec..6c2c96d 100644 --- a/src/orb_sdk/types/shared_params/new_plan_tiered_package_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_tiered_package_price.py @@ -14,16 +14,18 @@ class TieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier with business logic""" + per_unit: Required[str] """Price per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class TieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + package_size: Required[str] - """Package size""" tiers: Required[Iterable[TieredPackageConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -104,6 +106,9 @@ class NewPlanTieredPackagePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_tiered_package_with_minimum_price.py b/src/orb_sdk/types/shared_params/new_plan_tiered_package_with_minimum_price.py index 8dc0826..cdb4b2e 100644 --- a/src/orb_sdk/types/shared_params/new_plan_tiered_package_with_minimum_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_tiered_package_with_minimum_price.py @@ -19,19 +19,19 @@ class TieredPackageWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] - """Minimum amount""" per_unit: Required[str] - """Price per package""" tier_lower_bound: Required[str] - """Tier lower bound""" class TieredPackageWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_package_with_minimum pricing""" + package_size: Required[float] - """Package size""" tiers: Required[Iterable[TieredPackageWithMinimumConfigTier]] """Apply tiered pricing after rounding up the quantity to the package size. @@ -110,6 +110,9 @@ class NewPlanTieredPackageWithMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_tiered_price.py b/src/orb_sdk/types/shared_params/new_plan_tiered_price.py index 8a77a04..e1d026d 100644 --- a/src/orb_sdk/types/shared_params/new_plan_tiered_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_tiered_price.py @@ -83,6 +83,9 @@ class NewPlanTieredPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_tiered_with_minimum_price.py b/src/orb_sdk/types/shared_params/new_plan_tiered_with_minimum_price.py index 2089ad1..0a107b7 100644 --- a/src/orb_sdk/types/shared_params/new_plan_tiered_with_minimum_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_tiered_with_minimum_price.py @@ -19,17 +19,19 @@ class TieredWithMinimumConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + minimum_amount: Required[str] - """Minimum amount""" tier_lower_bound: Required[str] - """Tier lower bound""" unit_amount: Required[str] """Per unit amount""" class TieredWithMinimumConfig(TypedDict, total=False): + """Configuration for tiered_with_minimum pricing""" + tiers: Required[Iterable[TieredWithMinimumConfigTier]] """Tiered pricing with a minimum amount dependent on the volume tier. @@ -113,6 +115,9 @@ class NewPlanTieredWithMinimumPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_unit_price.py b/src/orb_sdk/types/shared_params/new_plan_unit_price.py index b1c660d..bfc4a50 100644 --- a/src/orb_sdk/types/shared_params/new_plan_unit_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_unit_price.py @@ -83,6 +83,9 @@ class NewPlanUnitPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_unit_with_percent_price.py b/src/orb_sdk/types/shared_params/new_plan_unit_with_percent_price.py index 8b6eafe..dbc8ed1 100644 --- a/src/orb_sdk/types/shared_params/new_plan_unit_with_percent_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_unit_with_percent_price.py @@ -14,6 +14,8 @@ class UnitWithPercentConfig(TypedDict, total=False): + """Configuration for unit_with_percent pricing""" + percent: Required[str] """What percent, out of 100, of the calculated total to charge""" @@ -91,6 +93,9 @@ class NewPlanUnitWithPercentPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/new_plan_unit_with_proration_price.py b/src/orb_sdk/types/shared_params/new_plan_unit_with_proration_price.py index 0c72b3f..cd8ee56 100644 --- a/src/orb_sdk/types/shared_params/new_plan_unit_with_proration_price.py +++ b/src/orb_sdk/types/shared_params/new_plan_unit_with_proration_price.py @@ -14,6 +14,8 @@ class UnitWithProrationConfig(TypedDict, total=False): + """Configuration for unit_with_proration pricing""" + unit_amount: Required[str] """Rate per unit of usage""" @@ -88,6 +90,9 @@ class NewPlanUnitWithProrationPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/shared_params/package_config.py b/src/orb_sdk/types/shared_params/package_config.py index ad4f51b..f37339f 100644 --- a/src/orb_sdk/types/shared_params/package_config.py +++ b/src/orb_sdk/types/shared_params/package_config.py @@ -8,6 +8,8 @@ class PackageConfig(TypedDict, total=False): + """Configuration for package pricing""" + package_amount: Required[str] """A currency amount to rate usage by""" diff --git a/src/orb_sdk/types/shared_params/tier.py b/src/orb_sdk/types/shared_params/tier.py index 23fa0b6..cf66df3 100644 --- a/src/orb_sdk/types/shared_params/tier.py +++ b/src/orb_sdk/types/shared_params/tier.py @@ -9,6 +9,8 @@ class Tier(TypedDict, total=False): + """Configuration for a single tier""" + first_unit: Required[float] """Exclusive tier starting value""" diff --git a/src/orb_sdk/types/shared_params/tiered_config.py b/src/orb_sdk/types/shared_params/tiered_config.py index f5d1c26..31c9dc1 100644 --- a/src/orb_sdk/types/shared_params/tiered_config.py +++ b/src/orb_sdk/types/shared_params/tiered_config.py @@ -11,6 +11,8 @@ class TieredConfig(TypedDict, total=False): + """Configuration for tiered pricing""" + tiers: Required[Iterable[Tier]] """Tiers for rating based on total usage quantities into the specified tier""" diff --git a/src/orb_sdk/types/shared_params/unit_config.py b/src/orb_sdk/types/shared_params/unit_config.py index 2a41542..ed96da8 100644 --- a/src/orb_sdk/types/shared_params/unit_config.py +++ b/src/orb_sdk/types/shared_params/unit_config.py @@ -8,6 +8,8 @@ class UnitConfig(TypedDict, total=False): + """Configuration for unit pricing""" + unit_amount: Required[str] """Rate per unit of usage""" diff --git a/src/orb_sdk/types/subscription.py b/src/orb_sdk/types/subscription.py index cac64a0..19145ee 100644 --- a/src/orb_sdk/types/subscription.py +++ b/src/orb_sdk/types/subscription.py @@ -30,6 +30,22 @@ class Subscription(BaseModel): + """ + A [subscription](/core-concepts#subscription) represents the purchase of a plan by a customer. + + By default, subscriptions begin on the day that they're created and renew automatically for each billing cycle at + the cadence that's configured in the plan definition. + + Subscriptions also default to **beginning of month alignment**, which means the first invoice issued for the + subscription will have pro-rated charges between the `start_date` and the first of the following month. Subsequent + billing periods will always start and end on a month boundary (e.g. subsequent month starts for monthly billing). + + Depending on the plan configuration, any _flat_ recurring fees will be billed either at the beginning (in-advance) + or end (in-arrears) of each billing cycle. Plans default to **in-advance billing**. Usage-based fees are billed in + arrears as usage is accumulated. In the normal course of events, you can expect an invoice to contain usage-based + charges for the previous period, and a recurring fee for the following period. + """ + id: str active_plan_phase_order: Optional[int] = None diff --git a/src/orb_sdk/types/subscription_change_apply_response.py b/src/orb_sdk/types/subscription_change_apply_response.py index 17127e7..5670c50 100644 --- a/src/orb_sdk/types/subscription_change_apply_response.py +++ b/src/orb_sdk/types/subscription_change_apply_response.py @@ -11,8 +11,17 @@ class SubscriptionChangeApplyResponse(BaseModel): + """ + A subscription change represents a desired new subscription / pending change to an existing subscription. It + is a way to first preview the effects on the subscription as well as any changes/creation of invoices + (see `subscription.changed_resources`). + """ + id: str + change_type: str + """The type of change (e.g., 'schedule_plan_change', 'create_subscription').""" + expiration_time: datetime """ Subscription change will be cancelled at this time and can no longer be applied. @@ -25,5 +34,20 @@ class SubscriptionChangeApplyResponse(BaseModel): applied_at: Optional[datetime] = None """When this change was applied.""" + billing_cycle_alignment: Optional[str] = None + """Billing cycle alignment for plan changes.""" + cancelled_at: Optional[datetime] = None """When this change was cancelled.""" + + change_option: Optional[str] = None + """ + How the change is scheduled (e.g., 'immediate', 'end_of_subscription_term', + 'requested_date'). + """ + + effective_date: Optional[datetime] = None + """When this change will take effect.""" + + plan_id: Optional[str] = None + """The target plan ID for plan changes.""" diff --git a/src/orb_sdk/types/subscription_change_cancel_response.py b/src/orb_sdk/types/subscription_change_cancel_response.py index 5f09737..996fa3c 100644 --- a/src/orb_sdk/types/subscription_change_cancel_response.py +++ b/src/orb_sdk/types/subscription_change_cancel_response.py @@ -11,8 +11,17 @@ class SubscriptionChangeCancelResponse(BaseModel): + """ + A subscription change represents a desired new subscription / pending change to an existing subscription. It + is a way to first preview the effects on the subscription as well as any changes/creation of invoices + (see `subscription.changed_resources`). + """ + id: str + change_type: str + """The type of change (e.g., 'schedule_plan_change', 'create_subscription').""" + expiration_time: datetime """ Subscription change will be cancelled at this time and can no longer be applied. @@ -25,5 +34,20 @@ class SubscriptionChangeCancelResponse(BaseModel): applied_at: Optional[datetime] = None """When this change was applied.""" + billing_cycle_alignment: Optional[str] = None + """Billing cycle alignment for plan changes.""" + cancelled_at: Optional[datetime] = None """When this change was cancelled.""" + + change_option: Optional[str] = None + """ + How the change is scheduled (e.g., 'immediate', 'end_of_subscription_term', + 'requested_date'). + """ + + effective_date: Optional[datetime] = None + """When this change will take effect.""" + + plan_id: Optional[str] = None + """The target plan ID for plan changes.""" diff --git a/src/orb_sdk/types/subscription_change_list_params.py b/src/orb_sdk/types/subscription_change_list_params.py new file mode 100644 index 0000000..3d52e7a --- /dev/null +++ b/src/orb_sdk/types/subscription_change_list_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, TypedDict + +__all__ = ["SubscriptionChangeListParams"] + + +class SubscriptionChangeListParams(TypedDict, total=False): + cursor: Optional[str] + """Cursor for pagination. + + This can be populated by the `next_cursor` value returned from the initial + request. + """ + + customer_id: Optional[str] + + external_customer_id: Optional[str] + + limit: int + """The number of items to fetch. Defaults to 20.""" + + status: Optional[Literal["pending", "applied", "cancelled"]] diff --git a/src/orb_sdk/types/subscription_change_list_response.py b/src/orb_sdk/types/subscription_change_list_response.py new file mode 100644 index 0000000..1a706dd --- /dev/null +++ b/src/orb_sdk/types/subscription_change_list_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["SubscriptionChangeListResponse"] + + +class SubscriptionChangeListResponse(BaseModel): + id: str + + expiration_time: datetime + """ + Subscription change will be cancelled at this time and can no longer be applied. + """ + + status: Literal["pending", "applied", "cancelled"] + + subscription_id: Optional[str] = None + + applied_at: Optional[datetime] = None + """When this change was applied.""" + + cancelled_at: Optional[datetime] = None + """When this change was cancelled.""" diff --git a/src/orb_sdk/types/subscription_change_retrieve_response.py b/src/orb_sdk/types/subscription_change_retrieve_response.py index 70d8e63..2cd2a72 100644 --- a/src/orb_sdk/types/subscription_change_retrieve_response.py +++ b/src/orb_sdk/types/subscription_change_retrieve_response.py @@ -11,8 +11,17 @@ class SubscriptionChangeRetrieveResponse(BaseModel): + """ + A subscription change represents a desired new subscription / pending change to an existing subscription. It + is a way to first preview the effects on the subscription as well as any changes/creation of invoices + (see `subscription.changed_resources`). + """ + id: str + change_type: str + """The type of change (e.g., 'schedule_plan_change', 'create_subscription').""" + expiration_time: datetime """ Subscription change will be cancelled at this time and can no longer be applied. @@ -25,5 +34,20 @@ class SubscriptionChangeRetrieveResponse(BaseModel): applied_at: Optional[datetime] = None """When this change was applied.""" + billing_cycle_alignment: Optional[str] = None + """Billing cycle alignment for plan changes.""" + cancelled_at: Optional[datetime] = None """When this change was cancelled.""" + + change_option: Optional[str] = None + """ + How the change is scheduled (e.g., 'immediate', 'end_of_subscription_term', + 'requested_date'). + """ + + effective_date: Optional[datetime] = None + """When this change will take effect.""" + + plan_id: Optional[str] = None + """The target plan ID for plan changes.""" diff --git a/src/orb_sdk/types/subscription_create_params.py b/src/orb_sdk/types/subscription_create_params.py index 47d4c6e..0f45457 100644 --- a/src/orb_sdk/types/subscription_create_params.py +++ b/src/orb_sdk/types/subscription_create_params.py @@ -309,6 +309,8 @@ class AddAdjustment(TypedDict, total=False): class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -317,6 +319,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilte class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -325,6 +329,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier( class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -404,6 +410,9 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -419,6 +428,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=False): class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -427,6 +438,8 @@ class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationCon class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -508,6 +521,9 @@ class AddPricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -525,6 +541,8 @@ class AddPricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total=Fals class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -612,6 +630,9 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -629,6 +650,8 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -716,6 +739,9 @@ class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict, to If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -731,6 +757,8 @@ class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict, to class AddPricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -807,6 +835,9 @@ class AddPricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -822,6 +853,8 @@ class AddPricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -911,6 +944,9 @@ class AddPricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1036,6 +1072,8 @@ class ReplaceAdjustment(TypedDict, total=False): class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -1044,6 +1082,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigF class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -1052,6 +1092,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigT class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -1131,6 +1173,9 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1146,6 +1191,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=Fals class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -1154,6 +1201,8 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProratio class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1235,6 +1284,9 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total= If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1252,6 +1304,8 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total= class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -1341,6 +1395,9 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1358,6 +1415,8 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -1447,6 +1506,9 @@ class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1462,6 +1524,8 @@ class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict class ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -1538,6 +1602,9 @@ class ReplacePricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=Fal If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1553,6 +1620,8 @@ class ReplacePricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=Fal class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -1642,6 +1711,9 @@ class ReplacePricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/subscription_price_intervals_params.py b/src/orb_sdk/types/subscription_price_intervals_params.py index 06df53f..eba9360 100644 --- a/src/orb_sdk/types/subscription_price_intervals_params.py +++ b/src/orb_sdk/types/subscription_price_intervals_params.py @@ -154,6 +154,8 @@ class AddFixedFeeQuantityTransition(TypedDict, total=False): class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -162,6 +164,8 @@ class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDi class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -170,6 +174,8 @@ class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict class AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPriceNewFloatingBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -246,6 +252,9 @@ class AddPriceNewFloatingBulkWithFiltersPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -255,6 +264,8 @@ class AddPriceNewFloatingBulkWithFiltersPrice(TypedDict, total=False): class AddPriceNewFloatingGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -339,6 +350,9 @@ class AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, total=False If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -348,6 +362,8 @@ class AddPriceNewFloatingGroupedWithMinMaxThresholdsPrice(TypedDict, total=False class AddPriceNewFloatingCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -432,6 +448,9 @@ class AddPriceNewFloatingCumulativeGroupedAllocationPrice(TypedDict, total=False If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -441,6 +460,8 @@ class AddPriceNewFloatingCumulativeGroupedAllocationPrice(TypedDict, total=False class AddPriceNewFloatingPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -514,6 +535,9 @@ class AddPriceNewFloatingPercentCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -523,6 +547,8 @@ class AddPriceNewFloatingPercentCompositePrice(TypedDict, total=False): class AddPriceNewFloatingEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -609,6 +635,9 @@ class AddPriceNewFloatingEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/subscription_schedule_plan_change_params.py b/src/orb_sdk/types/subscription_schedule_plan_change_params.py index 2862f63..e2208e2 100644 --- a/src/orb_sdk/types/subscription_schedule_plan_change_params.py +++ b/src/orb_sdk/types/subscription_schedule_plan_change_params.py @@ -297,6 +297,8 @@ class AddAdjustment(TypedDict, total=False): class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -305,6 +307,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilte class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -313,6 +317,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier( class AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[AddPricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -392,6 +398,9 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -407,6 +416,8 @@ class AddPricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=False): class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -415,6 +426,8 @@ class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationCon class AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[AddPricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -496,6 +509,9 @@ class AddPricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -513,6 +529,8 @@ class AddPricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total=Fals class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -600,6 +618,9 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -617,6 +638,8 @@ class AddPricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict, to class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -704,6 +727,9 @@ class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict, to If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -719,6 +745,8 @@ class AddPricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict, to class AddPricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -795,6 +823,9 @@ class AddPricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -810,6 +841,8 @@ class AddPricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=False): class AddPricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -899,6 +932,9 @@ class AddPricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1024,6 +1060,8 @@ class ReplaceAdjustment(TypedDict, total=False): class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): + """Configuration for a single property filter""" + property_key: Required[str] """Event property key to filter on""" @@ -1032,6 +1070,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigF class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + unit_amount: Required[str] """Amount per unit""" @@ -1040,6 +1080,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigT class ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + filters: Required[Iterable[ReplacePricePriceNewSubscriptionBulkWithFiltersPriceBulkWithFiltersConfigFilter]] """Property filters to apply (all must match)""" @@ -1119,6 +1161,9 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=Fals If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1134,6 +1179,8 @@ class ReplacePricePriceNewSubscriptionBulkWithFiltersPrice(TypedDict, total=Fals class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + tier_lower_bound: Required[str] """Inclusive tier starting value""" @@ -1142,6 +1189,8 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProratio class ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): + """Configuration for tiered_with_proration pricing""" + tiers: Required[Iterable[ReplacePricePriceNewSubscriptionTieredWithProrationPriceTieredWithProrationConfigTier]] """ Tiers for rating based on total usage quantities into the specified tier with @@ -1223,6 +1272,9 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total= If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1240,6 +1292,8 @@ class ReplacePricePriceNewSubscriptionTieredWithProrationPrice(TypedDict, total= class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( TypedDict, total=False ): + """Configuration for grouped_with_min_max_thresholds pricing""" + grouping_key: Required[str] """The event property used to group before applying thresholds""" @@ -1329,6 +1383,9 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1346,6 +1403,8 @@ class ReplacePricePriceNewSubscriptionGroupedWithMinMaxThresholdsPrice(TypedDict class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( TypedDict, total=False ): + """Configuration for cumulative_grouped_allocation pricing""" + cumulative_allocation: Required[str] """The overall allocation across all groups""" @@ -1435,6 +1494,9 @@ class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1450,6 +1512,8 @@ class ReplacePricePriceNewSubscriptionCumulativeGroupedAllocationPrice(TypedDict class ReplacePricePriceNewSubscriptionPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + percent: Required[float] """What percent of the component subtotals to charge""" @@ -1526,6 +1590,9 @@ class ReplacePricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=Fal If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1541,6 +1608,8 @@ class ReplacePricePriceNewSubscriptionPercentCompositePrice(TypedDict, total=Fal class ReplacePricePriceNewSubscriptionEventOutputPriceEventOutputConfig(TypedDict, total=False): + """Configuration for event_output pricing""" + unit_rating_key: Required[str] """The key in the event data to extract the unit rate from.""" @@ -1630,6 +1699,9 @@ class ReplacePricePriceNewSubscriptionEventOutputPrice(TypedDict, total=False): If unspecified, a single invoice is produced per billing cycle. """ + license_type_id: Optional[str] + """The ID of the license type to associate with this price.""" + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb_sdk/types/threshold.py b/src/orb_sdk/types/threshold.py index 41cacd4..6b889ab 100644 --- a/src/orb_sdk/types/threshold.py +++ b/src/orb_sdk/types/threshold.py @@ -6,6 +6,10 @@ class Threshold(BaseModel): + """ + Thresholds are used to define the conditions under which an alert will be triggered. + """ + value: float """The value at which an alert will fire. diff --git a/src/orb_sdk/types/threshold_param.py b/src/orb_sdk/types/threshold_param.py index 0ff3e87..a175e35 100644 --- a/src/orb_sdk/types/threshold_param.py +++ b/src/orb_sdk/types/threshold_param.py @@ -8,6 +8,10 @@ class ThresholdParam(TypedDict, total=False): + """ + Thresholds are used to define the conditions under which an alert will be triggered. + """ + value: Required[float] """The value at which an alert will fire. diff --git a/tests/api_resources/beta/test_external_plan_id.py b/tests/api_resources/beta/test_external_plan_id.py index 0ed8ed6..8c1c84b 100644 --- a/tests/api_resources/beta/test_external_plan_id.py +++ b/tests/api_resources/beta/test_external_plan_id.py @@ -71,6 +71,7 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -107,6 +108,7 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -167,6 +169,7 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -203,6 +206,7 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -396,6 +400,7 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -432,6 +437,7 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -492,6 +498,7 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -528,6 +535,7 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, diff --git a/tests/api_resources/customers/test_credits.py b/tests/api_resources/customers/test_credits.py index 029497e..a594773 100644 --- a/tests/api_resources/customers/test_credits.py +++ b/tests/api_resources/customers/test_credits.py @@ -8,6 +8,7 @@ import pytest from orb_sdk import Orb, AsyncOrb +from orb_sdk._utils import parse_datetime from tests.utils import assert_matches_type from orb_sdk.pagination import SyncPage, AsyncPage from orb_sdk.types.customers import ( @@ -34,6 +35,10 @@ def test_method_list_with_all_params(self, client: Orb) -> None: customer_id="customer_id", currency="currency", cursor="cursor", + effective_date_gt=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_gte=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"), include_all_blocks=True, limit=1, ) @@ -83,6 +88,10 @@ def test_method_list_by_external_id_with_all_params(self, client: Orb) -> None: external_customer_id="external_customer_id", currency="currency", cursor="cursor", + effective_date_gt=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_gte=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"), include_all_blocks=True, limit=1, ) @@ -138,6 +147,10 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None customer_id="customer_id", currency="currency", cursor="cursor", + effective_date_gt=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_gte=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"), include_all_blocks=True, limit=1, ) @@ -187,6 +200,10 @@ async def test_method_list_by_external_id_with_all_params(self, async_client: As external_customer_id="external_customer_id", currency="currency", cursor="cursor", + effective_date_gt=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_gte=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"), include_all_blocks=True, limit=1, ) diff --git a/tests/api_resources/licenses/__init__.py b/tests/api_resources/licenses/__init__.py new file mode 100644 index 0000000..fd8019a --- /dev/null +++ b/tests/api_resources/licenses/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/licenses/test_external_licenses.py b/tests/api_resources/licenses/test_external_licenses.py new file mode 100644 index 0000000..e4d63cf --- /dev/null +++ b/tests/api_resources/licenses/test_external_licenses.py @@ -0,0 +1,145 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from orb_sdk import Orb, AsyncOrb +from orb_sdk._utils import parse_date +from tests.utils import assert_matches_type +from orb_sdk.types.licenses import ExternalLicenseGetUsageResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestExternalLicenses: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get_usage(self, client: Orb) -> None: + external_license = client.licenses.external_licenses.get_usage( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + assert_matches_type(ExternalLicenseGetUsageResponse, external_license, path=["response"]) + + @parametrize + def test_method_get_usage_with_all_params(self, client: Orb) -> None: + external_license = client.licenses.external_licenses.get_usage( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + cursor="cursor", + end_date=parse_date("2019-12-27"), + group_by=["string"], + limit=1, + start_date=parse_date("2019-12-27"), + ) + assert_matches_type(ExternalLicenseGetUsageResponse, external_license, path=["response"]) + + @parametrize + def test_raw_response_get_usage(self, client: Orb) -> None: + response = client.licenses.external_licenses.with_raw_response.get_usage( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + external_license = response.parse() + assert_matches_type(ExternalLicenseGetUsageResponse, external_license, path=["response"]) + + @parametrize + def test_streaming_response_get_usage(self, client: Orb) -> None: + with client.licenses.external_licenses.with_streaming_response.get_usage( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + external_license = response.parse() + assert_matches_type(ExternalLicenseGetUsageResponse, external_license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_usage(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_license_id` but received ''"): + client.licenses.external_licenses.with_raw_response.get_usage( + external_license_id="", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + +class TestAsyncExternalLicenses: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_get_usage(self, async_client: AsyncOrb) -> None: + external_license = await async_client.licenses.external_licenses.get_usage( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + assert_matches_type(ExternalLicenseGetUsageResponse, external_license, path=["response"]) + + @parametrize + async def test_method_get_usage_with_all_params(self, async_client: AsyncOrb) -> None: + external_license = await async_client.licenses.external_licenses.get_usage( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + cursor="cursor", + end_date=parse_date("2019-12-27"), + group_by=["string"], + limit=1, + start_date=parse_date("2019-12-27"), + ) + assert_matches_type(ExternalLicenseGetUsageResponse, external_license, path=["response"]) + + @parametrize + async def test_raw_response_get_usage(self, async_client: AsyncOrb) -> None: + response = await async_client.licenses.external_licenses.with_raw_response.get_usage( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + external_license = response.parse() + assert_matches_type(ExternalLicenseGetUsageResponse, external_license, path=["response"]) + + @parametrize + async def test_streaming_response_get_usage(self, async_client: AsyncOrb) -> None: + async with async_client.licenses.external_licenses.with_streaming_response.get_usage( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + external_license = await response.parse() + assert_matches_type(ExternalLicenseGetUsageResponse, external_license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_usage(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_license_id` but received ''"): + await async_client.licenses.external_licenses.with_raw_response.get_usage( + external_license_id="", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) diff --git a/tests/api_resources/licenses/test_usage.py b/tests/api_resources/licenses/test_usage.py new file mode 100644 index 0000000..9acc56c --- /dev/null +++ b/tests/api_resources/licenses/test_usage.py @@ -0,0 +1,222 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from orb_sdk import Orb, AsyncOrb +from orb_sdk._utils import parse_date +from tests.utils import assert_matches_type +from orb_sdk.types.licenses import ( + UsageGetUsageResponse, + UsageGetAllUsageResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestUsage: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_get_all_usage(self, client: Orb) -> None: + usage = client.licenses.usage.get_all_usage( + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + assert_matches_type(UsageGetAllUsageResponse, usage, path=["response"]) + + @parametrize + def test_method_get_all_usage_with_all_params(self, client: Orb) -> None: + usage = client.licenses.usage.get_all_usage( + license_type_id="license_type_id", + subscription_id="subscription_id", + cursor="cursor", + end_date=parse_date("2019-12-27"), + group_by=["string"], + limit=1, + start_date=parse_date("2019-12-27"), + ) + assert_matches_type(UsageGetAllUsageResponse, usage, path=["response"]) + + @parametrize + def test_raw_response_get_all_usage(self, client: Orb) -> None: + response = client.licenses.usage.with_raw_response.get_all_usage( + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + usage = response.parse() + assert_matches_type(UsageGetAllUsageResponse, usage, path=["response"]) + + @parametrize + def test_streaming_response_get_all_usage(self, client: Orb) -> None: + with client.licenses.usage.with_streaming_response.get_all_usage( + license_type_id="license_type_id", + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + usage = response.parse() + assert_matches_type(UsageGetAllUsageResponse, usage, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_get_usage(self, client: Orb) -> None: + usage = client.licenses.usage.get_usage( + license_id="license_id", + ) + assert_matches_type(UsageGetUsageResponse, usage, path=["response"]) + + @parametrize + def test_method_get_usage_with_all_params(self, client: Orb) -> None: + usage = client.licenses.usage.get_usage( + license_id="license_id", + cursor="cursor", + end_date=parse_date("2019-12-27"), + group_by=["string"], + limit=1, + start_date=parse_date("2019-12-27"), + ) + assert_matches_type(UsageGetUsageResponse, usage, path=["response"]) + + @parametrize + def test_raw_response_get_usage(self, client: Orb) -> None: + response = client.licenses.usage.with_raw_response.get_usage( + license_id="license_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + usage = response.parse() + assert_matches_type(UsageGetUsageResponse, usage, path=["response"]) + + @parametrize + def test_streaming_response_get_usage(self, client: Orb) -> None: + with client.licenses.usage.with_streaming_response.get_usage( + license_id="license_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + usage = response.parse() + assert_matches_type(UsageGetUsageResponse, usage, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_usage(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `license_id` but received ''"): + client.licenses.usage.with_raw_response.get_usage( + license_id="", + ) + + +class TestAsyncUsage: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_get_all_usage(self, async_client: AsyncOrb) -> None: + usage = await async_client.licenses.usage.get_all_usage( + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + assert_matches_type(UsageGetAllUsageResponse, usage, path=["response"]) + + @parametrize + async def test_method_get_all_usage_with_all_params(self, async_client: AsyncOrb) -> None: + usage = await async_client.licenses.usage.get_all_usage( + license_type_id="license_type_id", + subscription_id="subscription_id", + cursor="cursor", + end_date=parse_date("2019-12-27"), + group_by=["string"], + limit=1, + start_date=parse_date("2019-12-27"), + ) + assert_matches_type(UsageGetAllUsageResponse, usage, path=["response"]) + + @parametrize + async def test_raw_response_get_all_usage(self, async_client: AsyncOrb) -> None: + response = await async_client.licenses.usage.with_raw_response.get_all_usage( + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + usage = response.parse() + assert_matches_type(UsageGetAllUsageResponse, usage, path=["response"]) + + @parametrize + async def test_streaming_response_get_all_usage(self, async_client: AsyncOrb) -> None: + async with async_client.licenses.usage.with_streaming_response.get_all_usage( + license_type_id="license_type_id", + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + usage = await response.parse() + assert_matches_type(UsageGetAllUsageResponse, usage, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_get_usage(self, async_client: AsyncOrb) -> None: + usage = await async_client.licenses.usage.get_usage( + license_id="license_id", + ) + assert_matches_type(UsageGetUsageResponse, usage, path=["response"]) + + @parametrize + async def test_method_get_usage_with_all_params(self, async_client: AsyncOrb) -> None: + usage = await async_client.licenses.usage.get_usage( + license_id="license_id", + cursor="cursor", + end_date=parse_date("2019-12-27"), + group_by=["string"], + limit=1, + start_date=parse_date("2019-12-27"), + ) + assert_matches_type(UsageGetUsageResponse, usage, path=["response"]) + + @parametrize + async def test_raw_response_get_usage(self, async_client: AsyncOrb) -> None: + response = await async_client.licenses.usage.with_raw_response.get_usage( + license_id="license_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + usage = response.parse() + assert_matches_type(UsageGetUsageResponse, usage, path=["response"]) + + @parametrize + async def test_streaming_response_get_usage(self, async_client: AsyncOrb) -> None: + async with async_client.licenses.usage.with_streaming_response.get_usage( + license_id="license_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + usage = await response.parse() + assert_matches_type(UsageGetUsageResponse, usage, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_usage(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `license_id` but received ''"): + await async_client.licenses.usage.with_raw_response.get_usage( + license_id="", + ) diff --git a/tests/api_resources/plans/test_migrations.py b/tests/api_resources/plans/test_migrations.py new file mode 100644 index 0000000..664dae4 --- /dev/null +++ b/tests/api_resources/plans/test_migrations.py @@ -0,0 +1,315 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from orb_sdk import Orb, AsyncOrb +from tests.utils import assert_matches_type +from orb_sdk.pagination import SyncPage, AsyncPage +from orb_sdk.types.plans import ( + MigrationListResponse, + MigrationCancelResponse, + MigrationRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestMigrations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Orb) -> None: + migration = client.plans.migrations.retrieve( + migration_id="migration_id", + plan_id="plan_id", + ) + assert_matches_type(MigrationRetrieveResponse, migration, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Orb) -> None: + response = client.plans.migrations.with_raw_response.retrieve( + migration_id="migration_id", + plan_id="plan_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + migration = response.parse() + assert_matches_type(MigrationRetrieveResponse, migration, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Orb) -> None: + with client.plans.migrations.with_streaming_response.retrieve( + migration_id="migration_id", + plan_id="plan_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + migration = response.parse() + assert_matches_type(MigrationRetrieveResponse, migration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"): + client.plans.migrations.with_raw_response.retrieve( + migration_id="migration_id", + plan_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `migration_id` but received ''"): + client.plans.migrations.with_raw_response.retrieve( + migration_id="", + plan_id="plan_id", + ) + + @parametrize + def test_method_list(self, client: Orb) -> None: + migration = client.plans.migrations.list( + plan_id="plan_id", + ) + assert_matches_type(SyncPage[MigrationListResponse], migration, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Orb) -> None: + migration = client.plans.migrations.list( + plan_id="plan_id", + cursor="cursor", + limit=1, + ) + assert_matches_type(SyncPage[MigrationListResponse], migration, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Orb) -> None: + response = client.plans.migrations.with_raw_response.list( + plan_id="plan_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + migration = response.parse() + assert_matches_type(SyncPage[MigrationListResponse], migration, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Orb) -> None: + with client.plans.migrations.with_streaming_response.list( + plan_id="plan_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + migration = response.parse() + assert_matches_type(SyncPage[MigrationListResponse], migration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"): + client.plans.migrations.with_raw_response.list( + plan_id="", + ) + + @parametrize + def test_method_cancel(self, client: Orb) -> None: + migration = client.plans.migrations.cancel( + migration_id="migration_id", + plan_id="plan_id", + ) + assert_matches_type(MigrationCancelResponse, migration, path=["response"]) + + @parametrize + def test_raw_response_cancel(self, client: Orb) -> None: + response = client.plans.migrations.with_raw_response.cancel( + migration_id="migration_id", + plan_id="plan_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + migration = response.parse() + assert_matches_type(MigrationCancelResponse, migration, path=["response"]) + + @parametrize + def test_streaming_response_cancel(self, client: Orb) -> None: + with client.plans.migrations.with_streaming_response.cancel( + migration_id="migration_id", + plan_id="plan_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + migration = response.parse() + assert_matches_type(MigrationCancelResponse, migration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_cancel(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"): + client.plans.migrations.with_raw_response.cancel( + migration_id="migration_id", + plan_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `migration_id` but received ''"): + client.plans.migrations.with_raw_response.cancel( + migration_id="", + plan_id="plan_id", + ) + + +class TestAsyncMigrations: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncOrb) -> None: + migration = await async_client.plans.migrations.retrieve( + migration_id="migration_id", + plan_id="plan_id", + ) + assert_matches_type(MigrationRetrieveResponse, migration, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: + response = await async_client.plans.migrations.with_raw_response.retrieve( + migration_id="migration_id", + plan_id="plan_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + migration = response.parse() + assert_matches_type(MigrationRetrieveResponse, migration, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: + async with async_client.plans.migrations.with_streaming_response.retrieve( + migration_id="migration_id", + plan_id="plan_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + migration = await response.parse() + assert_matches_type(MigrationRetrieveResponse, migration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"): + await async_client.plans.migrations.with_raw_response.retrieve( + migration_id="migration_id", + plan_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `migration_id` but received ''"): + await async_client.plans.migrations.with_raw_response.retrieve( + migration_id="", + plan_id="plan_id", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncOrb) -> None: + migration = await async_client.plans.migrations.list( + plan_id="plan_id", + ) + assert_matches_type(AsyncPage[MigrationListResponse], migration, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: + migration = await async_client.plans.migrations.list( + plan_id="plan_id", + cursor="cursor", + limit=1, + ) + assert_matches_type(AsyncPage[MigrationListResponse], migration, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncOrb) -> None: + response = await async_client.plans.migrations.with_raw_response.list( + plan_id="plan_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + migration = response.parse() + assert_matches_type(AsyncPage[MigrationListResponse], migration, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: + async with async_client.plans.migrations.with_streaming_response.list( + plan_id="plan_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + migration = await response.parse() + assert_matches_type(AsyncPage[MigrationListResponse], migration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"): + await async_client.plans.migrations.with_raw_response.list( + plan_id="", + ) + + @parametrize + async def test_method_cancel(self, async_client: AsyncOrb) -> None: + migration = await async_client.plans.migrations.cancel( + migration_id="migration_id", + plan_id="plan_id", + ) + assert_matches_type(MigrationCancelResponse, migration, path=["response"]) + + @parametrize + async def test_raw_response_cancel(self, async_client: AsyncOrb) -> None: + response = await async_client.plans.migrations.with_raw_response.cancel( + migration_id="migration_id", + plan_id="plan_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + migration = response.parse() + assert_matches_type(MigrationCancelResponse, migration, path=["response"]) + + @parametrize + async def test_streaming_response_cancel(self, async_client: AsyncOrb) -> None: + async with async_client.plans.migrations.with_streaming_response.cancel( + migration_id="migration_id", + plan_id="plan_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + migration = await response.parse() + assert_matches_type(MigrationCancelResponse, migration, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_cancel(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `plan_id` but received ''"): + await async_client.plans.migrations.with_raw_response.cancel( + migration_id="migration_id", + plan_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `migration_id` but received ''"): + await async_client.plans.migrations.with_raw_response.cancel( + migration_id="", + plan_id="plan_id", + ) diff --git a/tests/api_resources/test_beta.py b/tests/api_resources/test_beta.py index d4d30f1..a0363be 100644 --- a/tests/api_resources/test_beta.py +++ b/tests/api_resources/test_beta.py @@ -71,6 +71,7 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -107,6 +108,7 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -167,6 +169,7 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -203,6 +206,7 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -396,6 +400,7 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -432,6 +437,7 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -492,6 +498,7 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -528,6 +535,7 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, diff --git a/tests/api_resources/test_credit_blocks.py b/tests/api_resources/test_credit_blocks.py new file mode 100644 index 0000000..f69ea02 --- /dev/null +++ b/tests/api_resources/test_credit_blocks.py @@ -0,0 +1,252 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from orb_sdk import Orb, AsyncOrb +from orb_sdk.types import CreditBlockRetrieveResponse, CreditBlockListInvoicesResponse +from tests.utils import assert_matches_type + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestCreditBlocks: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Orb) -> None: + credit_block = client.credit_blocks.retrieve( + "block_id", + ) + assert_matches_type(CreditBlockRetrieveResponse, credit_block, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Orb) -> None: + response = client.credit_blocks.with_raw_response.retrieve( + "block_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + credit_block = response.parse() + assert_matches_type(CreditBlockRetrieveResponse, credit_block, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Orb) -> None: + with client.credit_blocks.with_streaming_response.retrieve( + "block_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + credit_block = response.parse() + assert_matches_type(CreditBlockRetrieveResponse, credit_block, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `block_id` but received ''"): + client.credit_blocks.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_delete(self, client: Orb) -> None: + credit_block = client.credit_blocks.delete( + "block_id", + ) + assert credit_block is None + + @parametrize + def test_raw_response_delete(self, client: Orb) -> None: + response = client.credit_blocks.with_raw_response.delete( + "block_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + credit_block = response.parse() + assert credit_block is None + + @parametrize + def test_streaming_response_delete(self, client: Orb) -> None: + with client.credit_blocks.with_streaming_response.delete( + "block_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + credit_block = response.parse() + assert credit_block is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `block_id` but received ''"): + client.credit_blocks.with_raw_response.delete( + "", + ) + + @parametrize + def test_method_list_invoices(self, client: Orb) -> None: + credit_block = client.credit_blocks.list_invoices( + "block_id", + ) + assert_matches_type(CreditBlockListInvoicesResponse, credit_block, path=["response"]) + + @parametrize + def test_raw_response_list_invoices(self, client: Orb) -> None: + response = client.credit_blocks.with_raw_response.list_invoices( + "block_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + credit_block = response.parse() + assert_matches_type(CreditBlockListInvoicesResponse, credit_block, path=["response"]) + + @parametrize + def test_streaming_response_list_invoices(self, client: Orb) -> None: + with client.credit_blocks.with_streaming_response.list_invoices( + "block_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + credit_block = response.parse() + assert_matches_type(CreditBlockListInvoicesResponse, credit_block, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list_invoices(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `block_id` but received ''"): + client.credit_blocks.with_raw_response.list_invoices( + "", + ) + + +class TestAsyncCreditBlocks: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncOrb) -> None: + credit_block = await async_client.credit_blocks.retrieve( + "block_id", + ) + assert_matches_type(CreditBlockRetrieveResponse, credit_block, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: + response = await async_client.credit_blocks.with_raw_response.retrieve( + "block_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + credit_block = response.parse() + assert_matches_type(CreditBlockRetrieveResponse, credit_block, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: + async with async_client.credit_blocks.with_streaming_response.retrieve( + "block_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + credit_block = await response.parse() + assert_matches_type(CreditBlockRetrieveResponse, credit_block, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `block_id` but received ''"): + await async_client.credit_blocks.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncOrb) -> None: + credit_block = await async_client.credit_blocks.delete( + "block_id", + ) + assert credit_block is None + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncOrb) -> None: + response = await async_client.credit_blocks.with_raw_response.delete( + "block_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + credit_block = response.parse() + assert credit_block is None + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncOrb) -> None: + async with async_client.credit_blocks.with_streaming_response.delete( + "block_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + credit_block = await response.parse() + assert credit_block is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `block_id` but received ''"): + await async_client.credit_blocks.with_raw_response.delete( + "", + ) + + @parametrize + async def test_method_list_invoices(self, async_client: AsyncOrb) -> None: + credit_block = await async_client.credit_blocks.list_invoices( + "block_id", + ) + assert_matches_type(CreditBlockListInvoicesResponse, credit_block, path=["response"]) + + @parametrize + async def test_raw_response_list_invoices(self, async_client: AsyncOrb) -> None: + response = await async_client.credit_blocks.with_raw_response.list_invoices( + "block_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + credit_block = response.parse() + assert_matches_type(CreditBlockListInvoicesResponse, credit_block, path=["response"]) + + @parametrize + async def test_streaming_response_list_invoices(self, async_client: AsyncOrb) -> None: + async with async_client.credit_blocks.with_streaming_response.list_invoices( + "block_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + credit_block = await response.parse() + assert_matches_type(CreditBlockListInvoicesResponse, credit_block, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list_invoices(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `block_id` but received ''"): + await async_client.credit_blocks.with_raw_response.list_invoices( + "", + ) diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 22c4638..5f262f7 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -62,6 +62,14 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "parent_customer_id": "parent_customer_id", }, metadata={"foo": "string"}, + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -155,6 +163,14 @@ def test_method_update_with_all_params(self, client: Orb) -> None: }, metadata={"foo": "string"}, name="name", + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -479,6 +495,14 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None }, metadata={"foo": "string"}, name="name", + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -582,6 +606,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "parent_customer_id": "parent_customer_id", }, metadata={"foo": "string"}, + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -675,6 +707,14 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No }, metadata={"foo": "string"}, name="name", + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, @@ -1011,6 +1051,14 @@ async def test_method_update_by_external_id_with_all_params(self, async_client: }, metadata={"foo": "string"}, name="name", + payment_configuration={ + "payment_providers": [ + { + "provider_type": "stripe", + "excluded_payment_method_types": ["string"], + } + ] + }, payment_provider="quickbooks", payment_provider_id="payment_provider_id", reporting_configuration={"exempt": True}, diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index 1e5ea47..f9cfb4e 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -9,6 +9,8 @@ from orb_sdk import Orb, AsyncOrb from orb_sdk.types import ( + InvoiceListSummaryResponse, + InvoiceIssueSummaryResponse, InvoiceFetchUpcomingResponse, ) from orb_sdk._utils import parse_date, parse_datetime @@ -230,6 +232,54 @@ def test_streaming_response_list(self, client: Orb) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_delete_line_item(self, client: Orb) -> None: + invoice = client.invoices.delete_line_item( + line_item_id="line_item_id", + invoice_id="invoice_id", + ) + assert invoice is None + + @parametrize + def test_raw_response_delete_line_item(self, client: Orb) -> None: + response = client.invoices.with_raw_response.delete_line_item( + line_item_id="line_item_id", + invoice_id="invoice_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invoice = response.parse() + assert invoice is None + + @parametrize + def test_streaming_response_delete_line_item(self, client: Orb) -> None: + with client.invoices.with_streaming_response.delete_line_item( + line_item_id="line_item_id", + invoice_id="invoice_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invoice = response.parse() + assert invoice is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete_line_item(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invoice_id` but received ''"): + client.invoices.with_raw_response.delete_line_item( + line_item_id="line_item_id", + invoice_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `line_item_id` but received ''"): + client.invoices.with_raw_response.delete_line_item( + line_item_id="", + invoice_id="invoice_id", + ) + @parametrize def test_method_fetch(self, client: Orb) -> None: invoice = client.invoices.fetch( @@ -345,6 +395,102 @@ def test_path_params_issue(self, client: Orb) -> None: invoice_id="", ) + @parametrize + def test_method_issue_summary(self, client: Orb) -> None: + invoice = client.invoices.issue_summary( + invoice_id="invoice_id", + ) + assert_matches_type(InvoiceIssueSummaryResponse, invoice, path=["response"]) + + @parametrize + def test_method_issue_summary_with_all_params(self, client: Orb) -> None: + invoice = client.invoices.issue_summary( + invoice_id="invoice_id", + synchronous=True, + ) + assert_matches_type(InvoiceIssueSummaryResponse, invoice, path=["response"]) + + @parametrize + def test_raw_response_issue_summary(self, client: Orb) -> None: + response = client.invoices.with_raw_response.issue_summary( + invoice_id="invoice_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invoice = response.parse() + assert_matches_type(InvoiceIssueSummaryResponse, invoice, path=["response"]) + + @parametrize + def test_streaming_response_issue_summary(self, client: Orb) -> None: + with client.invoices.with_streaming_response.issue_summary( + invoice_id="invoice_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invoice = response.parse() + assert_matches_type(InvoiceIssueSummaryResponse, invoice, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_issue_summary(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invoice_id` but received ''"): + client.invoices.with_raw_response.issue_summary( + invoice_id="", + ) + + @parametrize + def test_method_list_summary(self, client: Orb) -> None: + invoice = client.invoices.list_summary() + assert_matches_type(SyncPage[InvoiceListSummaryResponse], invoice, path=["response"]) + + @parametrize + def test_method_list_summary_with_all_params(self, client: Orb) -> None: + invoice = client.invoices.list_summary( + amount="amount", + amount_gt="amount[gt]", + amount_lt="amount[lt]", + cursor="cursor", + customer_id="customer_id", + date_type="due_date", + due_date=parse_date("2019-12-27"), + due_date_window="due_date_window", + due_date_gt=parse_date("2019-12-27"), + due_date_lt=parse_date("2019-12-27"), + external_customer_id="external_customer_id", + invoice_date_gt=parse_datetime("2019-12-27T18:11:19.117Z"), + invoice_date_gte=parse_datetime("2019-12-27T18:11:19.117Z"), + invoice_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"), + invoice_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"), + is_recurring=True, + limit=1, + status="draft", + subscription_id="subscription_id", + ) + assert_matches_type(SyncPage[InvoiceListSummaryResponse], invoice, path=["response"]) + + @parametrize + def test_raw_response_list_summary(self, client: Orb) -> None: + response = client.invoices.with_raw_response.list_summary() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invoice = response.parse() + assert_matches_type(SyncPage[InvoiceListSummaryResponse], invoice, path=["response"]) + + @parametrize + def test_streaming_response_list_summary(self, client: Orb) -> None: + with client.invoices.with_streaming_response.list_summary() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invoice = response.parse() + assert_matches_type(SyncPage[InvoiceListSummaryResponse], invoice, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_mark_paid(self, client: Orb) -> None: invoice = client.invoices.mark_paid( @@ -687,6 +833,54 @@ async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_delete_line_item(self, async_client: AsyncOrb) -> None: + invoice = await async_client.invoices.delete_line_item( + line_item_id="line_item_id", + invoice_id="invoice_id", + ) + assert invoice is None + + @parametrize + async def test_raw_response_delete_line_item(self, async_client: AsyncOrb) -> None: + response = await async_client.invoices.with_raw_response.delete_line_item( + line_item_id="line_item_id", + invoice_id="invoice_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invoice = response.parse() + assert invoice is None + + @parametrize + async def test_streaming_response_delete_line_item(self, async_client: AsyncOrb) -> None: + async with async_client.invoices.with_streaming_response.delete_line_item( + line_item_id="line_item_id", + invoice_id="invoice_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invoice = await response.parse() + assert invoice is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete_line_item(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invoice_id` but received ''"): + await async_client.invoices.with_raw_response.delete_line_item( + line_item_id="line_item_id", + invoice_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `line_item_id` but received ''"): + await async_client.invoices.with_raw_response.delete_line_item( + line_item_id="", + invoice_id="invoice_id", + ) + @parametrize async def test_method_fetch(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.fetch( @@ -802,6 +996,102 @@ async def test_path_params_issue(self, async_client: AsyncOrb) -> None: invoice_id="", ) + @parametrize + async def test_method_issue_summary(self, async_client: AsyncOrb) -> None: + invoice = await async_client.invoices.issue_summary( + invoice_id="invoice_id", + ) + assert_matches_type(InvoiceIssueSummaryResponse, invoice, path=["response"]) + + @parametrize + async def test_method_issue_summary_with_all_params(self, async_client: AsyncOrb) -> None: + invoice = await async_client.invoices.issue_summary( + invoice_id="invoice_id", + synchronous=True, + ) + assert_matches_type(InvoiceIssueSummaryResponse, invoice, path=["response"]) + + @parametrize + async def test_raw_response_issue_summary(self, async_client: AsyncOrb) -> None: + response = await async_client.invoices.with_raw_response.issue_summary( + invoice_id="invoice_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invoice = response.parse() + assert_matches_type(InvoiceIssueSummaryResponse, invoice, path=["response"]) + + @parametrize + async def test_streaming_response_issue_summary(self, async_client: AsyncOrb) -> None: + async with async_client.invoices.with_streaming_response.issue_summary( + invoice_id="invoice_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invoice = await response.parse() + assert_matches_type(InvoiceIssueSummaryResponse, invoice, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_issue_summary(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invoice_id` but received ''"): + await async_client.invoices.with_raw_response.issue_summary( + invoice_id="", + ) + + @parametrize + async def test_method_list_summary(self, async_client: AsyncOrb) -> None: + invoice = await async_client.invoices.list_summary() + assert_matches_type(AsyncPage[InvoiceListSummaryResponse], invoice, path=["response"]) + + @parametrize + async def test_method_list_summary_with_all_params(self, async_client: AsyncOrb) -> None: + invoice = await async_client.invoices.list_summary( + amount="amount", + amount_gt="amount[gt]", + amount_lt="amount[lt]", + cursor="cursor", + customer_id="customer_id", + date_type="due_date", + due_date=parse_date("2019-12-27"), + due_date_window="due_date_window", + due_date_gt=parse_date("2019-12-27"), + due_date_lt=parse_date("2019-12-27"), + external_customer_id="external_customer_id", + invoice_date_gt=parse_datetime("2019-12-27T18:11:19.117Z"), + invoice_date_gte=parse_datetime("2019-12-27T18:11:19.117Z"), + invoice_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"), + invoice_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"), + is_recurring=True, + limit=1, + status="draft", + subscription_id="subscription_id", + ) + assert_matches_type(AsyncPage[InvoiceListSummaryResponse], invoice, path=["response"]) + + @parametrize + async def test_raw_response_list_summary(self, async_client: AsyncOrb) -> None: + response = await async_client.invoices.with_raw_response.list_summary() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invoice = response.parse() + assert_matches_type(AsyncPage[InvoiceListSummaryResponse], invoice, path=["response"]) + + @parametrize + async def test_streaming_response_list_summary(self, async_client: AsyncOrb) -> None: + async with async_client.invoices.with_streaming_response.list_summary() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invoice = await response.parse() + assert_matches_type(AsyncPage[InvoiceListSummaryResponse], invoice, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_mark_paid(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.mark_paid( diff --git a/tests/api_resources/test_license_types.py b/tests/api_resources/test_license_types.py new file mode 100644 index 0000000..5700c29 --- /dev/null +++ b/tests/api_resources/test_license_types.py @@ -0,0 +1,239 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from orb_sdk import Orb, AsyncOrb +from orb_sdk.types import ( + LicenseTypeListResponse, + LicenseTypeCreateResponse, + LicenseTypeRetrieveResponse, +) +from tests.utils import assert_matches_type +from orb_sdk.pagination import SyncPage, AsyncPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLicenseTypes: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Orb) -> None: + license_type = client.license_types.create( + grouping_key="grouping_key", + name="name", + ) + assert_matches_type(LicenseTypeCreateResponse, license_type, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Orb) -> None: + response = client.license_types.with_raw_response.create( + grouping_key="grouping_key", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license_type = response.parse() + assert_matches_type(LicenseTypeCreateResponse, license_type, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Orb) -> None: + with client.license_types.with_streaming_response.create( + grouping_key="grouping_key", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license_type = response.parse() + assert_matches_type(LicenseTypeCreateResponse, license_type, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Orb) -> None: + license_type = client.license_types.retrieve( + "license_type_id", + ) + assert_matches_type(LicenseTypeRetrieveResponse, license_type, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Orb) -> None: + response = client.license_types.with_raw_response.retrieve( + "license_type_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license_type = response.parse() + assert_matches_type(LicenseTypeRetrieveResponse, license_type, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Orb) -> None: + with client.license_types.with_streaming_response.retrieve( + "license_type_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license_type = response.parse() + assert_matches_type(LicenseTypeRetrieveResponse, license_type, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `license_type_id` but received ''"): + client.license_types.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Orb) -> None: + license_type = client.license_types.list() + assert_matches_type(SyncPage[LicenseTypeListResponse], license_type, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Orb) -> None: + license_type = client.license_types.list( + cursor="cursor", + limit=1, + ) + assert_matches_type(SyncPage[LicenseTypeListResponse], license_type, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Orb) -> None: + response = client.license_types.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license_type = response.parse() + assert_matches_type(SyncPage[LicenseTypeListResponse], license_type, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Orb) -> None: + with client.license_types.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license_type = response.parse() + assert_matches_type(SyncPage[LicenseTypeListResponse], license_type, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncLicenseTypes: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncOrb) -> None: + license_type = await async_client.license_types.create( + grouping_key="grouping_key", + name="name", + ) + assert_matches_type(LicenseTypeCreateResponse, license_type, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncOrb) -> None: + response = await async_client.license_types.with_raw_response.create( + grouping_key="grouping_key", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license_type = response.parse() + assert_matches_type(LicenseTypeCreateResponse, license_type, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: + async with async_client.license_types.with_streaming_response.create( + grouping_key="grouping_key", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license_type = await response.parse() + assert_matches_type(LicenseTypeCreateResponse, license_type, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncOrb) -> None: + license_type = await async_client.license_types.retrieve( + "license_type_id", + ) + assert_matches_type(LicenseTypeRetrieveResponse, license_type, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: + response = await async_client.license_types.with_raw_response.retrieve( + "license_type_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license_type = response.parse() + assert_matches_type(LicenseTypeRetrieveResponse, license_type, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: + async with async_client.license_types.with_streaming_response.retrieve( + "license_type_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license_type = await response.parse() + assert_matches_type(LicenseTypeRetrieveResponse, license_type, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `license_type_id` but received ''"): + await async_client.license_types.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncOrb) -> None: + license_type = await async_client.license_types.list() + assert_matches_type(AsyncPage[LicenseTypeListResponse], license_type, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: + license_type = await async_client.license_types.list( + cursor="cursor", + limit=1, + ) + assert_matches_type(AsyncPage[LicenseTypeListResponse], license_type, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncOrb) -> None: + response = await async_client.license_types.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license_type = response.parse() + assert_matches_type(AsyncPage[LicenseTypeListResponse], license_type, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: + async with async_client.license_types.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license_type = await response.parse() + assert_matches_type(AsyncPage[LicenseTypeListResponse], license_type, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_licenses.py b/tests/api_resources/test_licenses.py new file mode 100644 index 0000000..f0d7745 --- /dev/null +++ b/tests/api_resources/test_licenses.py @@ -0,0 +1,474 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from orb_sdk import Orb, AsyncOrb +from orb_sdk.types import ( + LicenseListResponse, + LicenseCreateResponse, + LicenseRetrieveResponse, + LicenseDeactivateResponse, + LicenseRetrieveByExternalIDResponse, +) +from orb_sdk._utils import parse_date +from tests.utils import assert_matches_type +from orb_sdk.pagination import SyncPage, AsyncPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLicenses: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Orb) -> None: + license = client.licenses.create( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + assert_matches_type(LicenseCreateResponse, license, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Orb) -> None: + license = client.licenses.create( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + end_date=parse_date("2026-01-27"), + start_date=parse_date("2026-01-27"), + ) + assert_matches_type(LicenseCreateResponse, license, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Orb) -> None: + response = client.licenses.with_raw_response.create( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(LicenseCreateResponse, license, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Orb) -> None: + with client.licenses.with_streaming_response.create( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = response.parse() + assert_matches_type(LicenseCreateResponse, license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Orb) -> None: + license = client.licenses.retrieve( + "license_id", + ) + assert_matches_type(LicenseRetrieveResponse, license, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Orb) -> None: + response = client.licenses.with_raw_response.retrieve( + "license_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(LicenseRetrieveResponse, license, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Orb) -> None: + with client.licenses.with_streaming_response.retrieve( + "license_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = response.parse() + assert_matches_type(LicenseRetrieveResponse, license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `license_id` but received ''"): + client.licenses.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Orb) -> None: + license = client.licenses.list( + subscription_id="subscription_id", + ) + assert_matches_type(SyncPage[LicenseListResponse], license, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Orb) -> None: + license = client.licenses.list( + subscription_id="subscription_id", + cursor="cursor", + external_license_id="external_license_id", + license_type_id="license_type_id", + limit=1, + status="active", + ) + assert_matches_type(SyncPage[LicenseListResponse], license, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Orb) -> None: + response = client.licenses.with_raw_response.list( + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(SyncPage[LicenseListResponse], license, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Orb) -> None: + with client.licenses.with_streaming_response.list( + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = response.parse() + assert_matches_type(SyncPage[LicenseListResponse], license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_deactivate(self, client: Orb) -> None: + license = client.licenses.deactivate( + license_id="license_id", + ) + assert_matches_type(LicenseDeactivateResponse, license, path=["response"]) + + @parametrize + def test_method_deactivate_with_all_params(self, client: Orb) -> None: + license = client.licenses.deactivate( + license_id="license_id", + end_date=parse_date("2026-01-27"), + ) + assert_matches_type(LicenseDeactivateResponse, license, path=["response"]) + + @parametrize + def test_raw_response_deactivate(self, client: Orb) -> None: + response = client.licenses.with_raw_response.deactivate( + license_id="license_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(LicenseDeactivateResponse, license, path=["response"]) + + @parametrize + def test_streaming_response_deactivate(self, client: Orb) -> None: + with client.licenses.with_streaming_response.deactivate( + license_id="license_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = response.parse() + assert_matches_type(LicenseDeactivateResponse, license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_deactivate(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `license_id` but received ''"): + client.licenses.with_raw_response.deactivate( + license_id="", + ) + + @parametrize + def test_method_retrieve_by_external_id(self, client: Orb) -> None: + license = client.licenses.retrieve_by_external_id( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + assert_matches_type(LicenseRetrieveByExternalIDResponse, license, path=["response"]) + + @parametrize + def test_raw_response_retrieve_by_external_id(self, client: Orb) -> None: + response = client.licenses.with_raw_response.retrieve_by_external_id( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(LicenseRetrieveByExternalIDResponse, license, path=["response"]) + + @parametrize + def test_streaming_response_retrieve_by_external_id(self, client: Orb) -> None: + with client.licenses.with_streaming_response.retrieve_by_external_id( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = response.parse() + assert_matches_type(LicenseRetrieveByExternalIDResponse, license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve_by_external_id(self, client: Orb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_license_id` but received ''"): + client.licenses.with_raw_response.retrieve_by_external_id( + external_license_id="", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + +class TestAsyncLicenses: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncOrb) -> None: + license = await async_client.licenses.create( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + assert_matches_type(LicenseCreateResponse, license, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: + license = await async_client.licenses.create( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + end_date=parse_date("2026-01-27"), + start_date=parse_date("2026-01-27"), + ) + assert_matches_type(LicenseCreateResponse, license, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncOrb) -> None: + response = await async_client.licenses.with_raw_response.create( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(LicenseCreateResponse, license, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: + async with async_client.licenses.with_streaming_response.create( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = await response.parse() + assert_matches_type(LicenseCreateResponse, license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncOrb) -> None: + license = await async_client.licenses.retrieve( + "license_id", + ) + assert_matches_type(LicenseRetrieveResponse, license, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncOrb) -> None: + response = await async_client.licenses.with_raw_response.retrieve( + "license_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(LicenseRetrieveResponse, license, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncOrb) -> None: + async with async_client.licenses.with_streaming_response.retrieve( + "license_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = await response.parse() + assert_matches_type(LicenseRetrieveResponse, license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `license_id` but received ''"): + await async_client.licenses.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncOrb) -> None: + license = await async_client.licenses.list( + subscription_id="subscription_id", + ) + assert_matches_type(AsyncPage[LicenseListResponse], license, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: + license = await async_client.licenses.list( + subscription_id="subscription_id", + cursor="cursor", + external_license_id="external_license_id", + license_type_id="license_type_id", + limit=1, + status="active", + ) + assert_matches_type(AsyncPage[LicenseListResponse], license, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncOrb) -> None: + response = await async_client.licenses.with_raw_response.list( + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(AsyncPage[LicenseListResponse], license, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: + async with async_client.licenses.with_streaming_response.list( + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = await response.parse() + assert_matches_type(AsyncPage[LicenseListResponse], license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_deactivate(self, async_client: AsyncOrb) -> None: + license = await async_client.licenses.deactivate( + license_id="license_id", + ) + assert_matches_type(LicenseDeactivateResponse, license, path=["response"]) + + @parametrize + async def test_method_deactivate_with_all_params(self, async_client: AsyncOrb) -> None: + license = await async_client.licenses.deactivate( + license_id="license_id", + end_date=parse_date("2026-01-27"), + ) + assert_matches_type(LicenseDeactivateResponse, license, path=["response"]) + + @parametrize + async def test_raw_response_deactivate(self, async_client: AsyncOrb) -> None: + response = await async_client.licenses.with_raw_response.deactivate( + license_id="license_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(LicenseDeactivateResponse, license, path=["response"]) + + @parametrize + async def test_streaming_response_deactivate(self, async_client: AsyncOrb) -> None: + async with async_client.licenses.with_streaming_response.deactivate( + license_id="license_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = await response.parse() + assert_matches_type(LicenseDeactivateResponse, license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_deactivate(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `license_id` but received ''"): + await async_client.licenses.with_raw_response.deactivate( + license_id="", + ) + + @parametrize + async def test_method_retrieve_by_external_id(self, async_client: AsyncOrb) -> None: + license = await async_client.licenses.retrieve_by_external_id( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + assert_matches_type(LicenseRetrieveByExternalIDResponse, license, path=["response"]) + + @parametrize + async def test_raw_response_retrieve_by_external_id(self, async_client: AsyncOrb) -> None: + response = await async_client.licenses.with_raw_response.retrieve_by_external_id( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + license = response.parse() + assert_matches_type(LicenseRetrieveByExternalIDResponse, license, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve_by_external_id(self, async_client: AsyncOrb) -> None: + async with async_client.licenses.with_streaming_response.retrieve_by_external_id( + external_license_id="external_license_id", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + license = await response.parse() + assert_matches_type(LicenseRetrieveByExternalIDResponse, license, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve_by_external_id(self, async_client: AsyncOrb) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `external_license_id` but received ''"): + await async_client.licenses.with_raw_response.retrieve_by_external_id( + external_license_id="", + license_type_id="license_type_id", + subscription_id="subscription_id", + ) diff --git a/tests/api_resources/test_plans.py b/tests/api_resources/test_plans.py index cc23532..e7a5bed 100644 --- a/tests/api_resources/test_plans.py +++ b/tests/api_resources/test_plans.py @@ -52,6 +52,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -88,6 +89,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -321,6 +323,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "plan_phase_order": 0, @@ -357,6 +360,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index c5ff6d2..d4a9456 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -71,6 +71,7 @@ def test_method_create_with_all_params_overload_1(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -169,6 +170,7 @@ def test_method_create_with_all_params_overload_2(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -272,6 +274,7 @@ def test_method_create_with_all_params_overload_3(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -379,6 +382,7 @@ def test_method_create_with_all_params_overload_4(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -483,6 +487,7 @@ def test_method_create_with_all_params_overload_5(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -589,6 +594,7 @@ def test_method_create_with_all_params_overload_6(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -712,6 +718,7 @@ def test_method_create_with_all_params_overload_7(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -840,6 +847,7 @@ def test_method_create_with_all_params_overload_8(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -974,6 +982,7 @@ def test_method_create_with_all_params_overload_9(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1106,6 +1115,7 @@ def test_method_create_with_all_params_overload_10(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1240,6 +1250,7 @@ def test_method_create_with_all_params_overload_11(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1358,6 +1369,7 @@ def test_method_create_with_all_params_overload_12(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1454,6 +1466,7 @@ def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1562,6 +1575,7 @@ def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1678,6 +1692,7 @@ def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1774,6 +1789,7 @@ def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1864,6 +1880,7 @@ def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1965,6 +1982,7 @@ def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2055,6 +2073,7 @@ def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2179,6 +2198,7 @@ def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2305,6 +2325,7 @@ def test_method_create_with_all_params_overload_21(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2415,6 +2436,7 @@ def test_method_create_with_all_params_overload_22(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2541,6 +2563,7 @@ def test_method_create_with_all_params_overload_23(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2675,6 +2698,7 @@ def test_method_create_with_all_params_overload_24(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2804,6 +2828,7 @@ def test_method_create_with_all_params_overload_25(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2942,6 +2967,7 @@ def test_method_create_with_all_params_overload_26(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3078,6 +3104,7 @@ def test_method_create_with_all_params_overload_27(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3188,6 +3215,7 @@ def test_method_create_with_all_params_overload_28(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3242,8 +3270,8 @@ def test_method_create_overload_29(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - minimum_config={"minimum_amount": "minimum_amount"}, - model_type="minimum", + minimum_composite_config={"minimum_amount": "minimum_amount"}, + model_type="minimum_composite", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -3254,11 +3282,11 @@ def test_method_create_with_all_params_overload_29(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - minimum_config={ + minimum_composite_config={ "minimum_amount": "minimum_amount", "prorated": True, }, - model_type="minimum", + model_type="minimum_composite", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -3283,6 +3311,7 @@ def test_method_create_with_all_params_overload_29(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3293,8 +3322,8 @@ def test_raw_response_create_overload_29(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - minimum_config={"minimum_amount": "minimum_amount"}, - model_type="minimum", + minimum_composite_config={"minimum_amount": "minimum_amount"}, + model_type="minimum_composite", name="Annual fee", ) @@ -3309,8 +3338,8 @@ def test_streaming_response_create_overload_29(self, client: Orb) -> None: cadence="annual", currency="currency", item_id="item_id", - minimum_config={"minimum_amount": "minimum_amount"}, - model_type="minimum", + minimum_composite_config={"minimum_amount": "minimum_amount"}, + model_type="minimum_composite", name="Annual fee", ) as response: assert not response.is_closed @@ -3365,6 +3394,7 @@ def test_method_create_with_all_params_overload_30(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3451,6 +3481,7 @@ def test_method_create_with_all_params_overload_31(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3680,6 +3711,7 @@ def test_method_evaluate_multiple_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, }, "price_id": "price_id", @@ -3776,6 +3808,7 @@ def test_method_evaluate_preview_events_with_all_params(self, client: Orb) -> No "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, }, "price_id": "price_id", @@ -3901,6 +3934,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3999,6 +4033,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4102,6 +4137,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4209,6 +4245,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4313,6 +4350,7 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4419,6 +4457,7 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4542,6 +4581,7 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4670,6 +4710,7 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4804,6 +4845,7 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -4936,6 +4978,7 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5070,6 +5113,7 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5188,6 +5232,7 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5284,6 +5329,7 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5392,6 +5438,7 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5508,6 +5555,7 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5604,6 +5652,7 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5694,6 +5743,7 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5795,6 +5845,7 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -5885,6 +5936,7 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -6009,6 +6061,7 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -6135,6 +6188,7 @@ async def test_method_create_with_all_params_overload_21(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -6245,6 +6299,7 @@ async def test_method_create_with_all_params_overload_22(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -6371,6 +6426,7 @@ async def test_method_create_with_all_params_overload_23(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -6505,6 +6561,7 @@ async def test_method_create_with_all_params_overload_24(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -6634,6 +6691,7 @@ async def test_method_create_with_all_params_overload_25(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -6772,6 +6830,7 @@ async def test_method_create_with_all_params_overload_26(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -6908,6 +6967,7 @@ async def test_method_create_with_all_params_overload_27(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -7018,6 +7078,7 @@ async def test_method_create_with_all_params_overload_28(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -7072,8 +7133,8 @@ async def test_method_create_overload_29(self, async_client: AsyncOrb) -> None: cadence="annual", currency="currency", item_id="item_id", - minimum_config={"minimum_amount": "minimum_amount"}, - model_type="minimum", + minimum_composite_config={"minimum_amount": "minimum_amount"}, + model_type="minimum_composite", name="Annual fee", ) assert_matches_type(Price, price, path=["response"]) @@ -7084,11 +7145,11 @@ async def test_method_create_with_all_params_overload_29(self, async_client: Asy cadence="annual", currency="currency", item_id="item_id", - minimum_config={ + minimum_composite_config={ "minimum_amount": "minimum_amount", "prorated": True, }, - model_type="minimum", + model_type="minimum_composite", name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, @@ -7113,6 +7174,7 @@ async def test_method_create_with_all_params_overload_29(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -7123,8 +7185,8 @@ async def test_raw_response_create_overload_29(self, async_client: AsyncOrb) -> cadence="annual", currency="currency", item_id="item_id", - minimum_config={"minimum_amount": "minimum_amount"}, - model_type="minimum", + minimum_composite_config={"minimum_amount": "minimum_amount"}, + model_type="minimum_composite", name="Annual fee", ) @@ -7139,8 +7201,8 @@ async def test_streaming_response_create_overload_29(self, async_client: AsyncOr cadence="annual", currency="currency", item_id="item_id", - minimum_config={"minimum_amount": "minimum_amount"}, - model_type="minimum", + minimum_composite_config={"minimum_amount": "minimum_amount"}, + model_type="minimum_composite", name="Annual fee", ) as response: assert not response.is_closed @@ -7195,6 +7257,7 @@ async def test_method_create_with_all_params_overload_30(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -7281,6 +7344,7 @@ async def test_method_create_with_all_params_overload_31(self, async_client: Asy "duration": 0, "duration_unit": "day", }, + license_type_id="license_type_id", metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -7510,6 +7574,7 @@ async def test_method_evaluate_multiple_with_all_params(self, async_client: Asyn "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, }, "price_id": "price_id", @@ -7606,6 +7671,7 @@ async def test_method_evaluate_preview_events_with_all_params(self, async_client "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, }, "price_id": "price_id", diff --git a/tests/api_resources/test_subscription_changes.py b/tests/api_resources/test_subscription_changes.py index 7639cb0..96cea88 100644 --- a/tests/api_resources/test_subscription_changes.py +++ b/tests/api_resources/test_subscription_changes.py @@ -9,12 +9,14 @@ from orb_sdk import Orb, AsyncOrb from orb_sdk.types import ( + SubscriptionChangeListResponse, SubscriptionChangeApplyResponse, SubscriptionChangeCancelResponse, SubscriptionChangeRetrieveResponse, ) from orb_sdk._utils import parse_date from tests.utils import assert_matches_type +from orb_sdk.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -62,6 +64,42 @@ def test_path_params_retrieve(self, client: Orb) -> None: "", ) + @parametrize + def test_method_list(self, client: Orb) -> None: + subscription_change = client.subscription_changes.list() + assert_matches_type(SyncPage[SubscriptionChangeListResponse], subscription_change, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Orb) -> None: + subscription_change = client.subscription_changes.list( + cursor="cursor", + customer_id="customer_id", + external_customer_id="external_customer_id", + limit=1, + status="pending", + ) + assert_matches_type(SyncPage[SubscriptionChangeListResponse], subscription_change, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Orb) -> None: + response = client.subscription_changes.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + subscription_change = response.parse() + assert_matches_type(SyncPage[SubscriptionChangeListResponse], subscription_change, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Orb) -> None: + with client.subscription_changes.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + subscription_change = response.parse() + assert_matches_type(SyncPage[SubscriptionChangeListResponse], subscription_change, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_apply(self, client: Orb) -> None: subscription_change = client.subscription_changes.apply( @@ -201,6 +239,42 @@ async def test_path_params_retrieve(self, async_client: AsyncOrb) -> None: "", ) + @parametrize + async def test_method_list(self, async_client: AsyncOrb) -> None: + subscription_change = await async_client.subscription_changes.list() + assert_matches_type(AsyncPage[SubscriptionChangeListResponse], subscription_change, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: + subscription_change = await async_client.subscription_changes.list( + cursor="cursor", + customer_id="customer_id", + external_customer_id="external_customer_id", + limit=1, + status="pending", + ) + assert_matches_type(AsyncPage[SubscriptionChangeListResponse], subscription_change, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncOrb) -> None: + response = await async_client.subscription_changes.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + subscription_change = response.parse() + assert_matches_type(AsyncPage[SubscriptionChangeListResponse], subscription_change, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: + async with async_client.subscription_changes.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + subscription_change = await response.parse() + assert_matches_type(AsyncPage[SubscriptionChangeListResponse], subscription_change, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_apply(self, async_client: AsyncOrb) -> None: subscription_change = await async_client.subscription_changes.apply( diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 30eea71..121fcd5 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -76,6 +76,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "discounts": [ @@ -124,6 +125,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -208,6 +210,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "discounts": [ @@ -255,6 +258,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -662,6 +666,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "can_defer_billing": True, @@ -715,6 +720,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, }, "price_id": "h74gfhdjvn7ujokd", @@ -918,6 +924,7 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "discounts": [ @@ -966,6 +973,7 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -1043,6 +1051,7 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "discounts": [ @@ -1090,6 +1099,7 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -1466,6 +1476,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "discounts": [ @@ -1514,6 +1525,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -1598,6 +1610,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "discounts": [ @@ -1645,6 +1658,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -2052,6 +2066,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "can_defer_billing": True, @@ -2105,6 +2120,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, }, "price_id": "h74gfhdjvn7ujokd", @@ -2308,6 +2324,7 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "discounts": [ @@ -2356,6 +2373,7 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, @@ -2433,6 +2451,7 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A } ], "item_id": "item_id", + "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, "discounts": [ @@ -2480,6 +2499,7 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A "duration": 0, "duration_unit": "day", }, + "license_type_id": "license_type_id", "metadata": {"foo": "string"}, "reference_id": "reference_id", }, diff --git a/tests/api_resources/test_webhooks.py b/tests/api_resources/test_webhooks.py index 34eebdb..82e91a1 100644 --- a/tests/api_resources/test_webhooks.py +++ b/tests/api_resources/test_webhooks.py @@ -4,7 +4,7 @@ import os from typing import Any, cast -from datetime import datetime, timedelta +from datetime import datetime, timezone, timedelta import pytest import time_machine @@ -18,7 +18,11 @@ class TestWebhooks: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) timestamp = "2024-03-27T15:42:29.551" - fake_now = datetime.fromisoformat(timestamp).astimezone() + # Fix: Ensure fake_now matches how webhook timestamps are now parsed (UTC assumption) + fake_now_dt = datetime.fromisoformat(timestamp) + if fake_now_dt.tzinfo is None: + fake_now_dt = fake_now_dt.replace(tzinfo=timezone.utc) + fake_now = fake_now_dt.astimezone() payload = """{"id": "o4mmewpfNNTnjfZc", "created_at": "2024-03-27T15:42:29+00:00", "type": "resource_event.test", "properties": {"message": "A test webhook from Orb. Happy testing!"}}""" signature = "9d25de966891ab0bc18754faf8d83d0980b44ae330fcc130b41a6cf3daf1f391" @@ -106,12 +110,98 @@ def test_verify_signature(self, client: Orb) -> None: secret=secret, ) + def test_microsecond_precision_issue_fixed(self, client: Orb) -> None: + """Test that the webhook timestamp parsing issue is fixed for the reported examples.""" + import hmac + import hashlib + + secret = self.secret + + # Test cases from the reported issue - these should all work now + test_cases = [ + ("2025-08-08T21:35:11.531998+00:00", "2025-08-08T21:35:11.445"), + ("2025-08-08T21:32:02.585239+00:00", "2025-08-08T21:32:02.497"), + ("2025-08-08T21:35:42.810490+00:00", "2025-08-08T21:35:42.660"), + ] + + for _, (system_time_str, webhook_timestamp) in enumerate(test_cases, 1): + system_time = datetime.fromisoformat(system_time_str) + + # Generate the correct signature + to_sign = f"v1:{webhook_timestamp}:{self.payload}".encode("utf-8") + signature = hmac.new(secret.encode("utf-8"), to_sign, hashlib.sha256).hexdigest() + + with time_machine.travel(system_time): + # This should now work without raising "Webhook timestamp is too new" + client.webhooks.verify_signature( + payload=self.payload, + headers={"X-Orb-Timestamp": webhook_timestamp, "X-Orb-Signature": f"v1={signature}"}, + secret=secret, + ) + + # Also test the unwrap method + result = client.webhooks.unwrap( + payload=self.payload, + headers={"X-Orb-Timestamp": webhook_timestamp, "X-Orb-Signature": f"v1={signature}"}, + secret=secret, + ) + assert result is not None + + def test_timezone_aware_timestamps_still_work(self, client: Orb) -> None: + """Test that webhook timestamps with explicit timezone info still work.""" + import hmac + import hashlib + from datetime import timezone + + secret = self.secret + + # Test with explicit UTC timezone + system_time = datetime(2025, 8, 8, 21, 35, 11, 531998, tzinfo=timezone.utc) + webhook_timestamp = "2025-08-08T21:35:11.445+00:00" # Explicit UTC + + to_sign = f"v1:{webhook_timestamp}:{self.payload}".encode("utf-8") + signature = hmac.new(secret.encode("utf-8"), to_sign, hashlib.sha256).hexdigest() + + with time_machine.travel(system_time): + client.webhooks.verify_signature( + payload=self.payload, + headers={"X-Orb-Timestamp": webhook_timestamp, "X-Orb-Signature": f"v1={signature}"}, + secret=secret, + ) + + def test_webhook_timestamp_actually_too_new(self, client: Orb) -> None: + """Test that webhooks that are genuinely too new are still rejected.""" + import hmac + import hashlib + from datetime import timezone + + secret = self.secret + + # Set system time to be much earlier than webhook timestamp (more than 5 minute tolerance) + system_time = datetime(2025, 8, 8, 21, 30, 0, 0, tzinfo=timezone.utc) + webhook_timestamp = "2025-08-08T21:36:00.000" # 6 minutes later - should be rejected + + to_sign = f"v1:{webhook_timestamp}:{self.payload}".encode("utf-8") + signature = hmac.new(secret.encode("utf-8"), to_sign, hashlib.sha256).hexdigest() + + with time_machine.travel(system_time): + with pytest.raises(ValueError, match="Webhook timestamp is too new"): + client.webhooks.verify_signature( + payload=self.payload, + headers={"X-Orb-Timestamp": webhook_timestamp, "X-Orb-Signature": f"v1={signature}"}, + secret=secret, + ) + class TestAsyncWebhooks: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) timestamp = "2024-03-27T15:42:29.551" - fake_now = datetime.fromisoformat(timestamp).astimezone() + # Fix: Ensure fake_now matches how webhook timestamps are now parsed (UTC assumption) + fake_now_dt = datetime.fromisoformat(timestamp) + if fake_now_dt.tzinfo is None: + fake_now_dt = fake_now_dt.replace(tzinfo=timezone.utc) + fake_now = fake_now_dt.astimezone() payload = """{"id": "o4mmewpfNNTnjfZc", "created_at": "2024-03-27T15:42:29+00:00", "type": "resource_event.test", "properties": {"message": "A test webhook from Orb. Happy testing!"}}""" signature = "9d25de966891ab0bc18754faf8d83d0980b44ae330fcc130b41a6cf3daf1f391" diff --git a/tests/test_client.py b/tests/test_client.py index 5401eb7..922c430 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -8,10 +8,11 @@ import json import asyncio import inspect +import dataclasses import tracemalloc -from typing import Any, Union, cast +from typing import Any, Union, TypeVar, Callable, Iterable, Iterator, Optional, Coroutine, cast from unittest import mock -from typing_extensions import Literal +from typing_extensions import Literal, AsyncIterator, override import httpx import pytest @@ -36,6 +37,7 @@ from .utils import update_env +T = TypeVar("T") base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = "My API Key" @@ -50,6 +52,57 @@ def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: return 0.1 +def mirror_request_content(request: httpx.Request) -> httpx.Response: + return httpx.Response(200, content=request.content) + + +# note: we can't use the httpx.MockTransport class as it consumes the request +# body itself, which means we can't test that the body is read lazily +class MockTransport(httpx.BaseTransport, httpx.AsyncBaseTransport): + def __init__( + self, + handler: Callable[[httpx.Request], httpx.Response] + | Callable[[httpx.Request], Coroutine[Any, Any, httpx.Response]], + ) -> None: + self.handler = handler + + @override + def handle_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert not inspect.iscoroutinefunction(self.handler), "handler must not be a coroutine function" + assert inspect.isfunction(self.handler), "handler must be a function" + return self.handler(request) + + @override + async def handle_async_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert inspect.iscoroutinefunction(self.handler), "handler must be a coroutine function" + return await self.handler(request) + + +@dataclasses.dataclass +class Counter: + value: int = 0 + + +def _make_sync_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> Iterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + +async def _make_async_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> AsyncIterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + def _get_open_connections(client: Orb | AsyncOrb) -> int: transport = client._client._transport assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) @@ -492,6 +545,70 @@ def test_multipart_repeating_array(self, client: Orb) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload(self, respx_mock: MockRouter, client: Orb) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + def test_binary_content_upload_with_iterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_sync_iterator([file_content], counter=counter) + + def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=request.read()) + + with Orb( + base_url=base_url, + api_key=api_key, + _strict_response_validation=True, + http_client=httpx.Client(transport=MockTransport(handler=mock_handler)), + ) as client: + response = client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload_with_body_is_deprecated(self, respx_mock: MockRouter, client: Orb) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) def test_basic_union_response(self, respx_mock: MockRouter, client: Orb) -> None: class Model1(BaseModel): @@ -1367,6 +1484,72 @@ def test_multipart_repeating_array(self, async_client: AsyncOrb) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload(self, respx_mock: MockRouter, async_client: AsyncOrb) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = await async_client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + async def test_binary_content_upload_with_asynciterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_async_iterator([file_content], counter=counter) + + async def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=await request.aread()) + + async with AsyncOrb( + base_url=base_url, + api_key=api_key, + _strict_response_validation=True, + http_client=httpx.AsyncClient(transport=MockTransport(handler=mock_handler)), + ) as client: + response = await client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload_with_body_is_deprecated( + self, respx_mock: MockRouter, async_client: AsyncOrb + ) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = await async_client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncOrb) -> None: class Model1(BaseModel): diff --git a/tests/test_utils/test_json.py b/tests/test_utils/test_json.py new file mode 100644 index 0000000..3a1df3a --- /dev/null +++ b/tests/test_utils/test_json.py @@ -0,0 +1,126 @@ +from __future__ import annotations + +import datetime +from typing import Union + +import pydantic + +from orb_sdk import _compat +from orb_sdk._utils._json import openapi_dumps + + +class TestOpenapiDumps: + def test_basic(self) -> None: + data = {"key": "value", "number": 42} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"key":"value","number":42}' + + def test_datetime_serialization(self) -> None: + dt = datetime.datetime(2023, 1, 1, 12, 0, 0) + data = {"datetime": dt} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"datetime":"2023-01-01T12:00:00"}' + + def test_pydantic_model_serialization(self) -> None: + class User(pydantic.BaseModel): + first_name: str + last_name: str + age: int + + model_instance = User(first_name="John", last_name="Kramer", age=83) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"first_name":"John","last_name":"Kramer","age":83}}' + + def test_pydantic_model_with_default_values(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + score: int = 0 + + model_instance = User(name="Alice") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Alice"}}' + + def test_pydantic_model_with_default_values_overridden(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + + model_instance = User(name="Bob", role="admin", active=False) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Bob","role":"admin","active":false}}' + + def test_pydantic_model_with_alias(self) -> None: + class User(pydantic.BaseModel): + first_name: str = pydantic.Field(alias="firstName") + last_name: str = pydantic.Field(alias="lastName") + + model_instance = User(firstName="John", lastName="Doe") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"firstName":"John","lastName":"Doe"}}' + + def test_pydantic_model_with_alias_and_default(self) -> None: + class User(pydantic.BaseModel): + user_name: str = pydantic.Field(alias="userName") + user_role: str = pydantic.Field(default="member", alias="userRole") + is_active: bool = pydantic.Field(default=True, alias="isActive") + + model_instance = User(userName="charlie") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"charlie"}}' + + model_with_overrides = User(userName="diana", userRole="admin", isActive=False) + data = {"model": model_with_overrides} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"diana","userRole":"admin","isActive":false}}' + + def test_pydantic_model_with_nested_models_and_defaults(self) -> None: + class Address(pydantic.BaseModel): + street: str + city: str = "Unknown" + + class User(pydantic.BaseModel): + name: str + address: Address + verified: bool = False + + if _compat.PYDANTIC_V1: + # to handle forward references in Pydantic v1 + User.update_forward_refs(**locals()) # type: ignore[reportDeprecated] + + address = Address(street="123 Main St") + user = User(name="Diana", address=address) + data = {"user": user} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"user":{"name":"Diana","address":{"street":"123 Main St"}}}' + + address_with_city = Address(street="456 Oak Ave", city="Boston") + user_verified = User(name="Eve", address=address_with_city, verified=True) + data = {"user": user_verified} + json_bytes = openapi_dumps(data) + assert ( + json_bytes == b'{"user":{"name":"Eve","address":{"street":"456 Oak Ave","city":"Boston"},"verified":true}}' + ) + + def test_pydantic_model_with_optional_fields(self) -> None: + class User(pydantic.BaseModel): + name: str + email: Union[str, None] + phone: Union[str, None] + + model_with_none = User(name="Eve", email=None, phone=None) + data = {"model": model_with_none} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Eve","email":null,"phone":null}}' + + model_with_values = User(name="Frank", email="frank@example.com", phone=None) + data = {"model": model_with_values} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Frank","email":"frank@example.com","phone":null}}'