diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ee47b6d..4ddd2d14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' @@ -17,7 +19,7 @@ jobs: timeout-minutes: 10 name: lint 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 + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -36,7 +38,7 @@ jobs: run: ./scripts/lint build: - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') timeout-minutes: 10 name: build permissions: @@ -61,14 +63,18 @@ jobs: run: rye build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/orb-python' + if: |- + github.repository == 'stainless-sdks/orb-python' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/orb-python' + if: |- + github.repository == 'stainless-sdks/orb-python' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} diff --git a/.gitignore b/.gitignore index 95ceb189..3824f4c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log _dev __pycache__ diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c3d8acd5..331e8361 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.55.0" + ".": "4.56.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index c80eee48..c2abdb90 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ 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 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-17c43dab26af75e1b9f7e61ac8da1219cea65c7d0666d98686b71a60183e458d.yml +openapi_spec_hash: bbbd86881508bb69904eacdbce1e52b6 +config_hash: c01c1191b1cd696c7ca855ff6d28a8df diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c03365a..6b93ee0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,50 @@ # Changelog +## 4.56.0 (2026-03-26) + +Full Changelog: [v4.55.0...v4.56.0](https://github.com/orbcorp/orb-python/compare/v4.55.0...v4.56.0) + +### Features + +* **api:** api update ([4e3652d](https://github.com/orbcorp/orb-python/commit/4e3652dfaec77221b4907179784aaf88e1ff2d67)) +* **api:** api update ([931c0f4](https://github.com/orbcorp/orb-python/commit/931c0f421c553981b7c0326a0c721e7cc5fa53f3)) +* **api:** api update ([8c1ffda](https://github.com/orbcorp/orb-python/commit/8c1ffda41e28f9f3dad2b64363dc3e6d8b8e57b2)) +* **api:** api update ([deda5e1](https://github.com/orbcorp/orb-python/commit/deda5e1a4c4412e91ad61f038b5c9e17d3072a22)) +* **api:** api update ([425bac4](https://github.com/orbcorp/orb-python/commit/425bac4cc3a9df0085fad215bf5c66d108008d67)) +* **api:** api update ([cd1cd23](https://github.com/orbcorp/orb-python/commit/cd1cd2396264bbc01c71c6ba7e2dc937ee1b5928)) +* **api:** api update ([6b4583e](https://github.com/orbcorp/orb-python/commit/6b4583ede27c6245a828b670301e1bf37cf708a7)) +* **api:** api update ([b676980](https://github.com/orbcorp/orb-python/commit/b6769806d684451bd19d037fd80132e4a0de5930)) +* **api:** api update ([19af3f7](https://github.com/orbcorp/orb-python/commit/19af3f7d6238fb95b66cf2229e5095a0f2bb0df1)) +* **api:** api update ([3686dc6](https://github.com/orbcorp/orb-python/commit/3686dc6ec326e564578f5ab13c7d258d41de8def)) +* **api:** api update ([2fbc2b1](https://github.com/orbcorp/orb-python/commit/2fbc2b14d46648f4ef4ea57ead9cd08b444211b1)) +* **internal:** implement indices array format for query and form serialization ([b78355c](https://github.com/orbcorp/orb-python/commit/b78355cef870adb25c8c6995362c1bef24ca78d1)) + + +### Bug Fixes + +* **deps:** bump minimum typing-extensions version ([93f9afe](https://github.com/orbcorp/orb-python/commit/93f9afed7c1b6c5aa432e78bac43107a4b7f2df1)) +* **pydantic:** do not pass `by_alias` unless set ([06cedae](https://github.com/orbcorp/orb-python/commit/06cedaebd513685daa42d203346112a8ac4c792a)) +* sanitize endpoint path params ([a7e8834](https://github.com/orbcorp/orb-python/commit/a7e88347c865c3daa237efaedbb824cf04a5d3b2)) + + +### Chores + +* **ci:** skip lint on metadata-only changes ([16d7746](https://github.com/orbcorp/orb-python/commit/16d77465cdd71d193002e3d977f926a856b8a693)) +* **ci:** skip uploading artifacts on stainless-internal branches ([a2813c8](https://github.com/orbcorp/orb-python/commit/a2813c8575727ecbd2582b251095ed70a9b75613)) +* **docs:** add missing descriptions ([1bb4db8](https://github.com/orbcorp/orb-python/commit/1bb4db815a18a056aa19366c6622a66935d59577)) +* **internal:** add request options to SSE classes ([9110978](https://github.com/orbcorp/orb-python/commit/9110978adab2229b2eff3f3dfeb3ce6df2f5305e)) +* **internal:** make `test_proxy_environment_variables` more resilient ([e567054](https://github.com/orbcorp/orb-python/commit/e56705443f6920ad4b6eb750a5cd0488d8a119f3)) +* **internal:** make `test_proxy_environment_variables` more resilient to env ([a2da977](https://github.com/orbcorp/orb-python/commit/a2da97718dd34551d38475738e3fd701cc8e2fbe)) +* **internal:** tweak CI branches ([c5ab3b4](https://github.com/orbcorp/orb-python/commit/c5ab3b47348d6b75866c9e3e3ff6cc185e3cd1c8)) +* **internal:** update gitignore ([e2316ae](https://github.com/orbcorp/orb-python/commit/e2316aee6077ef333f4ae35fd759e3ef0a8d4343)) +* **test:** do not count install time for mock server timeout ([888e2ca](https://github.com/orbcorp/orb-python/commit/888e2ca02a4fd7cb2294bf0ce1af4b8cee014809)) +* **tests:** bump steady to v0.19.4 ([dba860e](https://github.com/orbcorp/orb-python/commit/dba860e1955d0964daee83d2f4eae6030df1e802)) +* **tests:** bump steady to v0.19.5 ([0918804](https://github.com/orbcorp/orb-python/commit/09188043849d27914198fd370b525ab9353cb174)) +* **tests:** bump steady to v0.19.6 ([f37e5be](https://github.com/orbcorp/orb-python/commit/f37e5be1bdad7d3f627f2a5f1a7e97fa590dc3c3)) +* **tests:** bump steady to v0.19.7 ([403afe2](https://github.com/orbcorp/orb-python/commit/403afe25fbed8a923ec2bbcf5b7ab4deb16bfaef)) +* **tests:** update mock server to steady ([97a3d8f](https://github.com/orbcorp/orb-python/commit/97a3d8ff2b9ffe7810864b7146fbe9dab0909aa5)) +* update mock server docs ([0f016de](https://github.com/orbcorp/orb-python/commit/0f016de052ebb429752c7ffdc4ca061c19562469)) + ## 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) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ea9f566f..13aed782 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,11 +85,10 @@ $ pip install ./path-to-wheel-file.whl ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. +Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. ```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh diff --git a/api.md b/api.md index b50a14f4..37c8c3c8 100644 --- a/api.md +++ b/api.md @@ -408,7 +408,7 @@ Methods: - 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.pay(invoice_id, \*\*params) -> Invoice - client.invoices.void(invoice_id) -> Invoice # Items diff --git a/pyproject.toml b/pyproject.toml index 0f0bbaa4..e1ada8c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "4.55.0" +version = "4.56.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" @@ -11,7 +11,7 @@ authors = [ dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", + "typing-extensions>=4.14, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", diff --git a/scripts/mock b/scripts/mock index 0b28f6ea..4931f304 100755 --- a/scripts/mock +++ b/scripts/mock @@ -19,23 +19,34 @@ fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stdy/cli@0.19.7 -- steady --version - # Wait for server to come online + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=0 + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Steady server to start" + cat .stdy.log + exit 1 + fi echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index dbeda2d2..52bcc4ce 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=brackets --validator-form-array-format=brackets --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi diff --git a/src/orb/_client.py b/src/orb/_client.py index d1f4078c..7e29e1cb 100644 --- a/src/orb/_client.py +++ b/src/orb/_client.py @@ -156,66 +156,134 @@ def top_level(self) -> TopLevel: @cached_property def beta(self) -> Beta: + """ + 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). + """ from .resources.beta import Beta return Beta(self) @cached_property def coupons(self) -> Coupons: + """ + 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. + """ from .resources.coupons import Coupons return Coupons(self) @cached_property def credit_notes(self) -> CreditNotes: + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ from .resources.credit_notes import CreditNotes return CreditNotes(self) @cached_property def customers(self) -> Customers: + """ + 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. + """ from .resources.customers import Customers return Customers(self) @cached_property def events(self) -> Events: + """ + 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. + """ from .resources.events import Events return Events(self) @cached_property def invoice_line_items(self) -> InvoiceLineItems: + """ + 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. + """ from .resources.invoice_line_items import InvoiceLineItems return InvoiceLineItems(self) @cached_property def invoices(self) -> Invoices: + """ + 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. + """ from .resources.invoices import Invoices return Invoices(self) @cached_property def items(self) -> Items: + """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. + """ from .resources.items import Items return Items(self) @cached_property def metrics(self) -> Metrics: + """ + 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. + """ from .resources.metrics import Metrics return Metrics(self) @cached_property def plans(self) -> Plans: + """ + 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). + """ from .resources.plans import Plans return Plans(self) @cached_property def prices(self) -> Prices: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ from .resources.prices import Prices return Prices(self) @@ -228,6 +296,12 @@ def subscriptions(self) -> Subscriptions: @cached_property def alerts(self) -> Alerts: + """ + [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. + """ from .resources.alerts import Alerts return Alerts(self) @@ -252,12 +326,19 @@ def webhooks(self) -> webhooks.Webhooks: @cached_property def credit_blocks(self) -> CreditBlocks: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ from .resources.credit_blocks import CreditBlocks return CreditBlocks(self) @cached_property def license_types(self) -> LicenseTypes: + """ + 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. + """ from .resources.license_types import LicenseTypes return LicenseTypes(self) @@ -504,66 +585,134 @@ def top_level(self) -> AsyncTopLevel: @cached_property def beta(self) -> AsyncBeta: + """ + 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). + """ from .resources.beta import AsyncBeta return AsyncBeta(self) @cached_property def coupons(self) -> AsyncCoupons: + """ + 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. + """ from .resources.coupons import AsyncCoupons return AsyncCoupons(self) @cached_property def credit_notes(self) -> AsyncCreditNotes: + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ from .resources.credit_notes import AsyncCreditNotes return AsyncCreditNotes(self) @cached_property def customers(self) -> AsyncCustomers: + """ + 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. + """ from .resources.customers import AsyncCustomers return AsyncCustomers(self) @cached_property def events(self) -> AsyncEvents: + """ + 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. + """ from .resources.events import AsyncEvents return AsyncEvents(self) @cached_property def invoice_line_items(self) -> AsyncInvoiceLineItems: + """ + 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. + """ from .resources.invoice_line_items import AsyncInvoiceLineItems return AsyncInvoiceLineItems(self) @cached_property def invoices(self) -> AsyncInvoices: + """ + 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. + """ from .resources.invoices import AsyncInvoices return AsyncInvoices(self) @cached_property def items(self) -> AsyncItems: + """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. + """ from .resources.items import AsyncItems return AsyncItems(self) @cached_property def metrics(self) -> AsyncMetrics: + """ + 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. + """ from .resources.metrics import AsyncMetrics return AsyncMetrics(self) @cached_property def plans(self) -> AsyncPlans: + """ + 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). + """ from .resources.plans import AsyncPlans return AsyncPlans(self) @cached_property def prices(self) -> AsyncPrices: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ from .resources.prices import AsyncPrices return AsyncPrices(self) @@ -576,6 +725,12 @@ def subscriptions(self) -> AsyncSubscriptions: @cached_property def alerts(self) -> AsyncAlerts: + """ + [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. + """ from .resources.alerts import AsyncAlerts return AsyncAlerts(self) @@ -600,12 +755,19 @@ def webhooks(self) -> webhooks.AsyncWebhooks: @cached_property def credit_blocks(self) -> AsyncCreditBlocks: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ from .resources.credit_blocks import AsyncCreditBlocks return AsyncCreditBlocks(self) @cached_property def license_types(self) -> AsyncLicenseTypes: + """ + 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. + """ from .resources.license_types import AsyncLicenseTypes return AsyncLicenseTypes(self) @@ -793,66 +955,134 @@ def top_level(self) -> top_level.TopLevelWithRawResponse: @cached_property def beta(self) -> beta.BetaWithRawResponse: + """ + 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). + """ from .resources.beta import BetaWithRawResponse return BetaWithRawResponse(self._client.beta) @cached_property def coupons(self) -> coupons.CouponsWithRawResponse: + """ + 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. + """ from .resources.coupons import CouponsWithRawResponse return CouponsWithRawResponse(self._client.coupons) @cached_property def credit_notes(self) -> credit_notes.CreditNotesWithRawResponse: + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ from .resources.credit_notes import CreditNotesWithRawResponse return CreditNotesWithRawResponse(self._client.credit_notes) @cached_property def customers(self) -> customers.CustomersWithRawResponse: + """ + 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. + """ from .resources.customers import CustomersWithRawResponse return CustomersWithRawResponse(self._client.customers) @cached_property def events(self) -> events.EventsWithRawResponse: + """ + 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. + """ from .resources.events import EventsWithRawResponse return EventsWithRawResponse(self._client.events) @cached_property def invoice_line_items(self) -> invoice_line_items.InvoiceLineItemsWithRawResponse: + """ + 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. + """ from .resources.invoice_line_items import InvoiceLineItemsWithRawResponse return InvoiceLineItemsWithRawResponse(self._client.invoice_line_items) @cached_property def invoices(self) -> invoices.InvoicesWithRawResponse: + """ + 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. + """ from .resources.invoices import InvoicesWithRawResponse return InvoicesWithRawResponse(self._client.invoices) @cached_property def items(self) -> items.ItemsWithRawResponse: + """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. + """ from .resources.items import ItemsWithRawResponse return ItemsWithRawResponse(self._client.items) @cached_property def metrics(self) -> metrics.MetricsWithRawResponse: + """ + 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. + """ from .resources.metrics import MetricsWithRawResponse return MetricsWithRawResponse(self._client.metrics) @cached_property def plans(self) -> plans.PlansWithRawResponse: + """ + 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). + """ from .resources.plans import PlansWithRawResponse return PlansWithRawResponse(self._client.plans) @cached_property def prices(self) -> prices.PricesWithRawResponse: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ from .resources.prices import PricesWithRawResponse return PricesWithRawResponse(self._client.prices) @@ -865,6 +1095,12 @@ def subscriptions(self) -> subscriptions.SubscriptionsWithRawResponse: @cached_property def alerts(self) -> alerts.AlertsWithRawResponse: + """ + [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. + """ from .resources.alerts import AlertsWithRawResponse return AlertsWithRawResponse(self._client.alerts) @@ -883,12 +1119,19 @@ def subscription_changes(self) -> subscription_changes.SubscriptionChangesWithRa @cached_property def credit_blocks(self) -> credit_blocks.CreditBlocksWithRawResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ from .resources.credit_blocks import CreditBlocksWithRawResponse return CreditBlocksWithRawResponse(self._client.credit_blocks) @cached_property def license_types(self) -> license_types.LicenseTypesWithRawResponse: + """ + 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. + """ from .resources.license_types import LicenseTypesWithRawResponse return LicenseTypesWithRawResponse(self._client.license_types) @@ -914,66 +1157,134 @@ def top_level(self) -> top_level.AsyncTopLevelWithRawResponse: @cached_property def beta(self) -> beta.AsyncBetaWithRawResponse: + """ + 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). + """ from .resources.beta import AsyncBetaWithRawResponse return AsyncBetaWithRawResponse(self._client.beta) @cached_property def coupons(self) -> coupons.AsyncCouponsWithRawResponse: + """ + 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. + """ from .resources.coupons import AsyncCouponsWithRawResponse return AsyncCouponsWithRawResponse(self._client.coupons) @cached_property def credit_notes(self) -> credit_notes.AsyncCreditNotesWithRawResponse: + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ from .resources.credit_notes import AsyncCreditNotesWithRawResponse return AsyncCreditNotesWithRawResponse(self._client.credit_notes) @cached_property def customers(self) -> customers.AsyncCustomersWithRawResponse: + """ + 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. + """ from .resources.customers import AsyncCustomersWithRawResponse return AsyncCustomersWithRawResponse(self._client.customers) @cached_property def events(self) -> events.AsyncEventsWithRawResponse: + """ + 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. + """ from .resources.events import AsyncEventsWithRawResponse return AsyncEventsWithRawResponse(self._client.events) @cached_property def invoice_line_items(self) -> invoice_line_items.AsyncInvoiceLineItemsWithRawResponse: + """ + 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. + """ from .resources.invoice_line_items import AsyncInvoiceLineItemsWithRawResponse return AsyncInvoiceLineItemsWithRawResponse(self._client.invoice_line_items) @cached_property def invoices(self) -> invoices.AsyncInvoicesWithRawResponse: + """ + 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. + """ from .resources.invoices import AsyncInvoicesWithRawResponse return AsyncInvoicesWithRawResponse(self._client.invoices) @cached_property def items(self) -> items.AsyncItemsWithRawResponse: + """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. + """ from .resources.items import AsyncItemsWithRawResponse return AsyncItemsWithRawResponse(self._client.items) @cached_property def metrics(self) -> metrics.AsyncMetricsWithRawResponse: + """ + 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. + """ from .resources.metrics import AsyncMetricsWithRawResponse return AsyncMetricsWithRawResponse(self._client.metrics) @cached_property def plans(self) -> plans.AsyncPlansWithRawResponse: + """ + 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). + """ from .resources.plans import AsyncPlansWithRawResponse return AsyncPlansWithRawResponse(self._client.plans) @cached_property def prices(self) -> prices.AsyncPricesWithRawResponse: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ from .resources.prices import AsyncPricesWithRawResponse return AsyncPricesWithRawResponse(self._client.prices) @@ -986,6 +1297,12 @@ def subscriptions(self) -> subscriptions.AsyncSubscriptionsWithRawResponse: @cached_property def alerts(self) -> alerts.AsyncAlertsWithRawResponse: + """ + [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. + """ from .resources.alerts import AsyncAlertsWithRawResponse return AsyncAlertsWithRawResponse(self._client.alerts) @@ -1004,12 +1321,19 @@ def subscription_changes(self) -> subscription_changes.AsyncSubscriptionChangesW @cached_property def credit_blocks(self) -> credit_blocks.AsyncCreditBlocksWithRawResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ from .resources.credit_blocks import AsyncCreditBlocksWithRawResponse return AsyncCreditBlocksWithRawResponse(self._client.credit_blocks) @cached_property def license_types(self) -> license_types.AsyncLicenseTypesWithRawResponse: + """ + 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. + """ from .resources.license_types import AsyncLicenseTypesWithRawResponse return AsyncLicenseTypesWithRawResponse(self._client.license_types) @@ -1035,66 +1359,134 @@ def top_level(self) -> top_level.TopLevelWithStreamingResponse: @cached_property def beta(self) -> beta.BetaWithStreamingResponse: + """ + 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). + """ from .resources.beta import BetaWithStreamingResponse return BetaWithStreamingResponse(self._client.beta) @cached_property def coupons(self) -> coupons.CouponsWithStreamingResponse: + """ + 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. + """ from .resources.coupons import CouponsWithStreamingResponse return CouponsWithStreamingResponse(self._client.coupons) @cached_property def credit_notes(self) -> credit_notes.CreditNotesWithStreamingResponse: + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ from .resources.credit_notes import CreditNotesWithStreamingResponse return CreditNotesWithStreamingResponse(self._client.credit_notes) @cached_property def customers(self) -> customers.CustomersWithStreamingResponse: + """ + 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. + """ from .resources.customers import CustomersWithStreamingResponse return CustomersWithStreamingResponse(self._client.customers) @cached_property def events(self) -> events.EventsWithStreamingResponse: + """ + 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. + """ from .resources.events import EventsWithStreamingResponse return EventsWithStreamingResponse(self._client.events) @cached_property def invoice_line_items(self) -> invoice_line_items.InvoiceLineItemsWithStreamingResponse: + """ + 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. + """ from .resources.invoice_line_items import InvoiceLineItemsWithStreamingResponse return InvoiceLineItemsWithStreamingResponse(self._client.invoice_line_items) @cached_property def invoices(self) -> invoices.InvoicesWithStreamingResponse: + """ + 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. + """ from .resources.invoices import InvoicesWithStreamingResponse return InvoicesWithStreamingResponse(self._client.invoices) @cached_property def items(self) -> items.ItemsWithStreamingResponse: + """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. + """ from .resources.items import ItemsWithStreamingResponse return ItemsWithStreamingResponse(self._client.items) @cached_property def metrics(self) -> metrics.MetricsWithStreamingResponse: + """ + 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. + """ from .resources.metrics import MetricsWithStreamingResponse return MetricsWithStreamingResponse(self._client.metrics) @cached_property def plans(self) -> plans.PlansWithStreamingResponse: + """ + 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). + """ from .resources.plans import PlansWithStreamingResponse return PlansWithStreamingResponse(self._client.plans) @cached_property def prices(self) -> prices.PricesWithStreamingResponse: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ from .resources.prices import PricesWithStreamingResponse return PricesWithStreamingResponse(self._client.prices) @@ -1107,6 +1499,12 @@ def subscriptions(self) -> subscriptions.SubscriptionsWithStreamingResponse: @cached_property def alerts(self) -> alerts.AlertsWithStreamingResponse: + """ + [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. + """ from .resources.alerts import AlertsWithStreamingResponse return AlertsWithStreamingResponse(self._client.alerts) @@ -1125,12 +1523,19 @@ def subscription_changes(self) -> subscription_changes.SubscriptionChangesWithSt @cached_property def credit_blocks(self) -> credit_blocks.CreditBlocksWithStreamingResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ from .resources.credit_blocks import CreditBlocksWithStreamingResponse return CreditBlocksWithStreamingResponse(self._client.credit_blocks) @cached_property def license_types(self) -> license_types.LicenseTypesWithStreamingResponse: + """ + 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. + """ from .resources.license_types import LicenseTypesWithStreamingResponse return LicenseTypesWithStreamingResponse(self._client.license_types) @@ -1156,66 +1561,134 @@ def top_level(self) -> top_level.AsyncTopLevelWithStreamingResponse: @cached_property def beta(self) -> beta.AsyncBetaWithStreamingResponse: + """ + 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). + """ from .resources.beta import AsyncBetaWithStreamingResponse return AsyncBetaWithStreamingResponse(self._client.beta) @cached_property def coupons(self) -> coupons.AsyncCouponsWithStreamingResponse: + """ + 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. + """ from .resources.coupons import AsyncCouponsWithStreamingResponse return AsyncCouponsWithStreamingResponse(self._client.coupons) @cached_property def credit_notes(self) -> credit_notes.AsyncCreditNotesWithStreamingResponse: + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ from .resources.credit_notes import AsyncCreditNotesWithStreamingResponse return AsyncCreditNotesWithStreamingResponse(self._client.credit_notes) @cached_property def customers(self) -> customers.AsyncCustomersWithStreamingResponse: + """ + 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. + """ from .resources.customers import AsyncCustomersWithStreamingResponse return AsyncCustomersWithStreamingResponse(self._client.customers) @cached_property def events(self) -> events.AsyncEventsWithStreamingResponse: + """ + 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. + """ from .resources.events import AsyncEventsWithStreamingResponse return AsyncEventsWithStreamingResponse(self._client.events) @cached_property def invoice_line_items(self) -> invoice_line_items.AsyncInvoiceLineItemsWithStreamingResponse: + """ + 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. + """ from .resources.invoice_line_items import AsyncInvoiceLineItemsWithStreamingResponse return AsyncInvoiceLineItemsWithStreamingResponse(self._client.invoice_line_items) @cached_property def invoices(self) -> invoices.AsyncInvoicesWithStreamingResponse: + """ + 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. + """ from .resources.invoices import AsyncInvoicesWithStreamingResponse return AsyncInvoicesWithStreamingResponse(self._client.invoices) @cached_property def items(self) -> items.AsyncItemsWithStreamingResponse: + """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. + """ from .resources.items import AsyncItemsWithStreamingResponse return AsyncItemsWithStreamingResponse(self._client.items) @cached_property def metrics(self) -> metrics.AsyncMetricsWithStreamingResponse: + """ + 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. + """ from .resources.metrics import AsyncMetricsWithStreamingResponse return AsyncMetricsWithStreamingResponse(self._client.metrics) @cached_property def plans(self) -> plans.AsyncPlansWithStreamingResponse: + """ + 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). + """ from .resources.plans import AsyncPlansWithStreamingResponse return AsyncPlansWithStreamingResponse(self._client.plans) @cached_property def prices(self) -> prices.AsyncPricesWithStreamingResponse: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ from .resources.prices import AsyncPricesWithStreamingResponse return AsyncPricesWithStreamingResponse(self._client.prices) @@ -1228,6 +1701,12 @@ def subscriptions(self) -> subscriptions.AsyncSubscriptionsWithStreamingResponse @cached_property def alerts(self) -> alerts.AsyncAlertsWithStreamingResponse: + """ + [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. + """ from .resources.alerts import AsyncAlertsWithStreamingResponse return AsyncAlertsWithStreamingResponse(self._client.alerts) @@ -1246,12 +1725,19 @@ def subscription_changes(self) -> subscription_changes.AsyncSubscriptionChangesW @cached_property def credit_blocks(self) -> credit_blocks.AsyncCreditBlocksWithStreamingResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ from .resources.credit_blocks import AsyncCreditBlocksWithStreamingResponse return AsyncCreditBlocksWithStreamingResponse(self._client.credit_blocks) @cached_property def license_types(self) -> license_types.AsyncLicenseTypesWithStreamingResponse: + """ + 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. + """ from .resources.license_types import AsyncLicenseTypesWithStreamingResponse return AsyncLicenseTypesWithStreamingResponse(self._client.license_types) diff --git a/src/orb/_compat.py b/src/orb/_compat.py index 786ff42a..e6690a4f 100644 --- a/src/orb/_compat.py +++ b/src/orb/_compat.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self, Literal +from typing_extensions import Self, Literal, TypedDict import pydantic from pydantic.fields import FieldInfo @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: return model.model_dump_json(indent=indent) +class _ModelDumpKwargs(TypedDict, total=False): + by_alias: bool + + def model_dump( model: pydantic.BaseModel, *, @@ -142,6 +146,9 @@ def model_dump( by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): + kwargs: _ModelDumpKwargs = {} + if by_alias is not None: + kwargs["by_alias"] = by_alias return model.model_dump( mode=mode, exclude=exclude, @@ -149,7 +156,7 @@ 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, + **kwargs, ) return cast( "dict[str, Any]", diff --git a/src/orb/_legacy_response.py b/src/orb/_legacy_response.py index 96cbe8bd..a78dda22 100644 --- a/src/orb/_legacy_response.py +++ b/src/orb/_legacy_response.py @@ -214,6 +214,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -224,6 +225,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -237,6 +239,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/orb/_qs.py b/src/orb/_qs.py index ada6fd3f..de8c99bc 100644 --- a/src/orb/_qs.py +++ b/src/orb/_qs.py @@ -101,7 +101,10 @@ def _stringify_item( items.extend(self._stringify_item(key, item, opts)) return items elif array_format == "indices": - raise NotImplementedError("The array indices format is not supported yet") + items = [] + for i, item in enumerate(value): + items.extend(self._stringify_item(f"{key}[{i}]", item, opts)) + return items elif array_format == "brackets": items = [] key = key + "[]" diff --git a/src/orb/_response.py b/src/orb/_response.py index 2e125354..d8a81963 100644 --- a/src/orb/_response.py +++ b/src/orb/_response.py @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/orb/_streaming.py b/src/orb/_streaming.py index 943d03ab..321fe6aa 100644 --- a/src/orb/_streaming.py +++ b/src/orb/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ._client import Orb, AsyncOrb + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -22,7 +23,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -31,10 +32,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: Orb, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -94,10 +97,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncOrb, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() diff --git a/src/orb/_utils/__init__.py b/src/orb/_utils/__init__.py index dc64e29a..10cb66d2 100644 --- a/src/orb/_utils/__init__.py +++ b/src/orb/_utils/__init__.py @@ -1,3 +1,4 @@ +from ._path import path_template as path_template from ._sync import asyncify as asyncify from ._proxy import LazyProxy as LazyProxy from ._utils import ( diff --git a/src/orb/_utils/_path.py b/src/orb/_utils/_path.py new file mode 100644 index 00000000..4d6e1e4c --- /dev/null +++ b/src/orb/_utils/_path.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +import re +from typing import ( + Any, + Mapping, + Callable, +) +from urllib.parse import quote + +# Matches '.' or '..' where each dot is either literal or percent-encoded (%2e / %2E). +_DOT_SEGMENT_RE = re.compile(r"^(?:\.|%2[eE]){1,2}$") + +_PLACEHOLDER_RE = re.compile(r"\{(\w+)\}") + + +def _quote_path_segment_part(value: str) -> str: + """Percent-encode `value` for use in a URI path segment. + + Considers characters not in `pchar` set from RFC 3986 §3.3 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 + """ + # quote() already treats unreserved characters (letters, digits, and -._~) + # as safe, so we only need to add sub-delims, ':', and '@'. + # Notably, unlike the default `safe` for quote(), / is unsafe and must be quoted. + return quote(value, safe="!$&'()*+,;=:@") + + +def _quote_query_part(value: str) -> str: + """Percent-encode `value` for use in a URI query string. + + Considers &, = and characters not in `query` set from RFC 3986 §3.4 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 + """ + return quote(value, safe="!$'()*+,;:@/?") + + +def _quote_fragment_part(value: str) -> str: + """Percent-encode `value` for use in a URI fragment. + + Considers characters not in `fragment` set from RFC 3986 §3.5 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.5 + """ + return quote(value, safe="!$&'()*+,;=:@/?") + + +def _interpolate( + template: str, + values: Mapping[str, Any], + quoter: Callable[[str], str], +) -> str: + """Replace {name} placeholders in `template`, quoting each value with `quoter`. + + Placeholder names are looked up in `values`. + + Raises: + KeyError: If a placeholder is not found in `values`. + """ + # re.split with a capturing group returns alternating + # [text, name, text, name, ..., text] elements. + parts = _PLACEHOLDER_RE.split(template) + + for i in range(1, len(parts), 2): + name = parts[i] + if name not in values: + raise KeyError(f"a value for placeholder {{{name}}} was not provided") + val = values[name] + if val is None: + parts[i] = "null" + elif isinstance(val, bool): + parts[i] = "true" if val else "false" + else: + parts[i] = quoter(str(values[name])) + + return "".join(parts) + + +def path_template(template: str, /, **kwargs: Any) -> str: + """Interpolate {name} placeholders in `template` from keyword arguments. + + Args: + template: The template string containing {name} placeholders. + **kwargs: Keyword arguments to interpolate into the template. + + Returns: + The template with placeholders interpolated and percent-encoded. + + Safe characters for percent-encoding are dependent on the URI component. + Placeholders in path and fragment portions are percent-encoded where the `segment` + and `fragment` sets from RFC 3986 respectively are considered safe. + Placeholders in the query portion are percent-encoded where the `query` set from + RFC 3986 §3.3 is considered safe except for = and & characters. + + Raises: + KeyError: If a placeholder is not found in `kwargs`. + ValueError: If resulting path contains /./ or /../ segments (including percent-encoded dot-segments). + """ + # Split the template into path, query, and fragment portions. + fragment_template: str | None = None + query_template: str | None = None + + rest = template + if "#" in rest: + rest, fragment_template = rest.split("#", 1) + if "?" in rest: + rest, query_template = rest.split("?", 1) + path_template = rest + + # Interpolate each portion with the appropriate quoting rules. + path_result = _interpolate(path_template, kwargs, _quote_path_segment_part) + + # Reject dot-segments (. and ..) in the final assembled path. The check + # runs after interpolation so that adjacent placeholders or a mix of static + # text and placeholders that together form a dot-segment are caught. + # Also reject percent-encoded dot-segments to protect against incorrectly + # implemented normalization in servers/proxies. + for segment in path_result.split("/"): + if _DOT_SEGMENT_RE.match(segment): + raise ValueError(f"Constructed path {path_result!r} contains dot-segment {segment!r} which is not allowed") + + result = path_result + if query_template is not None: + result += "?" + _interpolate(query_template, kwargs, _quote_query_part) + if fragment_template is not None: + result += "#" + _interpolate(fragment_template, kwargs, _quote_fragment_part) + + return result diff --git a/src/orb/_version.py b/src/orb/_version.py index 11898a79..c5a82e2e 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "orb" -__version__ = "4.55.0" # x-release-please-version +__version__ = "4.56.0" # x-release-please-version diff --git a/src/orb/resources/alerts.py b/src/orb/resources/alerts.py index 84f485f9..6b20674b 100644 --- a/src/orb/resources/alerts.py +++ b/src/orb/resources/alerts.py @@ -18,8 +18,8 @@ alert_create_for_subscription_params, alert_create_for_external_customer_params, ) -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from .._utils import path_template, 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 @@ -32,6 +32,13 @@ class Alerts(SyncAPIResource): + """ + [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. + """ + @cached_property def with_raw_response(self) -> AlertsWithRawResponse: """ @@ -77,7 +84,7 @@ def retrieve( if not alert_id: raise ValueError(f"Expected a non-empty value for `alert_id` but received {alert_id!r}") return self._get( - f"/alerts/{alert_id}", + path_template("/alerts/{alert_id}", alert_id=alert_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -118,7 +125,7 @@ def update( f"Expected a non-empty value for `alert_configuration_id` but received {alert_configuration_id!r}" ) return self._put( - f"/alerts/{alert_configuration_id}", + path_template("/alerts/{alert_configuration_id}", alert_configuration_id=alert_configuration_id), body=maybe_transform({"thresholds": thresholds}, alert_update_params.AlertUpdateParams), options=make_request_options( extra_headers=extra_headers, @@ -254,7 +261,7 @@ def create_for_customer( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._post( - f"/alerts/customer_id/{customer_id}", + path_template("/alerts/customer_id/{customer_id}", customer_id=customer_id), body=maybe_transform( { "currency": currency, @@ -321,7 +328,9 @@ def create_for_external_customer( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._post( - f"/alerts/external_customer_id/{external_customer_id}", + path_template( + "/alerts/external_customer_id/{external_customer_id}", external_customer_id=external_customer_id + ), body=maybe_transform( { "currency": currency, @@ -346,7 +355,9 @@ def create_for_subscription( *, thresholds: Iterable[ThresholdParam], type: Literal["usage_exceeded", "cost_exceeded"], + grouping_keys: Optional[SequenceNotStr[str]] | Omit = omit, metric_id: Optional[str] | Omit = omit, + pricing_unit_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, @@ -373,8 +384,14 @@ def create_for_subscription( type: The type of alert to create. This must be a valid alert type. + grouping_keys: The property keys to group cost alerts by. Only applicable for cost_exceeded + alerts. + metric_id: The metric to track usage for. + pricing_unit_id: The pricing unit to use for grouped cost alerts. Required when grouping_keys is + set. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -388,12 +405,14 @@ def create_for_subscription( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/alerts/subscription_id/{subscription_id}", + path_template("/alerts/subscription_id/{subscription_id}", subscription_id=subscription_id), body=maybe_transform( { "thresholds": thresholds, "type": type, + "grouping_keys": grouping_keys, "metric_id": metric_id, + "pricing_unit_id": pricing_unit_id, }, alert_create_for_subscription_params.AlertCreateForSubscriptionParams, ), @@ -444,7 +463,7 @@ def disable( f"Expected a non-empty value for `alert_configuration_id` but received {alert_configuration_id!r}" ) return self._post( - f"/alerts/{alert_configuration_id}/disable", + path_template("/alerts/{alert_configuration_id}/disable", alert_configuration_id=alert_configuration_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -493,7 +512,7 @@ def enable( f"Expected a non-empty value for `alert_configuration_id` but received {alert_configuration_id!r}" ) return self._post( - f"/alerts/{alert_configuration_id}/enable", + path_template("/alerts/{alert_configuration_id}/enable", alert_configuration_id=alert_configuration_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -507,6 +526,13 @@ def enable( class AsyncAlerts(AsyncAPIResource): + """ + [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. + """ + @cached_property def with_raw_response(self) -> AsyncAlertsWithRawResponse: """ @@ -552,7 +578,7 @@ async def retrieve( if not alert_id: raise ValueError(f"Expected a non-empty value for `alert_id` but received {alert_id!r}") return await self._get( - f"/alerts/{alert_id}", + path_template("/alerts/{alert_id}", alert_id=alert_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -593,7 +619,7 @@ async def update( f"Expected a non-empty value for `alert_configuration_id` but received {alert_configuration_id!r}" ) return await self._put( - f"/alerts/{alert_configuration_id}", + path_template("/alerts/{alert_configuration_id}", alert_configuration_id=alert_configuration_id), body=await async_maybe_transform({"thresholds": thresholds}, alert_update_params.AlertUpdateParams), options=make_request_options( extra_headers=extra_headers, @@ -729,7 +755,7 @@ async def create_for_customer( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return await self._post( - f"/alerts/customer_id/{customer_id}", + path_template("/alerts/customer_id/{customer_id}", customer_id=customer_id), body=await async_maybe_transform( { "currency": currency, @@ -796,7 +822,9 @@ async def create_for_external_customer( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return await self._post( - f"/alerts/external_customer_id/{external_customer_id}", + path_template( + "/alerts/external_customer_id/{external_customer_id}", external_customer_id=external_customer_id + ), body=await async_maybe_transform( { "currency": currency, @@ -821,7 +849,9 @@ async def create_for_subscription( *, thresholds: Iterable[ThresholdParam], type: Literal["usage_exceeded", "cost_exceeded"], + grouping_keys: Optional[SequenceNotStr[str]] | Omit = omit, metric_id: Optional[str] | Omit = omit, + pricing_unit_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, @@ -848,8 +878,14 @@ async def create_for_subscription( type: The type of alert to create. This must be a valid alert type. + grouping_keys: The property keys to group cost alerts by. Only applicable for cost_exceeded + alerts. + metric_id: The metric to track usage for. + pricing_unit_id: The pricing unit to use for grouped cost alerts. Required when grouping_keys is + set. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -863,12 +899,14 @@ async def create_for_subscription( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/alerts/subscription_id/{subscription_id}", + path_template("/alerts/subscription_id/{subscription_id}", subscription_id=subscription_id), body=await async_maybe_transform( { "thresholds": thresholds, "type": type, + "grouping_keys": grouping_keys, "metric_id": metric_id, + "pricing_unit_id": pricing_unit_id, }, alert_create_for_subscription_params.AlertCreateForSubscriptionParams, ), @@ -919,7 +957,7 @@ async def disable( f"Expected a non-empty value for `alert_configuration_id` but received {alert_configuration_id!r}" ) return await self._post( - f"/alerts/{alert_configuration_id}/disable", + path_template("/alerts/{alert_configuration_id}/disable", alert_configuration_id=alert_configuration_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -970,7 +1008,7 @@ async def enable( f"Expected a non-empty value for `alert_configuration_id` but received {alert_configuration_id!r}" ) return await self._post( - f"/alerts/{alert_configuration_id}/enable", + path_template("/alerts/{alert_configuration_id}/enable", alert_configuration_id=alert_configuration_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/orb/resources/beta/beta.py b/src/orb/resources/beta/beta.py index eb85e15f..4a49637c 100644 --- a/src/orb/resources/beta/beta.py +++ b/src/orb/resources/beta/beta.py @@ -9,7 +9,7 @@ from ... import _legacy_response from ...types import beta_create_plan_version_params, beta_set_default_plan_version_params from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -29,8 +29,19 @@ class Beta(SyncAPIResource): + """ + 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). + """ + @cached_property def external_plan_id(self) -> ExternalPlanID: + """ + 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). + """ return ExternalPlanID(self._client) @cached_property @@ -105,7 +116,7 @@ def create_plan_version( if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") return self._post( - f"/plans/{plan_id}/versions", + path_template("/plans/{plan_id}/versions", plan_id=plan_id), body=maybe_transform( { "version": version, @@ -160,7 +171,7 @@ def fetch_plan_version( if not version: raise ValueError(f"Expected a non-empty value for `version` but received {version!r}") return self._get( - f"/plans/{plan_id}/versions/{version}", + path_template("/plans/{plan_id}/versions/{version}", plan_id=plan_id, version=version), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -199,7 +210,7 @@ def set_default_plan_version( if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") return self._post( - f"/plans/{plan_id}/set_default_version", + path_template("/plans/{plan_id}/set_default_version", plan_id=plan_id), body=maybe_transform( {"version": version}, beta_set_default_plan_version_params.BetaSetDefaultPlanVersionParams ), @@ -215,8 +226,19 @@ def set_default_plan_version( class AsyncBeta(AsyncAPIResource): + """ + 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). + """ + @cached_property def external_plan_id(self) -> AsyncExternalPlanID: + """ + 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). + """ return AsyncExternalPlanID(self._client) @cached_property @@ -291,7 +313,7 @@ async def create_plan_version( if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") return await self._post( - f"/plans/{plan_id}/versions", + path_template("/plans/{plan_id}/versions", plan_id=plan_id), body=await async_maybe_transform( { "version": version, @@ -346,7 +368,7 @@ async def fetch_plan_version( if not version: raise ValueError(f"Expected a non-empty value for `version` but received {version!r}") return await self._get( - f"/plans/{plan_id}/versions/{version}", + path_template("/plans/{plan_id}/versions/{version}", plan_id=plan_id, version=version), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -385,7 +407,7 @@ async def set_default_plan_version( if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") return await self._post( - f"/plans/{plan_id}/set_default_version", + path_template("/plans/{plan_id}/set_default_version", plan_id=plan_id), body=await async_maybe_transform( {"version": version}, beta_set_default_plan_version_params.BetaSetDefaultPlanVersionParams ), @@ -416,6 +438,11 @@ def __init__(self, beta: Beta) -> None: @cached_property def external_plan_id(self) -> ExternalPlanIDWithRawResponse: + """ + 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). + """ return ExternalPlanIDWithRawResponse(self._beta.external_plan_id) @@ -435,6 +462,11 @@ def __init__(self, beta: AsyncBeta) -> None: @cached_property def external_plan_id(self) -> AsyncExternalPlanIDWithRawResponse: + """ + 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). + """ return AsyncExternalPlanIDWithRawResponse(self._beta.external_plan_id) @@ -454,6 +486,11 @@ def __init__(self, beta: Beta) -> None: @cached_property def external_plan_id(self) -> ExternalPlanIDWithStreamingResponse: + """ + 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). + """ return ExternalPlanIDWithStreamingResponse(self._beta.external_plan_id) @@ -473,4 +510,9 @@ def __init__(self, beta: AsyncBeta) -> None: @cached_property def external_plan_id(self) -> AsyncExternalPlanIDWithStreamingResponse: + """ + 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). + """ return AsyncExternalPlanIDWithStreamingResponse(self._beta.external_plan_id) diff --git a/src/orb/resources/beta/external_plan_id.py b/src/orb/resources/beta/external_plan_id.py index d76ecb35..48aa0a7d 100644 --- a/src/orb/resources/beta/external_plan_id.py +++ b/src/orb/resources/beta/external_plan_id.py @@ -8,7 +8,7 @@ from ... import _legacy_response from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -21,6 +21,12 @@ class ExternalPlanID(SyncAPIResource): + """ + 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). + """ + @cached_property def with_raw_response(self) -> ExternalPlanIDWithRawResponse: """ @@ -95,7 +101,7 @@ def create_plan_version( if not external_plan_id: raise ValueError(f"Expected a non-empty value for `external_plan_id` but received {external_plan_id!r}") return self._post( - f"/plans/external_plan_id/{external_plan_id}/versions", + path_template("/plans/external_plan_id/{external_plan_id}/versions", external_plan_id=external_plan_id), body=maybe_transform( { "version": version, @@ -150,7 +156,11 @@ def fetch_plan_version( if not version: raise ValueError(f"Expected a non-empty value for `version` but received {version!r}") return self._get( - f"/plans/external_plan_id/{external_plan_id}/versions/{version}", + path_template( + "/plans/external_plan_id/{external_plan_id}/versions/{version}", + external_plan_id=external_plan_id, + version=version, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -189,7 +199,9 @@ def set_default_plan_version( if not external_plan_id: raise ValueError(f"Expected a non-empty value for `external_plan_id` but received {external_plan_id!r}") return self._post( - f"/plans/external_plan_id/{external_plan_id}/set_default_version", + path_template( + "/plans/external_plan_id/{external_plan_id}/set_default_version", external_plan_id=external_plan_id + ), body=maybe_transform( {"version": version}, external_plan_id_set_default_plan_version_params.ExternalPlanIDSetDefaultPlanVersionParams, @@ -206,6 +218,12 @@ def set_default_plan_version( class AsyncExternalPlanID(AsyncAPIResource): + """ + 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). + """ + @cached_property def with_raw_response(self) -> AsyncExternalPlanIDWithRawResponse: """ @@ -280,7 +298,7 @@ async def create_plan_version( if not external_plan_id: raise ValueError(f"Expected a non-empty value for `external_plan_id` but received {external_plan_id!r}") return await self._post( - f"/plans/external_plan_id/{external_plan_id}/versions", + path_template("/plans/external_plan_id/{external_plan_id}/versions", external_plan_id=external_plan_id), body=await async_maybe_transform( { "version": version, @@ -335,7 +353,11 @@ async def fetch_plan_version( if not version: raise ValueError(f"Expected a non-empty value for `version` but received {version!r}") return await self._get( - f"/plans/external_plan_id/{external_plan_id}/versions/{version}", + path_template( + "/plans/external_plan_id/{external_plan_id}/versions/{version}", + external_plan_id=external_plan_id, + version=version, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -374,7 +396,9 @@ async def set_default_plan_version( if not external_plan_id: raise ValueError(f"Expected a non-empty value for `external_plan_id` but received {external_plan_id!r}") return await self._post( - f"/plans/external_plan_id/{external_plan_id}/set_default_version", + path_template( + "/plans/external_plan_id/{external_plan_id}/set_default_version", external_plan_id=external_plan_id + ), body=await async_maybe_transform( {"version": version}, external_plan_id_set_default_plan_version_params.ExternalPlanIDSetDefaultPlanVersionParams, diff --git a/src/orb/resources/coupons/coupons.py b/src/orb/resources/coupons/coupons.py index b89662c6..9b46d826 100644 --- a/src/orb/resources/coupons/coupons.py +++ b/src/orb/resources/coupons/coupons.py @@ -9,7 +9,7 @@ from ... import _legacy_response from ...types import coupon_list_params, coupon_create_params from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -29,8 +29,15 @@ class Coupons(SyncAPIResource): + """ + 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. + """ + @cached_property def subscriptions(self) -> Subscriptions: + """ + 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. + """ return Subscriptions(self._client) @cached_property @@ -205,7 +212,7 @@ def archive( if not coupon_id: raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return self._post( - f"/coupons/{coupon_id}/archive", + path_template("/coupons/{coupon_id}/archive", coupon_id=coupon_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -245,7 +252,7 @@ def fetch( if not coupon_id: raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return self._get( - f"/coupons/{coupon_id}", + path_template("/coupons/{coupon_id}", coupon_id=coupon_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -254,8 +261,15 @@ def fetch( class AsyncCoupons(AsyncAPIResource): + """ + 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. + """ + @cached_property def subscriptions(self) -> AsyncSubscriptions: + """ + 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. + """ return AsyncSubscriptions(self._client) @cached_property @@ -430,7 +444,7 @@ async def archive( if not coupon_id: raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return await self._post( - f"/coupons/{coupon_id}/archive", + path_template("/coupons/{coupon_id}/archive", coupon_id=coupon_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -470,7 +484,7 @@ async def fetch( if not coupon_id: raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return await self._get( - f"/coupons/{coupon_id}", + path_template("/coupons/{coupon_id}", coupon_id=coupon_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -497,6 +511,9 @@ def __init__(self, coupons: Coupons) -> None: @cached_property def subscriptions(self) -> SubscriptionsWithRawResponse: + """ + 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. + """ return SubscriptionsWithRawResponse(self._coupons.subscriptions) @@ -519,6 +536,9 @@ def __init__(self, coupons: AsyncCoupons) -> None: @cached_property def subscriptions(self) -> AsyncSubscriptionsWithRawResponse: + """ + 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. + """ return AsyncSubscriptionsWithRawResponse(self._coupons.subscriptions) @@ -541,6 +561,9 @@ def __init__(self, coupons: Coupons) -> None: @cached_property def subscriptions(self) -> SubscriptionsWithStreamingResponse: + """ + 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. + """ return SubscriptionsWithStreamingResponse(self._coupons.subscriptions) @@ -563,4 +586,7 @@ def __init__(self, coupons: AsyncCoupons) -> None: @cached_property def subscriptions(self) -> AsyncSubscriptionsWithStreamingResponse: + """ + 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. + """ return AsyncSubscriptionsWithStreamingResponse(self._coupons.subscriptions) diff --git a/src/orb/resources/coupons/subscriptions.py b/src/orb/resources/coupons/subscriptions.py index f3770de4..b8ea4181 100644 --- a/src/orb/resources/coupons/subscriptions.py +++ b/src/orb/resources/coupons/subscriptions.py @@ -8,7 +8,7 @@ from ... import _legacy_response from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform +from ..._utils import path_template, maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper @@ -21,6 +21,10 @@ class Subscriptions(SyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> SubscriptionsWithRawResponse: """ @@ -76,7 +80,7 @@ def list( if not coupon_id: raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return self._get_api_list( - f"/coupons/{coupon_id}/subscriptions", + path_template("/coupons/{coupon_id}/subscriptions", coupon_id=coupon_id), page=SyncPage[Subscription], options=make_request_options( extra_headers=extra_headers, @@ -96,6 +100,10 @@ def list( class AsyncSubscriptions(AsyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> AsyncSubscriptionsWithRawResponse: """ @@ -151,7 +159,7 @@ def list( if not coupon_id: raise ValueError(f"Expected a non-empty value for `coupon_id` but received {coupon_id!r}") return self._get_api_list( - f"/coupons/{coupon_id}/subscriptions", + path_template("/coupons/{coupon_id}/subscriptions", coupon_id=coupon_id), page=AsyncPage[Subscription], options=make_request_options( extra_headers=extra_headers, diff --git a/src/orb/resources/credit_blocks.py b/src/orb/resources/credit_blocks.py index dbba3823..6a698348 100644 --- a/src/orb/resources/credit_blocks.py +++ b/src/orb/resources/credit_blocks.py @@ -6,6 +6,7 @@ from .. import _legacy_response from .._types import Body, Query, Headers, NoneType, NotGiven, not_given +from .._utils import path_template from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper @@ -17,6 +18,10 @@ class CreditBlocks(SyncAPIResource): + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ + @cached_property def with_raw_response(self) -> CreditBlocksWithRawResponse: """ @@ -62,7 +67,7 @@ def retrieve( 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}", + path_template("/credit_blocks/{block_id}", block_id=block_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -113,7 +118,7 @@ def delete( 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}", + path_template("/credit_blocks/{block_id}", block_id=block_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -163,7 +168,7 @@ def list_invoices( 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", + path_template("/credit_blocks/{block_id}/invoices", block_id=block_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -172,6 +177,10 @@ def list_invoices( class AsyncCreditBlocks(AsyncAPIResource): + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ + @cached_property def with_raw_response(self) -> AsyncCreditBlocksWithRawResponse: """ @@ -217,7 +226,7 @@ async def retrieve( 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}", + path_template("/credit_blocks/{block_id}", block_id=block_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -268,7 +277,7 @@ async def delete( 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}", + path_template("/credit_blocks/{block_id}", block_id=block_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -318,7 +327,7 @@ async def list_invoices( 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", + path_template("/credit_blocks/{block_id}/invoices", block_id=block_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/orb/resources/credit_notes.py b/src/orb/resources/credit_notes.py index 0a862b32..98307829 100644 --- a/src/orb/resources/credit_notes.py +++ b/src/orb/resources/credit_notes.py @@ -11,7 +11,7 @@ from .. import _legacy_response from ..types import credit_note_list_params, credit_note_create_params from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, 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 @@ -23,6 +23,11 @@ class CreditNotes(SyncAPIResource): + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ + @cached_property def with_raw_response(self) -> CreditNotesWithRawResponse: """ @@ -220,7 +225,7 @@ def fetch( if not credit_note_id: raise ValueError(f"Expected a non-empty value for `credit_note_id` but received {credit_note_id!r}") return self._get( - f"/credit_notes/{credit_note_id}", + path_template("/credit_notes/{credit_note_id}", credit_note_id=credit_note_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -229,6 +234,11 @@ def fetch( class AsyncCreditNotes(AsyncAPIResource): + """ + The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to a + particular invoice. + """ + @cached_property def with_raw_response(self) -> AsyncCreditNotesWithRawResponse: """ @@ -426,7 +436,7 @@ async def fetch( if not credit_note_id: raise ValueError(f"Expected a non-empty value for `credit_note_id` but received {credit_note_id!r}") return await self._get( - f"/credit_notes/{credit_note_id}", + path_template("/credit_notes/{credit_note_id}", credit_note_id=credit_note_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/orb/resources/customers/balance_transactions.py b/src/orb/resources/customers/balance_transactions.py index cf122136..a35733cb 100644 --- a/src/orb/resources/customers/balance_transactions.py +++ b/src/orb/resources/customers/balance_transactions.py @@ -10,7 +10,7 @@ from ... import _legacy_response from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -24,6 +24,23 @@ class BalanceTransactions(SyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> BalanceTransactionsWithRawResponse: """ @@ -78,7 +95,7 @@ def create( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._post( - f"/customers/{customer_id}/balance_transactions", + path_template("/customers/{customer_id}/balance_transactions", customer_id=customer_id), body=maybe_transform( { "amount": amount, @@ -154,7 +171,7 @@ def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( - f"/customers/{customer_id}/balance_transactions", + path_template("/customers/{customer_id}/balance_transactions", customer_id=customer_id), page=SyncPage[BalanceTransactionListResponse], options=make_request_options( extra_headers=extra_headers, @@ -178,6 +195,23 @@ def list( class AsyncBalanceTransactions(AsyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> AsyncBalanceTransactionsWithRawResponse: """ @@ -232,7 +266,7 @@ async def create( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return await self._post( - f"/customers/{customer_id}/balance_transactions", + path_template("/customers/{customer_id}/balance_transactions", customer_id=customer_id), body=await async_maybe_transform( { "amount": amount, @@ -308,7 +342,7 @@ def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( - f"/customers/{customer_id}/balance_transactions", + path_template("/customers/{customer_id}/balance_transactions", customer_id=customer_id), page=AsyncPage[BalanceTransactionListResponse], options=make_request_options( extra_headers=extra_headers, diff --git a/src/orb/resources/customers/costs.py b/src/orb/resources/customers/costs.py index 6b5f040e..0ccf347b 100644 --- a/src/orb/resources/customers/costs.py +++ b/src/orb/resources/customers/costs.py @@ -10,7 +10,7 @@ from ... import _legacy_response from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -23,6 +23,23 @@ class Costs(SyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> CostsWithRawResponse: """ @@ -199,7 +216,7 @@ def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get( - f"/customers/{customer_id}/costs", + path_template("/customers/{customer_id}/costs", customer_id=customer_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -377,7 +394,10 @@ def list_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._get( - f"/customers/external_customer_id/{external_customer_id}/costs", + path_template( + "/customers/external_customer_id/{external_customer_id}/costs", + external_customer_id=external_customer_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -398,6 +418,23 @@ def list_by_external_id( class AsyncCosts(AsyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> AsyncCostsWithRawResponse: """ @@ -574,7 +611,7 @@ async def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return await self._get( - f"/customers/{customer_id}/costs", + path_template("/customers/{customer_id}/costs", customer_id=customer_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -752,7 +789,10 @@ async def list_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return await self._get( - f"/customers/external_customer_id/{external_customer_id}/costs", + path_template( + "/customers/external_customer_id/{external_customer_id}/costs", + external_customer_id=external_customer_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/orb/resources/customers/credits/credits.py b/src/orb/resources/customers/credits/credits.py index bd4f7c3a..21eee7d2 100644 --- a/src/orb/resources/customers/credits/credits.py +++ b/src/orb/resources/customers/credits/credits.py @@ -25,7 +25,7 @@ AsyncTopUpsWithStreamingResponse, ) from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import maybe_transform +from ...._utils import path_template, maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper @@ -39,12 +39,22 @@ class Credits(SyncAPIResource): + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ + @cached_property def ledger(self) -> Ledger: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return Ledger(self._client) @cached_property def top_ups(self) -> TopUps: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return TopUps(self._client) @cached_property @@ -121,7 +131,7 @@ def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( - f"/customers/{customer_id}/credits", + path_template("/customers/{customer_id}/credits", customer_id=customer_id), page=SyncPage[CreditListResponse], options=make_request_options( extra_headers=extra_headers, @@ -202,7 +212,10 @@ def list_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._get_api_list( - f"/customers/external_customer_id/{external_customer_id}/credits", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits", + external_customer_id=external_customer_id, + ), page=SyncPage[CreditListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, @@ -228,12 +241,22 @@ def list_by_external_id( class AsyncCredits(AsyncAPIResource): + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ + @cached_property def ledger(self) -> AsyncLedger: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return AsyncLedger(self._client) @cached_property def top_ups(self) -> AsyncTopUps: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return AsyncTopUps(self._client) @cached_property @@ -310,7 +333,7 @@ def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( - f"/customers/{customer_id}/credits", + path_template("/customers/{customer_id}/credits", customer_id=customer_id), page=AsyncPage[CreditListResponse], options=make_request_options( extra_headers=extra_headers, @@ -391,7 +414,10 @@ def list_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._get_api_list( - f"/customers/external_customer_id/{external_customer_id}/credits", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits", + external_customer_id=external_customer_id, + ), page=AsyncPage[CreditListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, @@ -429,10 +455,16 @@ def __init__(self, credits: Credits) -> None: @cached_property def ledger(self) -> LedgerWithRawResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return LedgerWithRawResponse(self._credits.ledger) @cached_property def top_ups(self) -> TopUpsWithRawResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return TopUpsWithRawResponse(self._credits.top_ups) @@ -449,10 +481,16 @@ def __init__(self, credits: AsyncCredits) -> None: @cached_property def ledger(self) -> AsyncLedgerWithRawResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return AsyncLedgerWithRawResponse(self._credits.ledger) @cached_property def top_ups(self) -> AsyncTopUpsWithRawResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return AsyncTopUpsWithRawResponse(self._credits.top_ups) @@ -469,10 +507,16 @@ def __init__(self, credits: Credits) -> None: @cached_property def ledger(self) -> LedgerWithStreamingResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return LedgerWithStreamingResponse(self._credits.ledger) @cached_property def top_ups(self) -> TopUpsWithStreamingResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return TopUpsWithStreamingResponse(self._credits.top_ups) @@ -489,8 +533,14 @@ def __init__(self, credits: AsyncCredits) -> None: @cached_property def ledger(self) -> AsyncLedgerWithStreamingResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return AsyncLedgerWithStreamingResponse(self._credits.ledger) @cached_property def top_ups(self) -> AsyncTopUpsWithStreamingResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return AsyncTopUpsWithStreamingResponse(self._credits.top_ups) diff --git a/src/orb/resources/customers/credits/ledger.py b/src/orb/resources/customers/credits/ledger.py index 4ae2e04d..879a93e0 100644 --- a/src/orb/resources/customers/credits/ledger.py +++ b/src/orb/resources/customers/credits/ledger.py @@ -10,7 +10,7 @@ from .... import _legacy_response from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import required_args, maybe_transform, async_maybe_transform +from ...._utils import path_template, required_args, 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 @@ -33,6 +33,10 @@ class Ledger(SyncAPIResource): + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ + @cached_property def with_raw_response(self) -> LedgerWithRawResponse: """ @@ -184,7 +188,7 @@ def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( - f"/customers/{customer_id}/credits/ledger", + path_template("/customers/{customer_id}/credits/ledger", customer_id=customer_id), page=SyncPage[LedgerListResponse], options=make_request_options( extra_headers=extra_headers, @@ -286,8 +290,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -460,8 +470,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -621,8 +637,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -790,8 +812,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -953,8 +981,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -1081,7 +1115,7 @@ def create_entry( return cast( LedgerCreateEntryResponse, self._post( - f"/customers/{customer_id}/credits/ledger_entry", + path_template("/customers/{customer_id}/credits/ledger_entry", customer_id=customer_id), body=maybe_transform( { "amount": amount, @@ -1193,8 +1227,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -1367,8 +1407,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -1528,8 +1574,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -1697,8 +1749,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -1860,8 +1918,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -1994,7 +2058,10 @@ def create_entry_by_external_id( return cast( LedgerCreateEntryByExternalIDResponse, self._post( - f"/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", + external_customer_id=external_customer_id, + ), body=maybe_transform( { "amount": amount, @@ -2160,7 +2227,10 @@ def list_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._get_api_list( - f"/customers/external_customer_id/{external_customer_id}/credits/ledger", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/ledger", + external_customer_id=external_customer_id, + ), page=SyncPage[LedgerListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, @@ -2190,6 +2260,10 @@ def list_by_external_id( class AsyncLedger(AsyncAPIResource): + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ + @cached_property def with_raw_response(self) -> AsyncLedgerWithRawResponse: """ @@ -2341,7 +2415,7 @@ def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( - f"/customers/{customer_id}/credits/ledger", + path_template("/customers/{customer_id}/credits/ledger", customer_id=customer_id), page=AsyncPage[LedgerListResponse], options=make_request_options( extra_headers=extra_headers, @@ -2443,8 +2517,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -2617,8 +2697,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -2778,8 +2864,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -2947,8 +3039,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -3110,8 +3208,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -3238,7 +3342,7 @@ async def create_entry( return cast( LedgerCreateEntryResponse, await self._post( - f"/customers/{customer_id}/credits/ledger_entry", + path_template("/customers/{customer_id}/credits/ledger_entry", customer_id=customer_id), body=await async_maybe_transform( { "amount": amount, @@ -3350,8 +3454,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -3524,8 +3634,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -3685,8 +3801,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -3854,8 +3976,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -4017,8 +4145,14 @@ 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. Additionally, Orb also enforces invoice generation when a - non-zero `per_unit_cost_basis` value is provided. + credit units added. If you invoice or handle payment of credits outside of Orb + (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to + `true` to prevent duplicate invoicing effects. + + - if `per_unit_cost_basis` is greater than zero, an invoice will be generated + and `invoice_settings` must be included + - if `invoice_settings` is passed, one of either `custom_due_date` or + `net_terms` is required to determine the due date ## Deducting Credits @@ -4151,7 +4285,10 @@ async def create_entry_by_external_id( return cast( LedgerCreateEntryByExternalIDResponse, await self._post( - f"/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", + external_customer_id=external_customer_id, + ), body=await async_maybe_transform( { "amount": amount, @@ -4317,7 +4454,10 @@ def list_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._get_api_list( - f"/customers/external_customer_id/{external_customer_id}/credits/ledger", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/ledger", + external_customer_id=external_customer_id, + ), page=AsyncPage[LedgerListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, diff --git a/src/orb/resources/customers/credits/top_ups.py b/src/orb/resources/customers/credits/top_ups.py index 6dc08792..52d2ac9f 100644 --- a/src/orb/resources/customers/credits/top_ups.py +++ b/src/orb/resources/customers/credits/top_ups.py @@ -10,7 +10,7 @@ from .... import _legacy_response from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given -from ...._utils import maybe_transform, async_maybe_transform +from ...._utils import path_template, 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 @@ -31,6 +31,10 @@ class TopUps(SyncAPIResource): + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ + @cached_property def with_raw_response(self) -> TopUpsWithRawResponse: """ @@ -113,7 +117,7 @@ def create( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._post( - f"/customers/{customer_id}/credits/top_ups", + path_template("/customers/{customer_id}/credits/top_ups", customer_id=customer_id), body=maybe_transform( { "amount": amount, @@ -171,7 +175,7 @@ def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( - f"/customers/{customer_id}/credits/top_ups", + path_template("/customers/{customer_id}/credits/top_ups", customer_id=customer_id), page=SyncPage[TopUpListResponse], options=make_request_options( extra_headers=extra_headers, @@ -223,7 +227,9 @@ def delete( raise ValueError(f"Expected a non-empty value for `top_up_id` but received {top_up_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._delete( - f"/customers/{customer_id}/credits/top_ups/{top_up_id}", + path_template( + "/customers/{customer_id}/credits/top_ups/{top_up_id}", customer_id=customer_id, top_up_id=top_up_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -299,7 +305,10 @@ def create_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._post( - f"/customers/external_customer_id/{external_customer_id}/credits/top_ups", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/top_ups", + external_customer_id=external_customer_id, + ), body=maybe_transform( { "amount": amount, @@ -359,7 +368,11 @@ def delete_by_external_id( raise ValueError(f"Expected a non-empty value for `top_up_id` but received {top_up_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._delete( - f"/customers/external_customer_id/{external_customer_id}/credits/top_ups/{top_up_id}", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/top_ups/{top_up_id}", + external_customer_id=external_customer_id, + top_up_id=top_up_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -406,7 +419,10 @@ def list_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._get_api_list( - f"/customers/external_customer_id/{external_customer_id}/credits/top_ups", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/top_ups", + external_customer_id=external_customer_id, + ), page=SyncPage[TopUpListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, @@ -426,6 +442,10 @@ def list_by_external_id( class AsyncTopUps(AsyncAPIResource): + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ + @cached_property def with_raw_response(self) -> AsyncTopUpsWithRawResponse: """ @@ -508,7 +528,7 @@ async def create( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return await self._post( - f"/customers/{customer_id}/credits/top_ups", + path_template("/customers/{customer_id}/credits/top_ups", customer_id=customer_id), body=await async_maybe_transform( { "amount": amount, @@ -566,7 +586,7 @@ def list( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get_api_list( - f"/customers/{customer_id}/credits/top_ups", + path_template("/customers/{customer_id}/credits/top_ups", customer_id=customer_id), page=AsyncPage[TopUpListResponse], options=make_request_options( extra_headers=extra_headers, @@ -618,7 +638,9 @@ async def delete( raise ValueError(f"Expected a non-empty value for `top_up_id` but received {top_up_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._delete( - f"/customers/{customer_id}/credits/top_ups/{top_up_id}", + path_template( + "/customers/{customer_id}/credits/top_ups/{top_up_id}", customer_id=customer_id, top_up_id=top_up_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -694,7 +716,10 @@ async def create_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return await self._post( - f"/customers/external_customer_id/{external_customer_id}/credits/top_ups", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/top_ups", + external_customer_id=external_customer_id, + ), body=await async_maybe_transform( { "amount": amount, @@ -754,7 +779,11 @@ async def delete_by_external_id( raise ValueError(f"Expected a non-empty value for `top_up_id` but received {top_up_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._delete( - f"/customers/external_customer_id/{external_customer_id}/credits/top_ups/{top_up_id}", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/top_ups/{top_up_id}", + external_customer_id=external_customer_id, + top_up_id=top_up_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -801,7 +830,10 @@ def list_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._get_api_list( - f"/customers/external_customer_id/{external_customer_id}/credits/top_ups", + path_template( + "/customers/external_customer_id/{external_customer_id}/credits/top_ups", + external_customer_id=external_customer_id, + ), page=AsyncPage[TopUpListByExternalIDResponse], options=make_request_options( extra_headers=extra_headers, diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index 20ae377a..94d424ab 100644 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -24,7 +24,7 @@ customer_update_by_external_id_params, ) from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -57,16 +57,68 @@ class Customers(SyncAPIResource): + """ + 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. + """ + @cached_property def costs(self) -> Costs: + """ + 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. + """ return Costs(self._client) @cached_property def credits(self) -> Credits: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return Credits(self._client) @cached_property def balance_transactions(self) -> BalanceTransactions: + """ + 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. + """ return BalanceTransactions(self._client) @cached_property @@ -104,7 +156,9 @@ def create( 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"]] + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, reporting_configuration: Optional[NewReportingConfigurationParam] | Omit = omit, @@ -391,7 +445,9 @@ def update( 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"]] + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, reporting_configuration: Optional[NewReportingConfigurationParam] | Omit = omit, @@ -409,9 +465,10 @@ def update( """ This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, - `auto_collection`, `metadata`, `shipping_address`, `billing_address`, and - `additional_emails` of an existing customer. Other fields on a customer are - currently immutable. + `auto_collection`, `metadata`, `shipping_address`, `billing_address`, + `additional_emails`, and `currency` of an existing customer. `currency` can only + be set if it has not already been set on the customer. Other fields on a + customer are currently immutable. Args: additional_emails: Additional email addresses for this customer. If populated, these email @@ -427,8 +484,10 @@ def update( manual approval.If `null` is specified, the customer's auto issuance setting will be inherited from the account-level setting. - currency: An ISO 4217 currency string used for the customer's invoices and balance. If not - set at creation time, will be set at subscription creation time. + currency: An ISO 4217 currency string used for the customer's invoices and balance. This + can only be set if the customer does not already have a currency configured. If + not set at creation or update time, it will be set at subscription creation + time. email: A valid customer email, to be used for invoicing and notifications. @@ -619,7 +678,7 @@ def update( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._put( - f"/customers/{customer_id}", + path_template("/customers/{customer_id}", customer_id=customer_id), body=maybe_transform( { "accounting_sync_configuration": accounting_sync_configuration, @@ -757,7 +816,7 @@ def delete( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._delete( - f"/customers/{customer_id}", + path_template("/customers/{customer_id}", customer_id=customer_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -800,7 +859,7 @@ def fetch( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return self._get( - f"/customers/{customer_id}", + path_template("/customers/{customer_id}", customer_id=customer_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -839,7 +898,9 @@ def fetch_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return self._get( - f"/customers/external_customer_id/{external_customer_id}", + path_template( + "/customers/external_customer_id/{external_customer_id}", external_customer_id=external_customer_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -881,7 +942,7 @@ def sync_payment_methods_from_gateway( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._post( - f"/customers/{customer_id}/sync_payment_methods_from_gateway", + path_template("/customers/{customer_id}/sync_payment_methods_from_gateway", customer_id=customer_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -929,7 +990,10 @@ def sync_payment_methods_from_gateway_by_external_customer_id( ) extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._post( - f"/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway", + path_template( + "/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway", + external_customer_id=external_customer_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -957,7 +1021,9 @@ def update_by_external_id( 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"]] + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, reporting_configuration: Optional[NewReportingConfigurationParam] | Omit = omit, @@ -992,8 +1058,10 @@ def update_by_external_id( manual approval.If `null` is specified, the customer's auto issuance setting will be inherited from the account-level setting. - currency: An ISO 4217 currency string used for the customer's invoices and balance. If not - set at creation time, will be set at subscription creation time. + currency: An ISO 4217 currency string used for the customer's invoices and balance. This + can only be set if the customer does not already have a currency configured. If + not set at creation or update time, it will be set at subscription creation + time. email: A valid customer email, to be used for invoicing and notifications. @@ -1184,7 +1252,7 @@ def update_by_external_id( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._put( - f"/customers/external_customer_id/{id}", + path_template("/customers/external_customer_id/{id}", id=id), body=maybe_transform( { "accounting_sync_configuration": accounting_sync_configuration, @@ -1221,16 +1289,68 @@ def update_by_external_id( class AsyncCustomers(AsyncAPIResource): + """ + 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. + """ + @cached_property def costs(self) -> AsyncCosts: + """ + 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. + """ return AsyncCosts(self._client) @cached_property def credits(self) -> AsyncCredits: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return AsyncCredits(self._client) @cached_property def balance_transactions(self) -> AsyncBalanceTransactions: + """ + 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. + """ return AsyncBalanceTransactions(self._client) @cached_property @@ -1268,7 +1388,9 @@ async def create( 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"]] + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, reporting_configuration: Optional[NewReportingConfigurationParam] | Omit = omit, @@ -1555,7 +1677,9 @@ async def update( 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"]] + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, reporting_configuration: Optional[NewReportingConfigurationParam] | Omit = omit, @@ -1573,9 +1697,10 @@ async def update( """ This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, - `auto_collection`, `metadata`, `shipping_address`, `billing_address`, and - `additional_emails` of an existing customer. Other fields on a customer are - currently immutable. + `auto_collection`, `metadata`, `shipping_address`, `billing_address`, + `additional_emails`, and `currency` of an existing customer. `currency` can only + be set if it has not already been set on the customer. Other fields on a + customer are currently immutable. Args: additional_emails: Additional email addresses for this customer. If populated, these email @@ -1591,8 +1716,10 @@ async def update( manual approval.If `null` is specified, the customer's auto issuance setting will be inherited from the account-level setting. - currency: An ISO 4217 currency string used for the customer's invoices and balance. If not - set at creation time, will be set at subscription creation time. + currency: An ISO 4217 currency string used for the customer's invoices and balance. This + can only be set if the customer does not already have a currency configured. If + not set at creation or update time, it will be set at subscription creation + time. email: A valid customer email, to be used for invoicing and notifications. @@ -1783,7 +1910,7 @@ async def update( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return await self._put( - f"/customers/{customer_id}", + path_template("/customers/{customer_id}", customer_id=customer_id), body=await async_maybe_transform( { "accounting_sync_configuration": accounting_sync_configuration, @@ -1921,7 +2048,7 @@ async def delete( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._delete( - f"/customers/{customer_id}", + path_template("/customers/{customer_id}", customer_id=customer_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1964,7 +2091,7 @@ async def fetch( if not customer_id: raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") return await self._get( - f"/customers/{customer_id}", + path_template("/customers/{customer_id}", customer_id=customer_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -2003,7 +2130,9 @@ async def fetch_by_external_id( f"Expected a non-empty value for `external_customer_id` but received {external_customer_id!r}" ) return await self._get( - f"/customers/external_customer_id/{external_customer_id}", + path_template( + "/customers/external_customer_id/{external_customer_id}", external_customer_id=external_customer_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -2045,7 +2174,7 @@ async def sync_payment_methods_from_gateway( raise ValueError(f"Expected a non-empty value for `customer_id` but received {customer_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._post( - f"/customers/{customer_id}/sync_payment_methods_from_gateway", + path_template("/customers/{customer_id}/sync_payment_methods_from_gateway", customer_id=customer_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2093,7 +2222,10 @@ async def sync_payment_methods_from_gateway_by_external_customer_id( ) extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._post( - f"/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway", + path_template( + "/customers/external_customer_id/{external_customer_id}/sync_payment_methods_from_gateway", + external_customer_id=external_customer_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2121,7 +2253,9 @@ async def update_by_external_id( 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"]] + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] | Omit = omit, payment_provider_id: Optional[str] | Omit = omit, reporting_configuration: Optional[NewReportingConfigurationParam] | Omit = omit, @@ -2156,8 +2290,10 @@ async def update_by_external_id( manual approval.If `null` is specified, the customer's auto issuance setting will be inherited from the account-level setting. - currency: An ISO 4217 currency string used for the customer's invoices and balance. If not - set at creation time, will be set at subscription creation time. + currency: An ISO 4217 currency string used for the customer's invoices and balance. This + can only be set if the customer does not already have a currency configured. If + not set at creation or update time, it will be set at subscription creation + time. email: A valid customer email, to be used for invoicing and notifications. @@ -2348,7 +2484,7 @@ async def update_by_external_id( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._put( - f"/customers/external_customer_id/{id}", + path_template("/customers/external_customer_id/{id}", id=id), body=await async_maybe_transform( { "accounting_sync_configuration": accounting_sync_configuration, @@ -2418,14 +2554,49 @@ def __init__(self, customers: Customers) -> None: @cached_property def costs(self) -> CostsWithRawResponse: + """ + 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. + """ return CostsWithRawResponse(self._customers.costs) @cached_property def credits(self) -> CreditsWithRawResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return CreditsWithRawResponse(self._customers.credits) @cached_property def balance_transactions(self) -> BalanceTransactionsWithRawResponse: + """ + 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. + """ return BalanceTransactionsWithRawResponse(self._customers.balance_transactions) @@ -2463,14 +2634,49 @@ def __init__(self, customers: AsyncCustomers) -> None: @cached_property def costs(self) -> AsyncCostsWithRawResponse: + """ + 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. + """ return AsyncCostsWithRawResponse(self._customers.costs) @cached_property def credits(self) -> AsyncCreditsWithRawResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return AsyncCreditsWithRawResponse(self._customers.credits) @cached_property def balance_transactions(self) -> AsyncBalanceTransactionsWithRawResponse: + """ + 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. + """ return AsyncBalanceTransactionsWithRawResponse(self._customers.balance_transactions) @@ -2508,14 +2714,49 @@ def __init__(self, customers: Customers) -> None: @cached_property def costs(self) -> CostsWithStreamingResponse: + """ + 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. + """ return CostsWithStreamingResponse(self._customers.costs) @cached_property def credits(self) -> CreditsWithStreamingResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return CreditsWithStreamingResponse(self._customers.credits) @cached_property def balance_transactions(self) -> BalanceTransactionsWithStreamingResponse: + """ + 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. + """ return BalanceTransactionsWithStreamingResponse(self._customers.balance_transactions) @@ -2553,12 +2794,47 @@ def __init__(self, customers: AsyncCustomers) -> None: @cached_property def costs(self) -> AsyncCostsWithStreamingResponse: + """ + 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. + """ return AsyncCostsWithStreamingResponse(self._customers.costs) @cached_property def credits(self) -> AsyncCreditsWithStreamingResponse: + """ + The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb. + """ return AsyncCreditsWithStreamingResponse(self._customers.credits) @cached_property def balance_transactions(self) -> AsyncBalanceTransactionsWithStreamingResponse: + """ + 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. + """ return AsyncBalanceTransactionsWithStreamingResponse(self._customers.balance_transactions) diff --git a/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py b/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py index 8c1367ab..1f0691df 100644 --- a/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py +++ b/src/orb/resources/dimensional_price_groups/dimensional_price_groups.py @@ -13,7 +13,7 @@ dimensional_price_group_update_params, ) from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -149,7 +149,10 @@ def retrieve( f"Expected a non-empty value for `dimensional_price_group_id` but received {dimensional_price_group_id!r}" ) return self._get( - f"/dimensional_price_groups/{dimensional_price_group_id}", + path_template( + "/dimensional_price_groups/{dimensional_price_group_id}", + dimensional_price_group_id=dimensional_price_group_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -200,7 +203,10 @@ def update( f"Expected a non-empty value for `dimensional_price_group_id` but received {dimensional_price_group_id!r}" ) return self._put( - f"/dimensional_price_groups/{dimensional_price_group_id}", + path_template( + "/dimensional_price_groups/{dimensional_price_group_id}", + dimensional_price_group_id=dimensional_price_group_id, + ), body=maybe_transform( { "external_dimensional_price_group_id": external_dimensional_price_group_id, @@ -385,7 +391,10 @@ async def retrieve( f"Expected a non-empty value for `dimensional_price_group_id` but received {dimensional_price_group_id!r}" ) return await self._get( - f"/dimensional_price_groups/{dimensional_price_group_id}", + path_template( + "/dimensional_price_groups/{dimensional_price_group_id}", + dimensional_price_group_id=dimensional_price_group_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -436,7 +445,10 @@ async def update( f"Expected a non-empty value for `dimensional_price_group_id` but received {dimensional_price_group_id!r}" ) return await self._put( - f"/dimensional_price_groups/{dimensional_price_group_id}", + path_template( + "/dimensional_price_groups/{dimensional_price_group_id}", + dimensional_price_group_id=dimensional_price_group_id, + ), body=await async_maybe_transform( { "external_dimensional_price_group_id": external_dimensional_price_group_id, diff --git a/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py b/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py index dcd0e4bb..1e3bf12d 100644 --- a/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py +++ b/src/orb/resources/dimensional_price_groups/external_dimensional_price_group_id.py @@ -8,7 +8,7 @@ from ... import _legacy_response from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -67,7 +67,10 @@ def retrieve( f"Expected a non-empty value for `external_dimensional_price_group_id` but received {external_dimensional_price_group_id!r}" ) return self._get( - f"/dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id}", + path_template( + "/dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id}", + external_dimensional_price_group_id=external_dimensional_price_group_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -118,7 +121,10 @@ def update( f"Expected a non-empty value for `path_external_dimensional_price_group_id` but received {path_external_dimensional_price_group_id!r}" ) return self._put( - f"/dimensional_price_groups/external_dimensional_price_group_id/{path_external_dimensional_price_group_id}", + path_template( + "/dimensional_price_groups/external_dimensional_price_group_id/{path_external_dimensional_price_group_id}", + path_external_dimensional_price_group_id=path_external_dimensional_price_group_id, + ), body=maybe_transform( { "body_external_dimensional_price_group_id": body_external_dimensional_price_group_id, @@ -185,7 +191,10 @@ async def retrieve( f"Expected a non-empty value for `external_dimensional_price_group_id` but received {external_dimensional_price_group_id!r}" ) return await self._get( - f"/dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id}", + path_template( + "/dimensional_price_groups/external_dimensional_price_group_id/{external_dimensional_price_group_id}", + external_dimensional_price_group_id=external_dimensional_price_group_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -236,7 +245,10 @@ async def update( f"Expected a non-empty value for `path_external_dimensional_price_group_id` but received {path_external_dimensional_price_group_id!r}" ) return await self._put( - f"/dimensional_price_groups/external_dimensional_price_group_id/{path_external_dimensional_price_group_id}", + path_template( + "/dimensional_price_groups/external_dimensional_price_group_id/{path_external_dimensional_price_group_id}", + path_external_dimensional_price_group_id=path_external_dimensional_price_group_id, + ), body=await async_maybe_transform( { "body_external_dimensional_price_group_id": body_external_dimensional_price_group_id, diff --git a/src/orb/resources/events/backfills.py b/src/orb/resources/events/backfills.py index 7839e27c..4147321a 100644 --- a/src/orb/resources/events/backfills.py +++ b/src/orb/resources/events/backfills.py @@ -9,7 +9,7 @@ from ... import _legacy_response from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -26,6 +26,12 @@ class Backfills(SyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> BackfillsWithRawResponse: """ @@ -252,7 +258,7 @@ def close( if not backfill_id: raise ValueError(f"Expected a non-empty value for `backfill_id` but received {backfill_id!r}") return self._post( - f"/events/backfills/{backfill_id}/close", + path_template("/events/backfills/{backfill_id}/close", backfill_id=backfill_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -289,7 +295,7 @@ def fetch( if not backfill_id: raise ValueError(f"Expected a non-empty value for `backfill_id` but received {backfill_id!r}") return self._get( - f"/events/backfills/{backfill_id}", + path_template("/events/backfills/{backfill_id}", backfill_id=backfill_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -332,7 +338,7 @@ def revert( if not backfill_id: raise ValueError(f"Expected a non-empty value for `backfill_id` but received {backfill_id!r}") return self._post( - f"/events/backfills/{backfill_id}/revert", + path_template("/events/backfills/{backfill_id}/revert", backfill_id=backfill_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -345,6 +351,12 @@ def revert( class AsyncBackfills(AsyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> AsyncBackfillsWithRawResponse: """ @@ -571,7 +583,7 @@ async def close( if not backfill_id: raise ValueError(f"Expected a non-empty value for `backfill_id` but received {backfill_id!r}") return await self._post( - f"/events/backfills/{backfill_id}/close", + path_template("/events/backfills/{backfill_id}/close", backfill_id=backfill_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -608,7 +620,7 @@ async def fetch( if not backfill_id: raise ValueError(f"Expected a non-empty value for `backfill_id` but received {backfill_id!r}") return await self._get( - f"/events/backfills/{backfill_id}", + path_template("/events/backfills/{backfill_id}", backfill_id=backfill_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -651,7 +663,7 @@ async def revert( if not backfill_id: raise ValueError(f"Expected a non-empty value for `backfill_id` but received {backfill_id!r}") return await self._post( - f"/events/backfills/{backfill_id}/revert", + path_template("/events/backfills/{backfill_id}/revert", backfill_id=backfill_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/orb/resources/events/events.py b/src/orb/resources/events/events.py index 0d372f1a..9deeff57 100644 --- a/src/orb/resources/events/events.py +++ b/src/orb/resources/events/events.py @@ -18,7 +18,7 @@ ) from ...types import event_ingest_params, event_search_params, event_update_params from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from .backfills import ( Backfills, @@ -40,12 +40,28 @@ class Events(SyncAPIResource): + """ + 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. + """ + @cached_property def backfills(self) -> Backfills: + """ + 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. + """ return Backfills(self._client) @cached_property def volume(self) -> Volume: + """ + 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. + """ return Volume(self._client) @cached_property @@ -159,7 +175,7 @@ def update( if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return self._put( - f"/events/{event_id}", + path_template("/events/{event_id}", event_id=event_id), body=maybe_transform( { "event_name": event_name, @@ -248,7 +264,7 @@ def deprecate( if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return self._put( - f"/events/{event_id}/deprecate", + path_template("/events/{event_id}/deprecate", event_id=event_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -591,12 +607,28 @@ def search( class AsyncEvents(AsyncAPIResource): + """ + 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. + """ + @cached_property def backfills(self) -> AsyncBackfills: + """ + 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. + """ return AsyncBackfills(self._client) @cached_property def volume(self) -> AsyncVolume: + """ + 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. + """ return AsyncVolume(self._client) @cached_property @@ -710,7 +742,7 @@ async def update( if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return await self._put( - f"/events/{event_id}", + path_template("/events/{event_id}", event_id=event_id), body=await async_maybe_transform( { "event_name": event_name, @@ -799,7 +831,7 @@ async def deprecate( if not event_id: raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") return await self._put( - f"/events/{event_id}/deprecate", + path_template("/events/{event_id}/deprecate", event_id=event_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1160,10 +1192,20 @@ def __init__(self, events: Events) -> None: @cached_property def backfills(self) -> BackfillsWithRawResponse: + """ + 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. + """ return BackfillsWithRawResponse(self._events.backfills) @cached_property def volume(self) -> VolumeWithRawResponse: + """ + 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. + """ return VolumeWithRawResponse(self._events.volume) @@ -1186,10 +1228,20 @@ def __init__(self, events: AsyncEvents) -> None: @cached_property def backfills(self) -> AsyncBackfillsWithRawResponse: + """ + 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. + """ return AsyncBackfillsWithRawResponse(self._events.backfills) @cached_property def volume(self) -> AsyncVolumeWithRawResponse: + """ + 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. + """ return AsyncVolumeWithRawResponse(self._events.volume) @@ -1212,10 +1264,20 @@ def __init__(self, events: Events) -> None: @cached_property def backfills(self) -> BackfillsWithStreamingResponse: + """ + 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. + """ return BackfillsWithStreamingResponse(self._events.backfills) @cached_property def volume(self) -> VolumeWithStreamingResponse: + """ + 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. + """ return VolumeWithStreamingResponse(self._events.volume) @@ -1238,8 +1300,18 @@ def __init__(self, events: AsyncEvents) -> None: @cached_property def backfills(self) -> AsyncBackfillsWithStreamingResponse: + """ + 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. + """ return AsyncBackfillsWithStreamingResponse(self._events.backfills) @cached_property def volume(self) -> AsyncVolumeWithStreamingResponse: + """ + 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. + """ return AsyncVolumeWithStreamingResponse(self._events.volume) diff --git a/src/orb/resources/events/volume.py b/src/orb/resources/events/volume.py index b2be9b8e..1342b46c 100644 --- a/src/orb/resources/events/volume.py +++ b/src/orb/resources/events/volume.py @@ -21,6 +21,12 @@ class Volume(SyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> VolumeWithRawResponse: """ @@ -115,6 +121,12 @@ def list( class AsyncVolume(AsyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> AsyncVolumeWithRawResponse: """ diff --git a/src/orb/resources/invoice_line_items.py b/src/orb/resources/invoice_line_items.py index 0bc3c106..0c2d31dc 100644 --- a/src/orb/resources/invoice_line_items.py +++ b/src/orb/resources/invoice_line_items.py @@ -21,6 +21,13 @@ class InvoiceLineItems(SyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> InvoiceLineItemsWithRawResponse: """ @@ -133,6 +140,13 @@ def create( class AsyncInvoiceLineItems(AsyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> AsyncInvoiceLineItemsWithRawResponse: """ diff --git a/src/orb/resources/invoices.py b/src/orb/resources/invoices.py index 6660d1f6..10195fdc 100644 --- a/src/orb/resources/invoices.py +++ b/src/orb/resources/invoices.py @@ -10,6 +10,7 @@ from .. import _legacy_response from ..types import ( + invoice_pay_params, invoice_list_params, invoice_issue_params, invoice_create_params, @@ -20,7 +21,7 @@ invoice_fetch_upcoming_params, ) from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, 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 @@ -36,6 +37,13 @@ class Invoices(SyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> InvoicesWithRawResponse: """ @@ -61,6 +69,7 @@ def create( currency: str, invoice_date: Union[str, datetime], line_items: Iterable[invoice_create_params.LineItem], + auto_collection: Optional[bool] | Omit = omit, customer_id: Optional[str] | Omit = omit, discount: Optional[Discount] | Omit = omit, due_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit, @@ -87,6 +96,10 @@ def create( invoice_date: Optional invoice date to set. Must be in the past, if not set, `invoice_date` is set to the current time in the customer's timezone. + auto_collection: Determines whether this invoice will automatically attempt to charge a saved + payment method, if any. If not specified, the invoice inherits the customer's + auto_collection setting. + customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and `external_customer_id` are required. @@ -132,6 +145,7 @@ def create( "currency": currency, "invoice_date": invoice_date, "line_items": line_items, + "auto_collection": auto_collection, "customer_id": customer_id, "discount": discount, "due_date": due_date, @@ -157,6 +171,7 @@ def update( self, invoice_id: str, *, + auto_collection: Optional[bool] | Omit = omit, due_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit, invoice_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, @@ -170,15 +185,20 @@ def update( idempotency_key: str | None = None, ) -> Invoice: """ - This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and - `invoice_date` properties on an invoice. If you pass null for the metadata - value, it will clear any existing metadata for that invoice. + This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, + `invoice_date`, and `auto_collection` properties on an invoice. If you pass null + for the metadata value, it will clear any existing metadata for that invoice. `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`, - and `invoice_date` can only be modified if the invoice is in a `draft` state. - `invoice_date` can only be modified for non-subscription invoices. + `invoice_date`, and `auto_collection` can only be modified if the invoice is in + a `draft` state. `invoice_date` can only be modified for non-subscription + invoices. Args: + auto_collection: Determines whether this invoice will automatically attempt to charge a saved + payment method, if any. Can only be modified on draft invoices. If not + specified, the invoice's existing setting is unchanged. + due_date: An optional custom due date for the invoice. If not set, the due date will be calculated based on the `net_terms` value. @@ -207,9 +227,10 @@ def update( if not invoice_id: raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") return self._put( - f"/invoices/{invoice_id}", + path_template("/invoices/{invoice_id}", invoice_id=invoice_id), body=maybe_transform( { + "auto_collection": auto_collection, "due_date": due_date, "invoice_date": invoice_date, "metadata": metadata, @@ -363,7 +384,11 @@ def delete_line_item( 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}", + path_template( + "/invoices/{invoice_id}/invoice_line_items/{line_item_id}", + invoice_id=invoice_id, + line_item_id=line_item_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -401,7 +426,7 @@ def fetch( if not invoice_id: raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") return self._get( - f"/invoices/{invoice_id}", + path_template("/invoices/{invoice_id}", invoice_id=invoice_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -489,7 +514,7 @@ def issue( 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/{invoice_id}/issue", + path_template("/invoices/{invoice_id}/issue", invoice_id=invoice_id), body=maybe_transform({"synchronous": synchronous}, invoice_issue_params.InvoiceIssueParams), options=make_request_options( extra_headers=extra_headers, @@ -546,7 +571,7 @@ def issue_summary( 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", + path_template("/invoices/summary/{invoice_id}/issue", invoice_id=invoice_id), body=maybe_transform({"synchronous": synchronous}, invoice_issue_summary_params.InvoiceIssueSummaryParams), options=make_request_options( extra_headers=extra_headers, @@ -700,7 +725,7 @@ def mark_paid( 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/{invoice_id}/mark_paid", + path_template("/invoices/{invoice_id}/mark_paid", invoice_id=invoice_id), body=maybe_transform( { "payment_received_date": payment_received_date, @@ -723,6 +748,7 @@ def pay( self, invoice_id: str, *, + shared_payment_token_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, @@ -731,11 +757,16 @@ def pay( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> Invoice: - """ - This endpoint collects payment for an invoice using the customer's default - payment method. This action can only be taken on invoices with status "issued". + """This endpoint collects payment for an invoice. + + By default, it uses the + customer's default payment method. Optionally, a shared payment token (SPT) can + be provided to pay using agent-granted credentials instead. This action can only + be taken on invoices with status "issued". Args: + shared_payment_token_id: The ID of a shared payment token granted by an agent to use for this payment. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -749,7 +780,10 @@ def pay( 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/{invoice_id}/pay", + path_template("/invoices/{invoice_id}/pay", invoice_id=invoice_id), + body=maybe_transform( + {"shared_payment_token_id": shared_payment_token_id}, invoice_pay_params.InvoicePayParams + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -800,7 +834,7 @@ def void( 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/{invoice_id}/void", + path_template("/invoices/{invoice_id}/void", invoice_id=invoice_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -813,6 +847,13 @@ def void( class AsyncInvoices(AsyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> AsyncInvoicesWithRawResponse: """ @@ -838,6 +879,7 @@ async def create( currency: str, invoice_date: Union[str, datetime], line_items: Iterable[invoice_create_params.LineItem], + auto_collection: Optional[bool] | Omit = omit, customer_id: Optional[str] | Omit = omit, discount: Optional[Discount] | Omit = omit, due_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit, @@ -864,6 +906,10 @@ async def create( invoice_date: Optional invoice date to set. Must be in the past, if not set, `invoice_date` is set to the current time in the customer's timezone. + auto_collection: Determines whether this invoice will automatically attempt to charge a saved + payment method, if any. If not specified, the invoice inherits the customer's + auto_collection setting. + customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and `external_customer_id` are required. @@ -909,6 +955,7 @@ async def create( "currency": currency, "invoice_date": invoice_date, "line_items": line_items, + "auto_collection": auto_collection, "customer_id": customer_id, "discount": discount, "due_date": due_date, @@ -934,6 +981,7 @@ async def update( self, invoice_id: str, *, + auto_collection: Optional[bool] | Omit = omit, due_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit, invoice_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit, metadata: Optional[Dict[str, Optional[str]]] | Omit = omit, @@ -947,15 +995,20 @@ async def update( idempotency_key: str | None = None, ) -> Invoice: """ - This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and - `invoice_date` properties on an invoice. If you pass null for the metadata - value, it will clear any existing metadata for that invoice. + This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, + `invoice_date`, and `auto_collection` properties on an invoice. If you pass null + for the metadata value, it will clear any existing metadata for that invoice. `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`, - and `invoice_date` can only be modified if the invoice is in a `draft` state. - `invoice_date` can only be modified for non-subscription invoices. + `invoice_date`, and `auto_collection` can only be modified if the invoice is in + a `draft` state. `invoice_date` can only be modified for non-subscription + invoices. Args: + auto_collection: Determines whether this invoice will automatically attempt to charge a saved + payment method, if any. Can only be modified on draft invoices. If not + specified, the invoice's existing setting is unchanged. + due_date: An optional custom due date for the invoice. If not set, the due date will be calculated based on the `net_terms` value. @@ -984,9 +1037,10 @@ async def update( if not invoice_id: raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") return await self._put( - f"/invoices/{invoice_id}", + path_template("/invoices/{invoice_id}", invoice_id=invoice_id), body=await async_maybe_transform( { + "auto_collection": auto_collection, "due_date": due_date, "invoice_date": invoice_date, "metadata": metadata, @@ -1140,7 +1194,11 @@ async def delete_line_item( 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}", + path_template( + "/invoices/{invoice_id}/invoice_line_items/{line_item_id}", + invoice_id=invoice_id, + line_item_id=line_item_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1178,7 +1236,7 @@ async def fetch( if not invoice_id: raise ValueError(f"Expected a non-empty value for `invoice_id` but received {invoice_id!r}") return await self._get( - f"/invoices/{invoice_id}", + path_template("/invoices/{invoice_id}", invoice_id=invoice_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1266,7 +1324,7 @@ async def issue( 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/{invoice_id}/issue", + path_template("/invoices/{invoice_id}/issue", invoice_id=invoice_id), body=await async_maybe_transform({"synchronous": synchronous}, invoice_issue_params.InvoiceIssueParams), options=make_request_options( extra_headers=extra_headers, @@ -1323,7 +1381,7 @@ async def issue_summary( 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", + path_template("/invoices/summary/{invoice_id}/issue", invoice_id=invoice_id), body=await async_maybe_transform( {"synchronous": synchronous}, invoice_issue_summary_params.InvoiceIssueSummaryParams ), @@ -1479,7 +1537,7 @@ async def mark_paid( 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/{invoice_id}/mark_paid", + path_template("/invoices/{invoice_id}/mark_paid", invoice_id=invoice_id), body=await async_maybe_transform( { "payment_received_date": payment_received_date, @@ -1502,6 +1560,7 @@ async def pay( self, invoice_id: str, *, + shared_payment_token_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, @@ -1510,11 +1569,16 @@ async def pay( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> Invoice: - """ - This endpoint collects payment for an invoice using the customer's default - payment method. This action can only be taken on invoices with status "issued". + """This endpoint collects payment for an invoice. + + By default, it uses the + customer's default payment method. Optionally, a shared payment token (SPT) can + be provided to pay using agent-granted credentials instead. This action can only + be taken on invoices with status "issued". Args: + shared_payment_token_id: The ID of a shared payment token granted by an agent to use for this payment. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1528,7 +1592,10 @@ async def pay( 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/{invoice_id}/pay", + path_template("/invoices/{invoice_id}/pay", invoice_id=invoice_id), + body=await async_maybe_transform( + {"shared_payment_token_id": shared_payment_token_id}, invoice_pay_params.InvoicePayParams + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1579,7 +1646,7 @@ async def void( 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/{invoice_id}/void", + path_template("/invoices/{invoice_id}/void", invoice_id=invoice_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/orb/resources/items.py b/src/orb/resources/items.py index d1cd7d7d..09589686 100644 --- a/src/orb/resources/items.py +++ b/src/orb/resources/items.py @@ -9,7 +9,7 @@ from .. import _legacy_response from ..types import item_list_params, item_create_params, item_update_params from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, 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 @@ -21,6 +21,12 @@ class Items(SyncAPIResource): + """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. + """ + @cached_property def with_raw_response(self) -> ItemsWithRawResponse: """ @@ -128,7 +134,7 @@ def update( if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") return self._put( - f"/items/{item_id}", + path_template("/items/{item_id}", item_id=item_id), body=maybe_transform( { "external_connections": external_connections, @@ -225,7 +231,7 @@ def archive( if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") return self._post( - f"/items/{item_id}/archive", + path_template("/items/{item_id}/archive", item_id=item_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -262,7 +268,7 @@ def fetch( if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") return self._get( - f"/items/{item_id}", + path_template("/items/{item_id}", item_id=item_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -271,6 +277,12 @@ def fetch( class AsyncItems(AsyncAPIResource): + """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. + """ + @cached_property def with_raw_response(self) -> AsyncItemsWithRawResponse: """ @@ -378,7 +390,7 @@ async def update( if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") return await self._put( - f"/items/{item_id}", + path_template("/items/{item_id}", item_id=item_id), body=await async_maybe_transform( { "external_connections": external_connections, @@ -475,7 +487,7 @@ async def archive( if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") return await self._post( - f"/items/{item_id}/archive", + path_template("/items/{item_id}/archive", item_id=item_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -512,7 +524,7 @@ async def fetch( if not item_id: raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") return await self._get( - f"/items/{item_id}", + path_template("/items/{item_id}", item_id=item_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/orb/resources/license_types.py b/src/orb/resources/license_types.py index 0809c648..f95b8e07 100644 --- a/src/orb/resources/license_types.py +++ b/src/orb/resources/license_types.py @@ -9,7 +9,7 @@ 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 .._utils import path_template, 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 @@ -23,6 +23,11 @@ class LicenseTypes(SyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> LicenseTypesWithRawResponse: """ @@ -126,7 +131,7 @@ def retrieve( 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}", + path_template("/license_types/{license_type_id}", license_type_id=license_type_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -188,6 +193,11 @@ def list( class AsyncLicenseTypes(AsyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> AsyncLicenseTypesWithRawResponse: """ @@ -291,7 +301,7 @@ async def retrieve( 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}", + path_template("/license_types/{license_type_id}", license_type_id=license_type_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/orb/resources/licenses/external_licenses.py b/src/orb/resources/licenses/external_licenses.py index 5d5468ff..66b98fc8 100644 --- a/src/orb/resources/licenses/external_licenses.py +++ b/src/orb/resources/licenses/external_licenses.py @@ -9,7 +9,7 @@ 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 ..._utils import path_template, 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 @@ -95,7 +95,9 @@ def get_usage( 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", + path_template( + "/licenses/external_licenses/{external_license_id}/usage", external_license_id=external_license_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -193,7 +195,9 @@ async def get_usage( 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", + path_template( + "/licenses/external_licenses/{external_license_id}/usage", external_license_id=external_license_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/orb/resources/licenses/licenses.py b/src/orb/resources/licenses/licenses.py index 14a70f77..ea56b1c4 100644 --- a/src/orb/resources/licenses/licenses.py +++ b/src/orb/resources/licenses/licenses.py @@ -24,7 +24,7 @@ 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 ..._utils import path_template, 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 @@ -165,7 +165,7 @@ def retrieve( 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}", + path_template("/licenses/{license_id}", license_id=license_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -265,7 +265,7 @@ def deactivate( 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", + path_template("/licenses/{license_id}/deactivate", license_id=license_id), body=maybe_transform({"end_date": end_date}, license_deactivate_params.LicenseDeactivateParams), options=make_request_options( extra_headers=extra_headers, @@ -311,7 +311,9 @@ def retrieve_by_external_id( 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}", + path_template( + "/licenses/external_license_id/{external_license_id}", external_license_id=external_license_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -447,7 +449,7 @@ async def retrieve( 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}", + path_template("/licenses/{license_id}", license_id=license_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -547,7 +549,7 @@ async def deactivate( 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", + path_template("/licenses/{license_id}/deactivate", license_id=license_id), body=await async_maybe_transform({"end_date": end_date}, license_deactivate_params.LicenseDeactivateParams), options=make_request_options( extra_headers=extra_headers, @@ -593,7 +595,9 @@ async def retrieve_by_external_id( 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}", + path_template( + "/licenses/external_license_id/{external_license_id}", external_license_id=external_license_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/orb/resources/licenses/usage.py b/src/orb/resources/licenses/usage.py index c58214f7..d78b6e4f 100644 --- a/src/orb/resources/licenses/usage.py +++ b/src/orb/resources/licenses/usage.py @@ -9,7 +9,7 @@ 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 ..._utils import path_template, 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 @@ -159,7 +159,7 @@ def get_usage( 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", + path_template("/licenses/{license_id}/usage", license_id=license_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -318,7 +318,7 @@ async def get_usage( 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", + path_template("/licenses/{license_id}/usage", license_id=license_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/orb/resources/metrics.py b/src/orb/resources/metrics.py index 6f62951d..08492c02 100644 --- a/src/orb/resources/metrics.py +++ b/src/orb/resources/metrics.py @@ -10,7 +10,7 @@ from .. import _legacy_response from ..types import metric_list_params, metric_create_params, metric_update_params from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, 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 @@ -22,6 +22,11 @@ class Metrics(SyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> MetricsWithRawResponse: """ @@ -144,7 +149,7 @@ def update( if not metric_id: raise ValueError(f"Expected a non-empty value for `metric_id` but received {metric_id!r}") return self._put( - f"/metrics/{metric_id}", + path_template("/metrics/{metric_id}", metric_id=metric_id), body=maybe_transform({"metadata": metadata}, metric_update_params.MetricUpdateParams), options=make_request_options( extra_headers=extra_headers, @@ -242,7 +247,7 @@ def fetch( if not metric_id: raise ValueError(f"Expected a non-empty value for `metric_id` but received {metric_id!r}") return self._get( - f"/metrics/{metric_id}", + path_template("/metrics/{metric_id}", metric_id=metric_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -251,6 +256,11 @@ def fetch( class AsyncMetrics(AsyncAPIResource): + """ + 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. + """ + @cached_property def with_raw_response(self) -> AsyncMetricsWithRawResponse: """ @@ -373,7 +383,7 @@ async def update( if not metric_id: raise ValueError(f"Expected a non-empty value for `metric_id` but received {metric_id!r}") return await self._put( - f"/metrics/{metric_id}", + path_template("/metrics/{metric_id}", metric_id=metric_id), body=await async_maybe_transform({"metadata": metadata}, metric_update_params.MetricUpdateParams), options=make_request_options( extra_headers=extra_headers, @@ -471,7 +481,7 @@ async def fetch( if not metric_id: raise ValueError(f"Expected a non-empty value for `metric_id` but received {metric_id!r}") return await self._get( - f"/metrics/{metric_id}", + path_template("/metrics/{metric_id}", metric_id=metric_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/orb/resources/plans/external_plan_id.py b/src/orb/resources/plans/external_plan_id.py index 1017afcc..f160c080 100644 --- a/src/orb/resources/plans/external_plan_id.py +++ b/src/orb/resources/plans/external_plan_id.py @@ -8,7 +8,7 @@ from ... import _legacy_response from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -20,6 +20,12 @@ class ExternalPlanID(SyncAPIResource): + """ + 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). + """ + @cached_property def with_raw_response(self) -> ExternalPlanIDWithRawResponse: """ @@ -83,7 +89,9 @@ def update( f"Expected a non-empty value for `other_external_plan_id` but received {other_external_plan_id!r}" ) return self._put( - f"/plans/external_plan_id/{other_external_plan_id}", + path_template( + "/plans/external_plan_id/{other_external_plan_id}", other_external_plan_id=other_external_plan_id + ), body=maybe_transform( { "external_plan_id": external_plan_id, @@ -142,7 +150,7 @@ def fetch( if not external_plan_id: raise ValueError(f"Expected a non-empty value for `external_plan_id` but received {external_plan_id!r}") return self._get( - f"/plans/external_plan_id/{external_plan_id}", + path_template("/plans/external_plan_id/{external_plan_id}", external_plan_id=external_plan_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -151,6 +159,12 @@ def fetch( class AsyncExternalPlanID(AsyncAPIResource): + """ + 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). + """ + @cached_property def with_raw_response(self) -> AsyncExternalPlanIDWithRawResponse: """ @@ -214,7 +228,9 @@ async def update( f"Expected a non-empty value for `other_external_plan_id` but received {other_external_plan_id!r}" ) return await self._put( - f"/plans/external_plan_id/{other_external_plan_id}", + path_template( + "/plans/external_plan_id/{other_external_plan_id}", other_external_plan_id=other_external_plan_id + ), body=await async_maybe_transform( { "external_plan_id": external_plan_id, @@ -273,7 +289,7 @@ async def fetch( if not external_plan_id: raise ValueError(f"Expected a non-empty value for `external_plan_id` but received {external_plan_id!r}") return await self._get( - f"/plans/external_plan_id/{external_plan_id}", + path_template("/plans/external_plan_id/{external_plan_id}", external_plan_id=external_plan_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/orb/resources/plans/migrations.py b/src/orb/resources/plans/migrations.py index 593a7e10..8655180b 100644 --- a/src/orb/resources/plans/migrations.py +++ b/src/orb/resources/plans/migrations.py @@ -8,7 +8,7 @@ from ... import _legacy_response from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform +from ..._utils import path_template, maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper @@ -23,6 +23,12 @@ class Migrations(SyncAPIResource): + """ + 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). + """ + @cached_property def with_raw_response(self) -> MigrationsWithRawResponse: """ @@ -71,7 +77,7 @@ def retrieve( 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}", + path_template("/plans/{plan_id}/migrations/{migration_id}", plan_id=plan_id, migration_id=migration_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -115,7 +121,7 @@ def list( 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", + path_template("/plans/{plan_id}/migrations", plan_id=plan_id), page=SyncPage[MigrationListResponse], options=make_request_options( extra_headers=extra_headers, @@ -165,7 +171,9 @@ def cancel( 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", + path_template( + "/plans/{plan_id}/migrations/{migration_id}/cancel", plan_id=plan_id, migration_id=migration_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -178,6 +186,12 @@ def cancel( class AsyncMigrations(AsyncAPIResource): + """ + 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). + """ + @cached_property def with_raw_response(self) -> AsyncMigrationsWithRawResponse: """ @@ -226,7 +240,7 @@ async def retrieve( 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}", + path_template("/plans/{plan_id}/migrations/{migration_id}", plan_id=plan_id, migration_id=migration_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -270,7 +284,7 @@ def list( 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", + path_template("/plans/{plan_id}/migrations", plan_id=plan_id), page=AsyncPage[MigrationListResponse], options=make_request_options( extra_headers=extra_headers, @@ -320,7 +334,9 @@ async def cancel( 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", + path_template( + "/plans/{plan_id}/migrations/{migration_id}/cancel", plan_id=plan_id, migration_id=migration_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/orb/resources/plans/plans.py b/src/orb/resources/plans/plans.py index 64d0bad8..3092a70c 100644 --- a/src/orb/resources/plans/plans.py +++ b/src/orb/resources/plans/plans.py @@ -11,7 +11,7 @@ from ... import _legacy_response from ...types import plan_list_params, plan_create_params, plan_update_params from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from .migrations import ( Migrations, @@ -39,12 +39,28 @@ class Plans(SyncAPIResource): + """ + 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). + """ + @cached_property def external_plan_id(self) -> ExternalPlanID: + """ + 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). + """ return ExternalPlanID(self._client) @cached_property def migrations(self) -> Migrations: + """ + 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). + """ return Migrations(self._client) @cached_property @@ -195,7 +211,7 @@ def update( if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") return self._put( - f"/plans/{plan_id}", + path_template("/plans/{plan_id}", plan_id=plan_id), body=maybe_transform( { "external_plan_id": external_plan_id, @@ -319,7 +335,7 @@ def fetch( if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") return self._get( - f"/plans/{plan_id}", + path_template("/plans/{plan_id}", plan_id=plan_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -328,12 +344,28 @@ def fetch( class AsyncPlans(AsyncAPIResource): + """ + 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). + """ + @cached_property def external_plan_id(self) -> AsyncExternalPlanID: + """ + 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). + """ return AsyncExternalPlanID(self._client) @cached_property def migrations(self) -> AsyncMigrations: + """ + 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). + """ return AsyncMigrations(self._client) @cached_property @@ -484,7 +516,7 @@ async def update( if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") return await self._put( - f"/plans/{plan_id}", + path_template("/plans/{plan_id}", plan_id=plan_id), body=await async_maybe_transform( { "external_plan_id": external_plan_id, @@ -608,7 +640,7 @@ async def fetch( if not plan_id: raise ValueError(f"Expected a non-empty value for `plan_id` but received {plan_id!r}") return await self._get( - f"/plans/{plan_id}", + path_template("/plans/{plan_id}", plan_id=plan_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -635,10 +667,20 @@ def __init__(self, plans: Plans) -> None: @cached_property def external_plan_id(self) -> ExternalPlanIDWithRawResponse: + """ + 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). + """ return ExternalPlanIDWithRawResponse(self._plans.external_plan_id) @cached_property def migrations(self) -> MigrationsWithRawResponse: + """ + 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). + """ return MigrationsWithRawResponse(self._plans.migrations) @@ -661,10 +703,20 @@ def __init__(self, plans: AsyncPlans) -> None: @cached_property def external_plan_id(self) -> AsyncExternalPlanIDWithRawResponse: + """ + 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). + """ return AsyncExternalPlanIDWithRawResponse(self._plans.external_plan_id) @cached_property def migrations(self) -> AsyncMigrationsWithRawResponse: + """ + 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). + """ return AsyncMigrationsWithRawResponse(self._plans.migrations) @@ -687,10 +739,20 @@ def __init__(self, plans: Plans) -> None: @cached_property def external_plan_id(self) -> ExternalPlanIDWithStreamingResponse: + """ + 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). + """ return ExternalPlanIDWithStreamingResponse(self._plans.external_plan_id) @cached_property def migrations(self) -> MigrationsWithStreamingResponse: + """ + 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). + """ return MigrationsWithStreamingResponse(self._plans.migrations) @@ -713,8 +775,18 @@ def __init__(self, plans: AsyncPlans) -> None: @cached_property def external_plan_id(self) -> AsyncExternalPlanIDWithStreamingResponse: + """ + 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). + """ return AsyncExternalPlanIDWithStreamingResponse(self._plans.external_plan_id) @cached_property def migrations(self) -> AsyncMigrationsWithStreamingResponse: + """ + 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). + """ return AsyncMigrationsWithStreamingResponse(self._plans.migrations) diff --git a/src/orb/resources/prices/external_price_id.py b/src/orb/resources/prices/external_price_id.py index 8d023ee9..541874e3 100644 --- a/src/orb/resources/prices/external_price_id.py +++ b/src/orb/resources/prices/external_price_id.py @@ -8,7 +8,7 @@ from ... import _legacy_response from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, 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 @@ -20,6 +20,16 @@ class ExternalPriceID(SyncAPIResource): + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ + @cached_property def with_raw_response(self) -> ExternalPriceIDWithRawResponse: """ @@ -78,7 +88,7 @@ def update( return cast( Price, self._put( - f"/prices/external_price_id/{external_price_id}", + path_template("/prices/external_price_id/{external_price_id}", external_price_id=external_price_id), body=maybe_transform( {"metadata": metadata}, external_price_id_update_params.ExternalPriceIDUpdateParams ), @@ -124,7 +134,7 @@ def fetch( return cast( Price, self._get( - f"/prices/external_price_id/{external_price_id}", + path_template("/prices/external_price_id/{external_price_id}", external_price_id=external_price_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -134,6 +144,16 @@ def fetch( class AsyncExternalPriceID(AsyncAPIResource): + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ + @cached_property def with_raw_response(self) -> AsyncExternalPriceIDWithRawResponse: """ @@ -192,7 +212,7 @@ async def update( return cast( Price, await self._put( - f"/prices/external_price_id/{external_price_id}", + path_template("/prices/external_price_id/{external_price_id}", external_price_id=external_price_id), body=await async_maybe_transform( {"metadata": metadata}, external_price_id_update_params.ExternalPriceIDUpdateParams ), @@ -238,7 +258,7 @@ async def fetch( return cast( Price, await self._get( - f"/prices/external_price_id/{external_price_id}", + path_template("/prices/external_price_id/{external_price_id}", external_price_id=external_price_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index 1c568a13..7b520f04 100644 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -18,7 +18,7 @@ price_evaluate_preview_events_params, ) from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import required_args, maybe_transform, async_maybe_transform +from ..._utils import path_template, required_args, 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 @@ -49,8 +49,27 @@ class Prices(SyncAPIResource): + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ + @cached_property def external_price_id(self) -> ExternalPriceID: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ return ExternalPriceID(self._client) @cached_property @@ -3431,7 +3450,7 @@ def update( return cast( Price, self._put( - f"/prices/{price_id}", + path_template("/prices/{price_id}", price_id=price_id), body=maybe_transform({"metadata": metadata}, price_update_params.PriceUpdateParams), options=make_request_options( extra_headers=extra_headers, @@ -3503,6 +3522,7 @@ def evaluate( external_customer_id: Optional[str] | Omit = omit, filter: Optional[str] | Omit = omit, grouping_keys: SequenceNotStr[str] | Omit = omit, + metric_parameter_overrides: Optional[Dict[str, object]] | 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, @@ -3555,6 +3575,9 @@ def evaluate( [computed properties](/extensibility/advanced-metrics#computed-properties)) used to group the underlying billable metric + metric_parameter_overrides: Optional overrides for parameterized billable metric parameters. If the metric + has parameter definitions and no overrides are provided, defaults will be used. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3568,7 +3591,7 @@ def evaluate( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return self._post( - f"/prices/{price_id}/evaluate", + path_template("/prices/{price_id}/evaluate", price_id=price_id), body=maybe_transform( { "timeframe_end": timeframe_end, @@ -3577,6 +3600,7 @@ def evaluate( "external_customer_id": external_customer_id, "filter": filter, "grouping_keys": grouping_keys, + "metric_parameter_overrides": metric_parameter_overrides, }, price_evaluate_params.PriceEvaluateParams, ), @@ -3791,7 +3815,7 @@ def fetch( return cast( Price, self._get( - f"/prices/{price_id}", + path_template("/prices/{price_id}", price_id=price_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -3801,8 +3825,27 @@ def fetch( class AsyncPrices(AsyncAPIResource): + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ + @cached_property def external_price_id(self) -> AsyncExternalPriceID: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ return AsyncExternalPriceID(self._client) @cached_property @@ -7183,7 +7226,7 @@ async def update( return cast( Price, await self._put( - f"/prices/{price_id}", + path_template("/prices/{price_id}", price_id=price_id), body=await async_maybe_transform({"metadata": metadata}, price_update_params.PriceUpdateParams), options=make_request_options( extra_headers=extra_headers, @@ -7255,6 +7298,7 @@ async def evaluate( external_customer_id: Optional[str] | Omit = omit, filter: Optional[str] | Omit = omit, grouping_keys: SequenceNotStr[str] | Omit = omit, + metric_parameter_overrides: Optional[Dict[str, object]] | 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, @@ -7307,6 +7351,9 @@ async def evaluate( [computed properties](/extensibility/advanced-metrics#computed-properties)) used to group the underlying billable metric + metric_parameter_overrides: Optional overrides for parameterized billable metric parameters. If the metric + has parameter definitions and no overrides are provided, defaults will be used. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7320,7 +7367,7 @@ async def evaluate( if not price_id: raise ValueError(f"Expected a non-empty value for `price_id` but received {price_id!r}") return await self._post( - f"/prices/{price_id}/evaluate", + path_template("/prices/{price_id}/evaluate", price_id=price_id), body=await async_maybe_transform( { "timeframe_end": timeframe_end, @@ -7329,6 +7376,7 @@ async def evaluate( "external_customer_id": external_customer_id, "filter": filter, "grouping_keys": grouping_keys, + "metric_parameter_overrides": metric_parameter_overrides, }, price_evaluate_params.PriceEvaluateParams, ), @@ -7543,7 +7591,7 @@ async def fetch( return cast( Price, await self._get( - f"/prices/{price_id}", + path_template("/prices/{price_id}", price_id=price_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -7580,6 +7628,15 @@ def __init__(self, prices: Prices) -> None: @cached_property def external_price_id(self) -> ExternalPriceIDWithRawResponse: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ return ExternalPriceIDWithRawResponse(self._prices.external_price_id) @@ -7611,6 +7668,15 @@ def __init__(self, prices: AsyncPrices) -> None: @cached_property def external_price_id(self) -> AsyncExternalPriceIDWithRawResponse: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ return AsyncExternalPriceIDWithRawResponse(self._prices.external_price_id) @@ -7642,6 +7708,15 @@ def __init__(self, prices: Prices) -> None: @cached_property def external_price_id(self) -> ExternalPriceIDWithStreamingResponse: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ return ExternalPriceIDWithStreamingResponse(self._prices.external_price_id) @@ -7673,4 +7748,13 @@ def __init__(self, prices: AsyncPrices) -> None: @cached_property def external_price_id(self) -> AsyncExternalPriceIDWithStreamingResponse: + """ + The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in + the form of an invoice line item. Prices take a quantity and determine an amount to bill. + + Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a + given Price object. The model_type field determines the key for the configuration object that is present. + + For more on the types of prices, see [the core concepts documentation](/core-concepts#plan-and-price) + """ return AsyncExternalPriceIDWithStreamingResponse(self._prices.external_price_id) diff --git a/src/orb/resources/subscription_changes.py b/src/orb/resources/subscription_changes.py index 5adbb9e3..65d3309d 100644 --- a/src/orb/resources/subscription_changes.py +++ b/src/orb/resources/subscription_changes.py @@ -11,7 +11,7 @@ from .. import _legacy_response 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 .._utils import path_template, 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 @@ -81,7 +81,9 @@ def retrieve( f"Expected a non-empty value for `subscription_change_id` but received {subscription_change_id!r}" ) return self._get( - f"/subscription_changes/{subscription_change_id}", + path_template( + "/subscription_changes/{subscription_change_id}", subscription_change_id=subscription_change_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -201,7 +203,9 @@ def apply( f"Expected a non-empty value for `subscription_change_id` but received {subscription_change_id!r}" ) return self._post( - f"/subscription_changes/{subscription_change_id}/apply", + path_template( + "/subscription_changes/{subscription_change_id}/apply", subscription_change_id=subscription_change_id + ), body=maybe_transform( { "description": description, @@ -257,7 +261,9 @@ def cancel( f"Expected a non-empty value for `subscription_change_id` but received {subscription_change_id!r}" ) return self._post( - f"/subscription_changes/{subscription_change_id}/cancel", + path_template( + "/subscription_changes/{subscription_change_id}/cancel", subscription_change_id=subscription_change_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -325,7 +331,9 @@ async def retrieve( f"Expected a non-empty value for `subscription_change_id` but received {subscription_change_id!r}" ) return await self._get( - f"/subscription_changes/{subscription_change_id}", + path_template( + "/subscription_changes/{subscription_change_id}", subscription_change_id=subscription_change_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -445,7 +453,9 @@ async def apply( f"Expected a non-empty value for `subscription_change_id` but received {subscription_change_id!r}" ) return await self._post( - f"/subscription_changes/{subscription_change_id}/apply", + path_template( + "/subscription_changes/{subscription_change_id}/apply", subscription_change_id=subscription_change_id + ), body=await async_maybe_transform( { "description": description, @@ -501,7 +511,9 @@ async def cancel( f"Expected a non-empty value for `subscription_change_id` but received {subscription_change_id!r}" ) return await self._post( - f"/subscription_changes/{subscription_change_id}/cancel", + path_template( + "/subscription_changes/{subscription_change_id}/cancel", subscription_change_id=subscription_change_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py index 0f41dd97..0d5faae8 100644 --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -26,7 +26,7 @@ subscription_unschedule_fixed_fee_quantity_updates_params, ) from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, 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 @@ -563,7 +563,7 @@ def update( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._put( - f"/subscriptions/{subscription_id}", + path_template("/subscriptions/{subscription_id}", subscription_id=subscription_id), body=maybe_transform( { "auto_collection": auto_collection, @@ -760,7 +760,7 @@ def cancel( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/cancel", + path_template("/subscriptions/{subscription_id}/cancel", subscription_id=subscription_id), body=maybe_transform( { "cancel_option": cancel_option, @@ -806,7 +806,7 @@ def fetch( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._get( - f"/subscriptions/{subscription_id}", + path_template("/subscriptions/{subscription_id}", subscription_id=subscription_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -863,7 +863,7 @@ def fetch_costs( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._get( - f"/subscriptions/{subscription_id}/costs", + path_template("/subscriptions/{subscription_id}/costs", subscription_id=subscription_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -922,7 +922,7 @@ def fetch_schedule( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._get_api_list( - f"/subscriptions/{subscription_id}/schedule", + path_template("/subscriptions/{subscription_id}/schedule", subscription_id=subscription_id), page=SyncPage[SubscriptionFetchScheduleResponse], options=make_request_options( extra_headers=extra_headers, @@ -1193,7 +1193,7 @@ def fetch_usage( return cast( SubscriptionUsage, self._get( - f"/subscriptions/{subscription_id}/usage", + path_template("/subscriptions/{subscription_id}/usage", subscription_id=subscription_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1340,7 +1340,7 @@ def price_intervals( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/price_intervals", + path_template("/subscriptions/{subscription_id}/price_intervals", subscription_id=subscription_id), body=maybe_transform( { "add": add, @@ -1407,7 +1407,7 @@ def redeem_coupon( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/redeem_coupon", + path_template("/subscriptions/{subscription_id}/redeem_coupon", subscription_id=subscription_id), body=maybe_transform( { "change_option": change_option, @@ -1745,7 +1745,7 @@ def schedule_plan_change( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/schedule_plan_change", + path_template("/subscriptions/{subscription_id}/schedule_plan_change", subscription_id=subscription_id), body=maybe_transform( { "change_option": change_option, @@ -1826,7 +1826,7 @@ def trigger_phase( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/trigger_phase", + path_template("/subscriptions/{subscription_id}/trigger_phase", subscription_id=subscription_id), body=maybe_transform( { "allow_invoice_credit_or_void": allow_invoice_credit_or_void, @@ -1878,7 +1878,7 @@ def unschedule_cancellation( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/unschedule_cancellation", + path_template("/subscriptions/{subscription_id}/unschedule_cancellation", subscription_id=subscription_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1925,7 +1925,10 @@ def unschedule_fixed_fee_quantity_updates( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/unschedule_fixed_fee_quantity_updates", + path_template( + "/subscriptions/{subscription_id}/unschedule_fixed_fee_quantity_updates", + subscription_id=subscription_id, + ), body=maybe_transform( {"price_id": price_id}, subscription_unschedule_fixed_fee_quantity_updates_params.SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, @@ -1970,7 +1973,9 @@ def unschedule_pending_plan_changes( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/unschedule_pending_plan_changes", + path_template( + "/subscriptions/{subscription_id}/unschedule_pending_plan_changes", subscription_id=subscription_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2042,7 +2047,9 @@ def update_fixed_fee_quantity( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/update_fixed_fee_quantity", + path_template( + "/subscriptions/{subscription_id}/update_fixed_fee_quantity", subscription_id=subscription_id + ), body=maybe_transform( { "price_id": price_id, @@ -2118,7 +2125,7 @@ def update_trial( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( - f"/subscriptions/{subscription_id}/update_trial", + path_template("/subscriptions/{subscription_id}/update_trial", subscription_id=subscription_id), body=maybe_transform( { "trial_end_date": trial_end_date, @@ -2658,7 +2665,7 @@ async def update( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._put( - f"/subscriptions/{subscription_id}", + path_template("/subscriptions/{subscription_id}", subscription_id=subscription_id), body=await async_maybe_transform( { "auto_collection": auto_collection, @@ -2855,7 +2862,7 @@ async def cancel( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/cancel", + path_template("/subscriptions/{subscription_id}/cancel", subscription_id=subscription_id), body=await async_maybe_transform( { "cancel_option": cancel_option, @@ -2901,7 +2908,7 @@ async def fetch( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._get( - f"/subscriptions/{subscription_id}", + path_template("/subscriptions/{subscription_id}", subscription_id=subscription_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -2958,7 +2965,7 @@ async def fetch_costs( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._get( - f"/subscriptions/{subscription_id}/costs", + path_template("/subscriptions/{subscription_id}/costs", subscription_id=subscription_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -3017,7 +3024,7 @@ def fetch_schedule( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._get_api_list( - f"/subscriptions/{subscription_id}/schedule", + path_template("/subscriptions/{subscription_id}/schedule", subscription_id=subscription_id), page=AsyncPage[SubscriptionFetchScheduleResponse], options=make_request_options( extra_headers=extra_headers, @@ -3288,7 +3295,7 @@ async def fetch_usage( return cast( SubscriptionUsage, await self._get( - f"/subscriptions/{subscription_id}/usage", + path_template("/subscriptions/{subscription_id}/usage", subscription_id=subscription_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -3435,7 +3442,7 @@ async def price_intervals( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/price_intervals", + path_template("/subscriptions/{subscription_id}/price_intervals", subscription_id=subscription_id), body=await async_maybe_transform( { "add": add, @@ -3502,7 +3509,7 @@ async def redeem_coupon( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/redeem_coupon", + path_template("/subscriptions/{subscription_id}/redeem_coupon", subscription_id=subscription_id), body=await async_maybe_transform( { "change_option": change_option, @@ -3840,7 +3847,7 @@ async def schedule_plan_change( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/schedule_plan_change", + path_template("/subscriptions/{subscription_id}/schedule_plan_change", subscription_id=subscription_id), body=await async_maybe_transform( { "change_option": change_option, @@ -3921,7 +3928,7 @@ async def trigger_phase( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/trigger_phase", + path_template("/subscriptions/{subscription_id}/trigger_phase", subscription_id=subscription_id), body=await async_maybe_transform( { "allow_invoice_credit_or_void": allow_invoice_credit_or_void, @@ -3973,7 +3980,7 @@ async def unschedule_cancellation( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/unschedule_cancellation", + path_template("/subscriptions/{subscription_id}/unschedule_cancellation", subscription_id=subscription_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -4020,7 +4027,10 @@ async def unschedule_fixed_fee_quantity_updates( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/unschedule_fixed_fee_quantity_updates", + path_template( + "/subscriptions/{subscription_id}/unschedule_fixed_fee_quantity_updates", + subscription_id=subscription_id, + ), body=await async_maybe_transform( {"price_id": price_id}, subscription_unschedule_fixed_fee_quantity_updates_params.SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, @@ -4065,7 +4075,9 @@ async def unschedule_pending_plan_changes( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/unschedule_pending_plan_changes", + path_template( + "/subscriptions/{subscription_id}/unschedule_pending_plan_changes", subscription_id=subscription_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -4137,7 +4149,9 @@ async def update_fixed_fee_quantity( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/update_fixed_fee_quantity", + path_template( + "/subscriptions/{subscription_id}/update_fixed_fee_quantity", subscription_id=subscription_id + ), body=await async_maybe_transform( { "price_id": price_id, @@ -4213,7 +4227,7 @@ async def update_trial( if not subscription_id: raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._post( - f"/subscriptions/{subscription_id}/update_trial", + path_template("/subscriptions/{subscription_id}/update_trial", subscription_id=subscription_id), body=await async_maybe_transform( { "trial_end_date": trial_end_date, diff --git a/src/orb/types/__init__.py b/src/orb/types/__init__.py index fb4d0969..888766fa 100644 --- a/src/orb/types/__init__.py +++ b/src/orb/types/__init__.py @@ -150,6 +150,7 @@ from .alert_list_params import AlertListParams as AlertListParams from .price_list_params import PriceListParams as PriceListParams from .coupon_list_params import CouponListParams as CouponListParams +from .invoice_pay_params import InvoicePayParams as InvoicePayParams from .item_create_params import ItemCreateParams as ItemCreateParams from .item_update_params import ItemUpdateParams as ItemUpdateParams from .metric_list_params import MetricListParams as MetricListParams diff --git a/src/orb/types/alert.py b/src/orb/types/alert.py index 433daf36..08ad5113 100644 --- a/src/orb/types/alert.py +++ b/src/orb/types/alert.py @@ -105,5 +105,11 @@ class Alert(BaseModel): This field is only present for credit balance alerts. """ + grouping_keys: Optional[List[str]] = None + """The property keys to group cost alerts by. + + Only present for cost alerts with grouping enabled. + """ + license_type: Optional[LicenseType] = None """Minified license type for alert serialization.""" diff --git a/src/orb/types/alert_create_for_subscription_params.py b/src/orb/types/alert_create_for_subscription_params.py index 9b8f2208..8a35f6ff 100644 --- a/src/orb/types/alert_create_for_subscription_params.py +++ b/src/orb/types/alert_create_for_subscription_params.py @@ -5,6 +5,7 @@ from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from .._types import SequenceNotStr from .threshold_param import ThresholdParam __all__ = ["AlertCreateForSubscriptionParams"] @@ -17,5 +18,17 @@ class AlertCreateForSubscriptionParams(TypedDict, total=False): type: Required[Literal["usage_exceeded", "cost_exceeded"]] """The type of alert to create. This must be a valid alert type.""" + grouping_keys: Optional[SequenceNotStr[str]] + """The property keys to group cost alerts by. + + Only applicable for cost_exceeded alerts. + """ + metric_id: Optional[str] """The metric to track usage for.""" + + pricing_unit_id: Optional[str] + """The pricing unit to use for grouped cost alerts. + + Required when grouping_keys is set. + """ diff --git a/src/orb/types/beta/external_plan_id_create_plan_version_params.py b/src/orb/types/beta/external_plan_id_create_plan_version_params.py index 6b31bed1..2b0a54b8 100644 --- a/src/orb/types/beta/external_plan_id_create_plan_version_params.py +++ b/src/orb/types/beta/external_plan_id_create_plan_version_params.py @@ -5,8 +5,13 @@ from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict +from ..shared_params.bulk_config import BulkConfig from ..shared_params.new_maximum import NewMaximum from ..shared_params.new_minimum import NewMinimum +from ..shared_params.unit_config import UnitConfig +from ..shared_params.matrix_config import MatrixConfig +from ..shared_params.tiered_config import TieredConfig +from ..shared_params.package_config import PackageConfig from ..shared_params.new_usage_discount import NewUsageDiscount from ..shared_params.new_amount_discount import NewAmountDiscount from ..shared_params.new_plan_bulk_price import NewPlanBulkPrice @@ -17,6 +22,7 @@ from ..shared_params.new_plan_package_price import NewPlanPackagePrice from ..shared_params.new_percentage_discount import NewPercentageDiscount from ..shared_params.unit_conversion_rate_config import UnitConversionRateConfig +from ..shared_params.matrix_with_allocation_config import MatrixWithAllocationConfig from ..shared_params.new_plan_grouped_tiered_price import NewPlanGroupedTieredPrice from ..shared_params.new_plan_tiered_package_price import NewPlanTieredPackagePrice from ..shared_params.tiered_conversion_rate_config import TieredConversionRateConfig @@ -48,6 +54,143 @@ "AddAdjustment", "AddAdjustmentAdjustment", "AddPrice", + "AddPriceLicenseAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig", "AddPricePrice", "AddPricePriceNewPlanBulkWithFiltersPrice", "AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig", @@ -75,6 +218,143 @@ "ReplaceAdjustment", "ReplaceAdjustmentAdjustment", "ReplacePrice", + "ReplacePriceLicenseAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig", "ReplacePricePrice", "ReplacePricePriceNewPlanBulkWithFiltersPrice", "ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig", @@ -139,57 +419,8391 @@ class AddAdjustment(TypedDict, total=False): """The phase to add this adjustment to.""" +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_config: Required[UnitConfig] + """Configuration for unit pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[TieredConfig] + """Configuration for tiered pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPrice(TypedDict, total=False): + bulk_config: Required[BulkConfig] + """Configuration for bulk pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter( + TypedDict, total=False +): + """Configuration for a single property filter""" + + property_key: Required[str] + """Event property key to filter on""" + + property_value: Required[str] + """Event property value to match""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier""" + + unit_amount: Required[str] + """Amount per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig( + TypedDict, total=False +): + """Configuration for bulk_with_filters pricing""" + + filters: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter] + ] + """Property filters to apply (all must match)""" + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier] + ] + """Bulk tiers for rating based on total usage volume""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice(TypedDict, total=False): + bulk_with_filters_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig + ] + """Configuration for bulk_with_filters pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_filters"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_config: Required[PackageConfig] + """Configuration for package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_config: Required[MatrixConfig] + """Configuration for matrix pricing""" + + model_type: Required[Literal["matrix"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable( + TypedDict, total=False +): + """Configuration for a single threshold""" + + threshold: Required[str] + + total_amount: Required[str] + """Total amount for this threshold""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig( + TypedDict, total=False +): + """Configuration for threshold_total_amount pricing""" + + consumption_table: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable + ] + ] + """ + When the quantity consumed passes a provided threshold, the configured total + will be charged + """ + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["threshold_total_amount"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig + ] + """Configuration for threshold_total_amount pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier with business logic""" + + per_unit: Required[str] + """Price per package""" + + tier_lower_bound: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + + package_size: Required[str] + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. The tier bounds are defined + based on the total quantity rather than the number of packages, so they must be + multiples of the package size. + """ + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig + ] + """Configuration for tiered_package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_with_minimum pricing""" + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier] + ] + """Tiered pricing with a minimum amount dependent on the volume tier. + + Tiers are defined using exclusive lower bounds. + """ + + hide_zero_amount_tiers: bool + """If true, tiers with an accrued amount of 0 will not be included in the rating.""" + + prorate: bool + """If true, the unit price will be prorated to the billing period""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig + ] + """Configuration for tiered_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + + grouping_key: Required[str] + """The billable metric property used to group before tiering""" + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier] + ] + """ + Apply tiered pricing to each segment generated after grouping with the provided + key + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig + ] + """Configuration for grouped_tiered pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + per_unit: Required[str] + + tier_lower_bound: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_package_with_minimum pricing""" + + package_size: Required[float] + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier + ] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_with_minimum_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig + ] + """Configuration for tiered_package_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig( + TypedDict, total=False +): + """Configuration for package_with_allocation pricing""" + + allocation: Required[str] + + package_amount: Required[str] + + package_size: Required[str] + + +AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig + ] + """Configuration for package_with_allocation pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig( + TypedDict, total=False +): + """Configuration for unit_with_percent pricing""" + + percent: Required[str] + """What percent, out of 100, of the calculated total to charge""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig + ] + """Configuration for unit_with_percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_allocation_config: Required[MatrixWithAllocationConfig] + """Configuration for matrix_with_allocation pricing""" + + model_type: Required[Literal["matrix_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single tiered with proration tier""" + + tier_lower_bound: Required[str] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig( + TypedDict, total=False +): + """Configuration for tiered_with_proration pricing""" + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier + ] + ] + """ + Tiers for rating based on total usage quantities into the specified tier with + proration + """ + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig + ] + """Configuration for tiered_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig( + TypedDict, total=False +): + """Configuration for unit_with_proration pricing""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig + ] + """Configuration for unit_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for grouped_allocation pricing""" + + allocation: Required[str] + """Usage allocation per group""" + + grouping_key: Required[str] + """How to determine the groups that should each be allocated some quantity""" + + overage_unit_rate: Required[str] + """Unit rate for post-allocation""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig + ] + """Configuration for grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier with proration""" + + unit_amount: Required[str] + """Cost per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig( + TypedDict, total=False +): + """Configuration for bulk_with_proration pricing""" + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier] + ] + """Bulk tiers for rating based on total usage volume""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig + ] + """Configuration for bulk_with_proration pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig( + 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""" + + minimum: Required[str] + """The minimum amount to charge per group""" + + unit_rate: Required[str] + """The amount to charge per unit""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig + ] + """Configuration for grouped_with_prorated_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor( + TypedDict, total=False +): + """Configuration for a scaling factor""" + + scaling_factor: Required[str] + + scaling_value: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount""" + + pricing_value: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig( + TypedDict, total=False +): + """Configuration for grouped_with_metered_minimum pricing""" + + grouping_key: Required[str] + """Used to partition the usage into groups. + + The minimum amount is applied to each group. + """ + + minimum_unit_amount: Required[str] + """The minimum amount to charge per group per unit""" + + pricing_key: Required[str] + """Used to determine the unit rate""" + + scaling_factors: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor + ] + ] + """Scale the unit rates by the scaling factor.""" + + scaling_key: Required[str] + """Used to determine the unit rate scaling factor""" + + unit_amounts: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount + ] + ] + """Apply per unit pricing to each pricing value. + + The minimum amount is applied any unmatched usage. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig + ] + """Configuration for grouped_with_metered_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_metered_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( + TypedDict, total=False +): + """Configuration for grouped_with_min_max_thresholds pricing""" + + grouping_key: Required[str] + """The event property used to group before applying thresholds""" + + maximum_charge: Required[str] + """The maximum amount to charge each group""" + + minimum_charge: Required[str] + """The minimum amount to charge each group, regardless of usage""" + + per_unit_rate: Required[str] + """The base price charged per group""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig + ] + """Configuration for grouped_with_min_max_thresholds pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_min_max_thresholds"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount item""" + + dimension_value: Required[str] + """The dimension value""" + + display_name: Required[str] + """Display name for this dimension value""" + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig( + TypedDict, total=False +): + """Configuration for matrix_with_display_name pricing""" + + dimension: Required[str] + """Used to determine the unit rate""" + + unit_amounts: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount + ] + ] + """Apply per unit pricing to each dimension value""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_display_name_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig + ] + """Configuration for matrix_with_display_name pricing""" + + model_type: Required[Literal["matrix_with_display_name"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + per_unit: Required[str] + """Per package""" + + tier_lower_bound: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier + ] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig + ] + """Configuration for grouped_tiered_package pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier + ] + ] + """Apply tiered pricing to the largest group after grouping with the provided key.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + max_group_tiered_package_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig + ] + """Configuration for max_group_tiered_package pricing""" + + model_type: Required[Literal["max_group_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + first_dimension: Required[str] + """Used to determine the unit rate""" + + matrix_scaling_factors: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" + + unit_price: Required[str] + """The final unit price to rate against the output of the matrix""" + + grouping_key: Optional[str] + """The property used to group this price""" + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + second_dimension: Optional[str] + """Used to determine the unit rate (optional)""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig + ] + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier( + TypedDict, total=False +): + """Configuration for a single tier entry with business logic""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + + first_dimension: Required[str] + """Used for the scalable matrix first dimension""" + + matrix_scaling_factors: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier + ] + ] + + second_dimension: Optional[str] + """Used for the scalable matrix second dimension (optional)""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig + ] + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue( + TypedDict, total=False +): + """Configuration for a dimension value entry""" + + grouping_key: Required[str] + """Grouping key value""" + + tier_lower_bound: Required[str] + """Tier lower bound""" + + unit_amount: Required[str] + """Unit amount for this combination""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_bulk pricing""" + + dimension_values: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue + ] + ] + """Each tier lower bound must have the same group of values.""" + + group: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig + ] + """Configuration for cumulative_grouped_bulk pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_bulk"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_allocation pricing""" + + cumulative_allocation: Required[str] + """The overall allocation across all groups""" + + group_allocation: Required[str] + """The allocation per individual group""" + + grouping_key: Required[str] + """The event property used to group usage before applying allocations""" + + unit_amount: Required[str] + """The amount to charge for each unit outside of the allocation""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_allocation_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig + ] + """Configuration for cumulative_grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig( + TypedDict, total=False +): + """Configuration for minimum_composite pricing""" + + minimum_amount: Required[str] + """The minimum amount to apply""" + + prorated: bool + """If true, subtotals from this price are prorated based on the service period""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + minimum_composite_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig + ] + """Configuration for minimum_composite pricing""" + + model_type: Required[Literal["minimum_composite"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + + percent: Required[float] + """What percent of the component subtotals to charge""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig(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.""" + + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +AddPriceLicenseAllocationPrice: TypeAlias = Union[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice, +] + + class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): """Configuration for a single property filter""" - property_key: Required[str] - """Event property key to filter on""" + property_key: Required[str] + """Event property key to filter on""" + + property_value: Required[str] + """Event property value to match""" + + +class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + + unit_amount: Required[str] + """Amount per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + + filters: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] + """Property filters to apply (all must match)""" + + tiers: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +AddPricePriceNewPlanBulkWithFiltersPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): + bulk_with_filters_config: Required[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig] + """Configuration for bulk_with_filters pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_filters"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanBulkWithFiltersPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + + tier_lower_bound: Required[str] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + +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 + proration + """ + + +AddPricePriceNewPlanTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig] + """Configuration for tiered_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanTieredWithProrationPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +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""" + + maximum_charge: Required[str] + """The maximum amount to charge each group""" + + minimum_charge: Required[str] + """The minimum amount to charge each group, regardless of usage""" + + per_unit_rate: Required[str] + """The base price charged per group""" + + +AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_config: Required[ + AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig + ] + """Configuration for grouped_with_min_max_thresholds pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_min_max_thresholds"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + + cumulative_allocation: Required[str] + """The overall allocation across all groups""" + + group_allocation: Required[str] + """The allocation per individual group""" + + grouping_key: Required[str] + """The event property used to group usage before applying allocations""" + + unit_amount: Required[str] + """The amount to charge for each unit outside of the allocation""" + + +AddPricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_allocation_config: Required[ + AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig + ] + """Configuration for cumulative_grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + + percent: Required[float] + """What percent of the component subtotals to charge""" + + +AddPricePriceNewPlanPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[AddPricePriceNewPlanPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanPercentCompositePriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +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.""" + + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +AddPricePriceNewPlanEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[AddPricePriceNewPlanEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +AddPricePrice: TypeAlias = Union[ + NewPlanUnitPrice, + NewPlanTieredPrice, + NewPlanBulkPrice, + AddPricePriceNewPlanBulkWithFiltersPrice, + NewPlanPackagePrice, + NewPlanMatrixPrice, + NewPlanThresholdTotalAmountPrice, + NewPlanTieredPackagePrice, + NewPlanTieredWithMinimumPrice, + NewPlanGroupedTieredPrice, + NewPlanTieredPackageWithMinimumPrice, + NewPlanPackageWithAllocationPrice, + NewPlanUnitWithPercentPrice, + NewPlanMatrixWithAllocationPrice, + AddPricePriceNewPlanTieredWithProrationPrice, + NewPlanUnitWithProrationPrice, + NewPlanGroupedAllocationPrice, + NewPlanBulkWithProrationPrice, + NewPlanGroupedWithProratedMinimumPrice, + NewPlanGroupedWithMeteredMinimumPrice, + AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice, + NewPlanMatrixWithDisplayNamePrice, + NewPlanGroupedTieredPackagePrice, + NewPlanMaxGroupTieredPackagePrice, + NewPlanScalableMatrixWithUnitPricingPrice, + NewPlanScalableMatrixWithTieredPricingPrice, + NewPlanCumulativeGroupedBulkPrice, + AddPricePriceNewPlanCumulativeGroupedAllocationPrice, + NewPlanMinimumCompositePrice, + AddPricePriceNewPlanPercentCompositePrice, + AddPricePriceNewPlanEventOutputPrice, +] + + +class AddPrice(TypedDict, total=False): + allocation_price: Optional[NewAllocationPrice] + """The allocation price to add to the plan.""" + + license_allocation_price: Optional[AddPriceLicenseAllocationPrice] + """The license allocation price to add to the plan.""" + + plan_phase_order: Optional[int] + """The phase to add this price to.""" + + price: Optional[AddPricePrice] + """New plan price request body params.""" + + +class RemoveAdjustment(TypedDict, total=False): + adjustment_id: Required[str] + """The id of the adjustment to remove from on the plan.""" + + plan_phase_order: Optional[int] + """The phase to remove this adjustment from.""" + + +class RemovePrice(TypedDict, total=False): + price_id: Required[str] + """The id of the price to remove from the plan.""" + + plan_phase_order: Optional[int] + """The phase to remove this price from.""" + + +ReplaceAdjustmentAdjustment: TypeAlias = Union[ + NewPercentageDiscount, NewUsageDiscount, NewAmountDiscount, NewMinimum, NewMaximum +] + + +class ReplaceAdjustment(TypedDict, total=False): + adjustment: Required[ReplaceAdjustmentAdjustment] + """The definition of a new adjustment to create and add to the plan.""" + + replaces_adjustment_id: Required[str] + """The id of the adjustment on the plan to replace in the plan.""" + + plan_phase_order: Optional[int] + """The phase to replace this adjustment from.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_config: Required[UnitConfig] + """Configuration for unit pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[TieredConfig] + """Configuration for tiered pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPrice(TypedDict, total=False): + bulk_config: Required[BulkConfig] + """Configuration for bulk pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter( + TypedDict, total=False +): + """Configuration for a single property filter""" + + property_key: Required[str] + """Event property key to filter on""" + + property_value: Required[str] + """Event property value to match""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier""" + + unit_amount: Required[str] + """Amount per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig( + TypedDict, total=False +): + """Configuration for bulk_with_filters pricing""" + + filters: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter] + ] + """Property filters to apply (all must match)""" + + tiers: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier] + ] + """Bulk tiers for rating based on total usage volume""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice(TypedDict, total=False): + bulk_with_filters_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig + ] + """Configuration for bulk_with_filters pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_filters"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_config: Required[PackageConfig] + """Configuration for package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_config: Required[MatrixConfig] + """Configuration for matrix pricing""" + + model_type: Required[Literal["matrix"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable( + TypedDict, total=False +): + """Configuration for a single threshold""" + + threshold: Required[str] + + total_amount: Required[str] + """Total amount for this threshold""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig( + TypedDict, total=False +): + """Configuration for threshold_total_amount pricing""" + + consumption_table: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable + ] + ] + """ + When the quantity consumed passes a provided threshold, the configured total + will be charged + """ + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["threshold_total_amount"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig + ] + """Configuration for threshold_total_amount pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier with business logic""" + + per_unit: Required[str] + """Price per package""" + + tier_lower_bound: Required[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig( + TypedDict, total=False +): + """Configuration for tiered_package pricing""" + + package_size: Required[str] + + tiers: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. The tier bounds are defined + based on the total quantity rather than the number of packages, so they must be + multiples of the package size. + """ + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig + ] + """Configuration for tiered_package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_with_minimum pricing""" + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier + ] + ] + """Tiered pricing with a minimum amount dependent on the volume tier. + + Tiers are defined using exclusive lower bounds. + """ + + hide_zero_amount_tiers: bool + """If true, tiers with an accrued amount of 0 will not be included in the rating.""" + + prorate: bool + """If true, the unit price will be prorated to the billing period""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig + ] + """Configuration for tiered_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig( + TypedDict, total=False +): + """Configuration for grouped_tiered pricing""" + + grouping_key: Required[str] + """The billable metric property used to group before tiering""" + + tiers: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier] + ] + """ + Apply tiered pricing to each segment generated after grouping with the provided + key + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig + ] + """Configuration for grouped_tiered pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + per_unit: Required[str] + + tier_lower_bound: Required[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_package_with_minimum pricing""" + + package_size: Required[float] + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier + ] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_with_minimum_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig + ] + """Configuration for tiered_package_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig( + TypedDict, total=False +): + """Configuration for package_with_allocation pricing""" + + allocation: Required[str] + + package_amount: Required[str] + + package_size: Required[str] + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig + ] + """Configuration for package_with_allocation pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig( + TypedDict, total=False +): + """Configuration for unit_with_percent pricing""" + + percent: Required[str] + """What percent, out of 100, of the calculated total to charge""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig + ] + """Configuration for unit_with_percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_allocation_config: Required[MatrixWithAllocationConfig] + """Configuration for matrix_with_allocation pricing""" + + model_type: Required[Literal["matrix_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single tiered with proration tier""" + + tier_lower_bound: Required[str] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig( + TypedDict, total=False +): + """Configuration for tiered_with_proration pricing""" + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier + ] + ] + """ + Tiers for rating based on total usage quantities into the specified tier with + proration + """ + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig + ] + """Configuration for tiered_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig( + TypedDict, total=False +): + """Configuration for unit_with_proration pricing""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig + ] + """Configuration for unit_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for grouped_allocation pricing""" + + allocation: Required[str] + """Usage allocation per group""" + + grouping_key: Required[str] + """How to determine the groups that should each be allocated some quantity""" + + overage_unit_rate: Required[str] + """Unit rate for post-allocation""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig + ] + """Configuration for grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier with proration""" + + unit_amount: Required[str] + """Cost per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig( + TypedDict, total=False +): + """Configuration for bulk_with_proration pricing""" + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier + ] + ] + """Bulk tiers for rating based on total usage volume""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig + ] + """Configuration for bulk_with_proration pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig( + 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""" + + minimum: Required[str] + """The minimum amount to charge per group""" + + unit_rate: Required[str] + """The amount to charge per unit""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig + ] + """Configuration for grouped_with_prorated_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor( + TypedDict, total=False +): + """Configuration for a scaling factor""" + + scaling_factor: Required[str] + + scaling_value: Required[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount""" + + pricing_value: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig( + TypedDict, total=False +): + """Configuration for grouped_with_metered_minimum pricing""" + + grouping_key: Required[str] + """Used to partition the usage into groups. + + The minimum amount is applied to each group. + """ + + minimum_unit_amount: Required[str] + """The minimum amount to charge per group per unit""" + + pricing_key: Required[str] + """Used to determine the unit rate""" + + scaling_factors: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor + ] + ] + """Scale the unit rates by the scaling factor.""" + + scaling_key: Required[str] + """Used to determine the unit rate scaling factor""" + + unit_amounts: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount + ] + ] + """Apply per unit pricing to each pricing value. + + The minimum amount is applied any unmatched usage. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig + ] + """Configuration for grouped_with_metered_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_metered_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( + TypedDict, total=False +): + """Configuration for grouped_with_min_max_thresholds pricing""" + + grouping_key: Required[str] + """The event property used to group before applying thresholds""" + + maximum_charge: Required[str] + """The maximum amount to charge each group""" + + minimum_charge: Required[str] + """The minimum amount to charge each group, regardless of usage""" + + per_unit_rate: Required[str] + """The base price charged per group""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig + ] + """Configuration for grouped_with_min_max_thresholds pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_min_max_thresholds"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount item""" + + dimension_value: Required[str] + """The dimension value""" + + display_name: Required[str] + """Display name for this dimension value""" + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig( + TypedDict, total=False +): + """Configuration for matrix_with_display_name pricing""" + + dimension: Required[str] + """Used to determine the unit rate""" + + unit_amounts: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount + ] + ] + """Apply per unit pricing to each dimension value""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_display_name_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig + ] + """Configuration for matrix_with_display_name pricing""" + + model_type: Required[Literal["matrix_with_display_name"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + per_unit: Required[str] + """Per package""" + + tier_lower_bound: Required[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier + ] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig + ] + """Configuration for grouped_tiered_package pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier + ] + ] + """Apply tiered pricing to the largest group after grouping with the provided key.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + max_group_tiered_package_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig + ] + """Configuration for max_group_tiered_package pricing""" + + model_type: Required[Literal["max_group_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + first_dimension: Required[str] + """Used to determine the unit rate""" + + matrix_scaling_factors: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" + + unit_price: Required[str] + """The final unit price to rate against the output of the matrix""" + + grouping_key: Optional[str] + """The property used to group this price""" + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + second_dimension: Optional[str] + """Used to determine the unit rate (optional)""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig + ] + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. - property_value: Required[str] - """Event property value to match""" + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ -class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): - """Configuration for a single bulk pricing tier""" + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier( + TypedDict, total=False +): + """Configuration for a single tier entry with business logic""" + + tier_lower_bound: Required[str] unit_amount: Required[str] - """Amount per unit""" - tier_lower_bound: Optional[str] - """The lower bound for this tier""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" -class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): - """Configuration for bulk_with_filters pricing""" + first_dimension: Required[str] + """Used for the scalable matrix first dimension""" - filters: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] - """Property filters to apply (all must match)""" + matrix_scaling_factors: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" - tiers: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier]] - """Bulk tiers for rating based on total usage volume""" + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier + ] + ] + second_dimension: Optional[str] + """Used for the scalable matrix second dimension (optional)""" -AddPricePriceNewPlanBulkWithFiltersPriceConversionRateConfig: TypeAlias = Union[ + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): - bulk_with_filters_config: Required[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig] - """Configuration for bulk_with_filters pricing""" - +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice( + TypedDict, total=False +): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["bulk_with_filters"]] + license_allocations: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] """The pricing model type""" name: Required[str] """The name of the price.""" + scalable_matrix_with_tiered_pricing_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig + ] + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -211,7 +8825,9 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanBulkWithFiltersPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -258,47 +8874,81 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): """ -class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): - """Configuration for a single tiered with proration tier""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue( + TypedDict, total=False +): + """Configuration for a dimension value entry""" + + grouping_key: Required[str] + """Grouping key value""" tier_lower_bound: Required[str] - """Inclusive tier starting value""" + """Tier lower bound""" unit_amount: Required[str] - """Amount per unit""" + """Unit amount for this combination""" -class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): - """Configuration for tiered_with_proration pricing""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_bulk pricing""" - tiers: Required[Iterable[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] - """ - Tiers for rating based on total usage quantities into the specified tier with - proration - """ + dimension_values: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue + ] + ] + """Each tier lower bound must have the same group of values.""" + group: Required[str] -AddPricePriceNewPlanTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" + cumulative_grouped_bulk_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig + ] + """Configuration for cumulative_grouped_bulk pricing""" + item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["tiered_with_proration"]] + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_bulk"]] """The pricing model type""" name: Required[str] """The name of the price.""" - tiered_with_proration_config: Required[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig] - """Configuration for tiered_with_proration pricing""" - billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -320,7 +8970,9 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanTieredWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -367,40 +9019,66 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): """ -class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): - """Configuration for grouped_with_min_max_thresholds pricing""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_allocation pricing""" + + cumulative_allocation: Required[str] + """The overall allocation across all groups""" + + group_allocation: Required[str] + """The allocation per individual group""" grouping_key: Required[str] - """The event property used to group before applying thresholds""" + """The event property used to group usage before applying allocations""" - maximum_charge: Required[str] - """The maximum amount to charge each group""" + unit_amount: Required[str] + """The amount to charge for each unit outside of the allocation""" - minimum_charge: Required[str] - """The minimum amount to charge each group, regardless of usage""" - per_unit_rate: Required[str] - """The base price charged per group""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + currency: Required[str] + """The currency of the license allocation.""" -AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_with_min_max_thresholds_config: Required[ - AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig + cumulative_grouped_allocation_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig ] - """Configuration for grouped_with_min_max_thresholds pricing""" + """Configuration for cumulative_grouped_allocation pricing""" item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["grouped_with_min_max_thresholds"]] + license_allocations: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_allocation"]] """The pricing model type""" name: Required[str] @@ -427,7 +9105,9 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -474,40 +9154,58 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals """ -class AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): - """Configuration for cumulative_grouped_allocation pricing""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" - cumulative_allocation: Required[str] - """The overall allocation across all groups""" + currency: Required[str] + """The currency of the license allocation.""" - group_allocation: Required[str] - """The allocation per individual group""" + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" - grouping_key: Required[str] - """The event property used to group usage before applying allocations""" - unit_amount: Required[str] - """The amount to charge for each unit outside of the allocation""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig( + TypedDict, total=False +): + """Configuration for minimum_composite pricing""" + minimum_amount: Required[str] + """The minimum amount to apply""" -AddPricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + prorated: bool + """If true, subtotals from this price are prorated based on the service period""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - cumulative_grouped_allocation_config: Required[ - AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig - ] - """Configuration for cumulative_grouped_allocation pricing""" - item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["cumulative_grouped_allocation"]] + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + minimum_composite_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig + ] + """Configuration for minimum_composite pricing""" + + model_type: Required[Literal["minimum_composite"]] """The pricing model type""" name: Required[str] @@ -534,7 +9232,9 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -581,32 +9281,54 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals """ -class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig(TypedDict, total=False): """Configuration for percent pricing""" percent: Required[float] """What percent of the component subtotals to charge""" -AddPricePriceNewPlanPercentCompositePriceConversionRateConfig: TypeAlias = Union[ +ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" item_id: Required[str] """The id of the item the price will be associated with.""" + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + model_type: Required[Literal["percent"]] """The pricing model type""" name: Required[str] """The name of the price.""" - percent_config: Required[AddPricePriceNewPlanPercentCompositePricePercentConfig] + percent_config: Required[ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig] """Configuration for percent pricing""" billable_metric_id: Optional[str] @@ -630,7 +9352,9 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanPercentCompositePriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -677,7 +9401,7 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): """ -class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig(TypedDict, total=False): """Configuration for event_output pricing""" unit_rating_key: Required[str] @@ -697,21 +9421,43 @@ class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=Fal """ -AddPricePriceNewPlanEventOutputPriceConversionRateConfig: TypeAlias = Union[ +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - event_output_config: Required[AddPricePriceNewPlanEventOutputPriceEventOutputConfig] + event_output_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig + ] """Configuration for event_output pricing""" item_id: Required[str] """The id of the item the price will be associated with.""" + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + model_type: Required[Literal["event_output"]] """The pricing model type""" @@ -739,7 +9485,9 @@ class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanEventOutputPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -786,84 +9534,41 @@ class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): """ -AddPricePrice: TypeAlias = Union[ - NewPlanUnitPrice, - NewPlanTieredPrice, - NewPlanBulkPrice, - AddPricePriceNewPlanBulkWithFiltersPrice, - NewPlanPackagePrice, - NewPlanMatrixPrice, - NewPlanThresholdTotalAmountPrice, - NewPlanTieredPackagePrice, - NewPlanTieredWithMinimumPrice, - NewPlanGroupedTieredPrice, - NewPlanTieredPackageWithMinimumPrice, - NewPlanPackageWithAllocationPrice, - NewPlanUnitWithPercentPrice, - NewPlanMatrixWithAllocationPrice, - AddPricePriceNewPlanTieredWithProrationPrice, - NewPlanUnitWithProrationPrice, - NewPlanGroupedAllocationPrice, - NewPlanBulkWithProrationPrice, - NewPlanGroupedWithProratedMinimumPrice, - NewPlanGroupedWithMeteredMinimumPrice, - AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice, - NewPlanMatrixWithDisplayNamePrice, - NewPlanGroupedTieredPackagePrice, - NewPlanMaxGroupTieredPackagePrice, - NewPlanScalableMatrixWithUnitPricingPrice, - NewPlanScalableMatrixWithTieredPricingPrice, - NewPlanCumulativeGroupedBulkPrice, - AddPricePriceNewPlanCumulativeGroupedAllocationPrice, - NewPlanMinimumCompositePrice, - AddPricePriceNewPlanPercentCompositePrice, - AddPricePriceNewPlanEventOutputPrice, -] - - -class AddPrice(TypedDict, total=False): - allocation_price: Optional[NewAllocationPrice] - """The allocation price to add to the plan.""" - - plan_phase_order: Optional[int] - """The phase to add this price to.""" - - price: Optional[AddPricePrice] - """New plan price request body params.""" - - -class RemoveAdjustment(TypedDict, total=False): - adjustment_id: Required[str] - """The id of the adjustment to remove from on the plan.""" - - plan_phase_order: Optional[int] - """The phase to remove this adjustment from.""" - - -class RemovePrice(TypedDict, total=False): - price_id: Required[str] - """The id of the price to remove from the plan.""" - - plan_phase_order: Optional[int] - """The phase to remove this price from.""" - - -ReplaceAdjustmentAdjustment: TypeAlias = Union[ - NewPercentageDiscount, NewUsageDiscount, NewAmountDiscount, NewMinimum, NewMaximum +ReplacePriceLicenseAllocationPrice: TypeAlias = Union[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice, ] -class ReplaceAdjustment(TypedDict, total=False): - adjustment: Required[ReplaceAdjustmentAdjustment] - """The definition of a new adjustment to create and add to the plan.""" - - replaces_adjustment_id: Required[str] - """The id of the adjustment on the plan to replace in the plan.""" - - plan_phase_order: Optional[int] - """The phase to replace this adjustment from.""" - - class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): """Configuration for a single property filter""" @@ -1553,6 +10258,9 @@ class ReplacePrice(TypedDict, total=False): allocation_price: Optional[NewAllocationPrice] """The allocation price to add to the plan.""" + license_allocation_price: Optional[ReplacePriceLicenseAllocationPrice] + """The license allocation price to add to the plan.""" + plan_phase_order: Optional[int] """The phase to replace this price from.""" diff --git a/src/orb/types/beta_create_plan_version_params.py b/src/orb/types/beta_create_plan_version_params.py index 813cbba0..75b96c24 100644 --- a/src/orb/types/beta_create_plan_version_params.py +++ b/src/orb/types/beta_create_plan_version_params.py @@ -5,8 +5,13 @@ from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .shared_params.bulk_config import BulkConfig from .shared_params.new_maximum import NewMaximum from .shared_params.new_minimum import NewMinimum +from .shared_params.unit_config import UnitConfig +from .shared_params.matrix_config import MatrixConfig +from .shared_params.tiered_config import TieredConfig +from .shared_params.package_config import PackageConfig from .shared_params.new_usage_discount import NewUsageDiscount from .shared_params.new_amount_discount import NewAmountDiscount from .shared_params.new_plan_bulk_price import NewPlanBulkPrice @@ -17,6 +22,7 @@ from .shared_params.new_plan_package_price import NewPlanPackagePrice from .shared_params.new_percentage_discount import NewPercentageDiscount from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig +from .shared_params.matrix_with_allocation_config import MatrixWithAllocationConfig from .shared_params.new_plan_grouped_tiered_price import NewPlanGroupedTieredPrice from .shared_params.new_plan_tiered_package_price import NewPlanTieredPackagePrice from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig @@ -48,6 +54,143 @@ "AddAdjustment", "AddAdjustmentAdjustment", "AddPrice", + "AddPriceLicenseAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable", + "AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier", + "AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice", + "AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig", + "AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation", + "AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig", "AddPricePrice", "AddPricePriceNewPlanBulkWithFiltersPrice", "AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig", @@ -75,6 +218,143 @@ "ReplaceAdjustment", "ReplaceAdjustmentAdjustment", "ReplacePrice", + "ReplacePriceLicenseAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation", + "ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig", "ReplacePricePrice", "ReplacePricePriceNewPlanBulkWithFiltersPrice", "ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig", @@ -139,57 +419,8391 @@ class AddAdjustment(TypedDict, total=False): """The phase to add this adjustment to.""" +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_config: Required[UnitConfig] + """Configuration for unit pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[TieredConfig] + """Configuration for tiered pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPrice(TypedDict, total=False): + bulk_config: Required[BulkConfig] + """Configuration for bulk pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter( + TypedDict, total=False +): + """Configuration for a single property filter""" + + property_key: Required[str] + """Event property key to filter on""" + + property_value: Required[str] + """Event property value to match""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier""" + + unit_amount: Required[str] + """Amount per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig( + TypedDict, total=False +): + """Configuration for bulk_with_filters pricing""" + + filters: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter] + ] + """Property filters to apply (all must match)""" + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier] + ] + """Bulk tiers for rating based on total usage volume""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice(TypedDict, total=False): + bulk_with_filters_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig + ] + """Configuration for bulk_with_filters pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_filters"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_config: Required[PackageConfig] + """Configuration for package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_config: Required[MatrixConfig] + """Configuration for matrix pricing""" + + model_type: Required[Literal["matrix"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable( + TypedDict, total=False +): + """Configuration for a single threshold""" + + threshold: Required[str] + + total_amount: Required[str] + """Total amount for this threshold""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig( + TypedDict, total=False +): + """Configuration for threshold_total_amount pricing""" + + consumption_table: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable + ] + ] + """ + When the quantity consumed passes a provided threshold, the configured total + will be charged + """ + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["threshold_total_amount"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig + ] + """Configuration for threshold_total_amount pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier with business logic""" + + per_unit: Required[str] + """Price per package""" + + tier_lower_bound: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + + package_size: Required[str] + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. The tier bounds are defined + based on the total quantity rather than the number of packages, so they must be + multiples of the package size. + """ + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig + ] + """Configuration for tiered_package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_with_minimum pricing""" + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier] + ] + """Tiered pricing with a minimum amount dependent on the volume tier. + + Tiers are defined using exclusive lower bounds. + """ + + hide_zero_amount_tiers: bool + """If true, tiers with an accrued amount of 0 will not be included in the rating.""" + + prorate: bool + """If true, the unit price will be prorated to the billing period""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig + ] + """Configuration for tiered_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + + grouping_key: Required[str] + """The billable metric property used to group before tiering""" + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier] + ] + """ + Apply tiered pricing to each segment generated after grouping with the provided + key + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig + ] + """Configuration for grouped_tiered pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + per_unit: Required[str] + + tier_lower_bound: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_package_with_minimum pricing""" + + package_size: Required[float] + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier + ] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_with_minimum_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig + ] + """Configuration for tiered_package_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig( + TypedDict, total=False +): + """Configuration for package_with_allocation pricing""" + + allocation: Required[str] + + package_amount: Required[str] + + package_size: Required[str] + + +AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig + ] + """Configuration for package_with_allocation pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig( + TypedDict, total=False +): + """Configuration for unit_with_percent pricing""" + + percent: Required[str] + """What percent, out of 100, of the calculated total to charge""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig + ] + """Configuration for unit_with_percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_allocation_config: Required[MatrixWithAllocationConfig] + """Configuration for matrix_with_allocation pricing""" + + model_type: Required[Literal["matrix_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single tiered with proration tier""" + + tier_lower_bound: Required[str] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig( + TypedDict, total=False +): + """Configuration for tiered_with_proration pricing""" + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier + ] + ] + """ + Tiers for rating based on total usage quantities into the specified tier with + proration + """ + + +AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig + ] + """Configuration for tiered_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig( + TypedDict, total=False +): + """Configuration for unit_with_proration pricing""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig + ] + """Configuration for unit_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for grouped_allocation pricing""" + + allocation: Required[str] + """Usage allocation per group""" + + grouping_key: Required[str] + """How to determine the groups that should each be allocated some quantity""" + + overage_unit_rate: Required[str] + """Unit rate for post-allocation""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig + ] + """Configuration for grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier with proration""" + + unit_amount: Required[str] + """Cost per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig( + TypedDict, total=False +): + """Configuration for bulk_with_proration pricing""" + + tiers: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier] + ] + """Bulk tiers for rating based on total usage volume""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig + ] + """Configuration for bulk_with_proration pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig( + 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""" + + minimum: Required[str] + """The minimum amount to charge per group""" + + unit_rate: Required[str] + """The amount to charge per unit""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig + ] + """Configuration for grouped_with_prorated_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor( + TypedDict, total=False +): + """Configuration for a scaling factor""" + + scaling_factor: Required[str] + + scaling_value: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount""" + + pricing_value: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig( + TypedDict, total=False +): + """Configuration for grouped_with_metered_minimum pricing""" + + grouping_key: Required[str] + """Used to partition the usage into groups. + + The minimum amount is applied to each group. + """ + + minimum_unit_amount: Required[str] + """The minimum amount to charge per group per unit""" + + pricing_key: Required[str] + """Used to determine the unit rate""" + + scaling_factors: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor + ] + ] + """Scale the unit rates by the scaling factor.""" + + scaling_key: Required[str] + """Used to determine the unit rate scaling factor""" + + unit_amounts: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount + ] + ] + """Apply per unit pricing to each pricing value. + + The minimum amount is applied any unmatched usage. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig + ] + """Configuration for grouped_with_metered_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_metered_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( + TypedDict, total=False +): + """Configuration for grouped_with_min_max_thresholds pricing""" + + grouping_key: Required[str] + """The event property used to group before applying thresholds""" + + maximum_charge: Required[str] + """The maximum amount to charge each group""" + + minimum_charge: Required[str] + """The minimum amount to charge each group, regardless of usage""" + + per_unit_rate: Required[str] + """The base price charged per group""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig + ] + """Configuration for grouped_with_min_max_thresholds pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_min_max_thresholds"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount item""" + + dimension_value: Required[str] + """The dimension value""" + + display_name: Required[str] + """Display name for this dimension value""" + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig( + TypedDict, total=False +): + """Configuration for matrix_with_display_name pricing""" + + dimension: Required[str] + """Used to determine the unit rate""" + + unit_amounts: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount + ] + ] + """Apply per unit pricing to each dimension value""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_display_name_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig + ] + """Configuration for matrix_with_display_name pricing""" + + model_type: Required[Literal["matrix_with_display_name"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + per_unit: Required[str] + """Per package""" + + tier_lower_bound: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier + ] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig + ] + """Configuration for grouped_tiered_package pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier + ] + ] + """Apply tiered pricing to the largest group after grouping with the provided key.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + max_group_tiered_package_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig + ] + """Configuration for max_group_tiered_package pricing""" + + model_type: Required[Literal["max_group_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + first_dimension: Required[str] + """Used to determine the unit rate""" + + matrix_scaling_factors: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" + + unit_price: Required[str] + """The final unit price to rate against the output of the matrix""" + + grouping_key: Optional[str] + """The property used to group this price""" + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + second_dimension: Optional[str] + """Used to determine the unit rate (optional)""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig + ] + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier( + TypedDict, total=False +): + """Configuration for a single tier entry with business logic""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + + first_dimension: Required[str] + """Used for the scalable matrix first dimension""" + + matrix_scaling_factors: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" + + tiers: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier + ] + ] + + second_dimension: Optional[str] + """Used for the scalable matrix second dimension (optional)""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig + ] + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue( + TypedDict, total=False +): + """Configuration for a dimension value entry""" + + grouping_key: Required[str] + """Grouping key value""" + + tier_lower_bound: Required[str] + """Tier lower bound""" + + unit_amount: Required[str] + """Unit amount for this combination""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_bulk pricing""" + + dimension_values: Required[ + Iterable[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue + ] + ] + """Each tier lower bound must have the same group of values.""" + + group: Required[str] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig + ] + """Configuration for cumulative_grouped_bulk pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_bulk"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_allocation pricing""" + + cumulative_allocation: Required[str] + """The overall allocation across all groups""" + + group_allocation: Required[str] + """The allocation per individual group""" + + grouping_key: Required[str] + """The event property used to group usage before applying allocations""" + + unit_amount: Required[str] + """The amount to charge for each unit outside of the allocation""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_allocation_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig + ] + """Configuration for cumulative_grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig( + TypedDict, total=False +): + """Configuration for minimum_composite pricing""" + + minimum_amount: Required[str] + """The minimum amount to apply""" + + prorated: bool + """If true, subtotals from this price are prorated based on the service period""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + minimum_composite_config: Required[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig + ] + """Configuration for minimum_composite pricing""" + + model_type: Required[Literal["minimum_composite"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + + percent: Required[float] + """What percent of the component subtotals to charge""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig(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.""" + + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +AddPriceLicenseAllocationPrice: TypeAlias = Union[ + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationPackagePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice, + AddPriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice, +] + + class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): """Configuration for a single property filter""" - property_key: Required[str] - """Event property key to filter on""" + property_key: Required[str] + """Event property key to filter on""" + + property_value: Required[str] + """Event property value to match""" + + +class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): + """Configuration for a single bulk pricing tier""" + + unit_amount: Required[str] + """Amount per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + + filters: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] + """Property filters to apply (all must match)""" + + tiers: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier]] + """Bulk tiers for rating based on total usage volume""" + + +AddPricePriceNewPlanBulkWithFiltersPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): + bulk_with_filters_config: Required[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig] + """Configuration for bulk_with_filters pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["bulk_with_filters"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanBulkWithFiltersPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): + """Configuration for a single tiered with proration tier""" + + tier_lower_bound: Required[str] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + +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 + proration + """ + + +AddPricePriceNewPlanTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["tiered_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig] + """Configuration for tiered_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanTieredWithProrationPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +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""" + + maximum_charge: Required[str] + """The maximum amount to charge each group""" + + minimum_charge: Required[str] + """The minimum amount to charge each group, regardless of usage""" + + per_unit_rate: Required[str] + """The base price charged per group""" + + +AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_config: Required[ + AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig + ] + """Configuration for grouped_with_min_max_thresholds pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["grouped_with_min_max_thresholds"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): + """Configuration for cumulative_grouped_allocation pricing""" + + cumulative_allocation: Required[str] + """The overall allocation across all groups""" + + group_allocation: Required[str] + """The allocation per individual group""" + + grouping_key: Required[str] + """The event property used to group usage before applying allocations""" + + unit_amount: Required[str] + """The amount to charge for each unit outside of the allocation""" + + +AddPricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_allocation_config: Required[ + AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig + ] + """Configuration for cumulative_grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["cumulative_grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + + percent: Required[float] + """What percent of the component subtotals to charge""" + + +AddPricePriceNewPlanPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[AddPricePriceNewPlanPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanPercentCompositePriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +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.""" + + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +AddPricePriceNewPlanEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[AddPricePriceNewPlanEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[AddPricePriceNewPlanEventOutputPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +AddPricePrice: TypeAlias = Union[ + NewPlanUnitPrice, + NewPlanTieredPrice, + NewPlanBulkPrice, + AddPricePriceNewPlanBulkWithFiltersPrice, + NewPlanPackagePrice, + NewPlanMatrixPrice, + NewPlanThresholdTotalAmountPrice, + NewPlanTieredPackagePrice, + NewPlanTieredWithMinimumPrice, + NewPlanGroupedTieredPrice, + NewPlanTieredPackageWithMinimumPrice, + NewPlanPackageWithAllocationPrice, + NewPlanUnitWithPercentPrice, + NewPlanMatrixWithAllocationPrice, + AddPricePriceNewPlanTieredWithProrationPrice, + NewPlanUnitWithProrationPrice, + NewPlanGroupedAllocationPrice, + NewPlanBulkWithProrationPrice, + NewPlanGroupedWithProratedMinimumPrice, + NewPlanGroupedWithMeteredMinimumPrice, + AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice, + NewPlanMatrixWithDisplayNamePrice, + NewPlanGroupedTieredPackagePrice, + NewPlanMaxGroupTieredPackagePrice, + NewPlanScalableMatrixWithUnitPricingPrice, + NewPlanScalableMatrixWithTieredPricingPrice, + NewPlanCumulativeGroupedBulkPrice, + AddPricePriceNewPlanCumulativeGroupedAllocationPrice, + NewPlanMinimumCompositePrice, + AddPricePriceNewPlanPercentCompositePrice, + AddPricePriceNewPlanEventOutputPrice, +] + + +class AddPrice(TypedDict, total=False): + allocation_price: Optional[NewAllocationPrice] + """The allocation price to add to the plan.""" + + license_allocation_price: Optional[AddPriceLicenseAllocationPrice] + """The license allocation price to add to the plan.""" + + plan_phase_order: Optional[int] + """The phase to add this price to.""" + + price: Optional[AddPricePrice] + """New plan price request body params.""" + + +class RemoveAdjustment(TypedDict, total=False): + adjustment_id: Required[str] + """The id of the adjustment to remove from on the plan.""" + + plan_phase_order: Optional[int] + """The phase to remove this adjustment from.""" + + +class RemovePrice(TypedDict, total=False): + price_id: Required[str] + """The id of the price to remove from the plan.""" + + plan_phase_order: Optional[int] + """The phase to remove this price from.""" + + +ReplaceAdjustmentAdjustment: TypeAlias = Union[ + NewPercentageDiscount, NewUsageDiscount, NewAmountDiscount, NewMinimum, NewMaximum +] + + +class ReplaceAdjustment(TypedDict, total=False): + adjustment: Required[ReplaceAdjustmentAdjustment] + """The definition of a new adjustment to create and add to the plan.""" + + replaces_adjustment_id: Required[str] + """The id of the adjustment on the plan to replace in the plan.""" + + plan_phase_order: Optional[int] + """The phase to replace this adjustment from.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_config: Required[UnitConfig] + """Configuration for unit pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[TieredConfig] + """Configuration for tiered pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPrice(TypedDict, total=False): + bulk_config: Required[BulkConfig] + """Configuration for bulk pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter( + TypedDict, total=False +): + """Configuration for a single property filter""" + + property_key: Required[str] + """Event property key to filter on""" + + property_value: Required[str] + """Event property value to match""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier""" + + unit_amount: Required[str] + """Amount per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig( + TypedDict, total=False +): + """Configuration for bulk_with_filters pricing""" + + filters: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter] + ] + """Property filters to apply (all must match)""" + + tiers: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier] + ] + """Bulk tiers for rating based on total usage volume""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice(TypedDict, total=False): + bulk_with_filters_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig + ] + """Configuration for bulk_with_filters pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_filters"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_config: Required[PackageConfig] + """Configuration for package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_config: Required[MatrixConfig] + """Configuration for matrix pricing""" + + model_type: Required[Literal["matrix"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable( + TypedDict, total=False +): + """Configuration for a single threshold""" + + threshold: Required[str] + + total_amount: Required[str] + """Total amount for this threshold""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig( + TypedDict, total=False +): + """Configuration for threshold_total_amount pricing""" + + consumption_table: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable + ] + ] + """ + When the quantity consumed passes a provided threshold, the configured total + will be charged + """ + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["threshold_total_amount"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig + ] + """Configuration for threshold_total_amount pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier with business logic""" + + per_unit: Required[str] + """Price per package""" + + tier_lower_bound: Required[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig( + TypedDict, total=False +): + """Configuration for tiered_package pricing""" + + package_size: Required[str] + + tiers: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. The tier bounds are defined + based on the total quantity rather than the number of packages, so they must be + multiples of the package size. + """ + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig + ] + """Configuration for tiered_package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_with_minimum pricing""" + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier + ] + ] + """Tiered pricing with a minimum amount dependent on the volume tier. + + Tiers are defined using exclusive lower bounds. + """ + + hide_zero_amount_tiers: bool + """If true, tiers with an accrued amount of 0 will not be included in the rating.""" + + prorate: bool + """If true, the unit price will be prorated to the billing period""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig + ] + """Configuration for tiered_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig( + TypedDict, total=False +): + """Configuration for grouped_tiered pricing""" + + grouping_key: Required[str] + """The billable metric property used to group before tiering""" + + tiers: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier] + ] + """ + Apply tiered pricing to each segment generated after grouping with the provided + key + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig + ] + """Configuration for grouped_tiered pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + per_unit: Required[str] + + tier_lower_bound: Required[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_package_with_minimum pricing""" + + package_size: Required[float] + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier + ] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_with_minimum_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig + ] + """Configuration for tiered_package_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig( + TypedDict, total=False +): + """Configuration for package_with_allocation pricing""" + + allocation: Required[str] + + package_amount: Required[str] + + package_size: Required[str] + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig + ] + """Configuration for package_with_allocation pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig( + TypedDict, total=False +): + """Configuration for unit_with_percent pricing""" + + percent: Required[str] + """What percent, out of 100, of the calculated total to charge""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig + ] + """Configuration for unit_with_percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_allocation_config: Required[MatrixWithAllocationConfig] + """Configuration for matrix_with_allocation pricing""" + + model_type: Required[Literal["matrix_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single tiered with proration tier""" + + tier_lower_bound: Required[str] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig( + TypedDict, total=False +): + """Configuration for tiered_with_proration pricing""" + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier + ] + ] + """ + Tiers for rating based on total usage quantities into the specified tier with + proration + """ + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig + ] + """Configuration for tiered_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig( + TypedDict, total=False +): + """Configuration for unit_with_proration pricing""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig + ] + """Configuration for unit_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for grouped_allocation pricing""" + + allocation: Required[str] + """Usage allocation per group""" + + grouping_key: Required[str] + """How to determine the groups that should each be allocated some quantity""" + + overage_unit_rate: Required[str] + """Unit rate for post-allocation""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig + ] + """Configuration for grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier with proration""" + + unit_amount: Required[str] + """Cost per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig( + TypedDict, total=False +): + """Configuration for bulk_with_proration pricing""" + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier + ] + ] + """Bulk tiers for rating based on total usage volume""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig + ] + """Configuration for bulk_with_proration pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig( + 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""" + + minimum: Required[str] + """The minimum amount to charge per group""" + + unit_rate: Required[str] + """The amount to charge per unit""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig + ] + """Configuration for grouped_with_prorated_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor( + TypedDict, total=False +): + """Configuration for a scaling factor""" + + scaling_factor: Required[str] + + scaling_value: Required[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount""" + + pricing_value: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig( + TypedDict, total=False +): + """Configuration for grouped_with_metered_minimum pricing""" + + grouping_key: Required[str] + """Used to partition the usage into groups. + + The minimum amount is applied to each group. + """ + + minimum_unit_amount: Required[str] + """The minimum amount to charge per group per unit""" + + pricing_key: Required[str] + """Used to determine the unit rate""" + + scaling_factors: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor + ] + ] + """Scale the unit rates by the scaling factor.""" + + scaling_key: Required[str] + """Used to determine the unit rate scaling factor""" + + unit_amounts: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount + ] + ] + """Apply per unit pricing to each pricing value. + + The minimum amount is applied any unmatched usage. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig + ] + """Configuration for grouped_with_metered_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_metered_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( + TypedDict, total=False +): + """Configuration for grouped_with_min_max_thresholds pricing""" + + grouping_key: Required[str] + """The event property used to group before applying thresholds""" + + maximum_charge: Required[str] + """The maximum amount to charge each group""" + + minimum_charge: Required[str] + """The minimum amount to charge each group, regardless of usage""" + + per_unit_rate: Required[str] + """The base price charged per group""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig + ] + """Configuration for grouped_with_min_max_thresholds pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_min_max_thresholds"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount item""" + + dimension_value: Required[str] + """The dimension value""" + + display_name: Required[str] + """Display name for this dimension value""" + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig( + TypedDict, total=False +): + """Configuration for matrix_with_display_name pricing""" + + dimension: Required[str] + """Used to determine the unit rate""" + + unit_amounts: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount + ] + ] + """Apply per unit pricing to each dimension value""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_display_name_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig + ] + """Configuration for matrix_with_display_name pricing""" + + model_type: Required[Literal["matrix_with_display_name"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + per_unit: Required[str] + """Per package""" + + tier_lower_bound: Required[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier + ] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig + ] + """Configuration for grouped_tiered_package pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier + ] + ] + """Apply tiered pricing to the largest group after grouping with the provided key.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + max_group_tiered_package_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig + ] + """Configuration for max_group_tiered_package pricing""" + + model_type: Required[Literal["max_group_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + first_dimension: Required[str] + """Used to determine the unit rate""" + + matrix_scaling_factors: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" + + unit_price: Required[str] + """The final unit price to rate against the output of the matrix""" + + grouping_key: Optional[str] + """The property used to group this price""" + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + second_dimension: Optional[str] + """Used to determine the unit rate (optional)""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig + ] + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. - property_value: Required[str] - """Event property value to match""" + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ -class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier(TypedDict, total=False): - """Configuration for a single bulk pricing tier""" + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier( + TypedDict, total=False +): + """Configuration for a single tier entry with business logic""" + + tier_lower_bound: Required[str] unit_amount: Required[str] - """Amount per unit""" - tier_lower_bound: Optional[str] - """The lower bound for this tier""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" -class AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): - """Configuration for bulk_with_filters pricing""" + first_dimension: Required[str] + """Used for the scalable matrix first dimension""" - filters: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter]] - """Property filters to apply (all must match)""" + matrix_scaling_factors: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" - tiers: Required[Iterable[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigTier]] - """Bulk tiers for rating based on total usage volume""" + tiers: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier + ] + ] + second_dimension: Optional[str] + """Used for the scalable matrix second dimension (optional)""" -AddPricePriceNewPlanBulkWithFiltersPriceConversionRateConfig: TypeAlias = Union[ + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): - bulk_with_filters_config: Required[AddPricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig] - """Configuration for bulk_with_filters pricing""" - +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice( + TypedDict, total=False +): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["bulk_with_filters"]] + license_allocations: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] """The pricing model type""" name: Required[str] """The name of the price.""" + scalable_matrix_with_tiered_pricing_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig + ] + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -211,7 +8825,9 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanBulkWithFiltersPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -258,47 +8874,81 @@ class AddPricePriceNewPlanBulkWithFiltersPrice(TypedDict, total=False): """ -class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier(TypedDict, total=False): - """Configuration for a single tiered with proration tier""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue( + TypedDict, total=False +): + """Configuration for a dimension value entry""" + + grouping_key: Required[str] + """Grouping key value""" tier_lower_bound: Required[str] - """Inclusive tier starting value""" + """Tier lower bound""" unit_amount: Required[str] - """Amount per unit""" + """Unit amount for this combination""" -class AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig(TypedDict, total=False): - """Configuration for tiered_with_proration pricing""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_bulk pricing""" - tiers: Required[Iterable[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfigTier]] - """ - Tiers for rating based on total usage quantities into the specified tier with - proration - """ + dimension_values: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue + ] + ] + """Each tier lower bound must have the same group of values.""" + group: Required[str] -AddPricePriceNewPlanTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" + cumulative_grouped_bulk_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig + ] + """Configuration for cumulative_grouped_bulk pricing""" + item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["tiered_with_proration"]] + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_bulk"]] """The pricing model type""" name: Required[str] """The name of the price.""" - tiered_with_proration_config: Required[AddPricePriceNewPlanTieredWithProrationPriceTieredWithProrationConfig] - """Configuration for tiered_with_proration pricing""" - billable_metric_id: Optional[str] """The id of the billable metric for the price. @@ -320,7 +8970,9 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanTieredWithProrationPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -367,40 +9019,66 @@ class AddPricePriceNewPlanTieredWithProrationPrice(TypedDict, total=False): """ -class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig(TypedDict, total=False): - """Configuration for grouped_with_min_max_thresholds pricing""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_allocation pricing""" + + cumulative_allocation: Required[str] + """The overall allocation across all groups""" + + group_allocation: Required[str] + """The allocation per individual group""" grouping_key: Required[str] - """The event property used to group before applying thresholds""" + """The event property used to group usage before applying allocations""" - maximum_charge: Required[str] - """The maximum amount to charge each group""" + unit_amount: Required[str] + """The amount to charge for each unit outside of the allocation""" - minimum_charge: Required[str] - """The minimum amount to charge each group, regardless of usage""" - per_unit_rate: Required[str] - """The base price charged per group""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + currency: Required[str] + """The currency of the license allocation.""" -AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - grouped_with_min_max_thresholds_config: Required[ - AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig + cumulative_grouped_allocation_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig ] - """Configuration for grouped_with_min_max_thresholds pricing""" + """Configuration for cumulative_grouped_allocation pricing""" item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["grouped_with_min_max_thresholds"]] + license_allocations: Required[ + Iterable[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation + ] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_allocation"]] """The pricing model type""" name: Required[str] @@ -427,7 +9105,9 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanGroupedWithMinMaxThresholdsPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -474,40 +9154,58 @@ class AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice(TypedDict, total=Fals """ -class AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig(TypedDict, total=False): - """Configuration for cumulative_grouped_allocation pricing""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" - cumulative_allocation: Required[str] - """The overall allocation across all groups""" + currency: Required[str] + """The currency of the license allocation.""" - group_allocation: Required[str] - """The allocation per individual group""" + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" - grouping_key: Required[str] - """The event property used to group usage before applying allocations""" - unit_amount: Required[str] - """The amount to charge for each unit outside of the allocation""" +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig( + TypedDict, total=False +): + """Configuration for minimum_composite pricing""" + minimum_amount: Required[str] + """The minimum amount to apply""" -AddPricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + prorated: bool + """If true, subtotals from this price are prorated based on the service period""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - cumulative_grouped_allocation_config: Required[ - AddPricePriceNewPlanCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig - ] - """Configuration for cumulative_grouped_allocation pricing""" - item_id: Required[str] """The id of the item the price will be associated with.""" - model_type: Required[Literal["cumulative_grouped_allocation"]] + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + minimum_composite_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig + ] + """Configuration for minimum_composite pricing""" + + model_type: Required[Literal["minimum_composite"]] """The pricing model type""" name: Required[str] @@ -534,7 +9232,9 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanCumulativeGroupedAllocationPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -581,32 +9281,54 @@ class AddPricePriceNewPlanCumulativeGroupedAllocationPrice(TypedDict, total=Fals """ -class AddPricePriceNewPlanPercentCompositePricePercentConfig(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig(TypedDict, total=False): """Configuration for percent pricing""" percent: Required[float] """What percent of the component subtotals to charge""" -AddPricePriceNewPlanPercentCompositePriceConversionRateConfig: TypeAlias = Union[ +ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" item_id: Required[str] """The id of the item the price will be associated with.""" + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + model_type: Required[Literal["percent"]] """The pricing model type""" name: Required[str] """The name of the price.""" - percent_config: Required[AddPricePriceNewPlanPercentCompositePricePercentConfig] + percent_config: Required[ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig] """Configuration for percent pricing""" billable_metric_id: Optional[str] @@ -630,7 +9352,9 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanPercentCompositePriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -677,7 +9401,7 @@ class AddPricePriceNewPlanPercentCompositePrice(TypedDict, total=False): """ -class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig(TypedDict, total=False): """Configuration for event_output pricing""" unit_rating_key: Required[str] @@ -697,21 +9421,43 @@ class AddPricePriceNewPlanEventOutputPriceEventOutputConfig(TypedDict, total=Fal """ -AddPricePriceNewPlanEventOutputPriceConversionRateConfig: TypeAlias = Union[ +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig: TypeAlias = Union[ UnitConversionRateConfig, TieredConversionRateConfig ] -class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): +class ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" - event_output_config: Required[AddPricePriceNewPlanEventOutputPriceEventOutputConfig] + event_output_config: Required[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig + ] """Configuration for event_output pricing""" item_id: Required[str] """The id of the item the price will be associated with.""" + license_allocations: Required[ + Iterable[ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + model_type: Required[Literal["event_output"]] """The pricing model type""" @@ -739,7 +9485,9 @@ class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): conversion_rate: Optional[float] """The per unit conversion rate of the price currency to the invoicing currency.""" - conversion_rate_config: Optional[AddPricePriceNewPlanEventOutputPriceConversionRateConfig] + conversion_rate_config: Optional[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig + ] """The configuration for the rate of the price currency to the invoicing currency.""" currency: Optional[str] @@ -786,84 +9534,41 @@ class AddPricePriceNewPlanEventOutputPrice(TypedDict, total=False): """ -AddPricePrice: TypeAlias = Union[ - NewPlanUnitPrice, - NewPlanTieredPrice, - NewPlanBulkPrice, - AddPricePriceNewPlanBulkWithFiltersPrice, - NewPlanPackagePrice, - NewPlanMatrixPrice, - NewPlanThresholdTotalAmountPrice, - NewPlanTieredPackagePrice, - NewPlanTieredWithMinimumPrice, - NewPlanGroupedTieredPrice, - NewPlanTieredPackageWithMinimumPrice, - NewPlanPackageWithAllocationPrice, - NewPlanUnitWithPercentPrice, - NewPlanMatrixWithAllocationPrice, - AddPricePriceNewPlanTieredWithProrationPrice, - NewPlanUnitWithProrationPrice, - NewPlanGroupedAllocationPrice, - NewPlanBulkWithProrationPrice, - NewPlanGroupedWithProratedMinimumPrice, - NewPlanGroupedWithMeteredMinimumPrice, - AddPricePriceNewPlanGroupedWithMinMaxThresholdsPrice, - NewPlanMatrixWithDisplayNamePrice, - NewPlanGroupedTieredPackagePrice, - NewPlanMaxGroupTieredPackagePrice, - NewPlanScalableMatrixWithUnitPricingPrice, - NewPlanScalableMatrixWithTieredPricingPrice, - NewPlanCumulativeGroupedBulkPrice, - AddPricePriceNewPlanCumulativeGroupedAllocationPrice, - NewPlanMinimumCompositePrice, - AddPricePriceNewPlanPercentCompositePrice, - AddPricePriceNewPlanEventOutputPrice, -] - - -class AddPrice(TypedDict, total=False): - allocation_price: Optional[NewAllocationPrice] - """The allocation price to add to the plan.""" - - plan_phase_order: Optional[int] - """The phase to add this price to.""" - - price: Optional[AddPricePrice] - """New plan price request body params.""" - - -class RemoveAdjustment(TypedDict, total=False): - adjustment_id: Required[str] - """The id of the adjustment to remove from on the plan.""" - - plan_phase_order: Optional[int] - """The phase to remove this adjustment from.""" - - -class RemovePrice(TypedDict, total=False): - price_id: Required[str] - """The id of the price to remove from the plan.""" - - plan_phase_order: Optional[int] - """The phase to remove this price from.""" - - -ReplaceAdjustmentAdjustment: TypeAlias = Union[ - NewPercentageDiscount, NewUsageDiscount, NewAmountDiscount, NewMinimum, NewMaximum +ReplacePriceLicenseAllocationPrice: TypeAlias = Union[ + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackagePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice, + ReplacePriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice, ] -class ReplaceAdjustment(TypedDict, total=False): - adjustment: Required[ReplaceAdjustmentAdjustment] - """The definition of a new adjustment to create and add to the plan.""" - - replaces_adjustment_id: Required[str] - """The id of the adjustment on the plan to replace in the plan.""" - - plan_phase_order: Optional[int] - """The phase to replace this adjustment from.""" - - class ReplacePricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): """Configuration for a single property filter""" @@ -1553,6 +10258,9 @@ class ReplacePrice(TypedDict, total=False): allocation_price: Optional[NewAllocationPrice] """The allocation price to add to the plan.""" + license_allocation_price: Optional[ReplacePriceLicenseAllocationPrice] + """The license allocation price to add to the plan.""" + plan_phase_order: Optional[int] """The phase to replace this price from.""" diff --git a/src/orb/types/billable_metric.py b/src/orb/types/billable_metric.py index e618c404..b3b6a158 100644 --- a/src/orb/types/billable_metric.py +++ b/src/orb/types/billable_metric.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from typing_extensions import Literal from .item import Item @@ -38,3 +38,5 @@ class BillableMetric(BaseModel): name: str status: Literal["active", "draft", "archived"] + + parameter_definitions: Optional[List[Dict[str, object]]] = None diff --git a/src/orb/types/customer.py b/src/orb/types/customer.py index 4eccf4a8..c89b5f54 100644 --- a/src/orb/types/customer.py +++ b/src/orb/types/customer.py @@ -31,7 +31,7 @@ class Hierarchy(BaseModel): class AccountingSyncConfigurationAccountingProvider(BaseModel): external_provider_id: Optional[str] = None - provider_type: Literal["quickbooks", "netsuite"] + provider_type: Literal["quickbooks", "netsuite", "netsuite_ampersand"] class AccountingSyncConfiguration(BaseModel): @@ -44,6 +44,13 @@ class PaymentConfigurationPaymentProvider(BaseModel): provider_type: Literal["stripe"] """The payment provider to configure.""" + default_shared_payment_token: Optional[str] = None + """ + The ID of a shared payment token granted by an agent to use as the default + payment instrument for this customer. When set, auto-collection will use this + token instead of the customer's default payment method. + """ + excluded_payment_method_types: Optional[List[str]] = None """List of Stripe payment method types to exclude for this customer. @@ -139,7 +146,9 @@ class Customer(BaseModel): name: str """The full name of the customer""" - payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] = None + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] = None """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 diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py index 7d8e6155..4e3aafe2 100644 --- a/src/orb/types/customer_create_params.py +++ b/src/orb/types/customer_create_params.py @@ -95,7 +95,9 @@ class CustomerCreateParams(TypedDict, total=False): a supported payment provider such as Stripe. """ - payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] """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 @@ -275,6 +277,13 @@ class PaymentConfigurationPaymentProvider(TypedDict, total=False): provider_type: Required[Literal["stripe"]] """The payment provider to configure.""" + default_shared_payment_token: Optional[str] + """ + The ID of a shared payment token granted by an agent to use as the default + payment instrument for this customer. When set, auto-collection will use this + token instead of the customer's default payment method. + """ + excluded_payment_method_types: SequenceNotStr[str] """List of Stripe payment method types to exclude for this customer. diff --git a/src/orb/types/customer_update_by_external_id_params.py b/src/orb/types/customer_update_by_external_id_params.py index 3d7a832e..92327800 100644 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -57,7 +57,9 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): currency: Optional[str] """An ISO 4217 currency string used for the customer's invoices and balance. - If not set at creation time, will be set at subscription creation time. + This can only be set if the customer does not already have a currency + configured. If not set at creation or update time, it will be set at + subscription creation time. """ email: Optional[str] @@ -93,7 +95,9 @@ class CustomerUpdateByExternalIDParams(TypedDict, total=False): a supported payment provider such as Stripe. """ - payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] """This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -270,6 +274,13 @@ class PaymentConfigurationPaymentProvider(TypedDict, total=False): provider_type: Required[Literal["stripe"]] """The payment provider to configure.""" + default_shared_payment_token: Optional[str] + """ + The ID of a shared payment token granted by an agent to use as the default + payment instrument for this customer. When set, auto-collection will use this + token instead of the customer's default payment method. + """ + excluded_payment_method_types: SequenceNotStr[str] """List of Stripe payment method types to exclude for this customer. diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index 13673f40..050d126d 100644 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -57,7 +57,9 @@ class CustomerUpdateParams(TypedDict, total=False): currency: Optional[str] """An ISO 4217 currency string used for the customer's invoices and balance. - If not set at creation time, will be set at subscription creation time. + This can only be set if the customer does not already have a currency + configured. If not set at creation or update time, it will be set at + subscription creation time. """ email: Optional[str] @@ -93,7 +95,9 @@ class CustomerUpdateParams(TypedDict, total=False): a supported payment provider such as Stripe. """ - payment_provider: Optional[Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite"]] + payment_provider: Optional[ + Literal["quickbooks", "bill.com", "stripe_charge", "stripe_invoice", "netsuite", "netsuite_ampersand"] + ] """This is used for creating charges or invoices in an external system via Orb. When not in test mode: @@ -270,6 +274,13 @@ class PaymentConfigurationPaymentProvider(TypedDict, total=False): provider_type: Required[Literal["stripe"]] """The payment provider to configure.""" + default_shared_payment_token: Optional[str] + """ + The ID of a shared payment token granted by an agent to use as the default + payment instrument for this customer. When set, auto-collection will use this + token instead of the customer's default payment method. + """ + excluded_payment_method_types: SequenceNotStr[str] """List of Stripe payment method types to exclude for this customer. diff --git a/src/orb/types/customers/credits/decrement_ledger_entry.py b/src/orb/types/customers/credits/decrement_ledger_entry.py index 9373f061..3f0896c2 100644 --- a/src/orb/types/customers/credits/decrement_ledger_entry.py +++ b/src/orb/types/customers/credits/decrement_ledger_entry.py @@ -45,6 +45,10 @@ class DecrementLedgerEntry(BaseModel): starting_balance: float event_id: Optional[str] = None + """This field is deprecated and will always be null. + + Decrements are not associated with individual events. + """ invoice_id: Optional[str] = None diff --git a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py index 598e681b..d7a7e1a5 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py @@ -125,6 +125,9 @@ class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total If not provided, a default 'Credits' item will be used. """ + mark_as_paid: bool + """If true, the new credits purchase invoice will be marked as paid.""" + memo: Optional[str] """An optional memo to display on the invoice.""" @@ -134,8 +137,8 @@ class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total Due date is calculated based on the invoice or issuance date, depending on the account's configured due date calculation method. A value of '0' here represents that the invoice is due on issue, whereas a value of '30' represents that the - customer has 30 days to pay the invoice. Do not set this field if you want to - set a custom due date. + customer has 30 days to pay the invoice. You must set either `net_terms` or + `custom_due_date`, but not both. """ require_successful_payment: bool diff --git a/src/orb/types/customers/credits/ledger_create_entry_params.py b/src/orb/types/customers/credits/ledger_create_entry_params.py index b0b47f75..c86f839f 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_params.py @@ -125,6 +125,9 @@ class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total If not provided, a default 'Credits' item will be used. """ + mark_as_paid: bool + """If true, the new credits purchase invoice will be marked as paid.""" + memo: Optional[str] """An optional memo to display on the invoice.""" @@ -134,8 +137,8 @@ class AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings(TypedDict, total Due date is calculated based on the invoice or issuance date, depending on the account's configured due date calculation method. A value of '0' here represents that the invoice is due on issue, whereas a value of '30' represents that the - customer has 30 days to pay the invoice. Do not set this field if you want to - set a custom due date. + customer has 30 days to pay the invoice. You must set either `net_terms` or + `custom_due_date`, but not both. """ require_successful_payment: bool diff --git a/src/orb/types/invoice_create_params.py b/src/orb/types/invoice_create_params.py index 92ae0229..650d26c0 100644 --- a/src/orb/types/invoice_create_params.py +++ b/src/orb/types/invoice_create_params.py @@ -29,6 +29,13 @@ class InvoiceCreateParams(TypedDict, total=False): line_items: Required[Iterable[LineItem]] + auto_collection: Optional[bool] + """ + Determines whether this invoice will automatically attempt to charge a saved + payment method, if any. If not specified, the invoice inherits the customer's + auto_collection setting. + """ + customer_id: Optional[str] """The id of the `Customer` to create this invoice for. diff --git a/src/orb/types/invoice_pay_params.py b/src/orb/types/invoice_pay_params.py new file mode 100644 index 00000000..e7a883d8 --- /dev/null +++ b/src/orb/types/invoice_pay_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["InvoicePayParams"] + + +class InvoicePayParams(TypedDict, total=False): + shared_payment_token_id: Required[str] + """The ID of a shared payment token granted by an agent to use for this payment.""" diff --git a/src/orb/types/invoice_update_params.py b/src/orb/types/invoice_update_params.py index b097d6f8..30367bce 100644 --- a/src/orb/types/invoice_update_params.py +++ b/src/orb/types/invoice_update_params.py @@ -12,6 +12,13 @@ class InvoiceUpdateParams(TypedDict, total=False): + auto_collection: Optional[bool] + """ + Determines whether this invoice will automatically attempt to charge a saved + payment method, if any. Can only be modified on draft invoices. If not + specified, the invoice's existing setting is unchanged. + """ + due_date: Annotated[Union[Union[str, date], Union[str, datetime], None], PropertyInfo(format="iso8601")] """An optional custom due date for the invoice. diff --git a/src/orb/types/item.py b/src/orb/types/item.py index c25cd993..6f4fcb32 100644 --- a/src/orb/types/item.py +++ b/src/orb/types/item.py @@ -15,7 +15,7 @@ class ExternalConnection(BaseModel): """ external_connection_name: Literal[ - "stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral" + "stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral", "stripe_tax" ] """The name of the external system this item is connected to.""" diff --git a/src/orb/types/item_update_params.py b/src/orb/types/item_update_params.py index d9504846..939b406c 100644 --- a/src/orb/types/item_update_params.py +++ b/src/orb/types/item_update_params.py @@ -27,7 +27,7 @@ class ExternalConnection(TypedDict, total=False): """ external_connection_name: Required[ - Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral"] + Literal["stripe", "quickbooks", "bill.com", "netsuite", "taxjar", "avalara", "anrok", "numeral", "stripe_tax"] ] """The name of the external system this item is connected to.""" diff --git a/src/orb/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py b/src/orb/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py index c0ea7c96..683bf6db 100644 --- a/src/orb/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py +++ b/src/orb/types/new_subscription_scalable_matrix_with_unit_pricing_price_param.py @@ -40,6 +40,9 @@ class ScalableMatrixWithUnitPricingConfig(TypedDict, total=False): unit_price: Required[str] """The final unit price to rate against the output of the matrix""" + grouping_key: Optional[str] + """The property used to group this price""" + prorate: Optional[bool] """If true, the unit price will be prorated to the billing period""" diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index ff20826c..e5e6723c 100644 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -5,8 +5,13 @@ from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .shared_params.bulk_config import BulkConfig from .shared_params.new_maximum import NewMaximum from .shared_params.new_minimum import NewMinimum +from .shared_params.unit_config import UnitConfig +from .shared_params.matrix_config import MatrixConfig +from .shared_params.tiered_config import TieredConfig +from .shared_params.package_config import PackageConfig from .shared_params.new_usage_discount import NewUsageDiscount from .shared_params.new_amount_discount import NewAmountDiscount from .shared_params.new_plan_bulk_price import NewPlanBulkPrice @@ -17,6 +22,7 @@ from .shared_params.new_plan_package_price import NewPlanPackagePrice from .shared_params.new_percentage_discount import NewPercentageDiscount from .shared_params.unit_conversion_rate_config import UnitConversionRateConfig +from .shared_params.matrix_with_allocation_config import MatrixWithAllocationConfig from .shared_params.new_plan_grouped_tiered_price import NewPlanGroupedTieredPrice from .shared_params.new_plan_tiered_package_price import NewPlanTieredPackagePrice from .shared_params.tiered_conversion_rate_config import TieredConversionRateConfig @@ -46,6 +52,143 @@ __all__ = [ "PlanCreateParams", "Price", + "PriceLicenseAllocationPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationPackagePrice", + "PriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable", + "PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount", + "PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice", + "PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier", + "PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue", + "PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice", + "PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice", + "PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice", + "PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig", + "PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation", + "PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig", "PricePrice", "PricePriceNewPlanBulkWithFiltersPrice", "PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfig", @@ -129,6 +272,4161 @@ class PlanCreateParams(TypedDict, total=False): """ +class PriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationUnitPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[Iterable[PriceLicenseAllocationPriceNewLicenseAllocationUnitPriceLicenseAllocation]] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_config: Required[UnitConfig] + """Configuration for unit pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[PriceLicenseAllocationPriceNewLicenseAllocationUnitPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[Iterable[PriceLicenseAllocationPriceNewLicenseAllocationTieredPriceLicenseAllocation]] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_config: Required[TieredConfig] + """Configuration for tiered pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[PriceLicenseAllocationPriceNewLicenseAllocationTieredPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkPrice(TypedDict, total=False): + bulk_config: Required[BulkConfig] + """Configuration for bulk pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[Iterable[PriceLicenseAllocationPriceNewLicenseAllocationBulkPriceLicenseAllocation]] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[PriceLicenseAllocationPriceNewLicenseAllocationBulkPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter( + TypedDict, total=False +): + """Configuration for a single property filter""" + + property_key: Required[str] + """Event property key to filter on""" + + property_value: Required[str] + """Event property value to match""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier""" + + unit_amount: Required[str] + """Amount per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig(TypedDict, total=False): + """Configuration for bulk_with_filters pricing""" + + filters: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigFilter] + ] + """Property filters to apply (all must match)""" + + tiers: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfigTier] + ] + """Bulk tiers for rating based on total usage volume""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice(TypedDict, total=False): + bulk_with_filters_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceBulkWithFiltersConfig + ] + """Configuration for bulk_with_filters pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_filters"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_config: Required[PackageConfig] + """Configuration for package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[PriceLicenseAllocationPriceNewLicenseAllocationPackagePriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[Iterable[PriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceLicenseAllocation]] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_config: Required[MatrixConfig] + """Configuration for matrix pricing""" + + model_type: Required[Literal["matrix"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[PriceLicenseAllocationPriceNewLicenseAllocationMatrixPriceConversionRateConfig] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable( + TypedDict, total=False +): + """Configuration for a single threshold""" + + threshold: Required[str] + + total_amount: Required[str] + """Total amount for this threshold""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig( + TypedDict, total=False +): + """Configuration for threshold_total_amount pricing""" + + consumption_table: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfigConsumptionTable + ] + ] + """ + When the quantity consumed passes a provided threshold, the configured total + will be charged + """ + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + +PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["threshold_total_amount"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + threshold_total_amount_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceThresholdTotalAmountConfig + ] + """Configuration for threshold_total_amount pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier(TypedDict, total=False): + """Configuration for a single tier with business logic""" + + per_unit: Required[str] + """Price per package""" + + tier_lower_bound: Required[str] + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig(TypedDict, total=False): + """Configuration for tiered_package pricing""" + + package_size: Required[str] + + tiers: Required[Iterable[PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfigTier]] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. The tier bounds are defined + based on the total quantity rather than the number of packages, so they must be + multiples of the package size. + """ + + +PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceTieredPackageConfig + ] + """Configuration for tiered_package pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_with_minimum pricing""" + + tiers: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfigTier] + ] + """Tiered pricing with a minimum amount dependent on the volume tier. + + Tiers are defined using exclusive lower bounds. + """ + + hide_zero_amount_tiers: bool + """If true, tiers with an accrued amount of 0 will not be included in the rating.""" + + prorate: bool + """If true, the unit price will be prorated to the billing period""" + + +PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_minimum_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceTieredWithMinimumConfig + ] + """Configuration for tiered_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier(TypedDict, total=False): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig(TypedDict, total=False): + """Configuration for grouped_tiered pricing""" + + grouping_key: Required[str] + """The billable metric property used to group before tiering""" + + tiers: Required[Iterable[PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfigTier]] + """ + Apply tiered pricing to each segment generated after grouping with the provided + key + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceGroupedTieredConfig + ] + """Configuration for grouped_tiered pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + minimum_amount: Required[str] + + per_unit: Required[str] + + tier_lower_bound: Required[str] + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig( + TypedDict, total=False +): + """Configuration for tiered_package_with_minimum pricing""" + + package_size: Required[float] + + tiers: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfigTier + ] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_package_with_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_package_with_minimum_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceTieredPackageWithMinimumConfig + ] + """Configuration for tiered_package_with_minimum pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig( + TypedDict, total=False +): + """Configuration for package_with_allocation pricing""" + + allocation: Required[str] + + package_amount: Required[str] + + package_size: Required[str] + + +PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["package_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + package_with_allocation_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPricePackageWithAllocationConfig + ] + """Configuration for package_with_allocation pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig(TypedDict, total=False): + """Configuration for unit_with_percent pricing""" + + percent: Required[str] + """What percent, out of 100, of the calculated total to charge""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_percent_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceUnitWithPercentConfig + ] + """Configuration for unit_with_percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_allocation_config: Required[MatrixWithAllocationConfig] + """Configuration for matrix_with_allocation pricing""" + + model_type: Required[Literal["matrix_with_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single tiered with proration tier""" + + tier_lower_bound: Required[str] + """Inclusive tier starting value""" + + unit_amount: Required[str] + """Amount per unit""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig( + TypedDict, total=False +): + """Configuration for tiered_with_proration pricing""" + + tiers: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfigTier] + ] + """ + Tiers for rating based on total usage quantities into the specified tier with + proration + """ + + +PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["tiered_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + tiered_with_proration_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceTieredWithProrationConfig + ] + """Configuration for tiered_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig( + TypedDict, total=False +): + """Configuration for unit_with_proration pricing""" + + unit_amount: Required[str] + """Rate per unit of usage""" + + +PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["unit_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + unit_with_proration_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceUnitWithProrationConfig + ] + """Configuration for unit_with_proration pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for grouped_allocation pricing""" + + allocation: Required[str] + """Usage allocation per group""" + + grouping_key: Required[str] + """How to determine the groups that should each be allocated some quantity""" + + overage_unit_rate: Required[str] + """Unit rate for post-allocation""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_allocation_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceGroupedAllocationConfig + ] + """Configuration for grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier( + TypedDict, total=False +): + """Configuration for a single bulk pricing tier with proration""" + + unit_amount: Required[str] + """Cost per unit""" + + tier_lower_bound: Optional[str] + """The lower bound for this tier""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig( + TypedDict, total=False +): + """Configuration for bulk_with_proration pricing""" + + tiers: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfigTier] + ] + """Bulk tiers for rating based on total usage volume""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice(TypedDict, total=False): + bulk_with_proration_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceBulkWithProrationConfig + ] + """Configuration for bulk_with_proration pricing""" + + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["bulk_with_proration"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig( + 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""" + + minimum: Required[str] + """The minimum amount to charge per group""" + + unit_rate: Required[str] + """The amount to charge per unit""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_prorated_minimum_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceGroupedWithProratedMinimumConfig + ] + """Configuration for grouped_with_prorated_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_prorated_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor( + TypedDict, total=False +): + """Configuration for a scaling factor""" + + scaling_factor: Required[str] + + scaling_value: Required[str] + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount""" + + pricing_value: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig( + TypedDict, total=False +): + """Configuration for grouped_with_metered_minimum pricing""" + + grouping_key: Required[str] + """Used to partition the usage into groups. + + The minimum amount is applied to each group. + """ + + minimum_unit_amount: Required[str] + """The minimum amount to charge per group per unit""" + + pricing_key: Required[str] + """Used to determine the unit rate""" + + scaling_factors: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigScalingFactor + ] + ] + """Scale the unit rates by the scaling factor.""" + + scaling_key: Required[str] + """Used to determine the unit rate scaling factor""" + + unit_amounts: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfigUnitAmount + ] + ] + """Apply per unit pricing to each pricing value. + + The minimum amount is applied any unmatched usage. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_metered_minimum_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceGroupedWithMeteredMinimumConfig + ] + """Configuration for grouped_with_metered_minimum pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_metered_minimum"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig( + TypedDict, total=False +): + """Configuration for grouped_with_min_max_thresholds pricing""" + + grouping_key: Required[str] + """The event property used to group before applying thresholds""" + + maximum_charge: Required[str] + """The maximum amount to charge each group""" + + minimum_charge: Required[str] + """The minimum amount to charge each group, regardless of usage""" + + per_unit_rate: Required[str] + """The base price charged per group""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_with_min_max_thresholds_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceGroupedWithMinMaxThresholdsConfig + ] + """Configuration for grouped_with_min_max_thresholds pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_with_min_max_thresholds"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount( + TypedDict, total=False +): + """Configuration for a unit amount item""" + + dimension_value: Required[str] + """The dimension value""" + + display_name: Required[str] + """Display name for this dimension value""" + + unit_amount: Required[str] + """Per unit amount""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig( + TypedDict, total=False +): + """Configuration for matrix_with_display_name pricing""" + + dimension: Required[str] + """Used to determine the unit rate""" + + unit_amounts: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfigUnitAmount + ] + ] + """Apply per unit pricing to each dimension value""" + + +PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + matrix_with_display_name_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceMatrixWithDisplayNameConfig + ] + """Configuration for matrix_with_display_name pricing""" + + model_type: Required[Literal["matrix_with_display_name"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + per_unit: Required[str] + """Per package""" + + tier_lower_bound: Required[str] + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfigTier] + ] + """Apply tiered pricing after rounding up the quantity to the package size. + + Tiers are defined using exclusive lower bounds. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + grouped_tiered_package_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceGroupedTieredPackageConfig + ] + """Configuration for grouped_tiered_package pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["grouped_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier( + TypedDict, total=False +): + """Configuration for a single tier""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + """Per unit amount""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig( + 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] + + tiers: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfigTier + ] + ] + """Apply tiered pricing to the largest group after grouping with the provided key.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + max_group_tiered_package_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceMaxGroupTieredPackageConfig + ] + """Configuration for max_group_tiered_package pricing""" + + model_type: Required[Literal["max_group_tiered_package"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + first_dimension: Required[str] + """Used to determine the unit rate""" + + matrix_scaling_factors: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" + + unit_price: Required[str] + """The final unit price to rate against the output of the matrix""" + + grouping_key: Optional[str] + """The property used to group this price""" + + prorate: Optional[bool] + """If true, the unit price will be prorated to the billing period""" + + second_dimension: Optional[str] + """Used to determine the unit rate (optional)""" + + +PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_unit_pricing"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_unit_pricing_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig + ] + """Configuration for scalable_matrix_with_unit_pricing pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor( + TypedDict, total=False +): + """Configuration for a single matrix scaling factor""" + + first_dimension_value: Required[str] + + scaling_factor: Required[str] + + second_dimension_value: Optional[str] + + +class PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier( + TypedDict, total=False +): + """Configuration for a single tier entry with business logic""" + + tier_lower_bound: Required[str] + + unit_amount: Required[str] + + +class PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig( + TypedDict, total=False +): + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + + first_dimension: Required[str] + """Used for the scalable matrix first dimension""" + + matrix_scaling_factors: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigMatrixScalingFactor + ] + ] + """Apply a scaling factor to each dimension""" + + tiers: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfigTier + ] + ] + + second_dimension: Optional[str] + """Used for the scalable matrix second dimension (optional)""" + + +PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig: TypeAlias = ( + Union[UnitConversionRateConfig, TieredConversionRateConfig] +) + + +class PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["scalable_matrix_with_tiered_pricing"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + scalable_matrix_with_tiered_pricing_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceScalableMatrixWithTieredPricingConfig + ] + """Configuration for scalable_matrix_with_tiered_pricing pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue( + TypedDict, total=False +): + """Configuration for a dimension value entry""" + + grouping_key: Required[str] + """Grouping key value""" + + tier_lower_bound: Required[str] + """Tier lower bound""" + + unit_amount: Required[str] + """Unit amount for this combination""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_bulk pricing""" + + dimension_values: Required[ + Iterable[ + PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfigDimensionValue + ] + ] + """Each tier lower bound must have the same group of values.""" + + group: Required[str] + + +class PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_bulk_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceCumulativeGroupedBulkConfig + ] + """Configuration for cumulative_grouped_bulk pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_bulk"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig( + TypedDict, total=False +): + """Configuration for cumulative_grouped_allocation pricing""" + + cumulative_allocation: Required[str] + """The overall allocation across all groups""" + + group_allocation: Required[str] + """The allocation per individual group""" + + grouping_key: Required[str] + """The event property used to group usage before applying allocations""" + + unit_amount: Required[str] + """The amount to charge for each unit outside of the allocation""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation( + TypedDict, total=False +): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + cumulative_grouped_allocation_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceCumulativeGroupedAllocationConfig + ] + """Configuration for cumulative_grouped_allocation pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["cumulative_grouped_allocation"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig( + TypedDict, total=False +): + """Configuration for minimum_composite pricing""" + + minimum_amount: Required[str] + """The minimum amount to apply""" + + prorated: bool + """If true, subtotals from this price are prorated based on the service period""" + + +PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + minimum_composite_config: Required[ + PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceMinimumCompositeConfig + ] + """Configuration for minimum_composite pricing""" + + model_type: Required[Literal["minimum_composite"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +class PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig(TypedDict, total=False): + """Configuration for percent pricing""" + + percent: Required[float] + """What percent of the component subtotals to charge""" + + +PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["percent"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + percent_config: Required[PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePricePercentConfig] + """Configuration for percent pricing""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig(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.""" + + default_unit_rate: Optional[str] + """ + If provided, this amount will be used as the unit rate when an event does not + have a value for the `unit_rating_key`. If not provided, events missing a unit + rate will be ignored. + """ + + grouping_key: Optional[str] + """An optional key in the event data to group by (e.g., event ID). + + All events will also be grouped by their unit rate. + """ + + +class PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation(TypedDict, total=False): + amount: Required[str] + """The amount of credits granted per active license per cadence.""" + + currency: Required[str] + """The currency of the license allocation.""" + + write_off_overage: Optional[bool] + """When True, overage beyond the allocation is written off.""" + + +PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig: TypeAlias = Union[ + UnitConversionRateConfig, TieredConversionRateConfig +] + + +class PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice(TypedDict, total=False): + cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] + """The cadence to bill for this price on.""" + + event_output_config: Required[PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceEventOutputConfig] + """Configuration for event_output pricing""" + + item_id: Required[str] + """The id of the item the price will be associated with.""" + + license_allocations: Required[ + Iterable[PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceLicenseAllocation] + ] + """License allocations to associate with this price. + + Each entry defines a per-license credit pool granted each cadence. Requires + license_type_id or license_type_configuration to be set. + """ + + model_type: Required[Literal["event_output"]] + """The pricing model type""" + + name: Required[str] + """The name of the price.""" + + billable_metric_id: Optional[str] + """The id of the billable metric for the price. + + Only needed if the price is usage-based. + """ + + billed_in_advance: Optional[bool] + """ + If the Price represents a fixed cost, the price will be billed in-advance if + this is true, and in-arrears if this is false. + """ + + billing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """ + For custom cadence: specifies the duration of the billing period in days or + months. + """ + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + conversion_rate_config: Optional[ + PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPriceConversionRateConfig + ] + """The configuration for the rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """ + An ISO 4217 currency string, or custom pricing unit identifier, in which this + price is billed. + """ + + dimensional_price_configuration: Optional[NewDimensionalPriceConfiguration] + """For dimensional price: specifies a price group and dimension values""" + + external_price_id: Optional[str] + """An alias for the price.""" + + fixed_price_quantity: Optional[float] + """ + If the Price represents a fixed cost, this represents the quantity of units + applied. + """ + + invoice_grouping_key: Optional[str] + """The property used to group this price on an invoice""" + + invoicing_cycle_configuration: Optional[NewBillingCycleConfiguration] + """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: 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. + + Individual keys can be removed by setting the value to `null`, and the entire + metadata mapping can be cleared by setting `metadata` to `null`. + """ + + reference_id: Optional[str] + """ + A transient ID that can be used to reference this price when adding adjustments + in the same API call. + """ + + +PriceLicenseAllocationPrice: TypeAlias = Union[ + PriceLicenseAllocationPriceNewLicenseAllocationUnitPrice, + PriceLicenseAllocationPriceNewLicenseAllocationTieredPrice, + PriceLicenseAllocationPriceNewLicenseAllocationBulkPrice, + PriceLicenseAllocationPriceNewLicenseAllocationBulkWithFiltersPrice, + PriceLicenseAllocationPriceNewLicenseAllocationPackagePrice, + PriceLicenseAllocationPriceNewLicenseAllocationMatrixPrice, + PriceLicenseAllocationPriceNewLicenseAllocationThresholdTotalAmountPrice, + PriceLicenseAllocationPriceNewLicenseAllocationTieredPackagePrice, + PriceLicenseAllocationPriceNewLicenseAllocationTieredWithMinimumPrice, + PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPrice, + PriceLicenseAllocationPriceNewLicenseAllocationTieredPackageWithMinimumPrice, + PriceLicenseAllocationPriceNewLicenseAllocationPackageWithAllocationPrice, + PriceLicenseAllocationPriceNewLicenseAllocationUnitWithPercentPrice, + PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithAllocationPrice, + PriceLicenseAllocationPriceNewLicenseAllocationTieredWithProrationPrice, + PriceLicenseAllocationPriceNewLicenseAllocationUnitWithProrationPrice, + PriceLicenseAllocationPriceNewLicenseAllocationGroupedAllocationPrice, + PriceLicenseAllocationPriceNewLicenseAllocationBulkWithProrationPrice, + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithProratedMinimumPrice, + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMeteredMinimumPrice, + PriceLicenseAllocationPriceNewLicenseAllocationGroupedWithMinMaxThresholdsPrice, + PriceLicenseAllocationPriceNewLicenseAllocationMatrixWithDisplayNamePrice, + PriceLicenseAllocationPriceNewLicenseAllocationGroupedTieredPackagePrice, + PriceLicenseAllocationPriceNewLicenseAllocationMaxGroupTieredPackagePrice, + PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithUnitPricingPrice, + PriceLicenseAllocationPriceNewLicenseAllocationScalableMatrixWithTieredPricingPrice, + PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedBulkPrice, + PriceLicenseAllocationPriceNewLicenseAllocationCumulativeGroupedAllocationPrice, + PriceLicenseAllocationPriceNewLicenseAllocationMinimumCompositePrice, + PriceLicenseAllocationPriceNewLicenseAllocationPercentCompositePrice, + PriceLicenseAllocationPriceNewLicenseAllocationEventOutputPrice, +] + + class PricePriceNewPlanBulkWithFiltersPriceBulkWithFiltersConfigFilter(TypedDict, total=False): """Configuration for a single property filter""" @@ -815,6 +5113,9 @@ class Price(TypedDict, total=False): allocation_price: Optional[NewAllocationPrice] """The allocation price to add to the plan.""" + license_allocation_price: Optional[PriceLicenseAllocationPrice] + """The license allocation price to add to the plan.""" + plan_phase_order: Optional[int] """The phase to add this price to.""" diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index e114775b..01ce39d0 100644 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -2516,6 +2516,9 @@ class NewFloatingScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricing unit_price: Required[str] """The final unit price to rate against the output of the matrix""" + grouping_key: Optional[str] + """The property used to group this price""" + prorate: Optional[bool] """If true, the unit price will be prorated to the billing period""" diff --git a/src/orb/types/price_evaluate_multiple_params.py b/src/orb/types/price_evaluate_multiple_params.py index 90cd75d4..50329781 100644 --- a/src/orb/types/price_evaluate_multiple_params.py +++ b/src/orb/types/price_evaluate_multiple_params.py @@ -638,6 +638,13 @@ class PriceEvaluation(TypedDict, total=False): to group the underlying billable metric """ + metric_parameter_overrides: Optional[Dict[str, object]] + """Optional overrides for parameterized billable metric parameters. + + If the metric has parameter definitions and no overrides are provided, defaults + will be used. + """ + price: Optional[PriceEvaluationPrice] """New floating price request body params.""" diff --git a/src/orb/types/price_evaluate_params.py b/src/orb/types/price_evaluate_params.py index fa8d6b66..4e508f11 100644 --- a/src/orb/types/price_evaluate_params.py +++ b/src/orb/types/price_evaluate_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union, Optional +from typing import Dict, Union, Optional from datetime import datetime from typing_extensions import Required, Annotated, TypedDict @@ -38,3 +38,10 @@ class PriceEvaluateParams(TypedDict, total=False): [computed properties](/extensibility/advanced-metrics#computed-properties)) used to group the underlying billable metric """ + + metric_parameter_overrides: Optional[Dict[str, object]] + """Optional overrides for parameterized billable metric parameters. + + If the metric has parameter definitions and no overrides are provided, defaults + will be used. + """ diff --git a/src/orb/types/price_evaluate_preview_events_params.py b/src/orb/types/price_evaluate_preview_events_params.py index ec487155..5e8d682b 100644 --- a/src/orb/types/price_evaluate_preview_events_params.py +++ b/src/orb/types/price_evaluate_preview_events_params.py @@ -670,6 +670,13 @@ class PriceEvaluation(TypedDict, total=False): to group the underlying billable metric """ + metric_parameter_overrides: Optional[Dict[str, object]] + """Optional overrides for parameterized billable metric parameters. + + If the metric has parameter definitions and no overrides are provided, defaults + will be used. + """ + price: Optional[PriceEvaluationPrice] """New floating price request body params.""" diff --git a/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py index afeb9a28..e1cc30a2 100644 --- a/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared/new_floating_scalable_matrix_with_unit_pricing_price.py @@ -42,6 +42,9 @@ class ScalableMatrixWithUnitPricingConfig(BaseModel): unit_price: str """The final unit price to rate against the output of the matrix""" + grouping_key: Optional[str] = None + """The property used to group this price""" + prorate: Optional[bool] = None """If true, the unit price will be prorated to the billing period""" diff --git a/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py index 9927a55e..5ed45a08 100644 --- a/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared/new_plan_scalable_matrix_with_unit_pricing_price.py @@ -42,6 +42,9 @@ class ScalableMatrixWithUnitPricingConfig(BaseModel): unit_price: str """The final unit price to rate against the output of the matrix""" + grouping_key: Optional[str] = None + """The property used to group this price""" + prorate: Optional[bool] = None """If true, the unit price will be prorated to the billing period""" diff --git a/src/orb/types/shared/price.py b/src/orb/types/shared/price.py index 68a9a5a8..7df3e4fb 100644 --- a/src/orb/types/shared/price.py +++ b/src/orb/types/shared/price.py @@ -3388,6 +3388,9 @@ class ScalableMatrixWithUnitPricingPriceScalableMatrixWithUnitPricingConfig(Base unit_price: str """The final unit price to rate against the output of the matrix""" + grouping_key: Optional[str] = None + """The property used to group this price""" + prorate: Optional[bool] = None """If true, the unit price will be prorated to the billing period""" diff --git a/src/orb/types/shared/price_interval.py b/src/orb/types/shared/price_interval.py index 6240931b..03fa50be 100644 --- a/src/orb/types/shared/price_interval.py +++ b/src/orb/types/shared/price_interval.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 .price import Price @@ -83,3 +83,9 @@ class PriceInterval(BaseModel): A list of customer IDs whose usage events will be aggregated and billed under this price interval. """ + + metric_parameter_overrides: Optional[Dict[str, object]] = None + """Override values for parameterized billable metric variables. + + Keys are parameter names, values are the override values. + """ diff --git a/src/orb/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py index 374f11e1..009b8569 100644 --- a/src/orb/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared_params/new_floating_scalable_matrix_with_unit_pricing_price.py @@ -40,6 +40,9 @@ class ScalableMatrixWithUnitPricingConfig(TypedDict, total=False): unit_price: Required[str] """The final unit price to rate against the output of the matrix""" + grouping_key: Optional[str] + """The property used to group this price""" + prorate: Optional[bool] """If true, the unit price will be prorated to the billing period""" diff --git a/src/orb/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py b/src/orb/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py index f9bee34c..d2085ec1 100644 --- a/src/orb/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py +++ b/src/orb/types/shared_params/new_plan_scalable_matrix_with_unit_pricing_price.py @@ -40,6 +40,9 @@ class ScalableMatrixWithUnitPricingConfig(TypedDict, total=False): unit_price: Required[str] """The final unit price to rate against the output of the matrix""" + grouping_key: Optional[str] + """The property used to group this price""" + prorate: Optional[bool] """If true, the unit price will be prorated to the billing period""" diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index 0f454571..f504eafa 100644 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -1022,6 +1022,12 @@ class AddPrice(TypedDict, total=False): The subscription's maximum amount for this price. """ + metric_parameter_overrides: Optional[Dict[str, object]] + """Override values for parameterized billable metric variables. + + Keys are parameter names, values are the override values. + """ + minimum_amount: Optional[str] """[DEPRECATED] Use add_adjustments instead. @@ -1788,6 +1794,12 @@ class ReplacePrice(TypedDict, total=False): The subscription's maximum amount for the replacement price. """ + metric_parameter_overrides: Optional[Dict[str, object]] + """Override values for parameterized billable metric variables. + + Keys are parameter names, values are the override values. + """ + minimum_amount: Optional[str] """[DEPRECATED] Use add_adjustments instead. diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index eba9360a..f747f583 100644 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -729,6 +729,12 @@ class Add(TypedDict, total=False): billing period. """ + metric_parameter_overrides: Optional[Dict[str, object]] + """Override values for parameterized billable metric variables. + + Keys are parameter names, values are the override values (number or string). + """ + minimum_amount: Optional[float] """ The minimum amount that will be billed for this price interval for a given @@ -836,6 +842,12 @@ class Edit(TypedDict, total=False): on the price interval. """ + metric_parameter_overrides: Optional[Dict[str, object]] + """Override values for parameterized billable metric variables. + + Keys are parameter names, values are the override values (number or string). + """ + start_date: Annotated[Union[Union[str, datetime], BillingCycleRelativeDate], PropertyInfo(format="iso8601")] """The updated start date of this price interval. diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index e2208e29..666586f6 100644 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -1010,6 +1010,12 @@ class AddPrice(TypedDict, total=False): The subscription's maximum amount for this price. """ + metric_parameter_overrides: Optional[Dict[str, object]] + """Override values for parameterized billable metric variables. + + Keys are parameter names, values are the override values. + """ + minimum_amount: Optional[str] """[DEPRECATED] Use add_adjustments instead. @@ -1776,6 +1782,12 @@ class ReplacePrice(TypedDict, total=False): The subscription's maximum amount for the replacement price. """ + metric_parameter_overrides: Optional[Dict[str, object]] + """Override values for parameterized billable metric variables. + + Keys are parameter names, values are the override values. + """ + minimum_amount: Optional[str] """[DEPRECATED] Use add_adjustments instead. diff --git a/tests/api_resources/beta/test_external_plan_id.py b/tests/api_resources/beta/test_external_plan_id.py index 13c78e4b..7507bb1d 100644 --- a/tests/api_resources/beta/test_external_plan_id.py +++ b/tests/api_resources/beta/test_external_plan_id.py @@ -74,6 +74,50 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", @@ -172,6 +216,50 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", @@ -403,6 +491,50 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", @@ -501,6 +633,50 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", diff --git a/tests/api_resources/customers/credits/test_ledger.py b/tests/api_resources/customers/credits/test_ledger.py index f3cf3ee6..d056bec6 100644 --- a/tests/api_resources/customers/credits/test_ledger.py +++ b/tests/api_resources/customers/credits/test_ledger.py @@ -110,6 +110,7 @@ def test_method_create_entry_with_all_params_overload_1(self, client: Orb) -> No "custom_due_date": parse_date("2019-12-27"), "invoice_date": parse_date("2019-12-27"), "item_id": "item_id", + "mark_as_paid": True, "memo": "memo", "net_terms": 0, "require_successful_payment": True, @@ -433,6 +434,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_1(self, cli "custom_due_date": parse_date("2019-12-27"), "invoice_date": parse_date("2019-12-27"), "item_id": "item_id", + "mark_as_paid": True, "memo": "memo", "net_terms": 0, "require_successful_payment": True, @@ -872,6 +874,7 @@ async def test_method_create_entry_with_all_params_overload_1(self, async_client "custom_due_date": parse_date("2019-12-27"), "invoice_date": parse_date("2019-12-27"), "item_id": "item_id", + "mark_as_paid": True, "memo": "memo", "net_terms": 0, "require_successful_payment": True, @@ -1195,6 +1198,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_1(sel "custom_due_date": parse_date("2019-12-27"), "invoice_date": parse_date("2019-12-27"), "item_id": "item_id", + "mark_as_paid": True, "memo": "memo", "net_terms": 0, "require_successful_payment": True, diff --git a/tests/api_resources/test_alerts.py b/tests/api_resources/test_alerts.py index bcae7a6b..927d14aa 100644 --- a/tests/api_resources/test_alerts.py +++ b/tests/api_resources/test_alerts.py @@ -274,7 +274,9 @@ def test_method_create_for_subscription_with_all_params(self, client: Orb) -> No subscription_id="subscription_id", thresholds=[{"value": 0}], type="usage_exceeded", + grouping_keys=["string"], metric_id="metric_id", + pricing_unit_id="pricing_unit_id", ) assert_matches_type(Alert, alert, path=["response"]) @@ -670,7 +672,9 @@ async def test_method_create_for_subscription_with_all_params(self, async_client subscription_id="subscription_id", thresholds=[{"value": 0}], type="usage_exceeded", + grouping_keys=["string"], metric_id="metric_id", + pricing_unit_id="pricing_unit_id", ) assert_matches_type(Alert, alert, path=["response"]) diff --git a/tests/api_resources/test_beta.py b/tests/api_resources/test_beta.py index e391b9b2..d5e9c572 100644 --- a/tests/api_resources/test_beta.py +++ b/tests/api_resources/test_beta.py @@ -74,6 +74,50 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", @@ -172,6 +216,50 @@ def test_method_create_plan_version_with_all_params(self, client: Orb) -> None: "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", @@ -403,6 +491,50 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", @@ -501,6 +633,50 @@ async def test_method_create_plan_version_with_all_params(self, async_client: As "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 99212e34..2fd979de 100644 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -66,6 +66,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "payment_providers": [ { "provider_type": "stripe", + "default_shared_payment_token": "default_shared_payment_token", "excluded_payment_method_types": ["string"], } ] @@ -167,6 +168,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None: "payment_providers": [ { "provider_type": "stripe", + "default_shared_payment_token": "default_shared_payment_token", "excluded_payment_method_types": ["string"], } ] @@ -499,6 +501,7 @@ def test_method_update_by_external_id_with_all_params(self, client: Orb) -> None "payment_providers": [ { "provider_type": "stripe", + "default_shared_payment_token": "default_shared_payment_token", "excluded_payment_method_types": ["string"], } ] @@ -610,6 +613,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "payment_providers": [ { "provider_type": "stripe", + "default_shared_payment_token": "default_shared_payment_token", "excluded_payment_method_types": ["string"], } ] @@ -711,6 +715,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No "payment_providers": [ { "provider_type": "stripe", + "default_shared_payment_token": "default_shared_payment_token", "excluded_payment_method_types": ["string"], } ] @@ -1055,6 +1060,7 @@ async def test_method_update_by_external_id_with_all_params(self, async_client: "payment_providers": [ { "provider_type": "stripe", + "default_shared_payment_token": "default_shared_payment_token", "excluded_payment_method_types": ["string"], } ] diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index 316aefc3..8ae434a3 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -62,6 +62,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: }, } ], + auto_collection=True, customer_id="4khy3nwzktxv7", discount={ "discount_type": "percentage", @@ -144,6 +145,7 @@ def test_method_update(self, client: Orb) -> None: def test_method_update_with_all_params(self, client: Orb) -> None: invoice = client.invoices.update( invoice_id="invoice_id", + auto_collection=True, due_date=parse_date("2023-09-22"), invoice_date=parse_date("2023-09-22"), metadata={"foo": "string"}, @@ -546,14 +548,16 @@ def test_path_params_mark_paid(self, client: Orb) -> None: @parametrize def test_method_pay(self, client: Orb) -> None: invoice = client.invoices.pay( - "invoice_id", + invoice_id="invoice_id", + shared_payment_token_id="shared_payment_token_id", ) assert_matches_type(Invoice, invoice, path=["response"]) @parametrize def test_raw_response_pay(self, client: Orb) -> None: response = client.invoices.with_raw_response.pay( - "invoice_id", + invoice_id="invoice_id", + shared_payment_token_id="shared_payment_token_id", ) assert response.is_closed is True @@ -564,7 +568,8 @@ def test_raw_response_pay(self, client: Orb) -> None: @parametrize def test_streaming_response_pay(self, client: Orb) -> None: with client.invoices.with_streaming_response.pay( - "invoice_id", + invoice_id="invoice_id", + shared_payment_token_id="shared_payment_token_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -578,7 +583,8 @@ def test_streaming_response_pay(self, client: Orb) -> None: def test_path_params_pay(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.pay( - "", + invoice_id="", + shared_payment_token_id="shared_payment_token_id", ) @parametrize @@ -663,6 +669,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No }, } ], + auto_collection=True, customer_id="4khy3nwzktxv7", discount={ "discount_type": "percentage", @@ -745,6 +752,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.update( invoice_id="invoice_id", + auto_collection=True, due_date=parse_date("2023-09-22"), invoice_date=parse_date("2023-09-22"), metadata={"foo": "string"}, @@ -1147,14 +1155,16 @@ async def test_path_params_mark_paid(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_pay(self, async_client: AsyncOrb) -> None: invoice = await async_client.invoices.pay( - "invoice_id", + invoice_id="invoice_id", + shared_payment_token_id="shared_payment_token_id", ) assert_matches_type(Invoice, invoice, path=["response"]) @parametrize async def test_raw_response_pay(self, async_client: AsyncOrb) -> None: response = await async_client.invoices.with_raw_response.pay( - "invoice_id", + invoice_id="invoice_id", + shared_payment_token_id="shared_payment_token_id", ) assert response.is_closed is True @@ -1165,7 +1175,8 @@ async def test_raw_response_pay(self, async_client: AsyncOrb) -> None: @parametrize async def test_streaming_response_pay(self, async_client: AsyncOrb) -> None: async with async_client.invoices.with_streaming_response.pay( - "invoice_id", + invoice_id="invoice_id", + shared_payment_token_id="shared_payment_token_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1179,7 +1190,8 @@ async def test_streaming_response_pay(self, async_client: AsyncOrb) -> None: async def test_path_params_pay(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.pay( - "", + invoice_id="", + shared_payment_token_id="shared_payment_token_id", ) @parametrize diff --git a/tests/api_resources/test_plans.py b/tests/api_resources/test_plans.py index 24286962..d67a670f 100644 --- a/tests/api_resources/test_plans.py +++ b/tests/api_resources/test_plans.py @@ -55,6 +55,50 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", @@ -326,6 +370,50 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "license_type_id": "license_type_id", "per_unit_cost_basis": "per_unit_cost_basis", }, + "license_allocation_price": { + "cadence": "annual", + "item_id": "item_id", + "license_allocations": [ + { + "amount": "amount", + "currency": "currency", + "write_off_overage": True, + } + ], + "model_type": "unit", + "name": "Annual fee", + "unit_config": { + "unit_amount": "unit_amount", + "prorated": True, + }, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "conversion_rate_config": { + "conversion_rate_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + }, + "currency": "currency", + "dimensional_price_configuration": { + "dimension_values": ["string"], + "dimensional_price_group_id": "dimensional_price_group_id", + "external_dimensional_price_group_id": "external_dimensional_price_group_id", + }, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "x", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "license_type_id": "license_type_id", + "metadata": {"foo": "string"}, + "reference_id": "reference_id", + }, "plan_phase_order": 0, "price": { "cadence": "annual", diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index 68a1c59b..3198d4e5 100644 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -2802,6 +2802,7 @@ def test_method_create_with_all_params_overload_25(self, client: Orb) -> None: } ], "unit_price": "unit_price", + "grouping_key": "x", "prorate": True, "second_dimension": "second_dimension", }, @@ -3618,6 +3619,7 @@ def test_method_evaluate_with_all_params(self, client: Orb) -> None: external_customer_id="external_customer_id", filter="my_numeric_property > 100 AND my_other_property = 'bar'", grouping_keys=["case when my_event_type = 'foo' then true else false end"], + metric_parameter_overrides={"foo": "bar"}, ) assert_matches_type(PriceEvaluateResponse, price, path=["response"]) @@ -3678,6 +3680,7 @@ def test_method_evaluate_multiple_with_all_params(self, client: Orb) -> None: "external_price_id": "external_price_id", "filter": "my_numeric_property > 100 AND my_other_property = 'bar'", "grouping_keys": ["case when my_event_type = 'foo' then true else false end"], + "metric_parameter_overrides": {"foo": "bar"}, "price": { "cadence": "annual", "currency": "currency", @@ -3775,6 +3778,7 @@ def test_method_evaluate_preview_events_with_all_params(self, client: Orb) -> No "external_price_id": "external_price_id", "filter": "my_numeric_property > 100 AND my_other_property = 'bar'", "grouping_keys": ["case when my_event_type = 'foo' then true else false end"], + "metric_parameter_overrides": {"foo": "bar"}, "price": { "cadence": "annual", "currency": "currency", @@ -6665,6 +6669,7 @@ async def test_method_create_with_all_params_overload_25(self, async_client: Asy } ], "unit_price": "unit_price", + "grouping_key": "x", "prorate": True, "second_dimension": "second_dimension", }, @@ -7481,6 +7486,7 @@ async def test_method_evaluate_with_all_params(self, async_client: AsyncOrb) -> external_customer_id="external_customer_id", filter="my_numeric_property > 100 AND my_other_property = 'bar'", grouping_keys=["case when my_event_type = 'foo' then true else false end"], + metric_parameter_overrides={"foo": "bar"}, ) assert_matches_type(PriceEvaluateResponse, price, path=["response"]) @@ -7541,6 +7547,7 @@ async def test_method_evaluate_multiple_with_all_params(self, async_client: Asyn "external_price_id": "external_price_id", "filter": "my_numeric_property > 100 AND my_other_property = 'bar'", "grouping_keys": ["case when my_event_type = 'foo' then true else false end"], + "metric_parameter_overrides": {"foo": "bar"}, "price": { "cadence": "annual", "currency": "currency", @@ -7638,6 +7645,7 @@ async def test_method_evaluate_preview_events_with_all_params(self, async_client "external_price_id": "external_price_id", "filter": "my_numeric_property > 100 AND my_other_property = 'bar'", "grouping_keys": ["case when my_event_type = 'foo' then true else false end"], + "metric_parameter_overrides": {"foo": "bar"}, "price": { "cadence": "annual", "currency": "currency", diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 2078ccf8..dd759427 100644 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -90,6 +90,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), "external_price_id": "external_price_id", "maximum_amount": "1.23", + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": "1.23", "plan_phase_order": 0, "price": { @@ -224,6 +225,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "external_price_id": "external_price_id", "fixed_price_quantity": 2, "maximum_amount": "1.23", + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": "1.23", "price": { "cadence": "annual", @@ -686,6 +688,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: } ], "maximum_amount": 0, + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": 0, "price": { "cadence": "annual", @@ -766,6 +769,7 @@ def test_method_price_intervals_with_all_params(self, client: Orb) -> None: "quantity": 5, } ], + "metric_parameter_overrides": {"foo": "bar"}, "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), "usage_customer_ids": ["string"], } @@ -938,6 +942,7 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), "external_price_id": "external_price_id", "maximum_amount": "1.23", + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": "1.23", "plan_phase_order": 0, "price": { @@ -1065,6 +1070,7 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: "external_price_id": "external_price_id", "fixed_price_quantity": 2, "maximum_amount": "1.23", + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": "1.23", "price": { "cadence": "annual", @@ -1490,6 +1496,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), "external_price_id": "external_price_id", "maximum_amount": "1.23", + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": "1.23", "plan_phase_order": 0, "price": { @@ -1624,6 +1631,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "external_price_id": "external_price_id", "fixed_price_quantity": 2, "maximum_amount": "1.23", + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": "1.23", "price": { "cadence": "annual", @@ -2086,6 +2094,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO } ], "maximum_amount": 0, + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": 0, "price": { "cadence": "annual", @@ -2166,6 +2175,7 @@ async def test_method_price_intervals_with_all_params(self, async_client: AsyncO "quantity": 5, } ], + "metric_parameter_overrides": {"foo": "bar"}, "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), "usage_customer_ids": ["string"], } @@ -2338,6 +2348,7 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), "external_price_id": "external_price_id", "maximum_amount": "1.23", + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": "1.23", "plan_phase_order": 0, "price": { @@ -2465,6 +2476,7 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A "external_price_id": "external_price_id", "fixed_price_quantity": 2, "maximum_amount": "1.23", + "metric_parameter_overrides": {"foo": "bar"}, "minimum_amount": "1.23", "price": { "cadence": "annual", diff --git a/tests/test_client.py b/tests/test_client.py index 32ed4d23..99f8e5c0 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -993,6 +993,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has any proxy env vars set + monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultHttpxClient() @@ -1947,6 +1955,14 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has any proxy env vars set + monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultAsyncHttpxClient() diff --git a/tests/test_utils/test_path.py b/tests/test_utils/test_path.py new file mode 100644 index 00000000..a6b990b5 --- /dev/null +++ b/tests/test_utils/test_path.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from typing import Any + +import pytest + +from orb._utils._path import path_template + + +@pytest.mark.parametrize( + "template, kwargs, expected", + [ + ("/v1/{id}", dict(id="abc"), "/v1/abc"), + ("/v1/{a}/{b}", dict(a="x", b="y"), "/v1/x/y"), + ("/v1/{a}{b}/path/{c}?val={d}#{e}", dict(a="x", b="y", c="z", d="u", e="v"), "/v1/xy/path/z?val=u#v"), + ("/{w}/{w}", dict(w="echo"), "/echo/echo"), + ("/v1/static", {}, "/v1/static"), + ("", {}, ""), + ("/v1/?q={n}&count=10", dict(n=42), "/v1/?q=42&count=10"), + ("/v1/{v}", dict(v=None), "/v1/null"), + ("/v1/{v}", dict(v=True), "/v1/true"), + ("/v1/{v}", dict(v=False), "/v1/false"), + ("/v1/{v}", dict(v=".hidden"), "/v1/.hidden"), # dot prefix ok + ("/v1/{v}", dict(v="file.txt"), "/v1/file.txt"), # dot in middle ok + ("/v1/{v}", dict(v="..."), "/v1/..."), # triple dot ok + ("/v1/{a}{b}", dict(a=".", b="txt"), "/v1/.txt"), # dot var combining with adjacent to be ok + ("/items?q={v}#{f}", dict(v=".", f=".."), "/items?q=.#.."), # dots in query/fragment are fine + ( + "/v1/{a}?query={b}", + dict(a="../../other/endpoint", b="a&bad=true"), + "/v1/..%2F..%2Fother%2Fendpoint?query=a%26bad%3Dtrue", + ), + ("/v1/{val}", dict(val="a/b/c"), "/v1/a%2Fb%2Fc"), + ("/v1/{val}", dict(val="a/b/c?query=value"), "/v1/a%2Fb%2Fc%3Fquery=value"), + ("/v1/{val}", dict(val="a/b/c?query=value&bad=true"), "/v1/a%2Fb%2Fc%3Fquery=value&bad=true"), + ("/v1/{val}", dict(val="%20"), "/v1/%2520"), # escapes escape sequences in input + # Query: slash and ? are safe, # is not + ("/items?q={v}", dict(v="a/b"), "/items?q=a/b"), + ("/items?q={v}", dict(v="a?b"), "/items?q=a?b"), + ("/items?q={v}", dict(v="a#b"), "/items?q=a%23b"), + ("/items?q={v}", dict(v="a b"), "/items?q=a%20b"), + # Fragment: slash and ? are safe + ("/docs#{v}", dict(v="a/b"), "/docs#a/b"), + ("/docs#{v}", dict(v="a?b"), "/docs#a?b"), + # Path: slash, ? and # are all encoded + ("/v1/{v}", dict(v="a/b"), "/v1/a%2Fb"), + ("/v1/{v}", dict(v="a?b"), "/v1/a%3Fb"), + ("/v1/{v}", dict(v="a#b"), "/v1/a%23b"), + # same var encoded differently by component + ( + "/v1/{v}?q={v}#{v}", + dict(v="a/b?c#d"), + "/v1/a%2Fb%3Fc%23d?q=a/b?c%23d#a/b?c%23d", + ), + ("/v1/{val}", dict(val="x?admin=true"), "/v1/x%3Fadmin=true"), # query injection + ("/v1/{val}", dict(val="x#admin"), "/v1/x%23admin"), # fragment injection + ], +) +def test_interpolation(template: str, kwargs: dict[str, Any], expected: str) -> None: + assert path_template(template, **kwargs) == expected + + +def test_missing_kwarg_raises_key_error() -> None: + with pytest.raises(KeyError, match="org_id"): + path_template("/v1/{org_id}") + + +@pytest.mark.parametrize( + "template, kwargs", + [ + ("{a}/path", dict(a=".")), + ("{a}/path", dict(a="..")), + ("/v1/{a}", dict(a=".")), + ("/v1/{a}", dict(a="..")), + ("/v1/{a}/path", dict(a=".")), + ("/v1/{a}/path", dict(a="..")), + ("/v1/{a}{b}", dict(a=".", b=".")), # adjacent vars → ".." + ("/v1/{a}.", dict(a=".")), # var + static → ".." + ("/v1/{a}{b}", dict(a="", b=".")), # empty + dot → "." + ("/v1/%2e/{x}", dict(x="ok")), # encoded dot in static text + ("/v1/%2e./{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/.%2E/{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/{v}?q=1", dict(v="..")), + ("/v1/{v}#frag", dict(v="..")), + ], +) +def test_dot_segment_rejected(template: str, kwargs: dict[str, Any]) -> None: + with pytest.raises(ValueError, match="dot-segment"): + path_template(template, **kwargs)