diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 21f60560..e6c39adb 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.10.0" + ".": "2.11.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 34c0ae51..dbdbbcd7 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 93 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7ae6544b3567d683dd64c5caff02b49ffc0dc4897d0a91738b0162f36a7ddee7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-90a52a59bc88bb7c8ae95cd1f8d2e0d69e48320d5481068fe1fbc54f539fd8db.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index caa6dc14..18487972 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 2.11.0 (2024-11-06) + +Full Changelog: [v2.10.0...v2.11.0](https://github.com/orbcorp/orb-python/compare/v2.10.0...v2.11.0) + +### Features + +* **api:** codegen changes ([#367](https://github.com/orbcorp/orb-python/issues/367)) ([57ab873](https://github.com/orbcorp/orb-python/commit/57ab873ce827c0dc7d833bedffe3f77d758aa05c)) +* **api:** OpenAPI spec update via Stainless API ([#368](https://github.com/orbcorp/orb-python/issues/368)) ([5899921](https://github.com/orbcorp/orb-python/commit/58999214b3df22d91273ec6e1319d6c7989c2e5b)) + ## 2.10.0 (2024-11-06) Full Changelog: [v2.9.0...v2.10.0](https://github.com/orbcorp/orb-python/compare/v2.9.0...v2.10.0) diff --git a/README.md b/README.md index 7a652310..3936ac2c 100755 --- a/README.md +++ b/README.md @@ -56,12 +56,14 @@ client = AsyncOrb( api_key=os.environ.get("ORB_API_KEY"), ) + async def main() -> None: - customer = await client.customers.create( - email="example-customer@withorb.com", - name="My Customer", - ) - print(customer.id) + customer = await client.customers.create( + email="example-customer@withorb.com", + name="My Customer", + ) + print(customer.id) + asyncio.run(main()) ``` @@ -104,6 +106,7 @@ from orb import AsyncOrb client = AsyncOrb() + async def main() -> None: all_coupons = [] # Iterate through items across all pages, issuing requests as needed. @@ -111,6 +114,7 @@ async def main() -> None: all_coupons.append(coupon) print(all_coupons) + asyncio.run(main()) ``` @@ -131,7 +135,9 @@ Or just work directly with the returned data: ```python first_page = await client.coupons.list() -print(f"next page cursor: {first_page.pagination_metadata.next_cursor}") # => "next page cursor: ..." +print( + f"next page cursor: {first_page.pagination_metadata.next_cursor}" +) # => "next page cursor: ..." for coupon in first_page.data: print(coupon.id) @@ -204,7 +210,7 @@ try: ) except orb.APIConnectionError as e: print("The server could not be reached") - print(e.__cause__) # an underlying Exception, likely raised within httpx. + print(e.__cause__) # an underlying Exception, likely raised within httpx. except orb.RateLimitError as e: print("A 429 status code was received; we should back off a bit.") except orb.APIStatusError as e: @@ -244,7 +250,7 @@ client = Orb( ) # Or, configure per-request: -client.with_options(max_retries = 5).customers.create( +client.with_options(max_retries=5).customers.create( email="example-customer@withorb.com", name="My Customer", ) @@ -270,7 +276,7 @@ client = Orb( ) # Override per-request: -client.with_options(timeout = 5.0).customers.create( +client.with_options(timeout=5.0).customers.create( email="example-customer@withorb.com", name="My Customer", ) @@ -343,11 +349,11 @@ As such, `.with_streaming_response` methods return a different [`APIResponse`](h with client.customers.with_streaming_response.create( email="example-customer@withorb.com", name="My Customer", -) as response : - print(response.headers.get('X-My-Header')) +) as response: + print(response.headers.get("X-My-Header")) for line in response.iter_lines(): - print(line) + print(line) ``` The context manager is required so that the response will reliably be closed. @@ -401,7 +407,10 @@ from orb import Orb, DefaultHttpxClient client = Orb( # Or use the `ORB_BASE_URL` env var base_url="http://my.test.server.example.com:8083", - http_client=DefaultHttpxClient(proxies="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")), + http_client=DefaultHttpxClient( + proxies="http://my.test.proxy.example.com", + transport=httpx.HTTPTransport(local_address="0.0.0.0"), + ), ) ``` diff --git a/api.md b/api.md index 848f3303..c441ce56 100755 --- a/api.md +++ b/api.md @@ -99,7 +99,12 @@ Methods: Types: ```python -from orb.types.customers.credits import LedgerListResponse, LedgerCreateEntryResponse, LedgerCreateEntryByExternalIDResponse, LedgerListByExternalIDResponse +from orb.types.customers.credits import ( + LedgerListResponse, + LedgerCreateEntryResponse, + LedgerCreateEntryByExternalIDResponse, + LedgerListByExternalIDResponse, +) ``` Methods: @@ -114,7 +119,12 @@ Methods: Types: ```python -from orb.types.customers.credits import TopUpCreateResponse, TopUpListResponse, TopUpCreateByExternalIDResponse, TopUpListByExternalIDResponse +from orb.types.customers.credits import ( + TopUpCreateResponse, + TopUpListResponse, + TopUpCreateByExternalIDResponse, + TopUpListByExternalIDResponse, +) ``` Methods: @@ -144,7 +154,12 @@ Methods: Types: ```python -from orb.types import EventUpdateResponse, EventDeprecateResponse, EventIngestResponse, EventSearchResponse +from orb.types import ( + EventUpdateResponse, + EventDeprecateResponse, + EventIngestResponse, + EventSearchResponse, +) ``` Methods: @@ -159,7 +174,13 @@ Methods: Types: ```python -from orb.types.events import BackfillCreateResponse, BackfillListResponse, BackfillCloseResponse, BackfillFetchResponse, BackfillRevertResponse +from orb.types.events import ( + BackfillCreateResponse, + BackfillListResponse, + BackfillCloseResponse, + BackfillFetchResponse, + BackfillRevertResponse, +) ``` Methods: @@ -281,7 +302,13 @@ Methods: Types: ```python -from orb.types import Subscription, SubscriptionUsage, Subscriptions, SubscriptionFetchCostsResponse, SubscriptionFetchScheduleResponse +from orb.types import ( + Subscription, + SubscriptionUsage, + Subscriptions, + SubscriptionFetchCostsResponse, + SubscriptionFetchScheduleResponse, +) ``` Methods: diff --git a/pyproject.toml b/pyproject.toml index ae55d62c..250eee4e 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "2.10.0" +version = "2.11.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/__init__.py b/src/orb/__init__.py index a231855a..801a1e71 100755 --- a/src/orb/__init__.py +++ b/src/orb/__init__.py @@ -1,43 +1,43 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from . import types -from ._version import __version__, __title__ -from ._client import Timeout, Transport, RequestOptions, Client, AsyncClient, Stream, AsyncStream, Orb, AsyncOrb +from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes +from ._utils import file_from_path +from ._client import Orb, Client, Stream, Timeout, AsyncOrb, Transport, AsyncClient, AsyncStream, RequestOptions +from ._models import BaseModel +from ._version import __title__, __version__ +from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse +from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS from ._exceptions import ( - OrbError, APIError, + OrbError, + URLNotFound, + ConflictError, + NotFoundError, APIStatusError, + RateLimitError, APITimeoutError, - APIConnectionError, - APIResponseValidationError, BadRequestError, + RequestTooLarge, + TooManyRequests, + ResourceConflict, + ResourceNotFound, + ResourceTooLarge, + APIConnectionError, AuthenticationError, - PermissionDeniedError, - NotFoundError, - ConflictError, - UnprocessableEntityError, - RateLimitError, - InternalServerError, ConstraintViolation, - DuplicateResourceCreation, - RequestValidationError, - OrbAuthenticationError, FeatureNotAvailable, - ResourceNotFound, - URLNotFound, - ResourceConflict, - RequestTooLarge, - ResourceTooLarge, - TooManyRequests, + InternalServerError, + PermissionDeniedError, + OrbAuthenticationError, OrbInternalServerError, + RequestValidationError, + UnprocessableEntityError, + DuplicateResourceCreation, + APIResponseValidationError, ) -from ._types import NoneType, Transport, ProxiesTypes, NotGiven, NOT_GIVEN -from ._utils import file_from_path -from ._models import BaseModel -from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient from ._utils._logs import setup_logging as _setup_logging -from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse __all__ = [ "types", @@ -101,7 +101,7 @@ for __name in __all__: if not __name.startswith("__"): try: - setattr(__locals[__name], "__module__", "orb") + __locals[__name].__module__ = "orb" except (TypeError, AttributeError): # Some of our exported symbols are builtins which we can't set attributes for. pass diff --git a/src/orb/_client.py b/src/orb/_client.py index 1d9fefe7..6b3f24c5 100755 --- a/src/orb/_client.py +++ b/src/orb/_client.py @@ -2,67 +2,36 @@ from __future__ import annotations -import httpx - -import os - -from ._streaming import AsyncStream as AsyncStream, Stream as Stream - -from ._exceptions import OrbError, APIStatusError - -from typing_extensions import override, Self - -from typing import Any - -from ._utils import is_mapping, get_async_library - -from . import _exceptions - import os -import asyncio -import warnings -from typing import Optional, Union, Dict, Any, Mapping, overload, cast -from typing_extensions import Literal +from typing import Any, Union, Mapping +from typing_extensions import Self, override import httpx -from ._version import __version__ +from . import resources, _exceptions from ._qs import Querystring -from ._utils import ( - extract_files, - maybe_transform, - required_args, - deepcopy_minimal, - maybe_coerce_integer, - maybe_coerce_float, - maybe_coerce_boolean, - is_given, -) from ._types import ( + NOT_GIVEN, Omit, - NotGiven, Timeout, + NotGiven, Transport, ProxiesTypes, RequestOptions, - Headers, - NoneType, - Query, - Body, - NOT_GIVEN, ) +from ._utils import ( + is_given, + is_mapping, + get_async_library, +) +from ._version import __version__ +from ._streaming import Stream as Stream, AsyncStream as AsyncStream +from ._exceptions import OrbError, APIStatusError from ._base_client import ( - DEFAULT_CONNECTION_LIMITS, - DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, - ResponseT, - SyncHttpxClientWrapper, - AsyncHttpxClientWrapper, SyncAPIClient, AsyncAPIClient, - make_request_options, ) -from . import resources __all__ = [ "Timeout", diff --git a/src/orb/_exceptions.py b/src/orb/_exceptions.py index f78a4d74..4a413c75 100755 --- a/src/orb/_exceptions.py +++ b/src/orb/_exceptions.py @@ -2,78 +2,14 @@ from __future__ import annotations -import httpx - +from typing import Any, List, Mapping, Optional, cast from typing_extensions import Literal -from typing import Optional, Mapping, Any, List +import httpx from ._utils import is_mapping - from ._models import construct_type -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast - __all__ = [ "BadRequestError", "AuthenticationError", diff --git a/src/orb/_resource.py b/src/orb/_resource.py index 1b3815df..f2b14588 100755 --- a/src/orb/_resource.py +++ b/src/orb/_resource.py @@ -3,9 +3,10 @@ from __future__ import annotations import time -import anyio from typing import TYPE_CHECKING +import anyio + if TYPE_CHECKING: from ._client import Orb, AsyncOrb diff --git a/src/orb/_response.py b/src/orb/_response.py index bcdd1212..bde0a041 100755 --- a/src/orb/_response.py +++ b/src/orb/_response.py @@ -18,7 +18,7 @@ cast, overload, ) -from typing_extensions import Awaitable, ParamSpec, TypeGuard, override, get_origin +from typing_extensions import Awaitable, ParamSpec, override, get_origin import anyio import httpx @@ -26,7 +26,6 @@ from ._types import NoneType from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base -from ._streaming import extract_stream_chunk_type from ._models import BaseModel, is_basemodel from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type diff --git a/src/orb/_streaming.py b/src/orb/_streaming.py index b42a5b59..757492e8 100755 --- a/src/orb/_streaming.py +++ b/src/orb/_streaming.py @@ -9,9 +9,7 @@ import httpx -from ._utils import is_mapping, is_dict, extract_type_var_from_base -from ._exceptions import APIError -from ._response import APIResponse, AsyncAPIResponse +from ._utils import extract_type_var_from_base if TYPE_CHECKING: from ._client import Orb, AsyncOrb diff --git a/src/orb/_types.py b/src/orb/_types.py index 73e09695..a6120d6a 100755 --- a/src/orb/_types.py +++ b/src/orb/_types.py @@ -1,7 +1,6 @@ from __future__ import annotations from os import PathLike -from abc import ABC, abstractmethod from typing import ( IO, TYPE_CHECKING, @@ -14,10 +13,8 @@ Mapping, TypeVar, Callable, - Iterator, Optional, Sequence, - AsyncIterator, ) from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable diff --git a/src/orb/_version.py b/src/orb/_version.py index 78d42cfd..86a80dcc 100755 --- 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__ = "2.10.0" # x-release-please-version +__version__ = "2.11.0" # x-release-please-version diff --git a/src/orb/pagination.py b/src/orb/pagination.py index 83d06998..df68690f 100755 --- a/src/orb/pagination.py +++ b/src/orb/pagination.py @@ -1,21 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ._models import BaseModel - -from typing import Optional, List - +from typing import List, Generic, TypeVar, Optional from typing_extensions import override -import re -from typing import Optional, TypeVar, List, Generic, Dict, Any, Type, Mapping, cast -from typing_extensions import TypedDict, Literal, Annotated, Protocol, runtime_checkable - -from httpx import URL, Response -from pydantic import Field as FieldInfo - from ._models import BaseModel -from ._utils import PropertyInfo, is_mapping -from ._base_client import BasePage, BaseSyncPage, BaseAsyncPage, PageInfo +from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage __all__ = ["PagePaginationMetadata", "SyncPage", "AsyncPage"] diff --git a/src/orb/resources/__init__.py b/src/orb/resources/__init__.py index 5fe32868..b248b84f 100755 --- a/src/orb/resources/__init__.py +++ b/src/orb/resources/__init__.py @@ -1,96 +1,108 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .top_level import ( - TopLevel, - AsyncTopLevel, - TopLevelWithRawResponse, - AsyncTopLevelWithRawResponse, - TopLevelWithStreamingResponse, - AsyncTopLevelWithStreamingResponse, -) -from .coupons import Coupons, AsyncCoupons -from .coupons import ( - CouponsWithRawResponse, - AsyncCouponsWithRawResponse, - CouponsWithStreamingResponse, - AsyncCouponsWithStreamingResponse, +from .items import ( + Items, + AsyncItems, + ItemsWithRawResponse, + AsyncItemsWithRawResponse, + ItemsWithStreamingResponse, + AsyncItemsWithStreamingResponse, ) -from .credit_notes import CreditNotes, AsyncCreditNotes -from .credit_notes import ( - CreditNotesWithRawResponse, - AsyncCreditNotesWithRawResponse, - CreditNotesWithStreamingResponse, - AsyncCreditNotesWithStreamingResponse, +from .plans import ( + Plans, + AsyncPlans, + PlansWithRawResponse, + AsyncPlansWithRawResponse, + PlansWithStreamingResponse, + AsyncPlansWithStreamingResponse, ) -from .customers import Customers, AsyncCustomers -from .customers import ( - CustomersWithRawResponse, - AsyncCustomersWithRawResponse, - CustomersWithStreamingResponse, - AsyncCustomersWithStreamingResponse, +from .alerts import ( + Alerts, + AsyncAlerts, + AlertsWithRawResponse, + AsyncAlertsWithRawResponse, + AlertsWithStreamingResponse, + AsyncAlertsWithStreamingResponse, ) -from .events import Events, AsyncEvents from .events import ( + Events, + AsyncEvents, EventsWithRawResponse, AsyncEventsWithRawResponse, EventsWithStreamingResponse, AsyncEventsWithStreamingResponse, ) -from .invoice_line_items import InvoiceLineItems, AsyncInvoiceLineItems -from .invoice_line_items import ( - InvoiceLineItemsWithRawResponse, - AsyncInvoiceLineItemsWithRawResponse, - InvoiceLineItemsWithStreamingResponse, - AsyncInvoiceLineItemsWithStreamingResponse, -) -from .invoices import Invoices, AsyncInvoices -from .invoices import ( - InvoicesWithRawResponse, - AsyncInvoicesWithRawResponse, - InvoicesWithStreamingResponse, - AsyncInvoicesWithStreamingResponse, +from .prices import ( + Prices, + AsyncPrices, + PricesWithRawResponse, + AsyncPricesWithRawResponse, + PricesWithStreamingResponse, + AsyncPricesWithStreamingResponse, ) -from .items import Items, AsyncItems -from .items import ( - ItemsWithRawResponse, - AsyncItemsWithRawResponse, - ItemsWithStreamingResponse, - AsyncItemsWithStreamingResponse, +from .coupons import ( + Coupons, + AsyncCoupons, + CouponsWithRawResponse, + AsyncCouponsWithRawResponse, + CouponsWithStreamingResponse, + AsyncCouponsWithStreamingResponse, ) -from .metrics import Metrics, AsyncMetrics from .metrics import ( + Metrics, + AsyncMetrics, MetricsWithRawResponse, AsyncMetricsWithRawResponse, MetricsWithStreamingResponse, AsyncMetricsWithStreamingResponse, ) -from .plans import Plans, AsyncPlans -from .plans import ( - PlansWithRawResponse, - AsyncPlansWithRawResponse, - PlansWithStreamingResponse, - AsyncPlansWithStreamingResponse, +from .invoices import ( + Invoices, + AsyncInvoices, + InvoicesWithRawResponse, + AsyncInvoicesWithRawResponse, + InvoicesWithStreamingResponse, + AsyncInvoicesWithStreamingResponse, ) -from .prices import Prices, AsyncPrices -from .prices import ( - PricesWithRawResponse, - AsyncPricesWithRawResponse, - PricesWithStreamingResponse, - AsyncPricesWithStreamingResponse, +from .customers import ( + Customers, + AsyncCustomers, + CustomersWithRawResponse, + AsyncCustomersWithRawResponse, + CustomersWithStreamingResponse, + AsyncCustomersWithStreamingResponse, +) +from .top_level import ( + TopLevel, + AsyncTopLevel, + TopLevelWithRawResponse, + AsyncTopLevelWithRawResponse, + TopLevelWithStreamingResponse, + AsyncTopLevelWithStreamingResponse, +) +from .credit_notes import ( + CreditNotes, + AsyncCreditNotes, + CreditNotesWithRawResponse, + AsyncCreditNotesWithRawResponse, + CreditNotesWithStreamingResponse, + AsyncCreditNotesWithStreamingResponse, ) -from .subscriptions import Subscriptions, AsyncSubscriptions from .subscriptions import ( + Subscriptions, + AsyncSubscriptions, SubscriptionsWithRawResponse, AsyncSubscriptionsWithRawResponse, SubscriptionsWithStreamingResponse, AsyncSubscriptionsWithStreamingResponse, ) -from .alerts import Alerts, AsyncAlerts -from .alerts import ( - AlertsWithRawResponse, - AsyncAlertsWithRawResponse, - AlertsWithStreamingResponse, - AsyncAlertsWithStreamingResponse, +from .invoice_line_items import ( + InvoiceLineItems, + AsyncInvoiceLineItems, + InvoiceLineItemsWithRawResponse, + AsyncInvoiceLineItemsWithRawResponse, + InvoiceLineItemsWithStreamingResponse, + AsyncInvoiceLineItemsWithStreamingResponse, ) from .webhooks import ( Webhooks, diff --git a/src/orb/resources/alerts.py b/src/orb/resources/alerts.py index 2be41e36..c168f120 100755 --- a/src/orb/resources/alerts.py +++ b/src/orb/resources/alerts.py @@ -2,47 +2,31 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.alert import Alert - -from .._base_client import make_request_options, AsyncPaginator - -from .._utils import maybe_transform, async_maybe_transform - -from typing import Iterable, Union, Optional - -from ..pagination import SyncPage, AsyncPage - +from typing import Union, Iterable, Optional from datetime import datetime - from typing_extensions import Literal -from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx +from .. import _legacy_response from ..types import ( + alert_list_params, alert_update_params, alert_create_for_customer_params, - alert_create_for_external_customer_params, alert_create_for_subscription_params, + alert_create_for_external_customer_params, ) - -from .. import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import alert_update_params -from ..types import alert_list_params -from ..types import alert_create_for_customer_params -from ..types import alert_create_for_external_customer_params -from ..types import alert_create_for_subscription_params +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..pagination import SyncPage, AsyncPage +from ..types.alert import Alert +from .._base_client import AsyncPaginator, make_request_options __all__ = ["Alerts", "AsyncAlerts"] diff --git a/src/orb/resources/coupons/__init__.py b/src/orb/resources/coupons/__init__.py index 377a0d26..06fce4d1 100755 --- a/src/orb/resources/coupons/__init__.py +++ b/src/orb/resources/coupons/__init__.py @@ -1,19 +1,21 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .subscriptions import Subscriptions, AsyncSubscriptions -from .subscriptions import ( - SubscriptionsWithRawResponse, - AsyncSubscriptionsWithRawResponse, - SubscriptionsWithStreamingResponse, - AsyncSubscriptionsWithStreamingResponse, -) -from .coupons import Coupons, AsyncCoupons from .coupons import ( + Coupons, + AsyncCoupons, CouponsWithRawResponse, AsyncCouponsWithRawResponse, CouponsWithStreamingResponse, AsyncCouponsWithStreamingResponse, ) +from .subscriptions import ( + Subscriptions, + AsyncSubscriptions, + SubscriptionsWithRawResponse, + AsyncSubscriptionsWithRawResponse, + SubscriptionsWithStreamingResponse, + AsyncSubscriptionsWithStreamingResponse, +) __all__ = [ "Subscriptions", diff --git a/src/orb/resources/coupons/coupons.py b/src/orb/resources/coupons/coupons.py index 4b3e15df..74d8d9f0 100755 --- a/src/orb/resources/coupons/coupons.py +++ b/src/orb/resources/coupons/coupons.py @@ -2,37 +2,21 @@ from __future__ import annotations -import httpx - -from .subscriptions import Subscriptions, AsyncSubscriptions - -from ..._compat import cached_property - -from ...types.coupon import Coupon - -from ..._utils import maybe_transform, async_maybe_transform - -from ..._base_client import make_request_options, AsyncPaginator - from typing import Optional -from ...pagination import SyncPage, AsyncPage - -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ...types import coupon_create_params +import httpx from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ...types import coupon_list_params, coupon_create_params +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params -from ...types import coupon_create_params -from ...types import coupon_list_params +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...pagination import SyncPage, AsyncPage from .subscriptions import ( Subscriptions, AsyncSubscriptions, @@ -41,6 +25,8 @@ SubscriptionsWithStreamingResponse, AsyncSubscriptionsWithStreamingResponse, ) +from ..._base_client import AsyncPaginator, make_request_options +from ...types.coupon import Coupon __all__ = ["Coupons", "AsyncCoupons"] diff --git a/src/orb/resources/coupons/subscriptions.py b/src/orb/resources/coupons/subscriptions.py index c9f0d115..a4184554 100755 --- a/src/orb/resources/coupons/subscriptions.py +++ b/src/orb/resources/coupons/subscriptions.py @@ -2,32 +2,20 @@ from __future__ import annotations -import httpx - -from ..._compat import cached_property - -from ...types.subscription import Subscription - -from ...pagination import SyncPage, AsyncPage - -from ..._utils import maybe_transform - -from ..._base_client import make_request_options, AsyncPaginator - from typing import Optional -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import maybe_transform +from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...pagination import SyncPage, AsyncPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.coupons import subscription_list_params +from ...types.subscription import Subscription __all__ = ["Subscriptions", "AsyncSubscriptions"] diff --git a/src/orb/resources/credit_notes.py b/src/orb/resources/credit_notes.py index 5dc13a59..c4aa0f94 100755 --- a/src/orb/resources/credit_notes.py +++ b/src/orb/resources/credit_notes.py @@ -2,32 +2,20 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.credit_note import CreditNote - -from ..pagination import SyncPage, AsyncPage - -from .._utils import maybe_transform - -from .._base_client import make_request_options, AsyncPaginator - from typing import Optional -from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx from .. import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params from ..types import credit_note_list_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.credit_note import CreditNote __all__ = ["CreditNotes", "AsyncCreditNotes"] diff --git a/src/orb/resources/customers/__init__.py b/src/orb/resources/customers/__init__.py index bcf0e4e5..ffe4db5c 100755 --- a/src/orb/resources/customers/__init__.py +++ b/src/orb/resources/customers/__init__.py @@ -1,33 +1,37 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .costs import Costs, AsyncCosts from .costs import ( + Costs, + AsyncCosts, CostsWithRawResponse, AsyncCostsWithRawResponse, CostsWithStreamingResponse, AsyncCostsWithStreamingResponse, ) -from .credits import Credits, AsyncCredits from .credits import ( + Credits, + AsyncCredits, CreditsWithRawResponse, AsyncCreditsWithRawResponse, CreditsWithStreamingResponse, AsyncCreditsWithStreamingResponse, ) -from .balance_transactions import BalanceTransactions, AsyncBalanceTransactions -from .balance_transactions import ( - BalanceTransactionsWithRawResponse, - AsyncBalanceTransactionsWithRawResponse, - BalanceTransactionsWithStreamingResponse, - AsyncBalanceTransactionsWithStreamingResponse, -) -from .customers import Customers, AsyncCustomers from .customers import ( + Customers, + AsyncCustomers, CustomersWithRawResponse, AsyncCustomersWithRawResponse, CustomersWithStreamingResponse, AsyncCustomersWithStreamingResponse, ) +from .balance_transactions import ( + BalanceTransactions, + AsyncBalanceTransactions, + BalanceTransactionsWithRawResponse, + AsyncBalanceTransactionsWithRawResponse, + BalanceTransactionsWithStreamingResponse, + AsyncBalanceTransactionsWithStreamingResponse, +) __all__ = [ "Costs", diff --git a/src/orb/resources/customers/balance_transactions.py b/src/orb/resources/customers/balance_transactions.py index 48b8c6a0..dfc7c425 100755 --- a/src/orb/resources/customers/balance_transactions.py +++ b/src/orb/resources/customers/balance_transactions.py @@ -2,39 +2,26 @@ from __future__ import annotations -import httpx - -from ..._compat import cached_property - -from ...types.customers.balance_transaction_create_response import BalanceTransactionCreateResponse - -from ..._utils import maybe_transform, async_maybe_transform - -from ..._base_client import make_request_options, AsyncPaginator - -from typing_extensions import Literal - -from typing import Optional, Union - -from ...types.customers.balance_transaction_list_response import BalanceTransactionListResponse - -from ...pagination import SyncPage, AsyncPage - +from typing import Union, Optional from datetime import datetime +from typing_extensions import Literal -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params -from ...types.customers import balance_transaction_create_params -from ...types.customers import balance_transaction_list_params +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...pagination import SyncPage, AsyncPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.customers import balance_transaction_list_params, balance_transaction_create_params +from ...types.customers.balance_transaction_list_response import BalanceTransactionListResponse +from ...types.customers.balance_transaction_create_response import BalanceTransactionCreateResponse __all__ = ["BalanceTransactions", "AsyncBalanceTransactions"] diff --git a/src/orb/resources/customers/costs.py b/src/orb/resources/customers/costs.py index 43f3cc15..4315389e 100755 --- a/src/orb/resources/customers/costs.py +++ b/src/orb/resources/customers/costs.py @@ -2,37 +2,25 @@ from __future__ import annotations -import httpx - -from ..._compat import cached_property - -from ...types.customers.cost_list_response import CostListResponse - -from ..._utils import maybe_transform, async_maybe_transform - -from ..._base_client import make_request_options - -from typing import Optional, Union - +from typing import Union, Optional from datetime import datetime - from typing_extensions import Literal -from ...types.customers.cost_list_by_external_id_response import CostListByExternalIDResponse - -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params -from ...types.customers import cost_list_params -from ...types.customers import cost_list_by_external_id_params +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..._base_client import make_request_options +from ...types.customers import cost_list_params, cost_list_by_external_id_params +from ...types.customers.cost_list_response import CostListResponse +from ...types.customers.cost_list_by_external_id_response import CostListByExternalIDResponse __all__ = ["Costs", "AsyncCosts"] diff --git a/src/orb/resources/customers/credits/__init__.py b/src/orb/resources/customers/credits/__init__.py index 74276b06..cb1b48d7 100755 --- a/src/orb/resources/customers/credits/__init__.py +++ b/src/orb/resources/customers/credits/__init__.py @@ -1,26 +1,29 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .ledger import Ledger, AsyncLedger from .ledger import ( + Ledger, + AsyncLedger, LedgerWithRawResponse, AsyncLedgerWithRawResponse, LedgerWithStreamingResponse, AsyncLedgerWithStreamingResponse, ) -from .top_ups import TopUps, AsyncTopUps -from .top_ups import ( - TopUpsWithRawResponse, - AsyncTopUpsWithRawResponse, - TopUpsWithStreamingResponse, - AsyncTopUpsWithStreamingResponse, -) -from .credits import Credits, AsyncCredits from .credits import ( + Credits, + AsyncCredits, CreditsWithRawResponse, AsyncCreditsWithRawResponse, CreditsWithStreamingResponse, AsyncCreditsWithStreamingResponse, ) +from .top_ups import ( + TopUps, + AsyncTopUps, + TopUpsWithRawResponse, + AsyncTopUpsWithRawResponse, + TopUpsWithStreamingResponse, + AsyncTopUpsWithStreamingResponse, +) __all__ = [ "Ledger", diff --git a/src/orb/resources/customers/credits/credits.py b/src/orb/resources/customers/credits/credits.py index 8dfc16e4..6167390b 100755 --- a/src/orb/resources/customers/credits/credits.py +++ b/src/orb/resources/customers/credits/credits.py @@ -2,39 +2,11 @@ from __future__ import annotations -import httpx - -from .ledger import Ledger, AsyncLedger - -from ...._compat import cached_property - -from .top_ups import TopUps, AsyncTopUps - -from ....types.customers.credit_list_response import CreditListResponse - -from ....pagination import SyncPage, AsyncPage - -from ...._utils import maybe_transform - -from ...._base_client import make_request_options, AsyncPaginator - from typing import Optional -from ....types.customers.credit_list_by_external_id_response import CreditListByExternalIDResponse - -from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx from .... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ...._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ...._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from ...._resource import SyncAPIResource, AsyncAPIResource -from ....types import shared_params -from ....types.customers import credit_list_params -from ....types.customers import credit_list_by_external_id_params from .ledger import ( Ledger, AsyncLedger, @@ -51,6 +23,16 @@ TopUpsWithStreamingResponse, AsyncTopUpsWithStreamingResponse, ) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ....pagination import SyncPage, AsyncPage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.customers import credit_list_params, credit_list_by_external_id_params +from ....types.customers.credit_list_response import CreditListResponse +from ....types.customers.credit_list_by_external_id_response import CreditListByExternalIDResponse __all__ = ["Credits", "AsyncCredits"] diff --git a/src/orb/resources/customers/credits/ledger.py b/src/orb/resources/customers/credits/ledger.py index e20cbdd4..f9853958 100755 --- a/src/orb/resources/customers/credits/ledger.py +++ b/src/orb/resources/customers/credits/ledger.py @@ -2,62 +2,37 @@ from __future__ import annotations +from typing import Any, Dict, Union, Optional, cast, overload +from datetime import date, datetime +from typing_extensions import Literal + import httpx +from .... import _legacy_response +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + required_args, + maybe_transform, + async_maybe_transform, +) from ...._compat import cached_property - -from ....types.customers.credits.ledger_list_response import LedgerListResponse - +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ....pagination import SyncPage, AsyncPage - -from ...._utils import maybe_transform, async_maybe_transform - -from ...._base_client import make_request_options, AsyncPaginator - -from typing import Union, Optional, Dict - -from datetime import datetime, date - -from typing_extensions import Literal - +from ...._base_client import AsyncPaginator, make_request_options +from ....types.customers.credits import ( + ledger_list_params, + ledger_create_entry_params, + ledger_list_by_external_id_params, + ledger_create_entry_by_external_id_params, +) +from ....types.customers.credits.ledger_list_response import LedgerListResponse from ....types.customers.credits.ledger_create_entry_response import LedgerCreateEntryResponse - +from ....types.customers.credits.ledger_list_by_external_id_response import LedgerListByExternalIDResponse from ....types.customers.credits.ledger_create_entry_by_external_id_response import ( LedgerCreateEntryByExternalIDResponse, ) -from ....types.customers.credits.ledger_list_by_external_id_response import LedgerListByExternalIDResponse - -from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ....types.customers.credits import ledger_create_entry_params, ledger_create_entry_by_external_id_params - -from .... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ...._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ...._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from ...._resource import SyncAPIResource, AsyncAPIResource -from ....types import shared_params -from ....types.customers.credits import ledger_list_params -from ....types.customers.credits import ledger_create_entry_params -from ....types.customers.credits import ledger_create_entry_by_external_id_params -from ....types.customers.credits import ledger_list_by_external_id_params -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast - __all__ = ["Ledger", "AsyncLedger"] diff --git a/src/orb/resources/customers/credits/top_ups.py b/src/orb/resources/customers/credits/top_ups.py index e4f61899..111fa566 100755 --- a/src/orb/resources/customers/credits/top_ups.py +++ b/src/orb/resources/customers/credits/top_ups.py @@ -2,45 +2,32 @@ from __future__ import annotations -import httpx - -from ...._compat import cached_property - -from ....types.customers.credits.top_up_create_response import TopUpCreateResponse - -from ...._utils import maybe_transform, async_maybe_transform - -from ...._base_client import make_request_options, AsyncPaginator - from typing import Optional - from typing_extensions import Literal -from ....types.customers.credits.top_up_list_response import TopUpListResponse - -from ....pagination import SyncPage, AsyncPage - -from ....types.customers.credits.top_up_create_by_external_id_response import TopUpCreateByExternalIDResponse - -from ....types.customers.credits.top_up_list_by_external_id_response import TopUpListByExternalIDResponse - -from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ....types.customers.credits import top_up_create_params, top_up_create_by_external_id_params +import httpx from .... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ...._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ...._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource -from ....types import shared_params -from ....types.customers.credits import top_up_create_params -from ....types.customers.credits import top_up_list_params -from ....types.customers.credits import top_up_create_by_external_id_params -from ....types.customers.credits import top_up_list_by_external_id_params +from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ....pagination import SyncPage, AsyncPage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.customers.credits import ( + top_up_list_params, + top_up_create_params, + top_up_list_by_external_id_params, + top_up_create_by_external_id_params, +) +from ....types.customers.credits.top_up_list_response import TopUpListResponse +from ....types.customers.credits.top_up_create_response import TopUpCreateResponse +from ....types.customers.credits.top_up_list_by_external_id_response import TopUpListByExternalIDResponse +from ....types.customers.credits.top_up_create_by_external_id_response import TopUpCreateByExternalIDResponse __all__ = ["TopUps", "AsyncTopUps"] diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index fda3b97f..b8603320 100755 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -2,47 +2,13 @@ from __future__ import annotations -import httpx - -from .costs import Costs, AsyncCosts - -from ..._compat import cached_property - -from .credits.credits import Credits, AsyncCredits - -from .balance_transactions import BalanceTransactions, AsyncBalanceTransactions - -from ...types.customer import Customer - -from ..._utils import maybe_transform, async_maybe_transform - -from ..._base_client import make_request_options, AsyncPaginator - -from typing import Optional, List, Dict, Union - -from typing_extensions import Literal - -from ...pagination import SyncPage, AsyncPage - +from typing import Dict, List, Union, Optional from datetime import datetime +from typing_extensions import Literal -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ...types import customer_create_params, customer_update_params, customer_update_by_external_id_params +import httpx from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params -from ...types import customer_create_params -from ...types import customer_update_params -from ...types import customer_list_params -from ...types import customer_update_by_external_id_params from .costs import ( Costs, AsyncCosts, @@ -51,6 +17,12 @@ CostsWithStreamingResponse, AsyncCostsWithStreamingResponse, ) +from ...types import ( + customer_list_params, + customer_create_params, + customer_update_params, + customer_update_by_external_id_params, +) from .credits import ( Credits, AsyncCredits, @@ -59,6 +31,18 @@ CreditsWithStreamingResponse, AsyncCreditsWithStreamingResponse, ) +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...pagination import SyncPage, AsyncPage +from ..._base_client import AsyncPaginator, make_request_options +from .credits.credits import Credits, AsyncCredits +from ...types.customer import Customer from .balance_transactions import ( BalanceTransactions, AsyncBalanceTransactions, diff --git a/src/orb/resources/events/__init__.py b/src/orb/resources/events/__init__.py index 25ebcbb1..ead1b010 100755 --- a/src/orb/resources/events/__init__.py +++ b/src/orb/resources/events/__init__.py @@ -1,19 +1,21 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .backfills import Backfills, AsyncBackfills -from .backfills import ( - BackfillsWithRawResponse, - AsyncBackfillsWithRawResponse, - BackfillsWithStreamingResponse, - AsyncBackfillsWithStreamingResponse, -) -from .events import Events, AsyncEvents from .events import ( + Events, + AsyncEvents, EventsWithRawResponse, AsyncEventsWithRawResponse, EventsWithStreamingResponse, AsyncEventsWithStreamingResponse, ) +from .backfills import ( + Backfills, + AsyncBackfills, + BackfillsWithRawResponse, + AsyncBackfillsWithRawResponse, + BackfillsWithStreamingResponse, + AsyncBackfillsWithStreamingResponse, +) __all__ = [ "Backfills", diff --git a/src/orb/resources/events/backfills.py b/src/orb/resources/events/backfills.py index f1f653a8..e742f6d5 100755 --- a/src/orb/resources/events/backfills.py +++ b/src/orb/resources/events/backfills.py @@ -2,44 +2,29 @@ from __future__ import annotations -import httpx - -from ..._compat import cached_property - -from ...types.events.backfill_create_response import BackfillCreateResponse - -from ..._utils import maybe_transform, async_maybe_transform - -from ..._base_client import make_request_options, AsyncPaginator - from typing import Union, Optional - from datetime import datetime -from ...types.events.backfill_list_response import BackfillListResponse +import httpx +from ... import _legacy_response +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ...pagination import SyncPage, AsyncPage - +from ..._base_client import AsyncPaginator, make_request_options +from ...types.events import backfill_list_params, backfill_create_params +from ...types.events.backfill_list_response import BackfillListResponse from ...types.events.backfill_close_response import BackfillCloseResponse - from ...types.events.backfill_fetch_response import BackfillFetchResponse - +from ...types.events.backfill_create_response import BackfillCreateResponse from ...types.events.backfill_revert_response import BackfillRevertResponse -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params -from ...types.events import backfill_create_params -from ...types.events import backfill_list_params - __all__ = ["Backfills", "AsyncBackfills"] diff --git a/src/orb/resources/events/events.py b/src/orb/resources/events/events.py index d8c26014..0c7edc7b 100755 --- a/src/orb/resources/events/events.py +++ b/src/orb/resources/events/events.py @@ -2,44 +2,19 @@ from __future__ import annotations -import httpx - -from .backfills import Backfills, AsyncBackfills - -from ..._compat import cached_property - -from ...types.event_update_response import EventUpdateResponse - -from ..._utils import maybe_transform, async_maybe_transform - -from ..._base_client import make_request_options - -from typing import Union, Optional, Iterable, List - +from typing import List, Union, Iterable, Optional from datetime import datetime -from ...types.event_deprecate_response import EventDeprecateResponse - -from ...types.event_ingest_response import EventIngestResponse - -from ...types.event_search_response import EventSearchResponse - -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ...types import event_ingest_params +import httpx from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params -from ...types import event_update_params -from ...types import event_ingest_params -from ...types import event_search_params +from ...types import event_ingest_params, event_search_params, event_update_params +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property from .backfills import ( Backfills, AsyncBackfills, @@ -48,6 +23,13 @@ BackfillsWithStreamingResponse, AsyncBackfillsWithStreamingResponse, ) +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..._base_client import make_request_options +from ...types.event_ingest_response import EventIngestResponse +from ...types.event_search_response import EventSearchResponse +from ...types.event_update_response import EventUpdateResponse +from ...types.event_deprecate_response import EventDeprecateResponse __all__ = ["Events", "AsyncEvents"] diff --git a/src/orb/resources/invoice_line_items.py b/src/orb/resources/invoice_line_items.py index dbeca6eb..3cc42cab 100755 --- a/src/orb/resources/invoice_line_items.py +++ b/src/orb/resources/invoice_line_items.py @@ -2,32 +2,23 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.invoice_line_item_create_response import InvoiceLineItemCreateResponse - -from .._utils import maybe_transform, async_maybe_transform - -from .._base_client import make_request_options - from typing import Union - from datetime import date -from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx from .. import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params from ..types import invoice_line_item_create_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from .._base_client import make_request_options +from ..types.invoice_line_item_create_response import InvoiceLineItemCreateResponse __all__ = ["InvoiceLineItems", "AsyncInvoiceLineItems"] diff --git a/src/orb/resources/invoices.py b/src/orb/resources/invoices.py index 385b1181..f522e06f 100755 --- a/src/orb/resources/invoices.py +++ b/src/orb/resources/invoices.py @@ -2,48 +2,34 @@ from __future__ import annotations +from typing import Dict, List, Union, Iterable, Optional +from datetime import date, datetime +from typing_extensions import Literal + import httpx +from .. import _legacy_response +from ..types import ( + invoice_list_params, + invoice_create_params, + invoice_update_params, + invoice_mark_paid_params, + invoice_fetch_upcoming_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) from .._compat import cached_property - +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options from ..types.invoice import Invoice - -from .._utils import maybe_transform, async_maybe_transform - -from .._base_client import make_request_options, AsyncPaginator - -from typing import Union, Iterable, Optional, Dict, List - -from datetime import datetime, date - from ..types.shared_params.discount import Discount - -from ..pagination import SyncPage, AsyncPage - -from typing_extensions import Literal - from ..types.invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse -from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ..types import invoice_create_params - -from .. import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import invoice_create_params -from ..types import invoice_update_params -from ..types import invoice_list_params -from ..types import invoice_fetch_upcoming_params -from ..types import invoice_mark_paid_params -from ..types import shared - __all__ = ["Invoices", "AsyncInvoices"] diff --git a/src/orb/resources/items.py b/src/orb/resources/items.py index 3858639f..2121f1de 100755 --- a/src/orb/resources/items.py +++ b/src/orb/resources/items.py @@ -2,36 +2,23 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.item import Item - -from .._utils import maybe_transform, async_maybe_transform - -from .._base_client import make_request_options, AsyncPaginator - -from typing import Optional, Iterable - -from ..pagination import SyncPage, AsyncPage - -from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from typing import Iterable, Optional -from ..types import item_update_params +import httpx from .. import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ..types import item_list_params, item_create_params, item_update_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import item_create_params -from ..types import item_update_params -from ..types import item_list_params +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..pagination import SyncPage, AsyncPage +from ..types.item import Item +from .._base_client import AsyncPaginator, make_request_options __all__ = ["Items", "AsyncItems"] diff --git a/src/orb/resources/metrics.py b/src/orb/resources/metrics.py index d3f5a1a8..0c60af6b 100755 --- a/src/orb/resources/metrics.py +++ b/src/orb/resources/metrics.py @@ -2,36 +2,24 @@ from __future__ import annotations -import httpx - -from .._compat import cached_property - -from ..types.billable_metric import BillableMetric - -from .._utils import maybe_transform, async_maybe_transform - -from .._base_client import make_request_options, AsyncPaginator - -from typing import Optional, Dict, Union - -from ..pagination import SyncPage, AsyncPage - +from typing import Dict, Union, Optional from datetime import datetime -from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx from .. import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ..types import metric_list_params, metric_create_params, metric_update_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import metric_create_params -from ..types import metric_update_params -from ..types import metric_list_params +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.billable_metric import BillableMetric __all__ = ["Metrics", "AsyncMetrics"] diff --git a/src/orb/resources/plans/__init__.py b/src/orb/resources/plans/__init__.py index 4751b8ba..fa461833 100755 --- a/src/orb/resources/plans/__init__.py +++ b/src/orb/resources/plans/__init__.py @@ -1,19 +1,21 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .external_plan_id import ExternalPlanID, AsyncExternalPlanID -from .external_plan_id import ( - ExternalPlanIDWithRawResponse, - AsyncExternalPlanIDWithRawResponse, - ExternalPlanIDWithStreamingResponse, - AsyncExternalPlanIDWithStreamingResponse, -) -from .plans import Plans, AsyncPlans from .plans import ( + Plans, + AsyncPlans, PlansWithRawResponse, AsyncPlansWithRawResponse, PlansWithStreamingResponse, AsyncPlansWithStreamingResponse, ) +from .external_plan_id import ( + ExternalPlanID, + AsyncExternalPlanID, + ExternalPlanIDWithRawResponse, + AsyncExternalPlanIDWithRawResponse, + ExternalPlanIDWithStreamingResponse, + AsyncExternalPlanIDWithStreamingResponse, +) __all__ = [ "ExternalPlanID", diff --git a/src/orb/resources/plans/external_plan_id.py b/src/orb/resources/plans/external_plan_id.py index b1fd4838..9b99ce1d 100755 --- a/src/orb/resources/plans/external_plan_id.py +++ b/src/orb/resources/plans/external_plan_id.py @@ -2,30 +2,22 @@ from __future__ import annotations -import httpx - -from ..._compat import cached_property - -from ...types.plan import Plan - -from ..._utils import maybe_transform, async_maybe_transform - -from ..._base_client import make_request_options +from typing import Dict, Optional -from typing import Optional, Dict - -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +import httpx from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...types.plan import Plan from ...types.plans import external_plan_id_update_params +from ..._base_client import make_request_options __all__ = ["ExternalPlanID", "AsyncExternalPlanID"] diff --git a/src/orb/resources/plans/plans.py b/src/orb/resources/plans/plans.py index bd8bb2da..e32f43a5 100755 --- a/src/orb/resources/plans/plans.py +++ b/src/orb/resources/plans/plans.py @@ -2,42 +2,25 @@ from __future__ import annotations -import httpx - -from .external_plan_id import ExternalPlanID, AsyncExternalPlanID - -from ..._compat import cached_property - -from ...types.plan import Plan - -from ..._utils import maybe_transform, async_maybe_transform - -from ..._base_client import make_request_options, AsyncPaginator - -from typing import Iterable, Optional, Dict, Union - -from typing_extensions import Literal - -from ...pagination import SyncPage, AsyncPage - +from typing import Dict, Union, Iterable, Optional from datetime import datetime +from typing_extensions import Literal -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ...types import plan_create_params +import httpx from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ...types import plan_list_params, plan_create_params, plan_update_params +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params -from ...types import plan_create_params -from ...types import plan_update_params -from ...types import plan_list_params +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...pagination import SyncPage, AsyncPage +from ...types.plan import Plan +from ..._base_client import AsyncPaginator, make_request_options from .external_plan_id import ( ExternalPlanID, AsyncExternalPlanID, diff --git a/src/orb/resources/prices/__init__.py b/src/orb/resources/prices/__init__.py index d7a04525..cbad4d69 100755 --- a/src/orb/resources/prices/__init__.py +++ b/src/orb/resources/prices/__init__.py @@ -1,19 +1,21 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .external_price_id import ExternalPriceID, AsyncExternalPriceID -from .external_price_id import ( - ExternalPriceIDWithRawResponse, - AsyncExternalPriceIDWithRawResponse, - ExternalPriceIDWithStreamingResponse, - AsyncExternalPriceIDWithStreamingResponse, -) -from .prices import Prices, AsyncPrices from .prices import ( + Prices, + AsyncPrices, PricesWithRawResponse, AsyncPricesWithRawResponse, PricesWithStreamingResponse, AsyncPricesWithStreamingResponse, ) +from .external_price_id import ( + ExternalPriceID, + AsyncExternalPriceID, + ExternalPriceIDWithRawResponse, + AsyncExternalPriceIDWithRawResponse, + ExternalPriceIDWithStreamingResponse, + AsyncExternalPriceIDWithStreamingResponse, +) __all__ = [ "ExternalPriceID", diff --git a/src/orb/resources/prices/external_price_id.py b/src/orb/resources/prices/external_price_id.py index fd9e0c12..e2ba2682 100755 --- a/src/orb/resources/prices/external_price_id.py +++ b/src/orb/resources/prices/external_price_id.py @@ -2,38 +2,22 @@ from __future__ import annotations +from typing import Any, Dict, Optional, cast + import httpx +from ... import _legacy_response +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) from ..._compat import cached_property - +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ...types.price import Price - -from ..._utils import maybe_transform, async_maybe_transform - from ..._base_client import make_request_options - -from typing import Optional, Dict - -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params from ...types.prices import external_price_id_update_params -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast __all__ = ["ExternalPriceID", "AsyncExternalPriceID"] diff --git a/src/orb/resources/prices/prices.py b/src/orb/resources/prices/prices.py index bc89fa2b..02c29ae4 100755 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -2,45 +2,26 @@ from __future__ import annotations -import httpx - -from .external_price_id import ExternalPriceID, AsyncExternalPriceID - -from ..._compat import cached_property - -from typing_extensions import Literal - -from typing import Optional, Dict, Union, List - -from ...types.price import Price - -from ..._utils import maybe_transform, async_maybe_transform - -from ..._base_client import make_request_options, AsyncPaginator - -from ...pagination import SyncPage, AsyncPage - -from ...types.price_evaluate_response import PriceEvaluateResponse - +from typing import Any, Dict, List, Union, Optional, cast, overload from datetime import datetime +from typing_extensions import Literal -from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ...types import price_create_params +import httpx from ... import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from ..._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from ..._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from ...types import price_list_params, price_create_params, price_update_params, price_evaluate_params +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + required_args, + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource -from ...types import shared_params -from ...types import price_create_params -from ...types import price_update_params -from ...types import price_list_params -from ...types import price_evaluate_params +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from ...pagination import SyncPage, AsyncPage +from ...types.price import Price +from ..._base_client import AsyncPaginator, make_request_options from .external_price_id import ( ExternalPriceID, AsyncExternalPriceID, @@ -49,20 +30,7 @@ ExternalPriceIDWithStreamingResponse, AsyncExternalPriceIDWithStreamingResponse, ) -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast -from typing import cast +from ...types.price_evaluate_response import PriceEvaluateResponse __all__ = ["Prices", "AsyncPrices"] @@ -92,10 +60,14 @@ def create( unit_config: price_create_params.NewFloatingUnitPriceUnitConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -133,6 +105,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -142,6 +117,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -170,10 +148,14 @@ def create( package_config: price_create_params.NewFloatingPackagePricePackageConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -211,6 +193,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -220,6 +205,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -248,10 +236,14 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -289,6 +281,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -298,6 +293,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -326,10 +324,18 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -367,6 +373,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -376,6 +385,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -404,10 +416,14 @@ def create( tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -445,6 +461,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -454,6 +473,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -482,10 +504,16 @@ def create( tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredBpsPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -523,6 +551,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -532,6 +563,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -560,10 +594,14 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -601,6 +639,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -610,6 +651,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -638,10 +682,14 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -679,6 +727,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -688,6 +739,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -716,10 +770,14 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -757,6 +815,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -766,6 +827,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -794,10 +858,18 @@ def create( threshold_total_amount_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -835,6 +907,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -844,6 +919,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -872,10 +950,18 @@ def create( tiered_package_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackagePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackagePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -913,6 +999,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -922,6 +1011,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -950,10 +1042,18 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -991,6 +1091,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -1000,6 +1103,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1028,10 +1134,18 @@ def create( tiered_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -1069,6 +1183,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -1078,6 +1195,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1106,10 +1226,18 @@ def create( package_with_allocation_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingPackageWithAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -1147,6 +1275,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -1156,6 +1287,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1184,10 +1318,18 @@ def create( tiered_package_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -1225,6 +1367,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -1234,6 +1379,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1262,10 +1410,18 @@ def create( unit_with_percent_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithPercentPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -1303,6 +1459,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -1312,6 +1471,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1340,10 +1502,18 @@ def create( tiered_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -1381,6 +1551,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -1390,6 +1563,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1418,10 +1594,18 @@ def create( unit_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -1459,6 +1643,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -1468,6 +1655,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1496,10 +1686,18 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -1537,6 +1735,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -1546,6 +1747,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1574,10 +1778,18 @@ def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingBulkWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -1615,6 +1827,9 @@ def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -1624,6 +1839,9 @@ def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -1692,10 +1910,14 @@ def create( unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, package_config: price_create_params.NewFloatingPackagePricePackageConfig | NotGiven = NOT_GIVEN, matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig | NotGiven = NOT_GIVEN, @@ -1739,10 +1961,12 @@ def create( "unit_config": unit_config, "billable_metric_id": billable_metric_id, "billed_in_advance": billed_in_advance, + "billing_cycle_configuration": billing_cycle_configuration, "conversion_rate": conversion_rate, "external_price_id": external_price_id, "fixed_price_quantity": fixed_price_quantity, "invoice_grouping_key": invoice_grouping_key, + "invoicing_cycle_configuration": invoicing_cycle_configuration, "metadata": metadata, "package_config": package_config, "matrix_config": matrix_config, @@ -2033,10 +2257,14 @@ async def create( unit_config: price_create_params.NewFloatingUnitPriceUnitConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2074,6 +2302,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2083,6 +2314,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2111,10 +2345,14 @@ async def create( package_config: price_create_params.NewFloatingPackagePricePackageConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingPackagePriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2152,6 +2390,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2161,6 +2402,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2189,10 +2433,14 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingMatrixPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2230,6 +2478,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2239,6 +2490,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2267,10 +2521,18 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2308,6 +2570,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2317,6 +2582,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2345,10 +2613,14 @@ async def create( tiered_config: price_create_params.NewFloatingTieredPriceTieredConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingTieredPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2386,6 +2658,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2395,6 +2670,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2423,10 +2701,16 @@ async def create( tiered_bps_config: price_create_params.NewFloatingTieredBpsPriceTieredBpsConfig, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingTieredBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredBpsPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2464,6 +2748,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2473,6 +2760,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2501,10 +2791,14 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBpsPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2542,6 +2836,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2551,6 +2848,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2579,10 +2879,14 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkBpsPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2620,6 +2924,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2629,6 +2936,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2657,10 +2967,14 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingBulkPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2698,6 +3012,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2707,6 +3024,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2735,10 +3055,18 @@ async def create( threshold_total_amount_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2776,6 +3104,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2785,6 +3116,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2813,10 +3147,18 @@ async def create( tiered_package_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackagePriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackagePriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2854,6 +3196,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2863,6 +3208,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2891,10 +3239,18 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedTieredPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -2932,6 +3288,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -2941,6 +3300,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -2969,10 +3331,18 @@ async def create( tiered_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -3010,6 +3380,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -3019,6 +3392,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3047,10 +3423,18 @@ async def create( package_with_allocation_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingPackageWithAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -3088,6 +3472,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -3097,6 +3484,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3125,10 +3515,18 @@ async def create( tiered_package_with_minimum_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -3166,6 +3564,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -3175,6 +3576,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3203,10 +3607,18 @@ async def create( unit_with_percent_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithPercentPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -3244,6 +3656,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -3253,6 +3668,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3281,10 +3699,18 @@ async def create( tiered_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -3322,6 +3748,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -3331,6 +3760,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3359,10 +3791,18 @@ async def create( unit_with_proration_config: Dict[str, object], billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -3400,6 +3840,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -3409,6 +3852,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3437,10 +3883,18 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedAllocationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -3478,6 +3932,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -3487,6 +3944,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3515,10 +3975,18 @@ async def create( name: str, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[ + price_create_params.NewFloatingBulkWithProrationPriceBillingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[ + price_create_params.NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration + ] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, # 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. @@ -3556,6 +4024,9 @@ async def create( billed_in_advance: 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: For custom cadence: specifies the duration of the billing period in days or + months. + conversion_rate: The per unit conversion rate of the price currency to the invoicing currency. external_price_id: An alias for the price. @@ -3565,6 +4036,9 @@ async def create( invoice_grouping_key: The property used to group this price on an invoice + invoicing_cycle_configuration: Within each billing cycle, specifies the cadence at which invoices are produced. + If unspecified, a single invoice is produced per billing cycle. + metadata: User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to `null`. @@ -3633,10 +4107,14 @@ async def create( unit_config: price_create_params.NewFloatingUnitPriceUnitConfig | NotGiven = NOT_GIVEN, billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, billed_in_advance: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceBillingCycleConfiguration] + | NotGiven = NOT_GIVEN, conversion_rate: Optional[float] | NotGiven = NOT_GIVEN, external_price_id: Optional[str] | NotGiven = NOT_GIVEN, fixed_price_quantity: Optional[float] | NotGiven = NOT_GIVEN, invoice_grouping_key: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_cycle_configuration: Optional[price_create_params.NewFloatingUnitPriceInvoicingCycleConfiguration] + | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, package_config: price_create_params.NewFloatingPackagePricePackageConfig | NotGiven = NOT_GIVEN, matrix_config: price_create_params.NewFloatingMatrixPriceMatrixConfig | NotGiven = NOT_GIVEN, @@ -3680,10 +4158,12 @@ async def create( "unit_config": unit_config, "billable_metric_id": billable_metric_id, "billed_in_advance": billed_in_advance, + "billing_cycle_configuration": billing_cycle_configuration, "conversion_rate": conversion_rate, "external_price_id": external_price_id, "fixed_price_quantity": fixed_price_quantity, "invoice_grouping_key": invoice_grouping_key, + "invoicing_cycle_configuration": invoicing_cycle_configuration, "metadata": metadata, "package_config": package_config, "matrix_config": matrix_config, diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py index a2bc29a3..b5af316b 100755 --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -2,62 +2,45 @@ from __future__ import annotations +from typing import Any, Dict, List, Union, Iterable, Optional, cast +from datetime import date, datetime +from typing_extensions import Literal + import httpx +from .. import _legacy_response +from ..types import ( + subscription_list_params, + subscription_cancel_params, + subscription_create_params, + subscription_update_params, + subscription_fetch_costs_params, + subscription_fetch_usage_params, + subscription_trigger_phase_params, + subscription_fetch_schedule_params, + subscription_price_intervals_params, + subscription_schedule_plan_change_params, + subscription_update_fixed_fee_quantity_params, + subscription_unschedule_fixed_fee_quantity_updates_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) from .._compat import cached_property - -from ..types.subscription import Subscription - -from .._utils import maybe_transform, async_maybe_transform - -from .._base_client import make_request_options, AsyncPaginator - -from typing import Optional, Union, Dict, Iterable, List - -from datetime import datetime, date - -from typing_extensions import Literal - +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncPage, AsyncPage - +from .._base_client import AsyncPaginator, make_request_options +from ..types.subscription import Subscription +from ..types.subscription_usage import SubscriptionUsage from ..types.subscription_fetch_costs_response import SubscriptionFetchCostsResponse - from ..types.subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse -from ..types.subscription_usage import SubscriptionUsage - -from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - -from ..types import subscription_create_params, subscription_price_intervals_params, subscription_schedule_plan_change_params - -from .. import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent -from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params -from ..types import subscription_create_params -from ..types import subscription_update_params -from ..types import subscription_list_params -from ..types import subscription_cancel_params -from ..types import subscription_fetch_costs_params -from ..types import subscription_fetch_schedule_params -from ..types import subscription_fetch_usage_params -from ..types import subscription_price_intervals_params -from ..types import subscription_schedule_plan_change_params -from ..types import subscription_trigger_phase_params -from ..types import subscription_unschedule_fixed_fee_quantity_updates_params -from ..types import subscription_update_fixed_fee_quantity_params -from typing import cast -from typing import cast -from typing import cast -from typing import cast - __all__ = ["Subscriptions", "AsyncSubscriptions"] + class Subscriptions(SyncAPIResource): @cached_property def with_raw_response(self) -> SubscriptionsWithRawResponse: @@ -67,35 +50,39 @@ def with_raw_response(self) -> SubscriptionsWithRawResponse: def with_streaming_response(self) -> SubscriptionsWithStreamingResponse: return SubscriptionsWithStreamingResponse(self) - def create(self, - *, - align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, - auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - aws_region: Optional[str] | NotGiven = NOT_GIVEN, - coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, - credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, - customer_id: Optional[str] | NotGiven = NOT_GIVEN, - default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, - end_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - external_marketplace: Optional[Literal["google", "aws", "azure"]] | NotGiven = NOT_GIVEN, - external_marketplace_reporting_id: Optional[str] | NotGiven = NOT_GIVEN, - external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, - initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, - invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, - net_terms: Optional[int] | NotGiven = NOT_GIVEN, - per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, - plan_id: Optional[str] | NotGiven = NOT_GIVEN, - price_overrides: Optional[Iterable[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN, - start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + def create( + self, + *, + align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, + auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + aws_region: Optional[str] | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[subscription_create_params.BillingCycleAnchorConfiguration] + | NotGiven = NOT_GIVEN, + coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, + credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, + customer_id: Optional[str] | NotGiven = NOT_GIVEN, + default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, + end_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, + external_marketplace: Optional[Literal["google", "aws", "azure"]] | NotGiven = NOT_GIVEN, + external_marketplace_reporting_id: Optional[str] | NotGiven = NOT_GIVEN, + external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, + initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, + invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + net_terms: Optional[int] | NotGiven = NOT_GIVEN, + per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, + plan_id: Optional[str] | NotGiven = NOT_GIVEN, + price_overrides: Optional[Iterable[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN, + start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """A subscription represents the purchase of a plan by a customer. The customer is @@ -514,47 +501,59 @@ def create(self, """ return self._post( "/subscriptions", - body=maybe_transform({ - "align_billing_with_subscription_start_date": align_billing_with_subscription_start_date, - "auto_collection": auto_collection, - "aws_region": aws_region, - "coupon_redemption_code": coupon_redemption_code, - "credits_overage_rate": credits_overage_rate, - "customer_id": customer_id, - "default_invoice_memo": default_invoice_memo, - "end_date": end_date, - "external_customer_id": external_customer_id, - "external_marketplace": external_marketplace, - "external_marketplace_reporting_id": external_marketplace_reporting_id, - "external_plan_id": external_plan_id, - "initial_phase_order": initial_phase_order, - "invoicing_threshold": invoicing_threshold, - "metadata": metadata, - "net_terms": net_terms, - "per_credit_overage_amount": per_credit_overage_amount, - "plan_id": plan_id, - "price_overrides": price_overrides, - "start_date": start_date, - }, subscription_create_params.SubscriptionCreateParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=maybe_transform( + { + "align_billing_with_subscription_start_date": align_billing_with_subscription_start_date, + "auto_collection": auto_collection, + "aws_region": aws_region, + "billing_cycle_anchor_configuration": billing_cycle_anchor_configuration, + "coupon_redemption_code": coupon_redemption_code, + "credits_overage_rate": credits_overage_rate, + "customer_id": customer_id, + "default_invoice_memo": default_invoice_memo, + "end_date": end_date, + "external_customer_id": external_customer_id, + "external_marketplace": external_marketplace, + "external_marketplace_reporting_id": external_marketplace_reporting_id, + "external_plan_id": external_plan_id, + "initial_phase_order": initial_phase_order, + "invoicing_threshold": invoicing_threshold, + "metadata": metadata, + "net_terms": net_terms, + "per_credit_overage_amount": per_credit_overage_amount, + "plan_id": plan_id, + "price_overrides": price_overrides, + "start_date": start_date, + }, + subscription_create_params.SubscriptionCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def update(self, - subscription_id: str, - *, - auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, - net_terms: Optional[int] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + def update( + self, + subscription_id: str, + *, + auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + net_terms: Optional[int] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to update the `metadata`, `net terms`, `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties @@ -592,41 +591,48 @@ def update(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._put( f"/subscriptions/{subscription_id}", - body=maybe_transform({ - "auto_collection": auto_collection, - "default_invoice_memo": default_invoice_memo, - "invoicing_threshold": invoicing_threshold, - "metadata": metadata, - "net_terms": net_terms, - }, subscription_update_params.SubscriptionUpdateParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=maybe_transform( + { + "auto_collection": auto_collection, + "default_invoice_memo": default_invoice_memo, + "invoicing_threshold": invoicing_threshold, + "metadata": metadata, + "net_terms": net_terms, + }, + subscription_update_params.SubscriptionUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def list(self, - *, - created_at_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_at_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - cursor: Optional[str] | NotGiven = NOT_GIVEN, - query_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - query_customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, - query_external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - query_external_customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - status: Optional[Literal["active", "ended", "upcoming"]] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> SyncPage[Subscription]: + def list( + self, + *, + created_at_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + created_at_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + cursor: Optional[str] | NotGiven = NOT_GIVEN, + customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, + external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + status: Optional[Literal["active", "ended", "upcoming"]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncPage[Subscription]: """ This endpoint returns a list of all subscriptions for an account as a [paginated](../reference/pagination) list, ordered starting from the most @@ -654,33 +660,44 @@ def list(self, """ return self._get_api_list( "/subscriptions", - page = SyncPage[Subscription], - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ - "created_at_gt": created_at_gt, - "created_at_gte": created_at_gte, - "created_at_lt": created_at_lt, - "created_at_lte": created_at_lte, - "cursor": cursor, - "customer_id": query_customer_id, - "external_customer_id": query_external_customer_id, - "limit": limit, - "status": status, - }, subscription_list_params.SubscriptionListParams)), + page=SyncPage[Subscription], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "created_at_gt": created_at_gt, + "created_at_gte": created_at_gte, + "created_at_lt": created_at_lt, + "created_at_lte": created_at_lte, + "cursor": cursor, + "customer_id": customer_id, + "external_customer_id": external_customer_id, + "limit": limit, + "status": status, + }, + subscription_list_params.SubscriptionListParams, + ), + ), model=Subscription, ) - def cancel(self, - subscription_id: str, - *, - cancel_option: Literal["end_of_subscription_term", "immediate", "requested_date"], - cancellation_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + def cancel( + self, + subscription_id: str, + *, + cancel_option: Literal["end_of_subscription_term", "immediate", "requested_date"], + cancellation_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """This endpoint can be used to cancel an existing subscription. It returns the @@ -762,28 +779,37 @@ def cancel(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._post( f"/subscriptions/{subscription_id}/cancel", - body=maybe_transform({ - "cancel_option": cancel_option, - "cancellation_date": cancellation_date, - }, subscription_cancel_params.SubscriptionCancelParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=maybe_transform( + { + "cancel_option": cancel_option, + "cancellation_date": cancellation_date, + }, + subscription_cancel_params.SubscriptionCancelParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def fetch(self, - subscription_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> Subscription: + def fetch( + self, + subscription_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Subscription: """ This endpoint is used to fetch a [Subscription](../guides/concepts#subscription) given an identifier. @@ -798,28 +824,30 @@ def fetch(self, timeout: Override the client-level default timeout for this request, in seconds """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._get( f"/subscriptions/{subscription_id}", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), cast_to=Subscription, ) - def fetch_costs(self, - subscription_id: str, - *, - currency: Optional[str] | NotGiven = NOT_GIVEN, - timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> SubscriptionFetchCostsResponse: + def fetch_costs( + self, + subscription_id: str, + *, + currency: Optional[str] | NotGiven = NOT_GIVEN, + timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SubscriptionFetchCostsResponse: """ This endpoint is used to fetch a day-by-day snapshot of a subscription's costs in Orb, calculated by applying pricing information to the underlying usage (see @@ -853,35 +881,44 @@ def fetch_costs(self, timeout: Override the client-level default timeout for this request, in seconds """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return self._get( f"/subscriptions/{subscription_id}/costs", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ - "currency": currency, - "timeframe_end": timeframe_end, - "timeframe_start": timeframe_start, - "view_mode": view_mode, - }, subscription_fetch_costs_params.SubscriptionFetchCostsParams)), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "currency": currency, + "timeframe_end": timeframe_end, + "timeframe_start": timeframe_start, + "view_mode": view_mode, + }, + subscription_fetch_costs_params.SubscriptionFetchCostsParams, + ), + ), cast_to=SubscriptionFetchCostsResponse, ) - def fetch_schedule(self, - subscription_id: str, - *, - cursor: Optional[str] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - start_date_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - start_date_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - start_date_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - start_date_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> SyncPage[SubscriptionFetchScheduleResponse]: + def fetch_schedule( + self, + subscription_id: str, + *, + cursor: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + start_date_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + start_date_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + start_date_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + start_date_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncPage[SubscriptionFetchScheduleResponse]: """ This endpoint returns a [paginated](../reference/pagination) list of all plans associated with a subscription along with their start and end dates. This list @@ -903,42 +940,51 @@ def fetch_schedule(self, timeout: Override the client-level default timeout for this request, in seconds """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - page = SyncPage[SubscriptionFetchScheduleResponse], - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ - "cursor": cursor, - "limit": limit, - "start_date_gt": start_date_gt, - "start_date_gte": start_date_gte, - "start_date_lt": start_date_lt, - "start_date_lte": start_date_lte, - }, subscription_fetch_schedule_params.SubscriptionFetchScheduleParams)), + page=SyncPage[SubscriptionFetchScheduleResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "limit": limit, + "start_date_gt": start_date_gt, + "start_date_gte": start_date_gte, + "start_date_lt": start_date_lt, + "start_date_lte": start_date_lte, + }, + subscription_fetch_schedule_params.SubscriptionFetchScheduleParams, + ), + ), model=SubscriptionFetchScheduleResponse, ) - def fetch_usage(self, - subscription_id: str, - *, - billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, - first_dimension_key: Optional[str] | NotGiven = NOT_GIVEN, - first_dimension_value: Optional[str] | NotGiven = NOT_GIVEN, - granularity: Optional[Literal["day"]] | NotGiven = NOT_GIVEN, - group_by: Optional[str] | NotGiven = NOT_GIVEN, - second_dimension_key: Optional[str] | NotGiven = NOT_GIVEN, - second_dimension_value: Optional[str] | NotGiven = NOT_GIVEN, - timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> SubscriptionUsage: + def fetch_usage( + self, + subscription_id: str, + *, + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + first_dimension_key: Optional[str] | NotGiven = NOT_GIVEN, + first_dimension_value: Optional[str] | NotGiven = NOT_GIVEN, + granularity: Optional[Literal["day"]] | NotGiven = NOT_GIVEN, + group_by: Optional[str] | NotGiven = NOT_GIVEN, + second_dimension_key: Optional[str] | NotGiven = NOT_GIVEN, + second_dimension_value: Optional[str] | NotGiven = NOT_GIVEN, + timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SubscriptionUsage: """This endpoint is used to fetch a subscription's usage in Orb. Especially when @@ -1163,40 +1209,52 @@ def fetch_usage(self, timeout: Override the client-level default timeout for this request, in seconds """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) - return cast(SubscriptionUsage, self._get( - f"/subscriptions/{subscription_id}/usage", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ - "billable_metric_id": billable_metric_id, - "first_dimension_key": first_dimension_key, - "first_dimension_value": first_dimension_value, - "granularity": granularity, - "group_by": group_by, - "second_dimension_key": second_dimension_key, - "second_dimension_value": second_dimension_value, - "timeframe_end": timeframe_end, - "timeframe_start": timeframe_start, - "view_mode": view_mode, - }, subscription_fetch_usage_params.SubscriptionFetchUsageParams)), - cast_to=cast(Any, SubscriptionUsage), # Union types cannot be passed in as arguments in the type system - )) - - def price_intervals(self, - subscription_id: str, - *, - add: Iterable[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN, - add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | NotGiven = NOT_GIVEN, - edit: Iterable[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN, - edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") + return cast( + SubscriptionUsage, + self._get( + f"/subscriptions/{subscription_id}/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "billable_metric_id": billable_metric_id, + "first_dimension_key": first_dimension_key, + "first_dimension_value": first_dimension_value, + "granularity": granularity, + "group_by": group_by, + "second_dimension_key": second_dimension_key, + "second_dimension_value": second_dimension_value, + "timeframe_end": timeframe_end, + "timeframe_start": timeframe_start, + "view_mode": view_mode, + }, + subscription_fetch_usage_params.SubscriptionFetchUsageParams, + ), + ), + cast_to=cast(Any, SubscriptionUsage), # Union types cannot be passed in as arguments in the type system + ), + ) + + def price_intervals( + self, + subscription_id: str, + *, + add: Iterable[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN, + add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | NotGiven = NOT_GIVEN, + edit: Iterable[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN, + edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint is used to add and edit subscription [price intervals](../reference/price-interval). By making modifications to a @@ -1291,43 +1349,54 @@ def price_intervals(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=maybe_transform({ - "add": add, - "add_adjustments": add_adjustments, - "edit": edit, - "edit_adjustments": edit_adjustments, - }, subscription_price_intervals_params.SubscriptionPriceIntervalsParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=maybe_transform( + { + "add": add, + "add_adjustments": add_adjustments, + "edit": edit, + "edit_adjustments": edit_adjustments, + }, + subscription_price_intervals_params.SubscriptionPriceIntervalsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def schedule_plan_change(self, - subscription_id: str, - *, - change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], - align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] | NotGiven = NOT_GIVEN, - change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, - credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, - external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, - initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, - invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, - per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, - plan_id: Optional[str] | NotGiven = NOT_GIVEN, - price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + def schedule_plan_change( + self, + subscription_id: str, + *, + change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], + align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] + | NotGiven = NOT_GIVEN, + change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, + credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, + external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, + initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, + invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, + per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, + plan_id: Optional[str] | NotGiven = NOT_GIVEN, + price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]] + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """This endpoint can be used to change the plan on an existing subscription. It @@ -1415,40 +1484,49 @@ def schedule_plan_change(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=maybe_transform({ - "change_option": change_option, - "align_billing_with_plan_change_date": align_billing_with_plan_change_date, - "billing_cycle_alignment": billing_cycle_alignment, - "change_date": change_date, - "coupon_redemption_code": coupon_redemption_code, - "credits_overage_rate": credits_overage_rate, - "external_plan_id": external_plan_id, - "initial_phase_order": initial_phase_order, - "invoicing_threshold": invoicing_threshold, - "per_credit_overage_amount": per_credit_overage_amount, - "plan_id": plan_id, - "price_overrides": price_overrides, - }, subscription_schedule_plan_change_params.SubscriptionSchedulePlanChangeParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=maybe_transform( + { + "change_option": change_option, + "align_billing_with_plan_change_date": align_billing_with_plan_change_date, + "billing_cycle_alignment": billing_cycle_alignment, + "change_date": change_date, + "coupon_redemption_code": coupon_redemption_code, + "credits_overage_rate": credits_overage_rate, + "external_plan_id": external_plan_id, + "initial_phase_order": initial_phase_order, + "invoicing_threshold": invoicing_threshold, + "per_credit_overage_amount": per_credit_overage_amount, + "plan_id": plan_id, + "price_overrides": price_overrides, + }, + subscription_schedule_plan_change_params.SubscriptionSchedulePlanChangeParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def trigger_phase(self, - subscription_id: str, - *, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + def trigger_phase( + self, + subscription_id: str, + *, + effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ Manually trigger a phase, effective the given date (or the current time, if not specified). @@ -1468,28 +1546,34 @@ def trigger_phase(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=maybe_transform({ - "effective_date": effective_date - }, subscription_trigger_phase_params.SubscriptionTriggerPhaseParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=maybe_transform( + {"effective_date": effective_date}, subscription_trigger_phase_params.SubscriptionTriggerPhaseParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def unschedule_cancellation(self, - subscription_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + def unschedule_cancellation( + self, + subscription_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to unschedule any pending cancellations for a subscription. @@ -1510,31 +1594,38 @@ def unschedule_cancellation(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def unschedule_fixed_fee_quantity_updates(self, - subscription_id: str, - *, - price_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + def unschedule_fixed_fee_quantity_updates( + self, + subscription_id: str, + *, + price_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to clear scheduled updates to the quantity for a fixed fee. - If there are no updates scheduled, this endpoint is a no-op. + If there are no updates scheduled, a request validation error will be returned + with a 400 status code. Args: price_id: Price for which the updates should be cleared. Must be a fixed fee. @@ -1550,28 +1641,35 @@ def unschedule_fixed_fee_quantity_updates(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=maybe_transform({ - "price_id": price_id - }, subscription_unschedule_fixed_fee_quantity_updates_params.SubscriptionUnscheduleFixedFeeQuantityUpdatesParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=maybe_transform( + {"price_id": price_id}, + subscription_unschedule_fixed_fee_quantity_updates_params.SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def unschedule_pending_plan_changes(self, - subscription_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + def unschedule_pending_plan_changes( + self, + subscription_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to unschedule any pending plan changes on an existing subscription. @@ -1588,29 +1686,35 @@ def unschedule_pending_plan_changes(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def update_fixed_fee_quantity(self, - subscription_id: str, - *, - price_id: str, - quantity: float, - change_option: Literal["immediate", "upcoming_invoice", "effective_date"] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + def update_fixed_fee_quantity( + self, + subscription_id: str, + *, + price_id: str, + quantity: float, + change_option: Literal["immediate", "upcoming_invoice", "effective_date"] | NotGiven = NOT_GIVEN, + effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to update the quantity for a fixed fee. @@ -1649,21 +1753,29 @@ def update_fixed_fee_quantity(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=maybe_transform({ - "price_id": price_id, - "quantity": quantity, - "change_option": change_option, - "effective_date": effective_date, - }, subscription_update_fixed_fee_quantity_params.SubscriptionUpdateFixedFeeQuantityParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=maybe_transform( + { + "price_id": price_id, + "quantity": quantity, + "change_option": change_option, + "effective_date": effective_date, + }, + subscription_update_fixed_fee_quantity_params.SubscriptionUpdateFixedFeeQuantityParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) + class AsyncSubscriptions(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncSubscriptionsWithRawResponse: @@ -1673,35 +1785,39 @@ def with_raw_response(self) -> AsyncSubscriptionsWithRawResponse: def with_streaming_response(self) -> AsyncSubscriptionsWithStreamingResponse: return AsyncSubscriptionsWithStreamingResponse(self) - async def create(self, - *, - align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, - auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - aws_region: Optional[str] | NotGiven = NOT_GIVEN, - coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, - credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, - customer_id: Optional[str] | NotGiven = NOT_GIVEN, - default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, - end_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - external_marketplace: Optional[Literal["google", "aws", "azure"]] | NotGiven = NOT_GIVEN, - external_marketplace_reporting_id: Optional[str] | NotGiven = NOT_GIVEN, - external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, - initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, - invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, - net_terms: Optional[int] | NotGiven = NOT_GIVEN, - per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, - plan_id: Optional[str] | NotGiven = NOT_GIVEN, - price_overrides: Optional[Iterable[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN, - start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + async def create( + self, + *, + align_billing_with_subscription_start_date: bool | NotGiven = NOT_GIVEN, + auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + aws_region: Optional[str] | NotGiven = NOT_GIVEN, + billing_cycle_anchor_configuration: Optional[subscription_create_params.BillingCycleAnchorConfiguration] + | NotGiven = NOT_GIVEN, + coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, + credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, + customer_id: Optional[str] | NotGiven = NOT_GIVEN, + default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, + end_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, + external_marketplace: Optional[Literal["google", "aws", "azure"]] | NotGiven = NOT_GIVEN, + external_marketplace_reporting_id: Optional[str] | NotGiven = NOT_GIVEN, + external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, + initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, + invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + net_terms: Optional[int] | NotGiven = NOT_GIVEN, + per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, + plan_id: Optional[str] | NotGiven = NOT_GIVEN, + price_overrides: Optional[Iterable[subscription_create_params.PriceOverride]] | NotGiven = NOT_GIVEN, + start_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """A subscription represents the purchase of a plan by a customer. The customer is @@ -2120,47 +2236,59 @@ async def create(self, """ return await self._post( "/subscriptions", - body=await async_maybe_transform({ - "align_billing_with_subscription_start_date": align_billing_with_subscription_start_date, - "auto_collection": auto_collection, - "aws_region": aws_region, - "coupon_redemption_code": coupon_redemption_code, - "credits_overage_rate": credits_overage_rate, - "customer_id": customer_id, - "default_invoice_memo": default_invoice_memo, - "end_date": end_date, - "external_customer_id": external_customer_id, - "external_marketplace": external_marketplace, - "external_marketplace_reporting_id": external_marketplace_reporting_id, - "external_plan_id": external_plan_id, - "initial_phase_order": initial_phase_order, - "invoicing_threshold": invoicing_threshold, - "metadata": metadata, - "net_terms": net_terms, - "per_credit_overage_amount": per_credit_overage_amount, - "plan_id": plan_id, - "price_overrides": price_overrides, - "start_date": start_date, - }, subscription_create_params.SubscriptionCreateParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=await async_maybe_transform( + { + "align_billing_with_subscription_start_date": align_billing_with_subscription_start_date, + "auto_collection": auto_collection, + "aws_region": aws_region, + "billing_cycle_anchor_configuration": billing_cycle_anchor_configuration, + "coupon_redemption_code": coupon_redemption_code, + "credits_overage_rate": credits_overage_rate, + "customer_id": customer_id, + "default_invoice_memo": default_invoice_memo, + "end_date": end_date, + "external_customer_id": external_customer_id, + "external_marketplace": external_marketplace, + "external_marketplace_reporting_id": external_marketplace_reporting_id, + "external_plan_id": external_plan_id, + "initial_phase_order": initial_phase_order, + "invoicing_threshold": invoicing_threshold, + "metadata": metadata, + "net_terms": net_terms, + "per_credit_overage_amount": per_credit_overage_amount, + "plan_id": plan_id, + "price_overrides": price_overrides, + "start_date": start_date, + }, + subscription_create_params.SubscriptionCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - async def update(self, - subscription_id: str, - *, - auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, - default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, - invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, - net_terms: Optional[int] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + async def update( + self, + subscription_id: str, + *, + auto_collection: Optional[bool] | NotGiven = NOT_GIVEN, + default_invoice_memo: Optional[str] | NotGiven = NOT_GIVEN, + invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, + net_terms: Optional[int] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to update the `metadata`, `net terms`, `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties @@ -2198,41 +2326,48 @@ async def update(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._put( f"/subscriptions/{subscription_id}", - body=await async_maybe_transform({ - "auto_collection": auto_collection, - "default_invoice_memo": default_invoice_memo, - "invoicing_threshold": invoicing_threshold, - "metadata": metadata, - "net_terms": net_terms, - }, subscription_update_params.SubscriptionUpdateParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=await async_maybe_transform( + { + "auto_collection": auto_collection, + "default_invoice_memo": default_invoice_memo, + "invoicing_threshold": invoicing_threshold, + "metadata": metadata, + "net_terms": net_terms, + }, + subscription_update_params.SubscriptionUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - def list(self, - *, - created_at_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_at_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - cursor: Optional[str] | NotGiven = NOT_GIVEN, - query_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - query_customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, - query_external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, - query_external_customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - status: Optional[Literal["active", "ended", "upcoming"]] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> AsyncPaginator[Subscription, AsyncPage[Subscription]]: + def list( + self, + *, + created_at_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + created_at_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + cursor: Optional[str] | NotGiven = NOT_GIVEN, + customer_id: Optional[List[str]] | NotGiven = NOT_GIVEN, + external_customer_id: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + status: Optional[Literal["active", "ended", "upcoming"]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[Subscription, AsyncPage[Subscription]]: """ This endpoint returns a list of all subscriptions for an account as a [paginated](../reference/pagination) list, ordered starting from the most @@ -2260,33 +2395,44 @@ def list(self, """ return self._get_api_list( "/subscriptions", - page = AsyncPage[Subscription], - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ - "created_at_gt": created_at_gt, - "created_at_gte": created_at_gte, - "created_at_lt": created_at_lt, - "created_at_lte": created_at_lte, - "cursor": cursor, - "customer_id": query_customer_id, - "external_customer_id": query_external_customer_id, - "limit": limit, - "status": status, - }, subscription_list_params.SubscriptionListParams)), + page=AsyncPage[Subscription], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "created_at_gt": created_at_gt, + "created_at_gte": created_at_gte, + "created_at_lt": created_at_lt, + "created_at_lte": created_at_lte, + "cursor": cursor, + "customer_id": customer_id, + "external_customer_id": external_customer_id, + "limit": limit, + "status": status, + }, + subscription_list_params.SubscriptionListParams, + ), + ), model=Subscription, ) - async def cancel(self, - subscription_id: str, - *, - cancel_option: Literal["end_of_subscription_term", "immediate", "requested_date"], - cancellation_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + async def cancel( + self, + subscription_id: str, + *, + cancel_option: Literal["end_of_subscription_term", "immediate", "requested_date"], + cancellation_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """This endpoint can be used to cancel an existing subscription. It returns the @@ -2368,28 +2514,37 @@ async def cancel(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=await async_maybe_transform({ - "cancel_option": cancel_option, - "cancellation_date": cancellation_date, - }, subscription_cancel_params.SubscriptionCancelParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=await async_maybe_transform( + { + "cancel_option": cancel_option, + "cancellation_date": cancellation_date, + }, + subscription_cancel_params.SubscriptionCancelParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - async def fetch(self, - subscription_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> Subscription: + async def fetch( + self, + subscription_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Subscription: """ This endpoint is used to fetch a [Subscription](../guides/concepts#subscription) given an identifier. @@ -2404,28 +2559,30 @@ async def fetch(self, timeout: Override the client-level default timeout for this request, in seconds """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") return await self._get( f"/subscriptions/{subscription_id}", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), cast_to=Subscription, ) - async def fetch_costs(self, - subscription_id: str, - *, - currency: Optional[str] | NotGiven = NOT_GIVEN, - timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> SubscriptionFetchCostsResponse: + async def fetch_costs( + self, + subscription_id: str, + *, + currency: Optional[str] | NotGiven = NOT_GIVEN, + timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SubscriptionFetchCostsResponse: """ This endpoint is used to fetch a day-by-day snapshot of a subscription's costs in Orb, calculated by applying pricing information to the underlying usage (see @@ -2459,35 +2616,44 @@ async def fetch_costs(self, timeout: Override the client-level default timeout for this request, in seconds """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ - "currency": currency, - "timeframe_end": timeframe_end, - "timeframe_start": timeframe_start, - "view_mode": view_mode, - }, subscription_fetch_costs_params.SubscriptionFetchCostsParams)), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "currency": currency, + "timeframe_end": timeframe_end, + "timeframe_start": timeframe_start, + "view_mode": view_mode, + }, + subscription_fetch_costs_params.SubscriptionFetchCostsParams, + ), + ), cast_to=SubscriptionFetchCostsResponse, ) - def fetch_schedule(self, - subscription_id: str, - *, - cursor: Optional[str] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - start_date_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - start_date_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - start_date_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - start_date_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> AsyncPaginator[SubscriptionFetchScheduleResponse, AsyncPage[SubscriptionFetchScheduleResponse]]: + def fetch_schedule( + self, + subscription_id: str, + *, + cursor: Optional[str] | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + start_date_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + start_date_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + start_date_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + start_date_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[SubscriptionFetchScheduleResponse, AsyncPage[SubscriptionFetchScheduleResponse]]: """ This endpoint returns a [paginated](../reference/pagination) list of all plans associated with a subscription along with their start and end dates. This list @@ -2509,42 +2675,51 @@ def fetch_schedule(self, timeout: Override the client-level default timeout for this request, in seconds """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - page = AsyncPage[SubscriptionFetchScheduleResponse], - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform({ - "cursor": cursor, - "limit": limit, - "start_date_gt": start_date_gt, - "start_date_gte": start_date_gte, - "start_date_lt": start_date_lt, - "start_date_lte": start_date_lte, - }, subscription_fetch_schedule_params.SubscriptionFetchScheduleParams)), + page=AsyncPage[SubscriptionFetchScheduleResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "limit": limit, + "start_date_gt": start_date_gt, + "start_date_gte": start_date_gte, + "start_date_lt": start_date_lt, + "start_date_lte": start_date_lte, + }, + subscription_fetch_schedule_params.SubscriptionFetchScheduleParams, + ), + ), model=SubscriptionFetchScheduleResponse, ) - async def fetch_usage(self, - subscription_id: str, - *, - billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, - first_dimension_key: Optional[str] | NotGiven = NOT_GIVEN, - first_dimension_value: Optional[str] | NotGiven = NOT_GIVEN, - granularity: Optional[Literal["day"]] | NotGiven = NOT_GIVEN, - group_by: Optional[str] | NotGiven = NOT_GIVEN, - second_dimension_key: Optional[str] | NotGiven = NOT_GIVEN, - second_dimension_value: Optional[str] | NotGiven = NOT_GIVEN, - timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,) -> SubscriptionUsage: + async def fetch_usage( + self, + subscription_id: str, + *, + billable_metric_id: Optional[str] | NotGiven = NOT_GIVEN, + first_dimension_key: Optional[str] | NotGiven = NOT_GIVEN, + first_dimension_value: Optional[str] | NotGiven = NOT_GIVEN, + granularity: Optional[Literal["day"]] | NotGiven = NOT_GIVEN, + group_by: Optional[str] | NotGiven = NOT_GIVEN, + second_dimension_key: Optional[str] | NotGiven = NOT_GIVEN, + second_dimension_value: Optional[str] | NotGiven = NOT_GIVEN, + timeframe_end: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + timeframe_start: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + view_mode: Optional[Literal["periodic", "cumulative"]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SubscriptionUsage: """This endpoint is used to fetch a subscription's usage in Orb. Especially when @@ -2769,40 +2944,52 @@ async def fetch_usage(self, timeout: Override the client-level default timeout for this request, in seconds """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) - return cast(SubscriptionUsage, await self._get( - f"/subscriptions/{subscription_id}/usage", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({ - "billable_metric_id": billable_metric_id, - "first_dimension_key": first_dimension_key, - "first_dimension_value": first_dimension_value, - "granularity": granularity, - "group_by": group_by, - "second_dimension_key": second_dimension_key, - "second_dimension_value": second_dimension_value, - "timeframe_end": timeframe_end, - "timeframe_start": timeframe_start, - "view_mode": view_mode, - }, subscription_fetch_usage_params.SubscriptionFetchUsageParams)), - cast_to=cast(Any, SubscriptionUsage), # Union types cannot be passed in as arguments in the type system - )) - - async def price_intervals(self, - subscription_id: str, - *, - add: Iterable[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN, - add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | NotGiven = NOT_GIVEN, - edit: Iterable[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN, - edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") + return cast( + SubscriptionUsage, + await self._get( + f"/subscriptions/{subscription_id}/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "billable_metric_id": billable_metric_id, + "first_dimension_key": first_dimension_key, + "first_dimension_value": first_dimension_value, + "granularity": granularity, + "group_by": group_by, + "second_dimension_key": second_dimension_key, + "second_dimension_value": second_dimension_value, + "timeframe_end": timeframe_end, + "timeframe_start": timeframe_start, + "view_mode": view_mode, + }, + subscription_fetch_usage_params.SubscriptionFetchUsageParams, + ), + ), + cast_to=cast(Any, SubscriptionUsage), # Union types cannot be passed in as arguments in the type system + ), + ) + + async def price_intervals( + self, + subscription_id: str, + *, + add: Iterable[subscription_price_intervals_params.Add] | NotGiven = NOT_GIVEN, + add_adjustments: Iterable[subscription_price_intervals_params.AddAdjustment] | NotGiven = NOT_GIVEN, + edit: Iterable[subscription_price_intervals_params.Edit] | NotGiven = NOT_GIVEN, + edit_adjustments: Iterable[subscription_price_intervals_params.EditAdjustment] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint is used to add and edit subscription [price intervals](../reference/price-interval). By making modifications to a @@ -2897,43 +3084,54 @@ async def price_intervals(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=await async_maybe_transform({ - "add": add, - "add_adjustments": add_adjustments, - "edit": edit, - "edit_adjustments": edit_adjustments, - }, subscription_price_intervals_params.SubscriptionPriceIntervalsParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=await async_maybe_transform( + { + "add": add, + "add_adjustments": add_adjustments, + "edit": edit, + "edit_adjustments": edit_adjustments, + }, + subscription_price_intervals_params.SubscriptionPriceIntervalsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - async def schedule_plan_change(self, - subscription_id: str, - *, - change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], - align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, - billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] | NotGiven = NOT_GIVEN, - change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, - credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, - external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, - initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, - invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, - per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, - plan_id: Optional[str] | NotGiven = NOT_GIVEN, - price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + async def schedule_plan_change( + self, + subscription_id: str, + *, + change_option: Literal["requested_date", "end_of_subscription_term", "immediate"], + align_billing_with_plan_change_date: Optional[bool] | NotGiven = NOT_GIVEN, + billing_cycle_alignment: Optional[Literal["unchanged", "plan_change_date", "start_of_month"]] + | NotGiven = NOT_GIVEN, + change_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + coupon_redemption_code: Optional[str] | NotGiven = NOT_GIVEN, + credits_overage_rate: Optional[float] | NotGiven = NOT_GIVEN, + external_plan_id: Optional[str] | NotGiven = NOT_GIVEN, + initial_phase_order: Optional[int] | NotGiven = NOT_GIVEN, + invoicing_threshold: Optional[str] | NotGiven = NOT_GIVEN, + per_credit_overage_amount: Optional[float] | NotGiven = NOT_GIVEN, + plan_id: Optional[str] | NotGiven = NOT_GIVEN, + price_overrides: Optional[Iterable[subscription_schedule_plan_change_params.PriceOverride]] + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """This endpoint can be used to change the plan on an existing subscription. It @@ -3021,40 +3219,49 @@ async def schedule_plan_change(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=await async_maybe_transform({ - "change_option": change_option, - "align_billing_with_plan_change_date": align_billing_with_plan_change_date, - "billing_cycle_alignment": billing_cycle_alignment, - "change_date": change_date, - "coupon_redemption_code": coupon_redemption_code, - "credits_overage_rate": credits_overage_rate, - "external_plan_id": external_plan_id, - "initial_phase_order": initial_phase_order, - "invoicing_threshold": invoicing_threshold, - "per_credit_overage_amount": per_credit_overage_amount, - "plan_id": plan_id, - "price_overrides": price_overrides, - }, subscription_schedule_plan_change_params.SubscriptionSchedulePlanChangeParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=await async_maybe_transform( + { + "change_option": change_option, + "align_billing_with_plan_change_date": align_billing_with_plan_change_date, + "billing_cycle_alignment": billing_cycle_alignment, + "change_date": change_date, + "coupon_redemption_code": coupon_redemption_code, + "credits_overage_rate": credits_overage_rate, + "external_plan_id": external_plan_id, + "initial_phase_order": initial_phase_order, + "invoicing_threshold": invoicing_threshold, + "per_credit_overage_amount": per_credit_overage_amount, + "plan_id": plan_id, + "price_overrides": price_overrides, + }, + subscription_schedule_plan_change_params.SubscriptionSchedulePlanChangeParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - async def trigger_phase(self, - subscription_id: str, - *, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + async def trigger_phase( + self, + subscription_id: str, + *, + effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ Manually trigger a phase, effective the given date (or the current time, if not specified). @@ -3074,28 +3281,34 @@ async def trigger_phase(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=await async_maybe_transform({ - "effective_date": effective_date - }, subscription_trigger_phase_params.SubscriptionTriggerPhaseParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=await async_maybe_transform( + {"effective_date": effective_date}, subscription_trigger_phase_params.SubscriptionTriggerPhaseParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - async def unschedule_cancellation(self, - subscription_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + async def unschedule_cancellation( + self, + subscription_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to unschedule any pending cancellations for a subscription. @@ -3116,31 +3329,38 @@ async def unschedule_cancellation(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - async def unschedule_fixed_fee_quantity_updates(self, - subscription_id: str, - *, - price_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + async def unschedule_fixed_fee_quantity_updates( + self, + subscription_id: str, + *, + price_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to clear scheduled updates to the quantity for a fixed fee. - If there are no updates scheduled, this endpoint is a no-op. + If there are no updates scheduled, a request validation error will be returned + with a 400 status code. Args: price_id: Price for which the updates should be cleared. Must be a fixed fee. @@ -3156,28 +3376,35 @@ async def unschedule_fixed_fee_quantity_updates(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=await async_maybe_transform({ - "price_id": price_id - }, subscription_unschedule_fixed_fee_quantity_updates_params.SubscriptionUnscheduleFixedFeeQuantityUpdatesParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=await async_maybe_transform( + {"price_id": price_id}, + subscription_unschedule_fixed_fee_quantity_updates_params.SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - async def unschedule_pending_plan_changes(self, - subscription_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + async def unschedule_pending_plan_changes( + self, + subscription_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to unschedule any pending plan changes on an existing subscription. @@ -3194,29 +3421,35 @@ async def unschedule_pending_plan_changes(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) - async def update_fixed_fee_quantity(self, - subscription_id: str, - *, - price_id: str, - quantity: float, - change_option: Literal["immediate", "upcoming_invoice", "effective_date"] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - idempotency_key: str | None = None,) -> Subscription: + async def update_fixed_fee_quantity( + self, + subscription_id: str, + *, + price_id: str, + quantity: float, + change_option: Literal["immediate", "upcoming_invoice", "effective_date"] | NotGiven = NOT_GIVEN, + effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> Subscription: """ This endpoint can be used to update the quantity for a fixed fee. @@ -3255,21 +3488,29 @@ async def update_fixed_fee_quantity(self, idempotency_key: Specify a custom idempotency key for this request """ if not subscription_id: - raise ValueError( - f'Expected a non-empty value for `subscription_id` but received {subscription_id!r}' - ) + 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", - body=await async_maybe_transform({ - "price_id": price_id, - "quantity": quantity, - "change_option": change_option, - "effective_date": effective_date, - }, subscription_update_fixed_fee_quantity_params.SubscriptionUpdateFixedFeeQuantityParams), - options=make_request_options(extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key), + body=await async_maybe_transform( + { + "price_id": price_id, + "quantity": quantity, + "change_option": change_option, + "effective_date": effective_date, + }, + subscription_update_fixed_fee_quantity_params.SubscriptionUpdateFixedFeeQuantityParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), cast_to=Subscription, ) + class SubscriptionsWithRawResponse: def __init__(self, subscriptions: Subscriptions) -> None: self._subscriptions = subscriptions @@ -3320,6 +3561,7 @@ def __init__(self, subscriptions: Subscriptions) -> None: subscriptions.update_fixed_fee_quantity, ) + class AsyncSubscriptionsWithRawResponse: def __init__(self, subscriptions: AsyncSubscriptions) -> None: self._subscriptions = subscriptions @@ -3370,6 +3612,7 @@ def __init__(self, subscriptions: AsyncSubscriptions) -> None: subscriptions.update_fixed_fee_quantity, ) + class SubscriptionsWithStreamingResponse: def __init__(self, subscriptions: Subscriptions) -> None: self._subscriptions = subscriptions @@ -3420,6 +3663,7 @@ def __init__(self, subscriptions: Subscriptions) -> None: subscriptions.update_fixed_fee_quantity, ) + class AsyncSubscriptionsWithStreamingResponse: def __init__(self, subscriptions: AsyncSubscriptions) -> None: self._subscriptions = subscriptions @@ -3468,4 +3712,4 @@ def __init__(self, subscriptions: AsyncSubscriptions) -> None: ) self.update_fixed_fee_quantity = async_to_streamed_response_wrapper( subscriptions.update_fixed_fee_quantity, - ) \ No newline at end of file + ) diff --git a/src/orb/resources/top_level.py b/src/orb/resources/top_level.py index dc76e888..4968a63a 100755 --- a/src/orb/resources/top_level.py +++ b/src/orb/resources/top_level.py @@ -4,23 +4,13 @@ import httpx -from .._compat import cached_property - -from ..types.top_level_ping_response import TopLevelPingResponse - -from .._base_client import make_request_options - -from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper - from .. import _legacy_response - -import warnings -from typing import TYPE_CHECKING, Optional, Union, List, Dict, Any, Mapping, cast, overload -from typing_extensions import Literal -from .._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, strip_not_given -from .._types import NotGiven, Timeout, Headers, NoneType, Query, Body, NOT_GIVEN, FileTypes, BinaryResponseContent +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource -from ..types import shared_params +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper +from .._base_client import make_request_options +from ..types.top_level_ping_response import TopLevelPingResponse __all__ = ["TopLevel", "AsyncTopLevel"] diff --git a/src/orb/types/__init__.py b/src/orb/types/__init__.py index 9cec085d..3c43ed44 100755 --- a/src/orb/types/__init__.py +++ b/src/orb/types/__init__.py @@ -2,85 +2,85 @@ from __future__ import annotations +from .item import Item as Item +from .plan import Plan as Plan +from .alert import Alert as Alert +from .price import Price as Price +from .coupon import Coupon as Coupon from .shared import ( - BillingCycleRelativeDate as BillingCycleRelativeDate, Discount as Discount, PaginationMetadata as PaginationMetadata, + BillingCycleRelativeDate as BillingCycleRelativeDate, ) -from .top_level_ping_response import TopLevelPingResponse as TopLevelPingResponse -from .coupon import Coupon as Coupon -from .coupon_create_params import CouponCreateParams as CouponCreateParams -from .coupon_list_params import CouponListParams as CouponListParams -from .credit_note import CreditNote as CreditNote -from .credit_note_list_params import CreditNoteListParams as CreditNoteListParams -from .customer import Customer as Customer -from .customer_create_params import CustomerCreateParams as CustomerCreateParams -from .customer_update_params import CustomerUpdateParams as CustomerUpdateParams -from .customer_list_params import CustomerListParams as CustomerListParams -from .customer_update_by_external_id_params import CustomerUpdateByExternalIDParams as CustomerUpdateByExternalIDParams -from .event_update_response import EventUpdateResponse as EventUpdateResponse -from .event_deprecate_response import EventDeprecateResponse as EventDeprecateResponse -from .event_ingest_response import EventIngestResponse as EventIngestResponse -from .event_search_response import EventSearchResponse as EventSearchResponse -from .event_update_params import EventUpdateParams as EventUpdateParams -from .event_ingest_params import EventIngestParams as EventIngestParams -from .event_search_params import EventSearchParams as EventSearchParams -from .invoice_line_item_create_response import InvoiceLineItemCreateResponse as InvoiceLineItemCreateResponse -from .invoice_line_item_create_params import InvoiceLineItemCreateParams as InvoiceLineItemCreateParams from .invoice import Invoice as Invoice -from .invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse -from .invoice_create_params import InvoiceCreateParams as InvoiceCreateParams -from .invoice_update_params import InvoiceUpdateParams as InvoiceUpdateParams -from .invoice_list_params import InvoiceListParams as InvoiceListParams -from .invoice_fetch_upcoming_params import InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams -from .invoice_mark_paid_params import InvoiceMarkPaidParams as InvoiceMarkPaidParams -from .item import Item as Item +from .customer import Customer as Customer +from .credit_note import CreditNote as CreditNote +from .subscription import Subscription as Subscription +from .subscriptions import Subscriptions as Subscriptions +from .billable_metric import BillableMetric as BillableMetric +from .item_list_params import ItemListParams as ItemListParams +from .plan_list_params import PlanListParams as PlanListParams +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 .item_create_params import ItemCreateParams as ItemCreateParams from .item_update_params import ItemUpdateParams as ItemUpdateParams -from .item_list_params import ItemListParams as ItemListParams -from .billable_metric import BillableMetric as BillableMetric -from .metric_create_params import MetricCreateParams as MetricCreateParams -from .metric_update_params import MetricUpdateParams as MetricUpdateParams from .metric_list_params import MetricListParams as MetricListParams -from .plan import Plan as Plan from .plan_create_params import PlanCreateParams as PlanCreateParams from .plan_update_params import PlanUpdateParams as PlanUpdateParams -from .plan_list_params import PlanListParams as PlanListParams -from .evaluate_price_group import EvaluatePriceGroup as EvaluatePriceGroup -from .price import Price as Price -from .price_evaluate_response import PriceEvaluateResponse as PriceEvaluateResponse +from .subscription_usage import SubscriptionUsage as SubscriptionUsage +from .alert_update_params import AlertUpdateParams as AlertUpdateParams +from .event_ingest_params import EventIngestParams as EventIngestParams +from .event_search_params import EventSearchParams as EventSearchParams +from .event_update_params import EventUpdateParams as EventUpdateParams +from .invoice_list_params import InvoiceListParams as InvoiceListParams from .price_create_params import PriceCreateParams as PriceCreateParams from .price_update_params import PriceUpdateParams as PriceUpdateParams -from .price_list_params import PriceListParams as PriceListParams +from .coupon_create_params import CouponCreateParams as CouponCreateParams +from .customer_list_params import CustomerListParams as CustomerListParams +from .evaluate_price_group import EvaluatePriceGroup as EvaluatePriceGroup +from .metric_create_params import MetricCreateParams as MetricCreateParams +from .metric_update_params import MetricUpdateParams as MetricUpdateParams +from .event_ingest_response import EventIngestResponse as EventIngestResponse +from .event_search_response import EventSearchResponse as EventSearchResponse +from .event_update_response import EventUpdateResponse as EventUpdateResponse +from .invoice_create_params import InvoiceCreateParams as InvoiceCreateParams +from .invoice_update_params import InvoiceUpdateParams as InvoiceUpdateParams from .price_evaluate_params import PriceEvaluateParams as PriceEvaluateParams -from .subscription import Subscription as Subscription -from .subscription_usage import SubscriptionUsage as SubscriptionUsage -from .subscriptions import Subscriptions as Subscriptions -from .subscription_fetch_costs_response import SubscriptionFetchCostsResponse as SubscriptionFetchCostsResponse -from .subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse as SubscriptionFetchScheduleResponse -from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams -from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams +from .customer_create_params import CustomerCreateParams as CustomerCreateParams +from .customer_update_params import CustomerUpdateParams as CustomerUpdateParams +from .credit_note_list_params import CreditNoteListParams as CreditNoteListParams +from .price_evaluate_response import PriceEvaluateResponse as PriceEvaluateResponse +from .top_level_ping_response import TopLevelPingResponse as TopLevelPingResponse +from .event_deprecate_response import EventDeprecateResponse as EventDeprecateResponse +from .invoice_mark_paid_params import InvoiceMarkPaidParams as InvoiceMarkPaidParams from .subscription_list_params import SubscriptionListParams as SubscriptionListParams from .subscription_cancel_params import SubscriptionCancelParams as SubscriptionCancelParams +from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams +from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams +from .invoice_fetch_upcoming_params import InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams +from .invoice_fetch_upcoming_response import InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse +from .invoice_line_item_create_params import InvoiceLineItemCreateParams as InvoiceLineItemCreateParams from .subscription_fetch_costs_params import SubscriptionFetchCostsParams as SubscriptionFetchCostsParams -from .subscription_fetch_schedule_params import SubscriptionFetchScheduleParams as SubscriptionFetchScheduleParams from .subscription_fetch_usage_params import SubscriptionFetchUsageParams as SubscriptionFetchUsageParams +from .alert_create_for_customer_params import AlertCreateForCustomerParams as AlertCreateForCustomerParams +from .invoice_line_item_create_response import InvoiceLineItemCreateResponse as InvoiceLineItemCreateResponse +from .subscription_fetch_costs_response import SubscriptionFetchCostsResponse as SubscriptionFetchCostsResponse +from .subscription_trigger_phase_params import SubscriptionTriggerPhaseParams as SubscriptionTriggerPhaseParams +from .subscription_fetch_schedule_params import SubscriptionFetchScheduleParams as SubscriptionFetchScheduleParams from .subscription_price_intervals_params import SubscriptionPriceIntervalsParams as SubscriptionPriceIntervalsParams +from .alert_create_for_subscription_params import AlertCreateForSubscriptionParams as AlertCreateForSubscriptionParams +from .subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse as SubscriptionFetchScheduleResponse +from .customer_update_by_external_id_params import CustomerUpdateByExternalIDParams as CustomerUpdateByExternalIDParams from .subscription_schedule_plan_change_params import ( SubscriptionSchedulePlanChangeParams as SubscriptionSchedulePlanChangeParams, ) -from .subscription_trigger_phase_params import SubscriptionTriggerPhaseParams as SubscriptionTriggerPhaseParams -from .subscription_unschedule_fixed_fee_quantity_updates_params import ( - SubscriptionUnscheduleFixedFeeQuantityUpdatesParams as SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, +from .alert_create_for_external_customer_params import ( + AlertCreateForExternalCustomerParams as AlertCreateForExternalCustomerParams, ) from .subscription_update_fixed_fee_quantity_params import ( SubscriptionUpdateFixedFeeQuantityParams as SubscriptionUpdateFixedFeeQuantityParams, ) -from .alert import Alert as Alert -from .alert_update_params import AlertUpdateParams as AlertUpdateParams -from .alert_list_params import AlertListParams as AlertListParams -from .alert_create_for_customer_params import AlertCreateForCustomerParams as AlertCreateForCustomerParams -from .alert_create_for_external_customer_params import ( - AlertCreateForExternalCustomerParams as AlertCreateForExternalCustomerParams, +from .subscription_unschedule_fixed_fee_quantity_updates_params import ( + SubscriptionUnscheduleFixedFeeQuantityUpdatesParams as SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, ) -from .alert_create_for_subscription_params import AlertCreateForSubscriptionParams as AlertCreateForSubscriptionParams diff --git a/src/orb/types/alert.py b/src/orb/types/alert.py index 2d8df205..7a7dd4b2 100755 --- a/src/orb/types/alert.py +++ b/src/orb/types/alert.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - +from typing import Dict, List, Optional from datetime import datetime - -from typing import Optional, Dict, List - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .._models import BaseModel __all__ = ["Alert", "Threshold"] diff --git a/src/orb/types/alert_create_for_customer_params.py b/src/orb/types/alert_create_for_customer_params.py index 4381f398..5eeec557 100755 --- a/src/orb/types/alert_create_for_customer_params.py +++ b/src/orb/types/alert_create_for_customer_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal - -from typing import Optional, Iterable - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Iterable, Optional +from typing_extensions import Literal, Required, TypedDict __all__ = ["AlertCreateForCustomerParams", "Threshold"] diff --git a/src/orb/types/alert_create_for_external_customer_params.py b/src/orb/types/alert_create_for_external_customer_params.py index c59ea353..6732f61c 100755 --- a/src/orb/types/alert_create_for_external_customer_params.py +++ b/src/orb/types/alert_create_for_external_customer_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal - -from typing import Optional, Iterable - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Iterable, Optional +from typing_extensions import Literal, Required, TypedDict __all__ = ["AlertCreateForExternalCustomerParams", "Threshold"] diff --git a/src/orb/types/alert_create_for_subscription_params.py b/src/orb/types/alert_create_for_subscription_params.py index be320a26..767408dc 100755 --- a/src/orb/types/alert_create_for_subscription_params.py +++ b/src/orb/types/alert_create_for_subscription_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal - from typing import Iterable, Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing_extensions import Literal, Required, TypedDict __all__ = ["AlertCreateForSubscriptionParams", "Threshold"] diff --git a/src/orb/types/alert_list_params.py b/src/orb/types/alert_list_params.py index 25908ddb..ccd37423 100755 --- a/src/orb/types/alert_list_params.py +++ b/src/orb/types/alert_list_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated - from typing import Union, Optional - from datetime import datetime +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["AlertListParams"] diff --git a/src/orb/types/alert_update_params.py b/src/orb/types/alert_update_params.py index a9dab69f..6be6b1d2 100755 --- a/src/orb/types/alert_update_params.py +++ b/src/orb/types/alert_update_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required - from typing import Iterable - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing_extensions import Required, TypedDict __all__ = ["AlertUpdateParams", "Threshold"] diff --git a/src/orb/types/billable_metric.py b/src/orb/types/billable_metric.py index ef13a797..ac70464c 100755 --- a/src/orb/types/billable_metric.py +++ b/src/orb/types/billable_metric.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing import Optional, Dict - -from .item import Item - +from typing import Dict, Optional from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .item import Item +from .._models import BaseModel __all__ = ["BillableMetric"] diff --git a/src/orb/types/coupon.py b/src/orb/types/coupon.py index 1575c0e1..5003327d 100755 --- a/src/orb/types/coupon.py +++ b/src/orb/types/coupon.py @@ -1,18 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing import List, Optional - -from typing_extensions import Literal, TypeAlias, Annotated - -from .._utils import PropertyInfo - +from typing import List, Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .._utils import PropertyInfo +from .._models import BaseModel __all__ = ["Coupon", "Discount", "DiscountPercentageDiscount", "DiscountAmountDiscount"] diff --git a/src/orb/types/coupon_create_params.py b/src/orb/types/coupon_create_params.py index 34b693e4..50746cd1 100755 --- a/src/orb/types/coupon_create_params.py +++ b/src/orb/types/coupon_create_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal, TypeAlias - -from typing import Optional, Union - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict __all__ = ["CouponCreateParams", "Discount", "DiscountNewCouponPercentageDiscount", "DiscountNewCouponAmountDiscount"] diff --git a/src/orb/types/coupon_list_params.py b/src/orb/types/coupon_list_params.py index e84c560f..7f70e5ad 100755 --- a/src/orb/types/coupon_list_params.py +++ b/src/orb/types/coupon_list_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["CouponListParams"] diff --git a/src/orb/types/coupons/subscription_list_params.py b/src/orb/types/coupons/subscription_list_params.py index 5bd4531b..6d948e53 100755 --- a/src/orb/types/coupons/subscription_list_params.py +++ b/src/orb/types/coupons/subscription_list_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["SubscriptionListParams"] diff --git a/src/orb/types/credit_note.py b/src/orb/types/credit_note.py index e99ff0f3..d883c425 100755 --- a/src/orb/types/credit_note.py +++ b/src/orb/types/credit_note.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing import Optional, List - -from typing_extensions import Literal - +from typing import List, Optional from datetime import datetime - -from typing import Optional, Union, List, Dict, Any from typing_extensions import Literal -from pydantic import Field as FieldInfo + +from .._models import BaseModel __all__ = [ "CreditNote", diff --git a/src/orb/types/credit_note_list_params.py b/src/orb/types/credit_note_list_params.py index 7345fdd6..fa1314af 100755 --- a/src/orb/types/credit_note_list_params.py +++ b/src/orb/types/credit_note_list_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["CreditNoteListParams"] diff --git a/src/orb/types/customer.py b/src/orb/types/customer.py index 5f322439..679a29a4 100755 --- a/src/orb/types/customer.py +++ b/src/orb/types/customer.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing import Optional, List, Dict - -from typing_extensions import Literal - +from typing import Dict, List, Optional from datetime import datetime - -from typing import Optional, Union, List, Dict, Any from typing_extensions import Literal -from pydantic import Field as FieldInfo + +from .._models import BaseModel __all__ = [ "Customer", diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py index 3dbdf9da..24f380f9 100755 --- a/src/orb/types/customer_create_params.py +++ b/src/orb/types/customer_create_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal - -from typing import Optional, List, Dict, Iterable - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Dict, List, Iterable, Optional +from typing_extensions import Literal, Required, TypedDict __all__ = [ "CustomerCreateParams", diff --git a/src/orb/types/customer_list_params.py b/src/orb/types/customer_list_params.py index a1832df0..518ee766 100755 --- a/src/orb/types/customer_list_params.py +++ b/src/orb/types/customer_list_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated - from typing import Union, Optional - from datetime import datetime +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["CustomerListParams"] 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 38bbf976..66f25cb3 100755 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Required - -from typing import Optional, List, Dict, Iterable - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Dict, List, Iterable, Optional +from typing_extensions import Literal, Required, TypedDict __all__ = [ "CustomerUpdateByExternalIDParams", diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index e9d719a2..b36781be 100755 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Required - -from typing import Optional, List, Dict, Iterable - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Dict, List, Iterable, Optional +from typing_extensions import Literal, Required, TypedDict __all__ = [ "CustomerUpdateParams", diff --git a/src/orb/types/customers/__init__.py b/src/orb/types/customers/__init__.py index e98ad3fd..ba43a9b2 100755 --- a/src/orb/types/customers/__init__.py +++ b/src/orb/types/customers/__init__.py @@ -2,15 +2,15 @@ from __future__ import annotations -from .cost_list_response import CostListResponse as CostListResponse -from .cost_list_by_external_id_response import CostListByExternalIDResponse as CostListByExternalIDResponse from .cost_list_params import CostListParams as CostListParams -from .cost_list_by_external_id_params import CostListByExternalIDParams as CostListByExternalIDParams -from .credit_list_response import CreditListResponse as CreditListResponse -from .credit_list_by_external_id_response import CreditListByExternalIDResponse as CreditListByExternalIDResponse +from .cost_list_response import CostListResponse as CostListResponse from .credit_list_params import CreditListParams as CreditListParams +from .credit_list_response import CreditListResponse as CreditListResponse +from .balance_transaction_list_params import BalanceTransactionListParams as BalanceTransactionListParams +from .cost_list_by_external_id_params import CostListByExternalIDParams as CostListByExternalIDParams +from .balance_transaction_create_params import BalanceTransactionCreateParams as BalanceTransactionCreateParams +from .balance_transaction_list_response import BalanceTransactionListResponse as BalanceTransactionListResponse +from .cost_list_by_external_id_response import CostListByExternalIDResponse as CostListByExternalIDResponse from .credit_list_by_external_id_params import CreditListByExternalIDParams as CreditListByExternalIDParams from .balance_transaction_create_response import BalanceTransactionCreateResponse as BalanceTransactionCreateResponse -from .balance_transaction_list_response import BalanceTransactionListResponse as BalanceTransactionListResponse -from .balance_transaction_create_params import BalanceTransactionCreateParams as BalanceTransactionCreateParams -from .balance_transaction_list_params import BalanceTransactionListParams as BalanceTransactionListParams +from .credit_list_by_external_id_response import CreditListByExternalIDResponse as CreditListByExternalIDResponse diff --git a/src/orb/types/customers/balance_transaction_create_params.py b/src/orb/types/customers/balance_transaction_create_params.py index 2bcc4846..0e440728 100755 --- a/src/orb/types/customers/balance_transaction_create_params.py +++ b/src/orb/types/customers/balance_transaction_create_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo +from typing_extensions import Literal, Required, TypedDict __all__ = ["BalanceTransactionCreateParams"] diff --git a/src/orb/types/customers/balance_transaction_create_response.py b/src/orb/types/customers/balance_transaction_create_response.py index 2d1a563f..09f688d0 100755 --- a/src/orb/types/customers/balance_transaction_create_response.py +++ b/src/orb/types/customers/balance_transaction_create_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - -from typing_extensions import Literal - -from datetime import datetime - from typing import Optional - -from typing import Optional, Union, List, Dict, Any +from datetime import datetime from typing_extensions import Literal -from pydantic import Field as FieldInfo + +from ..._models import BaseModel __all__ = ["BalanceTransactionCreateResponse", "CreditNote", "Invoice"] diff --git a/src/orb/types/customers/balance_transaction_list_params.py b/src/orb/types/customers/balance_transaction_list_params.py index 4a37bbb1..c3d5eb61 100755 --- a/src/orb/types/customers/balance_transaction_list_params.py +++ b/src/orb/types/customers/balance_transaction_list_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated - -from typing import Optional, Union - +from typing import Union, Optional from datetime import datetime +from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo - __all__ = ["BalanceTransactionListParams"] diff --git a/src/orb/types/customers/balance_transaction_list_response.py b/src/orb/types/customers/balance_transaction_list_response.py index 9de2d7e6..d5d3bb38 100755 --- a/src/orb/types/customers/balance_transaction_list_response.py +++ b/src/orb/types/customers/balance_transaction_list_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - -from typing_extensions import Literal - -from datetime import datetime - from typing import Optional - -from typing import Optional, Union, List, Dict, Any +from datetime import datetime from typing_extensions import Literal -from pydantic import Field as FieldInfo + +from ..._models import BaseModel __all__ = ["BalanceTransactionListResponse", "CreditNote", "Invoice"] diff --git a/src/orb/types/customers/cost_list_by_external_id_params.py b/src/orb/types/customers/cost_list_by_external_id_params.py index b9638001..dad37e47 100755 --- a/src/orb/types/customers/cost_list_by_external_id_params.py +++ b/src/orb/types/customers/cost_list_by_external_id_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Literal - -from typing import Optional, Union - +from typing import Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo - __all__ = ["CostListByExternalIDParams"] diff --git a/src/orb/types/customers/cost_list_by_external_id_response.py b/src/orb/types/customers/cost_list_by_external_id_response.py index d736e7c2..8345151d 100755 --- a/src/orb/types/customers/cost_list_by_external_id_response.py +++ b/src/orb/types/customers/cost_list_by_external_id_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - -from ..price import Price - -from typing import Optional, List - +from typing import List, Optional from datetime import datetime -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ..price import Price +from ..._models import BaseModel __all__ = ["CostListByExternalIDResponse", "Data", "DataPerPriceCost"] diff --git a/src/orb/types/customers/cost_list_params.py b/src/orb/types/customers/cost_list_params.py index 94fdf164..741fd8d9 100755 --- a/src/orb/types/customers/cost_list_params.py +++ b/src/orb/types/customers/cost_list_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Literal - -from typing import Optional, Union - +from typing import Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo - __all__ = ["CostListParams"] diff --git a/src/orb/types/customers/cost_list_response.py b/src/orb/types/customers/cost_list_response.py index 21406085..fe384554 100755 --- a/src/orb/types/customers/cost_list_response.py +++ b/src/orb/types/customers/cost_list_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - -from ..price import Price - -from typing import Optional, List - +from typing import List, Optional from datetime import datetime -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ..price import Price +from ..._models import BaseModel __all__ = ["CostListResponse", "Data", "DataPerPriceCost"] diff --git a/src/orb/types/customers/credit_list_by_external_id_params.py b/src/orb/types/customers/credit_list_by_external_id_params.py index e4d306aa..b192dc5c 100755 --- a/src/orb/types/customers/credit_list_by_external_id_params.py +++ b/src/orb/types/customers/credit_list_by_external_id_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["CreditListByExternalIDParams"] diff --git a/src/orb/types/customers/credit_list_by_external_id_response.py b/src/orb/types/customers/credit_list_by_external_id_response.py index 7bba0e00..d88e900b 100755 --- a/src/orb/types/customers/credit_list_by_external_id_response.py +++ b/src/orb/types/customers/credit_list_by_external_id_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - from typing import Optional - from datetime import datetime - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ..._models import BaseModel __all__ = ["CreditListByExternalIDResponse"] diff --git a/src/orb/types/customers/credit_list_params.py b/src/orb/types/customers/credit_list_params.py index 7517876d..9e8d7ba7 100755 --- a/src/orb/types/customers/credit_list_params.py +++ b/src/orb/types/customers/credit_list_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["CreditListParams"] diff --git a/src/orb/types/customers/credit_list_response.py b/src/orb/types/customers/credit_list_response.py index e6031598..7ccbfcf1 100755 --- a/src/orb/types/customers/credit_list_response.py +++ b/src/orb/types/customers/credit_list_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - from typing import Optional - from datetime import datetime - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ..._models import BaseModel __all__ = ["CreditListResponse"] diff --git a/src/orb/types/customers/credits/__init__.py b/src/orb/types/customers/credits/__init__.py index 4bdfca02..9baa17d8 100755 --- a/src/orb/types/customers/credits/__init__.py +++ b/src/orb/types/customers/credits/__init__.py @@ -2,23 +2,23 @@ from __future__ import annotations +from .ledger_list_params import LedgerListParams as LedgerListParams +from .top_up_list_params import TopUpListParams as TopUpListParams from .ledger_list_response import LedgerListResponse as LedgerListResponse +from .top_up_create_params import TopUpCreateParams as TopUpCreateParams +from .top_up_list_response import TopUpListResponse as TopUpListResponse +from .top_up_create_response import TopUpCreateResponse as TopUpCreateResponse +from .ledger_create_entry_params import LedgerCreateEntryParams as LedgerCreateEntryParams from .ledger_create_entry_response import LedgerCreateEntryResponse as LedgerCreateEntryResponse -from .ledger_create_entry_by_external_id_response import ( - LedgerCreateEntryByExternalIDResponse as LedgerCreateEntryByExternalIDResponse, -) +from .ledger_list_by_external_id_params import LedgerListByExternalIDParams as LedgerListByExternalIDParams +from .top_up_list_by_external_id_params import TopUpListByExternalIDParams as TopUpListByExternalIDParams from .ledger_list_by_external_id_response import LedgerListByExternalIDResponse as LedgerListByExternalIDResponse -from .ledger_list_params import LedgerListParams as LedgerListParams -from .ledger_create_entry_params import LedgerCreateEntryParams as LedgerCreateEntryParams +from .top_up_create_by_external_id_params import TopUpCreateByExternalIDParams as TopUpCreateByExternalIDParams +from .top_up_list_by_external_id_response import TopUpListByExternalIDResponse as TopUpListByExternalIDResponse +from .top_up_create_by_external_id_response import TopUpCreateByExternalIDResponse as TopUpCreateByExternalIDResponse from .ledger_create_entry_by_external_id_params import ( LedgerCreateEntryByExternalIDParams as LedgerCreateEntryByExternalIDParams, ) -from .ledger_list_by_external_id_params import LedgerListByExternalIDParams as LedgerListByExternalIDParams -from .top_up_create_response import TopUpCreateResponse as TopUpCreateResponse -from .top_up_list_response import TopUpListResponse as TopUpListResponse -from .top_up_create_by_external_id_response import TopUpCreateByExternalIDResponse as TopUpCreateByExternalIDResponse -from .top_up_list_by_external_id_response import TopUpListByExternalIDResponse as TopUpListByExternalIDResponse -from .top_up_create_params import TopUpCreateParams as TopUpCreateParams -from .top_up_list_params import TopUpListParams as TopUpListParams -from .top_up_create_by_external_id_params import TopUpCreateByExternalIDParams as TopUpCreateByExternalIDParams -from .top_up_list_by_external_id_params import TopUpListByExternalIDParams as TopUpListByExternalIDParams +from .ledger_create_entry_by_external_id_response import ( + LedgerCreateEntryByExternalIDResponse as LedgerCreateEntryByExternalIDResponse, +) 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 969a7e60..07e8217c 100755 --- 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 @@ -2,17 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal, Annotated, TypeAlias +from typing import Dict, Union, Optional +from datetime import date, datetime +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from typing import Optional, Union, Dict - -from datetime import datetime, date - -from ...._utils import PropertyInfo - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ...._types import FileTypes from ...._utils import PropertyInfo __all__ = [ diff --git a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py index d3f56841..82acb578 100755 --- a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py +++ b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_response.py @@ -1,18 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ...._models import BaseModel - -from typing import Optional, Dict - +from typing import Dict, Union, Optional from datetime import datetime - -from typing_extensions import Literal, TypeAlias, Annotated +from typing_extensions import Literal, Annotated, TypeAlias from ...._utils import PropertyInfo - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ...._models import BaseModel __all__ = [ "LedgerCreateEntryByExternalIDResponse", 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 6d198666..46ce0a9e 100755 --- a/src/orb/types/customers/credits/ledger_create_entry_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_params.py @@ -2,17 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal, Annotated, TypeAlias +from typing import Dict, Union, Optional +from datetime import date, datetime +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from typing import Optional, Union, Dict - -from datetime import datetime, date - -from ...._utils import PropertyInfo - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ...._types import FileTypes from ...._utils import PropertyInfo __all__ = [ diff --git a/src/orb/types/customers/credits/ledger_create_entry_response.py b/src/orb/types/customers/credits/ledger_create_entry_response.py index dd962a66..17dc5228 100755 --- a/src/orb/types/customers/credits/ledger_create_entry_response.py +++ b/src/orb/types/customers/credits/ledger_create_entry_response.py @@ -1,18 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ...._models import BaseModel - -from typing import Optional, Dict - +from typing import Dict, Union, Optional from datetime import datetime - -from typing_extensions import Literal, TypeAlias, Annotated +from typing_extensions import Literal, Annotated, TypeAlias from ...._utils import PropertyInfo - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ...._models import BaseModel __all__ = [ "LedgerCreateEntryResponse", diff --git a/src/orb/types/customers/credits/ledger_list_by_external_id_params.py b/src/orb/types/customers/credits/ledger_list_by_external_id_params.py index 4c00ce12..165d85bb 100755 --- a/src/orb/types/customers/credits/ledger_list_by_external_id_params.py +++ b/src/orb/types/customers/credits/ledger_list_by_external_id_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Literal - from typing import Union, Optional - from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict from ...._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ...._types import FileTypes -from ...._utils import PropertyInfo - __all__ = ["LedgerListByExternalIDParams"] diff --git a/src/orb/types/customers/credits/ledger_list_by_external_id_response.py b/src/orb/types/customers/credits/ledger_list_by_external_id_response.py index 88d09cc3..fd5d03a2 100755 --- a/src/orb/types/customers/credits/ledger_list_by_external_id_response.py +++ b/src/orb/types/customers/credits/ledger_list_by_external_id_response.py @@ -1,18 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ...._models import BaseModel - -from typing import Optional, Dict - +from typing import Dict, Union, Optional from datetime import datetime - -from typing_extensions import Literal, TypeAlias, Annotated +from typing_extensions import Literal, Annotated, TypeAlias from ...._utils import PropertyInfo - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ...._models import BaseModel __all__ = [ "LedgerListByExternalIDResponse", diff --git a/src/orb/types/customers/credits/ledger_list_params.py b/src/orb/types/customers/credits/ledger_list_params.py index 3978a803..24be2285 100755 --- a/src/orb/types/customers/credits/ledger_list_params.py +++ b/src/orb/types/customers/credits/ledger_list_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Literal - from typing import Union, Optional - from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict from ...._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ...._types import FileTypes -from ...._utils import PropertyInfo - __all__ = ["LedgerListParams"] diff --git a/src/orb/types/customers/credits/ledger_list_response.py b/src/orb/types/customers/credits/ledger_list_response.py index 8432f3d7..c02858de 100755 --- a/src/orb/types/customers/credits/ledger_list_response.py +++ b/src/orb/types/customers/credits/ledger_list_response.py @@ -1,18 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ...._models import BaseModel - -from typing import Optional, Dict - +from typing import Dict, Union, Optional from datetime import datetime - -from typing_extensions import Literal, TypeAlias, Annotated +from typing_extensions import Literal, Annotated, TypeAlias from ...._utils import PropertyInfo - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ...._models import BaseModel __all__ = [ "LedgerListResponse", diff --git a/src/orb/types/customers/credits/top_up_create_by_external_id_params.py b/src/orb/types/customers/credits/top_up_create_by_external_id_params.py index 22137d4a..bbddd72e 100755 --- a/src/orb/types/customers/credits/top_up_create_by_external_id_params.py +++ b/src/orb/types/customers/credits/top_up_create_by_external_id_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ...._types import FileTypes -from ...._utils import PropertyInfo +from typing_extensions import Literal, Required, TypedDict __all__ = ["TopUpCreateByExternalIDParams", "InvoiceSettings"] diff --git a/src/orb/types/customers/credits/top_up_create_by_external_id_response.py b/src/orb/types/customers/credits/top_up_create_by_external_id_response.py index fab31e17..9b889e61 100755 --- a/src/orb/types/customers/credits/top_up_create_by_external_id_response.py +++ b/src/orb/types/customers/credits/top_up_create_by_external_id_response.py @@ -1,14 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ...._models import BaseModel - from typing import Optional - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ...._models import BaseModel __all__ = ["TopUpCreateByExternalIDResponse", "InvoiceSettings"] diff --git a/src/orb/types/customers/credits/top_up_create_params.py b/src/orb/types/customers/credits/top_up_create_params.py index 8332740e..571263d6 100755 --- a/src/orb/types/customers/credits/top_up_create_params.py +++ b/src/orb/types/customers/credits/top_up_create_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ...._types import FileTypes -from ...._utils import PropertyInfo +from typing_extensions import Literal, Required, TypedDict __all__ = ["TopUpCreateParams", "InvoiceSettings"] diff --git a/src/orb/types/customers/credits/top_up_create_response.py b/src/orb/types/customers/credits/top_up_create_response.py index f7295ef3..d9497888 100755 --- a/src/orb/types/customers/credits/top_up_create_response.py +++ b/src/orb/types/customers/credits/top_up_create_response.py @@ -1,14 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ...._models import BaseModel - from typing import Optional - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ...._models import BaseModel __all__ = ["TopUpCreateResponse", "InvoiceSettings"] diff --git a/src/orb/types/customers/credits/top_up_list_by_external_id_params.py b/src/orb/types/customers/credits/top_up_list_by_external_id_params.py index 1cb68660..97821b60 100755 --- a/src/orb/types/customers/credits/top_up_list_by_external_id_params.py +++ b/src/orb/types/customers/credits/top_up_list_by_external_id_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ...._types import FileTypes -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TopUpListByExternalIDParams"] diff --git a/src/orb/types/customers/credits/top_up_list_by_external_id_response.py b/src/orb/types/customers/credits/top_up_list_by_external_id_response.py index 71b6a356..fc3088ad 100755 --- a/src/orb/types/customers/credits/top_up_list_by_external_id_response.py +++ b/src/orb/types/customers/credits/top_up_list_by_external_id_response.py @@ -1,14 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ...._models import BaseModel - from typing import Optional - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ...._models import BaseModel __all__ = ["TopUpListByExternalIDResponse", "InvoiceSettings"] diff --git a/src/orb/types/customers/credits/top_up_list_params.py b/src/orb/types/customers/credits/top_up_list_params.py index 67a55738..bf551c42 100755 --- a/src/orb/types/customers/credits/top_up_list_params.py +++ b/src/orb/types/customers/credits/top_up_list_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ...._types import FileTypes -from ...._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["TopUpListParams"] diff --git a/src/orb/types/customers/credits/top_up_list_response.py b/src/orb/types/customers/credits/top_up_list_response.py index f51e1ec4..69a59f4d 100755 --- a/src/orb/types/customers/credits/top_up_list_response.py +++ b/src/orb/types/customers/credits/top_up_list_response.py @@ -1,14 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ...._models import BaseModel - from typing import Optional - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ...._models import BaseModel __all__ = ["TopUpListResponse", "InvoiceSettings"] diff --git a/src/orb/types/evaluate_price_group.py b/src/orb/types/evaluate_price_group.py index 80754824..2a6af81a 100755 --- a/src/orb/types/evaluate_price_group.py +++ b/src/orb/types/evaluate_price_group.py @@ -1,12 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List, Union -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .._models import BaseModel __all__ = ["EvaluatePriceGroup"] diff --git a/src/orb/types/event_deprecate_response.py b/src/orb/types/event_deprecate_response.py index 23ea3b77..08b4aecb 100755 --- a/src/orb/types/event_deprecate_response.py +++ b/src/orb/types/event_deprecate_response.py @@ -1,10 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo + +from .._models import BaseModel __all__ = ["EventDeprecateResponse"] diff --git a/src/orb/types/event_ingest_params.py b/src/orb/types/event_ingest_params.py index 21bc0543..505fbfe6 100755 --- a/src/orb/types/event_ingest_params.py +++ b/src/orb/types/event_ingest_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated - -from typing import Iterable, Optional, Union - +from typing import Union, Iterable, Optional from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["EventIngestParams", "Event"] diff --git a/src/orb/types/event_ingest_response.py b/src/orb/types/event_ingest_response.py index 94ea1475..933e18c8 100755 --- a/src/orb/types/event_ingest_response.py +++ b/src/orb/types/event_ingest_response.py @@ -1,12 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List, Optional -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .._models import BaseModel __all__ = ["EventIngestResponse", "ValidationFailed", "Debug"] diff --git a/src/orb/types/event_search_params.py b/src/orb/types/event_search_params.py index dc4edd70..e422ae4f 100755 --- a/src/orb/types/event_search_params.py +++ b/src/orb/types/event_search_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated - from typing import List, Union - from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["EventSearchParams"] diff --git a/src/orb/types/event_search_response.py b/src/orb/types/event_search_response.py index 874c3cd2..62a5a9ee 100755 --- a/src/orb/types/event_search_response.py +++ b/src/orb/types/event_search_response.py @@ -1,14 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing import Optional, List - +from typing import List, Optional from datetime import datetime -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .._models import BaseModel __all__ = ["EventSearchResponse", "Data"] diff --git a/src/orb/types/event_update_params.py b/src/orb/types/event_update_params.py index 7fbe183d..3de8f966 100755 --- a/src/orb/types/event_update_params.py +++ b/src/orb/types/event_update_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated - from typing import Union, Optional - from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["EventUpdateParams"] diff --git a/src/orb/types/event_update_response.py b/src/orb/types/event_update_response.py index 99a82d8d..aa91fd81 100755 --- a/src/orb/types/event_update_response.py +++ b/src/orb/types/event_update_response.py @@ -1,10 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo + +from .._models import BaseModel __all__ = ["EventUpdateResponse"] diff --git a/src/orb/types/events/__init__.py b/src/orb/types/events/__init__.py index ad8fa1fb..a13aa150 100755 --- a/src/orb/types/events/__init__.py +++ b/src/orb/types/events/__init__.py @@ -2,10 +2,10 @@ from __future__ import annotations -from .backfill_create_response import BackfillCreateResponse as BackfillCreateResponse +from .backfill_list_params import BackfillListParams as BackfillListParams +from .backfill_create_params import BackfillCreateParams as BackfillCreateParams from .backfill_list_response import BackfillListResponse as BackfillListResponse from .backfill_close_response import BackfillCloseResponse as BackfillCloseResponse from .backfill_fetch_response import BackfillFetchResponse as BackfillFetchResponse +from .backfill_create_response import BackfillCreateResponse as BackfillCreateResponse from .backfill_revert_response import BackfillRevertResponse as BackfillRevertResponse -from .backfill_create_params import BackfillCreateParams as BackfillCreateParams -from .backfill_list_params import BackfillListParams as BackfillListParams diff --git a/src/orb/types/events/backfill_close_response.py b/src/orb/types/events/backfill_close_response.py index b9de7314..393fc793 100755 --- a/src/orb/types/events/backfill_close_response.py +++ b/src/orb/types/events/backfill_close_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - from typing import Optional - from datetime import datetime - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ..._models import BaseModel __all__ = ["BackfillCloseResponse"] diff --git a/src/orb/types/events/backfill_create_params.py b/src/orb/types/events/backfill_create_params.py index bcd7e873..1c526f39 100755 --- a/src/orb/types/events/backfill_create_params.py +++ b/src/orb/types/events/backfill_create_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Required - from typing import Union, Optional - from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo - __all__ = ["BackfillCreateParams"] diff --git a/src/orb/types/events/backfill_create_response.py b/src/orb/types/events/backfill_create_response.py index 097b91de..d8b9f837 100755 --- a/src/orb/types/events/backfill_create_response.py +++ b/src/orb/types/events/backfill_create_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - from typing import Optional - from datetime import datetime - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ..._models import BaseModel __all__ = ["BackfillCreateResponse"] diff --git a/src/orb/types/events/backfill_fetch_response.py b/src/orb/types/events/backfill_fetch_response.py index b3bcce37..c82d950b 100755 --- a/src/orb/types/events/backfill_fetch_response.py +++ b/src/orb/types/events/backfill_fetch_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - from typing import Optional - from datetime import datetime - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ..._models import BaseModel __all__ = ["BackfillFetchResponse"] diff --git a/src/orb/types/events/backfill_list_params.py b/src/orb/types/events/backfill_list_params.py index 510de04f..4b6adaef 100755 --- a/src/orb/types/events/backfill_list_params.py +++ b/src/orb/types/events/backfill_list_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["BackfillListParams"] diff --git a/src/orb/types/events/backfill_list_response.py b/src/orb/types/events/backfill_list_response.py index a4f73ff3..2df11980 100755 --- a/src/orb/types/events/backfill_list_response.py +++ b/src/orb/types/events/backfill_list_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - from typing import Optional - from datetime import datetime - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ..._models import BaseModel __all__ = ["BackfillListResponse"] diff --git a/src/orb/types/events/backfill_revert_response.py b/src/orb/types/events/backfill_revert_response.py index 7d32dbe4..39ad6836 100755 --- a/src/orb/types/events/backfill_revert_response.py +++ b/src/orb/types/events/backfill_revert_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - from typing import Optional - from datetime import datetime - from typing_extensions import Literal -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from ..._models import BaseModel __all__ = ["BackfillRevertResponse"] diff --git a/src/orb/types/invoice.py b/src/orb/types/invoice.py index 85448b29..5781f30d 100755 --- a/src/orb/types/invoice.py +++ b/src/orb/types/invoice.py @@ -1,23 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing import Optional, List, Dict - +from typing import Dict, List, Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias -from typing_extensions import Literal, TypeAlias, Annotated - +from .price import Price from .._utils import PropertyInfo - +from .._models import BaseModel from .shared.discount import Discount -from .price import Price - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = [ "Invoice", "AutoCollection", diff --git a/src/orb/types/invoice_create_params.py b/src/orb/types/invoice_create_params.py index 045dcbe4..78e22ea8 100755 --- a/src/orb/types/invoice_create_params.py +++ b/src/orb/types/invoice_create_params.py @@ -2,21 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated, Literal - -from typing import Union, Iterable, Optional, Dict - -from datetime import datetime, date +from typing import Dict, Union, Iterable, Optional +from datetime import date, datetime +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo - from .shared_params.discount import Discount -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["InvoiceCreateParams", "LineItem", "LineItemUnitConfig"] diff --git a/src/orb/types/invoice_fetch_upcoming_params.py b/src/orb/types/invoice_fetch_upcoming_params.py index 8bfda1c7..0d219ef7 100755 --- a/src/orb/types/invoice_fetch_upcoming_params.py +++ b/src/orb/types/invoice_fetch_upcoming_params.py @@ -4,11 +4,6 @@ from typing_extensions import TypedDict -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["InvoiceFetchUpcomingParams"] diff --git a/src/orb/types/invoice_fetch_upcoming_response.py b/src/orb/types/invoice_fetch_upcoming_response.py index c4efb69d..f1398c16 100755 --- a/src/orb/types/invoice_fetch_upcoming_response.py +++ b/src/orb/types/invoice_fetch_upcoming_response.py @@ -1,23 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing import Optional, List, Dict - +from typing import Dict, List, Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias -from typing_extensions import Literal, TypeAlias, Annotated - +from .price import Price from .._utils import PropertyInfo - +from .._models import BaseModel from .shared.discount import Discount -from .price import Price - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = [ "InvoiceFetchUpcomingResponse", "AutoCollection", diff --git a/src/orb/types/invoice_line_item_create_params.py b/src/orb/types/invoice_line_item_create_params.py index 3739be8d..03016bfd 100755 --- a/src/orb/types/invoice_line_item_create_params.py +++ b/src/orb/types/invoice_line_item_create_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Annotated - from typing import Union - from datetime import date +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["InvoiceLineItemCreateParams"] diff --git a/src/orb/types/invoice_line_item_create_response.py b/src/orb/types/invoice_line_item_create_response.py index 13443894..7ac86286 100755 --- a/src/orb/types/invoice_line_item_create_response.py +++ b/src/orb/types/invoice_line_item_create_response.py @@ -1,22 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing import List, Optional - -from typing_extensions import Literal, TypeAlias, Annotated - -from .._utils import PropertyInfo - -from .shared.discount import Discount - +from typing import List, Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias from .price import Price - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .._utils import PropertyInfo +from .._models import BaseModel +from .shared.discount import Discount __all__ = [ "InvoiceLineItemCreateResponse", diff --git a/src/orb/types/invoice_list_params.py b/src/orb/types/invoice_list_params.py index 4382a962..31bc4111 100755 --- a/src/orb/types/invoice_list_params.py +++ b/src/orb/types/invoice_list_params.py @@ -2,17 +2,10 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Literal - -from typing import Optional, Union, List - -from .._utils import PropertyInfo - +from typing import List, Union, Optional from datetime import date, datetime +from typing_extensions import Literal, Annotated, TypedDict -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes from .._utils import PropertyInfo __all__ = ["InvoiceListParams"] diff --git a/src/orb/types/invoice_mark_paid_params.py b/src/orb/types/invoice_mark_paid_params.py index 496595c2..28a20dda 100755 --- a/src/orb/types/invoice_mark_paid_params.py +++ b/src/orb/types/invoice_mark_paid_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Required - from typing import Union, Optional - from datetime import date +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["InvoiceMarkPaidParams"] diff --git a/src/orb/types/invoice_update_params.py b/src/orb/types/invoice_update_params.py index c8fe744d..e0e5c347 100755 --- a/src/orb/types/invoice_update_params.py +++ b/src/orb/types/invoice_update_params.py @@ -2,15 +2,9 @@ from __future__ import annotations +from typing import Dict, Optional from typing_extensions import TypedDict -from typing import Optional, Dict - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["InvoiceUpdateParams"] diff --git a/src/orb/types/item.py b/src/orb/types/item.py index de224c05..ad22a1dd 100755 --- a/src/orb/types/item.py +++ b/src/orb/types/item.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing_extensions import Literal - -from datetime import datetime - from typing import List - -from typing import Optional, Union, List, Dict, Any +from datetime import datetime from typing_extensions import Literal -from pydantic import Field as FieldInfo + +from .._models import BaseModel __all__ = ["Item", "ExternalConnection"] diff --git a/src/orb/types/item_create_params.py b/src/orb/types/item_create_params.py index 1ca4f960..8b45e468 100755 --- a/src/orb/types/item_create_params.py +++ b/src/orb/types/item_create_params.py @@ -2,12 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing_extensions import Required, TypedDict __all__ = ["ItemCreateParams"] diff --git a/src/orb/types/item_list_params.py b/src/orb/types/item_list_params.py index df4e06ec..d2317a13 100755 --- a/src/orb/types/item_list_params.py +++ b/src/orb/types/item_list_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["ItemListParams"] diff --git a/src/orb/types/item_update_params.py b/src/orb/types/item_update_params.py index 14dcac6a..a94f7c59 100755 --- a/src/orb/types/item_update_params.py +++ b/src/orb/types/item_update_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Required - -from typing import Optional, Iterable - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Iterable, Optional +from typing_extensions import Literal, Required, TypedDict __all__ = ["ItemUpdateParams", "ExternalConnection"] diff --git a/src/orb/types/metric_create_params.py b/src/orb/types/metric_create_params.py index d84189bd..5e53ddf9 100755 --- a/src/orb/types/metric_create_params.py +++ b/src/orb/types/metric_create_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required - -from typing import Optional, Dict - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Dict, Optional +from typing_extensions import Required, TypedDict __all__ = ["MetricCreateParams"] diff --git a/src/orb/types/metric_list_params.py b/src/orb/types/metric_list_params.py index 11b9dc08..90e5db42 100755 --- a/src/orb/types/metric_list_params.py +++ b/src/orb/types/metric_list_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated - from typing import Union, Optional - from datetime import datetime +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["MetricListParams"] diff --git a/src/orb/types/metric_update_params.py b/src/orb/types/metric_update_params.py index 32ec5df8..5c182e03 100755 --- a/src/orb/types/metric_update_params.py +++ b/src/orb/types/metric_update_params.py @@ -2,15 +2,9 @@ from __future__ import annotations +from typing import Dict, Optional from typing_extensions import TypedDict -from typing import Optional, Dict - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["MetricUpdateParams"] diff --git a/src/orb/types/plan.py b/src/orb/types/plan.py index 35ed4b31..f3b3b805 100755 --- a/src/orb/types/plan.py +++ b/src/orb/types/plan.py @@ -1,20 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing import Optional, List, Dict - -from .shared.discount import Discount - -from typing_extensions import Literal - +from typing import Dict, List, Optional from datetime import datetime +from typing_extensions import Literal from .price import Price - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.discount import Discount __all__ = [ "Plan", diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 6fd8a17c..3709cfae 100755 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -2,48 +2,76 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal, TypeAlias - -from typing import Iterable, Optional, Dict, List, Union - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict __all__ = [ "PlanCreateParams", "Price", "PriceNewPlanUnitPrice", "PriceNewPlanUnitPriceUnitConfig", + "PriceNewPlanUnitPriceBillingCycleConfiguration", + "PriceNewPlanUnitPriceInvoicingCycleConfiguration", "PriceNewPlanPackagePrice", "PriceNewPlanPackagePricePackageConfig", + "PriceNewPlanPackagePriceBillingCycleConfiguration", + "PriceNewPlanPackagePriceInvoicingCycleConfiguration", "PriceNewPlanMatrixPrice", "PriceNewPlanMatrixPriceMatrixConfig", "PriceNewPlanMatrixPriceMatrixConfigMatrixValue", + "PriceNewPlanMatrixPriceBillingCycleConfiguration", + "PriceNewPlanMatrixPriceInvoicingCycleConfiguration", "PriceNewPlanTieredPrice", "PriceNewPlanTieredPriceTieredConfig", "PriceNewPlanTieredPriceTieredConfigTier", + "PriceNewPlanTieredPriceBillingCycleConfiguration", + "PriceNewPlanTieredPriceInvoicingCycleConfiguration", "PriceNewPlanTieredBpsPrice", "PriceNewPlanTieredBpsPriceTieredBpsConfig", "PriceNewPlanTieredBpsPriceTieredBpsConfigTier", + "PriceNewPlanTieredBpsPriceBillingCycleConfiguration", + "PriceNewPlanTieredBpsPriceInvoicingCycleConfiguration", "PriceNewPlanBpsPrice", "PriceNewPlanBpsPriceBpsConfig", + "PriceNewPlanBpsPriceBillingCycleConfiguration", + "PriceNewPlanBpsPriceInvoicingCycleConfiguration", "PriceNewPlanBulkBpsPrice", "PriceNewPlanBulkBpsPriceBulkBpsConfig", "PriceNewPlanBulkBpsPriceBulkBpsConfigTier", + "PriceNewPlanBulkBpsPriceBillingCycleConfiguration", + "PriceNewPlanBulkBpsPriceInvoicingCycleConfiguration", "PriceNewPlanBulkPrice", "PriceNewPlanBulkPriceBulkConfig", "PriceNewPlanBulkPriceBulkConfigTier", + "PriceNewPlanBulkPriceBillingCycleConfiguration", + "PriceNewPlanBulkPriceInvoicingCycleConfiguration", "PriceNewPlanThresholdTotalAmountPrice", + "PriceNewPlanThresholdTotalAmountPriceBillingCycleConfiguration", + "PriceNewPlanThresholdTotalAmountPriceInvoicingCycleConfiguration", "PriceNewPlanTieredPackagePrice", + "PriceNewPlanTieredPackagePriceBillingCycleConfiguration", + "PriceNewPlanTieredPackagePriceInvoicingCycleConfiguration", "PriceNewPlanTieredWithMinimumPrice", + "PriceNewPlanTieredWithMinimumPriceBillingCycleConfiguration", + "PriceNewPlanTieredWithMinimumPriceInvoicingCycleConfiguration", "PriceNewPlanUnitWithPercentPrice", + "PriceNewPlanUnitWithPercentPriceBillingCycleConfiguration", + "PriceNewPlanUnitWithPercentPriceInvoicingCycleConfiguration", "PriceNewPlanPackageWithAllocationPrice", + "PriceNewPlanPackageWithAllocationPriceBillingCycleConfiguration", + "PriceNewPlanPackageWithAllocationPriceInvoicingCycleConfiguration", "PriceNewPlanTierWithProrationPrice", + "PriceNewPlanTierWithProrationPriceBillingCycleConfiguration", + "PriceNewPlanTierWithProrationPriceInvoicingCycleConfiguration", "PriceNewPlanUnitWithProrationPrice", + "PriceNewPlanUnitWithProrationPriceBillingCycleConfiguration", + "PriceNewPlanUnitWithProrationPriceInvoicingCycleConfiguration", "PriceNewPlanGroupedAllocationPrice", + "PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration", + "PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration", "PriceNewPlanBulkWithProrationPrice", + "PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration", + "PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration", ] @@ -95,6 +123,22 @@ class PriceNewPlanUnitPriceUnitConfig(TypedDict, total=False): """Rate per unit of usage""" +class PriceNewPlanUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanUnitPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -121,6 +165,12 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanUnitPriceBillingCycleConfiguration] + """ + 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.""" @@ -142,6 +192,12 @@ class PriceNewPlanUnitPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -162,6 +218,22 @@ class PriceNewPlanPackagePricePackageConfig(TypedDict, total=False): """ +class PriceNewPlanPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -188,6 +260,12 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanPackagePriceBillingCycleConfiguration] + """ + 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.""" @@ -209,6 +287,12 @@ class PriceNewPlanPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -240,6 +324,22 @@ class PriceNewPlanMatrixPriceMatrixConfig(TypedDict, total=False): """Matrix values for specified matrix grouping keys""" +class PriceNewPlanMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanMatrixPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -266,6 +366,12 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanMatrixPriceBillingCycleConfiguration] + """ + 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.""" @@ -287,6 +393,12 @@ class PriceNewPlanMatrixPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -311,6 +423,22 @@ class PriceNewPlanTieredPriceTieredConfig(TypedDict, total=False): """Tiers for rating based on total usage quantities into the specified tier""" +class PriceNewPlanTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -337,6 +465,12 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanTieredPriceBillingCycleConfiguration] + """ + 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.""" @@ -358,6 +492,12 @@ class PriceNewPlanTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -388,6 +528,22 @@ class PriceNewPlanTieredBpsPriceTieredBpsConfig(TypedDict, total=False): """ +class PriceNewPlanTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTieredBpsPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -414,6 +570,12 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanTieredBpsPriceBillingCycleConfiguration] + """ + 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.""" @@ -435,6 +597,12 @@ class PriceNewPlanTieredBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -451,6 +619,22 @@ class PriceNewPlanBpsPriceBpsConfig(TypedDict, total=False): """Optional currency amount maximum to cap spend per event""" +class PriceNewPlanBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanBpsPrice(TypedDict, total=False): bps_config: Required[PriceNewPlanBpsPriceBpsConfig] @@ -477,6 +661,12 @@ class PriceNewPlanBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanBpsPriceBillingCycleConfiguration] + """ + 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.""" @@ -498,6 +688,12 @@ class PriceNewPlanBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -525,6 +721,22 @@ class PriceNewPlanBulkBpsPriceBulkBpsConfig(TypedDict, total=False): """ +class PriceNewPlanBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanBulkBpsPrice(TypedDict, total=False): bulk_bps_config: Required[PriceNewPlanBulkBpsPriceBulkBpsConfig] @@ -551,6 +763,12 @@ class PriceNewPlanBulkBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanBulkBpsPriceBillingCycleConfiguration] + """ + 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.""" @@ -572,6 +790,12 @@ class PriceNewPlanBulkBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -593,6 +817,22 @@ class PriceNewPlanBulkPriceBulkConfig(TypedDict, total=False): """Bulk tiers for rating based on total usage volume""" +class PriceNewPlanBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanBulkPrice(TypedDict, total=False): bulk_config: Required[PriceNewPlanBulkPriceBulkConfig] @@ -619,6 +859,12 @@ class PriceNewPlanBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanBulkPriceBillingCycleConfiguration] + """ + 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.""" @@ -640,6 +886,12 @@ class PriceNewPlanBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -648,6 +900,22 @@ class PriceNewPlanBulkPrice(TypedDict, total=False): """ +class PriceNewPlanThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -674,6 +942,12 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanThresholdTotalAmountPriceBillingCycleConfiguration] + """ + 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.""" @@ -695,6 +969,12 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanThresholdTotalAmountPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -703,6 +983,22 @@ class PriceNewPlanThresholdTotalAmountPrice(TypedDict, total=False): """ +class PriceNewPlanTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -729,6 +1025,12 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanTieredPackagePriceBillingCycleConfiguration] + """ + 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.""" @@ -750,6 +1052,12 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -758,6 +1066,22 @@ class PriceNewPlanTieredPackagePrice(TypedDict, total=False): """ +class PriceNewPlanTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -784,6 +1108,12 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanTieredWithMinimumPriceBillingCycleConfiguration] + """ + 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.""" @@ -805,6 +1135,12 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanTieredWithMinimumPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -813,6 +1149,22 @@ class PriceNewPlanTieredWithMinimumPrice(TypedDict, total=False): """ +class PriceNewPlanUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -839,6 +1191,12 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanUnitWithPercentPriceBillingCycleConfiguration] + """ + 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.""" @@ -860,6 +1218,12 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanUnitWithPercentPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -868,6 +1232,22 @@ class PriceNewPlanUnitWithPercentPrice(TypedDict, total=False): """ +class PriceNewPlanPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -894,6 +1274,12 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanPackageWithAllocationPriceBillingCycleConfiguration] + """ + 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.""" @@ -915,6 +1301,12 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanPackageWithAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -923,6 +1315,22 @@ class PriceNewPlanPackageWithAllocationPrice(TypedDict, total=False): """ +class PriceNewPlanTierWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanTierWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -949,6 +1357,12 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanTierWithProrationPriceBillingCycleConfiguration] + """ + 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.""" @@ -970,6 +1384,12 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanTierWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -978,6 +1398,22 @@ class PriceNewPlanTierWithProrationPrice(TypedDict, total=False): """ +class PriceNewPlanUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1004,6 +1440,12 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanUnitWithProrationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1025,6 +1467,12 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanUnitWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1033,6 +1481,22 @@ class PriceNewPlanUnitWithProrationPrice(TypedDict, total=False): """ +class PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1059,6 +1523,12 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanGroupedAllocationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1080,6 +1550,12 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanGroupedAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1088,6 +1564,22 @@ class PriceNewPlanGroupedAllocationPrice(TypedDict, total=False): """ +class PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): bulk_with_proration_config: Required[Dict[str, object]] @@ -1114,6 +1606,12 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[PriceNewPlanBulkWithProrationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1135,6 +1633,12 @@ class PriceNewPlanBulkWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[PriceNewPlanBulkWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb/types/plan_list_params.py b/src/orb/types/plan_list_params.py index 95eb522d..0611f905 100755 --- a/src/orb/types/plan_list_params.py +++ b/src/orb/types/plan_list_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Literal - from typing import Union, Optional - from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["PlanListParams"] diff --git a/src/orb/types/plan_update_params.py b/src/orb/types/plan_update_params.py index 639b0e08..5fc717f0 100755 --- a/src/orb/types/plan_update_params.py +++ b/src/orb/types/plan_update_params.py @@ -2,15 +2,9 @@ from __future__ import annotations +from typing import Dict, Optional from typing_extensions import TypedDict -from typing import Optional, Dict - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["PlanUpdateParams"] diff --git a/src/orb/types/plans/external_plan_id_update_params.py b/src/orb/types/plans/external_plan_id_update_params.py index 65d43981..d7017899 100755 --- a/src/orb/types/plans/external_plan_id_update_params.py +++ b/src/orb/types/plans/external_plan_id_update_params.py @@ -2,15 +2,9 @@ from __future__ import annotations +from typing import Dict, Optional from typing_extensions import TypedDict -from typing import Optional, Dict - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo - __all__ = ["ExternalPlanIDUpdateParams"] diff --git a/src/orb/types/price.py b/src/orb/types/price.py index 3230e31f..e4ea52e8 100755 --- a/src/orb/types/price.py +++ b/src/orb/types/price.py @@ -1,20 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing_extensions import Literal, TypeAlias, Annotated - -from typing import List, Optional, Dict - +from typing import Dict, List, Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias -from .shared.discount import Discount +from pydantic import Field as FieldInfo from .._utils import PropertyInfo - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .._models import BaseModel +from .shared.discount import Discount __all__ = [ "Price", @@ -22,6 +16,7 @@ "UnitPriceBillableMetric", "UnitPriceBillingCycleConfiguration", "UnitPriceCreditAllocation", + "UnitPriceInvoicingCycleConfiguration", "UnitPriceItem", "UnitPriceMaximum", "UnitPriceMinimum", @@ -30,6 +25,7 @@ "PackagePriceBillableMetric", "PackagePriceBillingCycleConfiguration", "PackagePriceCreditAllocation", + "PackagePriceInvoicingCycleConfiguration", "PackagePriceItem", "PackagePriceMaximum", "PackagePriceMinimum", @@ -38,6 +34,7 @@ "MatrixPriceBillableMetric", "MatrixPriceBillingCycleConfiguration", "MatrixPriceCreditAllocation", + "MatrixPriceInvoicingCycleConfiguration", "MatrixPriceItem", "MatrixPriceMatrixConfig", "MatrixPriceMatrixConfigMatrixValue", @@ -47,6 +44,7 @@ "TieredPriceBillableMetric", "TieredPriceBillingCycleConfiguration", "TieredPriceCreditAllocation", + "TieredPriceInvoicingCycleConfiguration", "TieredPriceItem", "TieredPriceMaximum", "TieredPriceMinimum", @@ -56,6 +54,7 @@ "TieredBpsPriceBillableMetric", "TieredBpsPriceBillingCycleConfiguration", "TieredBpsPriceCreditAllocation", + "TieredBpsPriceInvoicingCycleConfiguration", "TieredBpsPriceItem", "TieredBpsPriceMaximum", "TieredBpsPriceMinimum", @@ -66,6 +65,7 @@ "BpsPriceBillingCycleConfiguration", "BpsPriceBpsConfig", "BpsPriceCreditAllocation", + "BpsPriceInvoicingCycleConfiguration", "BpsPriceItem", "BpsPriceMaximum", "BpsPriceMinimum", @@ -75,6 +75,7 @@ "BulkBpsPriceBulkBpsConfig", "BulkBpsPriceBulkBpsConfigTier", "BulkBpsPriceCreditAllocation", + "BulkBpsPriceInvoicingCycleConfiguration", "BulkBpsPriceItem", "BulkBpsPriceMaximum", "BulkBpsPriceMinimum", @@ -84,6 +85,7 @@ "BulkPriceBulkConfig", "BulkPriceBulkConfigTier", "BulkPriceCreditAllocation", + "BulkPriceInvoicingCycleConfiguration", "BulkPriceItem", "BulkPriceMaximum", "BulkPriceMinimum", @@ -91,6 +93,7 @@ "ThresholdTotalAmountPriceBillableMetric", "ThresholdTotalAmountPriceBillingCycleConfiguration", "ThresholdTotalAmountPriceCreditAllocation", + "ThresholdTotalAmountPriceInvoicingCycleConfiguration", "ThresholdTotalAmountPriceItem", "ThresholdTotalAmountPriceMaximum", "ThresholdTotalAmountPriceMinimum", @@ -98,6 +101,7 @@ "TieredPackagePriceBillableMetric", "TieredPackagePriceBillingCycleConfiguration", "TieredPackagePriceCreditAllocation", + "TieredPackagePriceInvoicingCycleConfiguration", "TieredPackagePriceItem", "TieredPackagePriceMaximum", "TieredPackagePriceMinimum", @@ -105,6 +109,7 @@ "GroupedTieredPriceBillableMetric", "GroupedTieredPriceBillingCycleConfiguration", "GroupedTieredPriceCreditAllocation", + "GroupedTieredPriceInvoicingCycleConfiguration", "GroupedTieredPriceItem", "GroupedTieredPriceMaximum", "GroupedTieredPriceMinimum", @@ -112,6 +117,7 @@ "TieredWithMinimumPriceBillableMetric", "TieredWithMinimumPriceBillingCycleConfiguration", "TieredWithMinimumPriceCreditAllocation", + "TieredWithMinimumPriceInvoicingCycleConfiguration", "TieredWithMinimumPriceItem", "TieredWithMinimumPriceMaximum", "TieredWithMinimumPriceMinimum", @@ -119,6 +125,7 @@ "TieredPackageWithMinimumPriceBillableMetric", "TieredPackageWithMinimumPriceBillingCycleConfiguration", "TieredPackageWithMinimumPriceCreditAllocation", + "TieredPackageWithMinimumPriceInvoicingCycleConfiguration", "TieredPackageWithMinimumPriceItem", "TieredPackageWithMinimumPriceMaximum", "TieredPackageWithMinimumPriceMinimum", @@ -126,6 +133,7 @@ "PackageWithAllocationPriceBillableMetric", "PackageWithAllocationPriceBillingCycleConfiguration", "PackageWithAllocationPriceCreditAllocation", + "PackageWithAllocationPriceInvoicingCycleConfiguration", "PackageWithAllocationPriceItem", "PackageWithAllocationPriceMaximum", "PackageWithAllocationPriceMinimum", @@ -133,6 +141,7 @@ "UnitWithPercentPriceBillableMetric", "UnitWithPercentPriceBillingCycleConfiguration", "UnitWithPercentPriceCreditAllocation", + "UnitWithPercentPriceInvoicingCycleConfiguration", "UnitWithPercentPriceItem", "UnitWithPercentPriceMaximum", "UnitWithPercentPriceMinimum", @@ -140,6 +149,7 @@ "MatrixWithAllocationPriceBillableMetric", "MatrixWithAllocationPriceBillingCycleConfiguration", "MatrixWithAllocationPriceCreditAllocation", + "MatrixWithAllocationPriceInvoicingCycleConfiguration", "MatrixWithAllocationPriceItem", "MatrixWithAllocationPriceMatrixWithAllocationConfig", "MatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", @@ -149,6 +159,7 @@ "TieredWithProrationPriceBillableMetric", "TieredWithProrationPriceBillingCycleConfiguration", "TieredWithProrationPriceCreditAllocation", + "TieredWithProrationPriceInvoicingCycleConfiguration", "TieredWithProrationPriceItem", "TieredWithProrationPriceMaximum", "TieredWithProrationPriceMinimum", @@ -156,6 +167,7 @@ "UnitWithProrationPriceBillableMetric", "UnitWithProrationPriceBillingCycleConfiguration", "UnitWithProrationPriceCreditAllocation", + "UnitWithProrationPriceInvoicingCycleConfiguration", "UnitWithProrationPriceItem", "UnitWithProrationPriceMaximum", "UnitWithProrationPriceMinimum", @@ -163,6 +175,7 @@ "GroupedAllocationPriceBillableMetric", "GroupedAllocationPriceBillingCycleConfiguration", "GroupedAllocationPriceCreditAllocation", + "GroupedAllocationPriceInvoicingCycleConfiguration", "GroupedAllocationPriceItem", "GroupedAllocationPriceMaximum", "GroupedAllocationPriceMinimum", @@ -170,6 +183,7 @@ "BulkWithProrationPriceBillableMetric", "BulkWithProrationPriceBillingCycleConfiguration", "BulkWithProrationPriceCreditAllocation", + "BulkWithProrationPriceInvoicingCycleConfiguration", "BulkWithProrationPriceItem", "BulkWithProrationPriceMaximum", "BulkWithProrationPriceMinimum", @@ -192,6 +206,12 @@ class UnitPriceCreditAllocation(BaseModel): currency: str +class UnitPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class UnitPriceItem(BaseModel): id: str @@ -230,7 +250,7 @@ class UnitPrice(BaseModel): billable_metric: Optional[UnitPriceBillableMetric] = None - billing_cycle_configuration: Optional[UnitPriceBillingCycleConfiguration] = None + billing_cycle_configuration: UnitPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -248,6 +268,8 @@ class UnitPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[UnitPriceInvoicingCycleConfiguration] = None + item: UnitPriceItem maximum: Optional[UnitPriceMaximum] = None @@ -293,6 +315,12 @@ class PackagePriceCreditAllocation(BaseModel): currency: str +class PackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class PackagePriceItem(BaseModel): id: str @@ -338,7 +366,7 @@ class PackagePrice(BaseModel): billable_metric: Optional[PackagePriceBillableMetric] = None - billing_cycle_configuration: Optional[PackagePriceBillingCycleConfiguration] = None + billing_cycle_configuration: PackagePriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -356,6 +384,8 @@ class PackagePrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[PackagePriceInvoicingCycleConfiguration] = None + item: PackagePriceItem maximum: Optional[PackagePriceMaximum] = None @@ -401,6 +431,12 @@ class MatrixPriceCreditAllocation(BaseModel): currency: str +class MatrixPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class MatrixPriceItem(BaseModel): id: str @@ -457,7 +493,7 @@ class MatrixPrice(BaseModel): billable_metric: Optional[MatrixPriceBillableMetric] = None - billing_cycle_configuration: Optional[MatrixPriceBillingCycleConfiguration] = None + billing_cycle_configuration: MatrixPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -475,6 +511,8 @@ class MatrixPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[MatrixPriceInvoicingCycleConfiguration] = None + item: MatrixPriceItem matrix_config: MatrixPriceMatrixConfig @@ -520,6 +558,12 @@ class TieredPriceCreditAllocation(BaseModel): currency: str +class TieredPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class TieredPriceItem(BaseModel): id: str @@ -569,7 +613,7 @@ class TieredPrice(BaseModel): billable_metric: Optional[TieredPriceBillableMetric] = None - billing_cycle_configuration: Optional[TieredPriceBillingCycleConfiguration] = None + billing_cycle_configuration: TieredPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -587,6 +631,8 @@ class TieredPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[TieredPriceInvoicingCycleConfiguration] = None + item: TieredPriceItem maximum: Optional[TieredPriceMaximum] = None @@ -632,6 +678,12 @@ class TieredBpsPriceCreditAllocation(BaseModel): currency: str +class TieredBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class TieredBpsPriceItem(BaseModel): id: str @@ -687,7 +739,7 @@ class TieredBpsPrice(BaseModel): billable_metric: Optional[TieredBpsPriceBillableMetric] = None - billing_cycle_configuration: Optional[TieredBpsPriceBillingCycleConfiguration] = None + billing_cycle_configuration: TieredBpsPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -705,6 +757,8 @@ class TieredBpsPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[TieredBpsPriceInvoicingCycleConfiguration] = None + item: TieredBpsPriceItem maximum: Optional[TieredBpsPriceMaximum] = None @@ -758,6 +812,12 @@ class BpsPriceCreditAllocation(BaseModel): currency: str +class BpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class BpsPriceItem(BaseModel): id: str @@ -791,7 +851,7 @@ class BpsPrice(BaseModel): billable_metric: Optional[BpsPriceBillableMetric] = None - billing_cycle_configuration: Optional[BpsPriceBillingCycleConfiguration] = None + billing_cycle_configuration: BpsPriceBillingCycleConfiguration bps_config: BpsPriceBpsConfig @@ -811,6 +871,8 @@ class BpsPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[BpsPriceInvoicingCycleConfiguration] = None + item: BpsPriceItem maximum: Optional[BpsPriceMaximum] = None @@ -873,6 +935,12 @@ class BulkBpsPriceCreditAllocation(BaseModel): currency: str +class BulkBpsPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class BulkBpsPriceItem(BaseModel): id: str @@ -906,7 +974,7 @@ class BulkBpsPrice(BaseModel): billable_metric: Optional[BulkBpsPriceBillableMetric] = None - billing_cycle_configuration: Optional[BulkBpsPriceBillingCycleConfiguration] = None + billing_cycle_configuration: BulkBpsPriceBillingCycleConfiguration bulk_bps_config: BulkBpsPriceBulkBpsConfig @@ -926,6 +994,8 @@ class BulkBpsPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[BulkBpsPriceInvoicingCycleConfiguration] = None + item: BulkBpsPriceItem maximum: Optional[BulkBpsPriceMaximum] = None @@ -982,6 +1052,12 @@ class BulkPriceCreditAllocation(BaseModel): currency: str +class BulkPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class BulkPriceItem(BaseModel): id: str @@ -1015,7 +1091,7 @@ class BulkPrice(BaseModel): billable_metric: Optional[BulkPriceBillableMetric] = None - billing_cycle_configuration: Optional[BulkPriceBillingCycleConfiguration] = None + billing_cycle_configuration: BulkPriceBillingCycleConfiguration bulk_config: BulkPriceBulkConfig @@ -1035,6 +1111,8 @@ class BulkPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[BulkPriceInvoicingCycleConfiguration] = None + item: BulkPriceItem maximum: Optional[BulkPriceMaximum] = None @@ -1078,6 +1156,12 @@ class ThresholdTotalAmountPriceCreditAllocation(BaseModel): currency: str +class ThresholdTotalAmountPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class ThresholdTotalAmountPriceItem(BaseModel): id: str @@ -1111,7 +1195,7 @@ class ThresholdTotalAmountPrice(BaseModel): billable_metric: Optional[ThresholdTotalAmountPriceBillableMetric] = None - billing_cycle_configuration: Optional[ThresholdTotalAmountPriceBillingCycleConfiguration] = None + billing_cycle_configuration: ThresholdTotalAmountPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -1129,6 +1213,8 @@ class ThresholdTotalAmountPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[ThresholdTotalAmountPriceInvoicingCycleConfiguration] = None + item: ThresholdTotalAmountPriceItem maximum: Optional[ThresholdTotalAmountPriceMaximum] = None @@ -1174,6 +1260,12 @@ class TieredPackagePriceCreditAllocation(BaseModel): currency: str +class TieredPackagePriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class TieredPackagePriceItem(BaseModel): id: str @@ -1207,7 +1299,7 @@ class TieredPackagePrice(BaseModel): billable_metric: Optional[TieredPackagePriceBillableMetric] = None - billing_cycle_configuration: Optional[TieredPackagePriceBillingCycleConfiguration] = None + billing_cycle_configuration: TieredPackagePriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -1225,6 +1317,8 @@ class TieredPackagePrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[TieredPackagePriceInvoicingCycleConfiguration] = None + item: TieredPackagePriceItem maximum: Optional[TieredPackagePriceMaximum] = None @@ -1270,6 +1364,12 @@ class GroupedTieredPriceCreditAllocation(BaseModel): currency: str +class GroupedTieredPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class GroupedTieredPriceItem(BaseModel): id: str @@ -1303,7 +1403,7 @@ class GroupedTieredPrice(BaseModel): billable_metric: Optional[GroupedTieredPriceBillableMetric] = None - billing_cycle_configuration: Optional[GroupedTieredPriceBillingCycleConfiguration] = None + billing_cycle_configuration: GroupedTieredPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -1323,6 +1423,8 @@ class GroupedTieredPrice(BaseModel): grouped_tiered_config: Dict[str, object] + invoicing_cycle_configuration: Optional[GroupedTieredPriceInvoicingCycleConfiguration] = None + item: GroupedTieredPriceItem maximum: Optional[GroupedTieredPriceMaximum] = None @@ -1366,6 +1468,12 @@ class TieredWithMinimumPriceCreditAllocation(BaseModel): currency: str +class TieredWithMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class TieredWithMinimumPriceItem(BaseModel): id: str @@ -1399,7 +1507,7 @@ class TieredWithMinimumPrice(BaseModel): billable_metric: Optional[TieredWithMinimumPriceBillableMetric] = None - billing_cycle_configuration: Optional[TieredWithMinimumPriceBillingCycleConfiguration] = None + billing_cycle_configuration: TieredWithMinimumPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -1417,6 +1525,8 @@ class TieredWithMinimumPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[TieredWithMinimumPriceInvoicingCycleConfiguration] = None + item: TieredWithMinimumPriceItem maximum: Optional[TieredWithMinimumPriceMaximum] = None @@ -1462,6 +1572,12 @@ class TieredPackageWithMinimumPriceCreditAllocation(BaseModel): currency: str +class TieredPackageWithMinimumPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class TieredPackageWithMinimumPriceItem(BaseModel): id: str @@ -1495,7 +1611,7 @@ class TieredPackageWithMinimumPrice(BaseModel): billable_metric: Optional[TieredPackageWithMinimumPriceBillableMetric] = None - billing_cycle_configuration: Optional[TieredPackageWithMinimumPriceBillingCycleConfiguration] = None + billing_cycle_configuration: TieredPackageWithMinimumPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -1513,6 +1629,8 @@ class TieredPackageWithMinimumPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[TieredPackageWithMinimumPriceInvoicingCycleConfiguration] = None + item: TieredPackageWithMinimumPriceItem maximum: Optional[TieredPackageWithMinimumPriceMaximum] = None @@ -1558,6 +1676,12 @@ class PackageWithAllocationPriceCreditAllocation(BaseModel): currency: str +class PackageWithAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class PackageWithAllocationPriceItem(BaseModel): id: str @@ -1591,7 +1715,7 @@ class PackageWithAllocationPrice(BaseModel): billable_metric: Optional[PackageWithAllocationPriceBillableMetric] = None - billing_cycle_configuration: Optional[PackageWithAllocationPriceBillingCycleConfiguration] = None + billing_cycle_configuration: PackageWithAllocationPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -1609,6 +1733,8 @@ class PackageWithAllocationPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[PackageWithAllocationPriceInvoicingCycleConfiguration] = None + item: PackageWithAllocationPriceItem maximum: Optional[PackageWithAllocationPriceMaximum] = None @@ -1654,6 +1780,12 @@ class UnitWithPercentPriceCreditAllocation(BaseModel): currency: str +class UnitWithPercentPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class UnitWithPercentPriceItem(BaseModel): id: str @@ -1687,7 +1819,7 @@ class UnitWithPercentPrice(BaseModel): billable_metric: Optional[UnitWithPercentPriceBillableMetric] = None - billing_cycle_configuration: Optional[UnitWithPercentPriceBillingCycleConfiguration] = None + billing_cycle_configuration: UnitWithPercentPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -1705,6 +1837,8 @@ class UnitWithPercentPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[UnitWithPercentPriceInvoicingCycleConfiguration] = None + item: UnitWithPercentPriceItem maximum: Optional[UnitWithPercentPriceMaximum] = None @@ -1750,6 +1884,12 @@ class MatrixWithAllocationPriceCreditAllocation(BaseModel): currency: str +class MatrixWithAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class MatrixWithAllocationPriceItem(BaseModel): id: str @@ -1809,7 +1949,7 @@ class MatrixWithAllocationPrice(BaseModel): billable_metric: Optional[MatrixWithAllocationPriceBillableMetric] = None - billing_cycle_configuration: Optional[MatrixWithAllocationPriceBillingCycleConfiguration] = None + billing_cycle_configuration: MatrixWithAllocationPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -1827,6 +1967,8 @@ class MatrixWithAllocationPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[MatrixWithAllocationPriceInvoicingCycleConfiguration] = None + item: MatrixWithAllocationPriceItem matrix_with_allocation_config: MatrixWithAllocationPriceMatrixWithAllocationConfig @@ -1872,6 +2014,12 @@ class TieredWithProrationPriceCreditAllocation(BaseModel): currency: str +class TieredWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class TieredWithProrationPriceItem(BaseModel): id: str @@ -1905,7 +2053,7 @@ class TieredWithProrationPrice(BaseModel): billable_metric: Optional[TieredWithProrationPriceBillableMetric] = None - billing_cycle_configuration: Optional[TieredWithProrationPriceBillingCycleConfiguration] = None + billing_cycle_configuration: TieredWithProrationPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -1923,6 +2071,8 @@ class TieredWithProrationPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[TieredWithProrationPriceInvoicingCycleConfiguration] = None + item: TieredWithProrationPriceItem maximum: Optional[TieredWithProrationPriceMaximum] = None @@ -1968,6 +2118,12 @@ class UnitWithProrationPriceCreditAllocation(BaseModel): currency: str +class UnitWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class UnitWithProrationPriceItem(BaseModel): id: str @@ -2001,7 +2157,7 @@ class UnitWithProrationPrice(BaseModel): billable_metric: Optional[UnitWithProrationPriceBillableMetric] = None - billing_cycle_configuration: Optional[UnitWithProrationPriceBillingCycleConfiguration] = None + billing_cycle_configuration: UnitWithProrationPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -2019,6 +2175,8 @@ class UnitWithProrationPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[UnitWithProrationPriceInvoicingCycleConfiguration] = None + item: UnitWithProrationPriceItem maximum: Optional[UnitWithProrationPriceMaximum] = None @@ -2064,6 +2222,12 @@ class GroupedAllocationPriceCreditAllocation(BaseModel): currency: str +class GroupedAllocationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class GroupedAllocationPriceItem(BaseModel): id: str @@ -2097,7 +2261,7 @@ class GroupedAllocationPrice(BaseModel): billable_metric: Optional[GroupedAllocationPriceBillableMetric] = None - billing_cycle_configuration: Optional[GroupedAllocationPriceBillingCycleConfiguration] = None + billing_cycle_configuration: GroupedAllocationPriceBillingCycleConfiguration cadence: Literal["one_time", "monthly", "quarterly", "semi_annual", "annual", "custom"] @@ -2117,6 +2281,8 @@ class GroupedAllocationPrice(BaseModel): grouped_allocation_config: Dict[str, object] + invoicing_cycle_configuration: Optional[GroupedAllocationPriceInvoicingCycleConfiguration] = None + item: GroupedAllocationPriceItem maximum: Optional[GroupedAllocationPriceMaximum] = None @@ -2160,6 +2326,12 @@ class BulkWithProrationPriceCreditAllocation(BaseModel): currency: str +class BulkWithProrationPriceInvoicingCycleConfiguration(BaseModel): + duration: int + + duration_unit: Literal["day", "month"] + + class BulkWithProrationPriceItem(BaseModel): id: str @@ -2193,7 +2365,7 @@ class BulkWithProrationPrice(BaseModel): billable_metric: Optional[BulkWithProrationPriceBillableMetric] = None - billing_cycle_configuration: Optional[BulkWithProrationPriceBillingCycleConfiguration] = None + billing_cycle_configuration: BulkWithProrationPriceBillingCycleConfiguration bulk_with_proration_config: Dict[str, object] @@ -2213,6 +2385,8 @@ class BulkWithProrationPrice(BaseModel): fixed_price_quantity: Optional[float] = None + invoicing_cycle_configuration: Optional[BulkWithProrationPriceInvoicingCycleConfiguration] = None + item: BulkWithProrationPriceItem maximum: Optional[BulkWithProrationPriceMaximum] = None diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index ad95be72..acdc2a58 100755 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -2,52 +2,86 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Required, TypeAlias - -from typing import Optional, Dict, List, Iterable - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict __all__ = [ "PriceCreateParams", "NewFloatingUnitPrice", "NewFloatingUnitPriceUnitConfig", + "NewFloatingUnitPriceBillingCycleConfiguration", + "NewFloatingUnitPriceInvoicingCycleConfiguration", "NewFloatingPackagePrice", "NewFloatingPackagePricePackageConfig", + "NewFloatingPackagePriceBillingCycleConfiguration", + "NewFloatingPackagePriceInvoicingCycleConfiguration", "NewFloatingMatrixPrice", "NewFloatingMatrixPriceMatrixConfig", "NewFloatingMatrixPriceMatrixConfigMatrixValue", + "NewFloatingMatrixPriceBillingCycleConfiguration", + "NewFloatingMatrixPriceInvoicingCycleConfiguration", "NewFloatingMatrixWithAllocationPrice", "NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig", "NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", + "NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration", + "NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration", "NewFloatingTieredPrice", "NewFloatingTieredPriceTieredConfig", "NewFloatingTieredPriceTieredConfigTier", + "NewFloatingTieredPriceBillingCycleConfiguration", + "NewFloatingTieredPriceInvoicingCycleConfiguration", "NewFloatingTieredBpsPrice", "NewFloatingTieredBpsPriceTieredBpsConfig", "NewFloatingTieredBpsPriceTieredBpsConfigTier", + "NewFloatingTieredBpsPriceBillingCycleConfiguration", + "NewFloatingTieredBpsPriceInvoicingCycleConfiguration", "NewFloatingBpsPrice", "NewFloatingBpsPriceBpsConfig", + "NewFloatingBpsPriceBillingCycleConfiguration", + "NewFloatingBpsPriceInvoicingCycleConfiguration", "NewFloatingBulkBpsPrice", "NewFloatingBulkBpsPriceBulkBpsConfig", "NewFloatingBulkBpsPriceBulkBpsConfigTier", + "NewFloatingBulkBpsPriceBillingCycleConfiguration", + "NewFloatingBulkBpsPriceInvoicingCycleConfiguration", "NewFloatingBulkPrice", "NewFloatingBulkPriceBulkConfig", "NewFloatingBulkPriceBulkConfigTier", + "NewFloatingBulkPriceBillingCycleConfiguration", + "NewFloatingBulkPriceInvoicingCycleConfiguration", "NewFloatingThresholdTotalAmountPrice", + "NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration", + "NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration", "NewFloatingTieredPackagePrice", + "NewFloatingTieredPackagePriceBillingCycleConfiguration", + "NewFloatingTieredPackagePriceInvoicingCycleConfiguration", "NewFloatingGroupedTieredPrice", + "NewFloatingGroupedTieredPriceBillingCycleConfiguration", + "NewFloatingGroupedTieredPriceInvoicingCycleConfiguration", "NewFloatingTieredWithMinimumPrice", + "NewFloatingTieredWithMinimumPriceBillingCycleConfiguration", + "NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration", "NewFloatingPackageWithAllocationPrice", + "NewFloatingPackageWithAllocationPriceBillingCycleConfiguration", + "NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration", "NewFloatingTieredPackageWithMinimumPrice", + "NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration", + "NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration", "NewFloatingUnitWithPercentPrice", + "NewFloatingUnitWithPercentPriceBillingCycleConfiguration", + "NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration", "NewFloatingTieredWithProrationPrice", + "NewFloatingTieredWithProrationPriceBillingCycleConfiguration", + "NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration", "NewFloatingUnitWithProrationPrice", + "NewFloatingUnitWithProrationPriceBillingCycleConfiguration", + "NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration", "NewFloatingGroupedAllocationPrice", + "NewFloatingGroupedAllocationPriceBillingCycleConfiguration", + "NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration", "NewFloatingBulkWithProrationPrice", + "NewFloatingBulkWithProrationPriceBillingCycleConfiguration", + "NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration", ] @@ -80,6 +114,12 @@ class NewFloatingUnitPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingUnitPriceBillingCycleConfiguration] + """ + 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.""" @@ -95,6 +135,12 @@ class NewFloatingUnitPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -108,6 +154,22 @@ class NewFloatingUnitPriceUnitConfig(TypedDict, total=False): """Rate per unit of usage""" +class NewFloatingUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -137,6 +199,12 @@ class NewFloatingPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingPackagePriceBillingCycleConfiguration] + """ + 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.""" @@ -152,6 +220,12 @@ class NewFloatingPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -172,6 +246,22 @@ class NewFloatingPackagePricePackageConfig(TypedDict, total=False): """ +class NewFloatingPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingMatrixPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -201,6 +291,12 @@ class NewFloatingMatrixPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingMatrixPriceBillingCycleConfiguration] + """ + 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.""" @@ -216,6 +312,12 @@ class NewFloatingMatrixPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -247,6 +349,22 @@ class NewFloatingMatrixPriceMatrixConfig(TypedDict, total=False): """Matrix values for specified matrix grouping keys""" +class NewFloatingMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -276,6 +394,12 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration] + """ + 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.""" @@ -291,6 +415,12 @@ class NewFloatingMatrixWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -325,6 +455,22 @@ class NewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig(TypedDict, """Matrix values for specified matrix grouping keys""" +class NewFloatingMatrixWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -354,6 +500,12 @@ class NewFloatingTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingTieredPriceBillingCycleConfiguration] + """ + 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.""" @@ -369,6 +521,12 @@ class NewFloatingTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -393,6 +551,22 @@ class NewFloatingTieredPriceTieredConfig(TypedDict, total=False): """Tiers for rating based on total usage quantities into the specified tier""" +class NewFloatingTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredBpsPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -422,6 +596,12 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingTieredBpsPriceBillingCycleConfiguration] + """ + 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.""" @@ -437,6 +617,12 @@ class NewFloatingTieredBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -467,6 +653,22 @@ class NewFloatingTieredBpsPriceTieredBpsConfig(TypedDict, total=False): """ +class NewFloatingTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingBpsPrice(TypedDict, total=False): bps_config: Required[NewFloatingBpsPriceBpsConfig] @@ -496,6 +698,12 @@ class NewFloatingBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingBpsPriceBillingCycleConfiguration] + """ + 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.""" @@ -511,6 +719,12 @@ class NewFloatingBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -527,6 +741,22 @@ class NewFloatingBpsPriceBpsConfig(TypedDict, total=False): """Optional currency amount maximum to cap spend per event""" +class NewFloatingBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingBulkBpsPrice(TypedDict, total=False): bulk_bps_config: Required[NewFloatingBulkBpsPriceBulkBpsConfig] @@ -556,6 +786,12 @@ class NewFloatingBulkBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingBulkBpsPriceBillingCycleConfiguration] + """ + 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.""" @@ -571,6 +807,12 @@ class NewFloatingBulkBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -598,6 +840,22 @@ class NewFloatingBulkBpsPriceBulkBpsConfig(TypedDict, total=False): """ +class NewFloatingBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingBulkPrice(TypedDict, total=False): bulk_config: Required[NewFloatingBulkPriceBulkConfig] @@ -627,6 +885,12 @@ class NewFloatingBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingBulkPriceBillingCycleConfiguration] + """ + 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.""" @@ -642,6 +906,12 @@ class NewFloatingBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -663,6 +933,22 @@ class NewFloatingBulkPriceBulkConfig(TypedDict, total=False): """Bulk tiers for rating based on total usage volume""" +class NewFloatingBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -692,6 +978,12 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration] + """ + 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.""" @@ -707,6 +999,12 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -715,6 +1013,22 @@ class NewFloatingThresholdTotalAmountPrice(TypedDict, total=False): """ +class NewFloatingThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -744,6 +1058,12 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingTieredPackagePriceBillingCycleConfiguration] + """ + 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.""" @@ -759,6 +1079,12 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -767,6 +1093,22 @@ class NewFloatingTieredPackagePrice(TypedDict, total=False): """ +class NewFloatingTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingGroupedTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -796,6 +1138,12 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingGroupedTieredPriceBillingCycleConfiguration] + """ + 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.""" @@ -811,6 +1159,12 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingGroupedTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -819,6 +1173,22 @@ class NewFloatingGroupedTieredPrice(TypedDict, total=False): """ +class NewFloatingGroupedTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingGroupedTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -848,6 +1218,12 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingTieredWithMinimumPriceBillingCycleConfiguration] + """ + 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.""" @@ -863,6 +1239,12 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -871,6 +1253,22 @@ class NewFloatingTieredWithMinimumPrice(TypedDict, total=False): """ +class NewFloatingTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -900,6 +1298,12 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingPackageWithAllocationPriceBillingCycleConfiguration] + """ + 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.""" @@ -915,6 +1319,12 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -923,6 +1333,22 @@ class NewFloatingPackageWithAllocationPrice(TypedDict, total=False): """ +class NewFloatingPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -952,6 +1378,12 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration] + """ + 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.""" @@ -967,6 +1399,12 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -975,6 +1413,22 @@ class NewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): """ +class NewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingUnitWithPercentPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1004,6 +1458,12 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingUnitWithPercentPriceBillingCycleConfiguration] + """ + 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.""" @@ -1019,6 +1479,12 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1027,6 +1493,22 @@ class NewFloatingUnitWithPercentPrice(TypedDict, total=False): """ +class NewFloatingUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingTieredWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1056,6 +1538,12 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingTieredWithProrationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1071,6 +1559,12 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1079,6 +1573,22 @@ class NewFloatingTieredWithProrationPrice(TypedDict, total=False): """ +class NewFloatingTieredWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingTieredWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingUnitWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1108,6 +1618,12 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingUnitWithProrationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1123,6 +1639,12 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1131,6 +1653,22 @@ class NewFloatingUnitWithProrationPrice(TypedDict, total=False): """ +class NewFloatingUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingGroupedAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1160,6 +1698,12 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingGroupedAllocationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1175,6 +1719,12 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1183,6 +1733,22 @@ class NewFloatingGroupedAllocationPrice(TypedDict, total=False): """ +class NewFloatingGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class NewFloatingBulkWithProrationPrice(TypedDict, total=False): bulk_with_proration_config: Required[Dict[str, object]] @@ -1212,6 +1778,12 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[NewFloatingBulkWithProrationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1227,6 +1799,12 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1235,6 +1813,22 @@ class NewFloatingBulkWithProrationPrice(TypedDict, total=False): """ +class NewFloatingBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class NewFloatingBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + PriceCreateParams: TypeAlias = Union[ NewFloatingUnitPrice, NewFloatingPackagePrice, diff --git a/src/orb/types/price_evaluate_params.py b/src/orb/types/price_evaluate_params.py index 5d6df76d..32b7c838 100755 --- a/src/orb/types/price_evaluate_params.py +++ b/src/orb/types/price_evaluate_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Required - -from typing import Union, Optional, List - +from typing import List, Union, Optional from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["PriceEvaluateParams"] diff --git a/src/orb/types/price_evaluate_response.py b/src/orb/types/price_evaluate_response.py index 4a669d78..793ed493 100755 --- a/src/orb/types/price_evaluate_response.py +++ b/src/orb/types/price_evaluate_response.py @@ -1,15 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List +from .._models import BaseModel from .evaluate_price_group import EvaluatePriceGroup -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["PriceEvaluateResponse"] diff --git a/src/orb/types/price_list_params.py b/src/orb/types/price_list_params.py index 02a0ef6a..d908c7f5 100755 --- a/src/orb/types/price_list_params.py +++ b/src/orb/types/price_list_params.py @@ -2,14 +2,8 @@ from __future__ import annotations -from typing_extensions import TypedDict - from typing import Optional - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing_extensions import TypedDict __all__ = ["PriceListParams"] diff --git a/src/orb/types/price_update_params.py b/src/orb/types/price_update_params.py index bf8a44c6..d6396a1b 100755 --- a/src/orb/types/price_update_params.py +++ b/src/orb/types/price_update_params.py @@ -2,15 +2,9 @@ from __future__ import annotations +from typing import Dict, Optional from typing_extensions import TypedDict -from typing import Optional, Dict - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["PriceUpdateParams"] diff --git a/src/orb/types/prices/external_price_id_update_params.py b/src/orb/types/prices/external_price_id_update_params.py index f84e963d..9b431435 100755 --- a/src/orb/types/prices/external_price_id_update_params.py +++ b/src/orb/types/prices/external_price_id_update_params.py @@ -2,15 +2,9 @@ from __future__ import annotations +from typing import Dict, Optional from typing_extensions import TypedDict -from typing import Optional, Dict - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from ..._types import FileTypes -from ..._utils import PropertyInfo - __all__ = ["ExternalPriceIDUpdateParams"] diff --git a/src/orb/types/shared/__init__.py b/src/orb/types/shared/__init__.py index 3f790a1d..98c8e5c0 100755 --- a/src/orb/types/shared/__init__.py +++ b/src/orb/types/shared/__init__.py @@ -1,5 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate from .discount import Discount as Discount from .pagination_metadata import PaginationMetadata as PaginationMetadata +from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate diff --git a/src/orb/types/shared/billing_cycle_relative_date.py b/src/orb/types/shared/billing_cycle_relative_date.py index 35de9f7a..b4e6a488 100755 --- a/src/orb/types/shared/billing_cycle_relative_date.py +++ b/src/orb/types/shared/billing_cycle_relative_date.py @@ -2,13 +2,6 @@ from typing_extensions import Literal, TypeAlias -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - __all__ = ["BillingCycleRelativeDate"] BillingCycleRelativeDate: TypeAlias = Literal["start_of_term", "end_of_term"] diff --git a/src/orb/types/shared/discount.py b/src/orb/types/shared/discount.py index 3fba654d..866b378c 100755 --- a/src/orb/types/shared/discount.py +++ b/src/orb/types/shared/discount.py @@ -1,18 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - -from typing import List, Optional - -from typing_extensions import Literal, TypeAlias, Annotated +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias from ..._utils import PropertyInfo - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - from ..._models import BaseModel __all__ = ["Discount", "PercentageDiscount", "TrialDiscount", "UsageDiscount", "AmountDiscount"] diff --git a/src/orb/types/shared/pagination_metadata.py b/src/orb/types/shared/pagination_metadata.py index 36b4a3d3..8390ceb5 100755 --- a/src/orb/types/shared/pagination_metadata.py +++ b/src/orb/types/shared/pagination_metadata.py @@ -1,14 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from ..._models import BaseModel - from typing import Optional -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - from ..._models import BaseModel __all__ = ["PaginationMetadata"] diff --git a/src/orb/types/shared_params/__init__.py b/src/orb/types/shared_params/__init__.py index 4cc25f45..ed0e0225 100755 --- a/src/orb/types/shared_params/__init__.py +++ b/src/orb/types/shared_params/__init__.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate from .discount import Discount as Discount +from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate diff --git a/src/orb/types/shared_params/discount.py b/src/orb/types/shared_params/discount.py index 3c6958e6..17e76491 100755 --- a/src/orb/types/shared_params/discount.py +++ b/src/orb/types/shared_params/discount.py @@ -2,9 +2,8 @@ from __future__ import annotations -from typing import List, Optional, Union - -from typing_extensions import Literal, TypedDict, Required, TypeAlias +from typing import List, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict __all__ = ["Discount", "PercentageDiscount", "TrialDiscount", "UsageDiscount", "AmountDiscount"] diff --git a/src/orb/types/subscription.py b/src/orb/types/subscription.py index e2d5825d..3c7a08d7 100755 --- a/src/orb/types/subscription.py +++ b/src/orb/types/subscription.py @@ -1,25 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from typing_extensions import Literal, TypeAlias, Annotated - -from typing import List, Optional, Dict - -from .._utils import PropertyInfo - +from typing import Dict, List, Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias +from .plan import Plan from .price import Price - +from .._utils import PropertyInfo +from .._models import BaseModel from .customer import Customer -from .plan import Plan - -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = [ "Subscription", "AdjustmentInterval", @@ -29,6 +19,7 @@ "AdjustmentIntervalAdjustmentUsageDiscountAdjustment", "AdjustmentIntervalAdjustmentMinimumAdjustment", "AdjustmentIntervalAdjustmentMaximumAdjustment", + "BillingCycleAnchorConfiguration", "DiscountInterval", "DiscountIntervalAmountDiscountInterval", "DiscountIntervalPercentageDiscountInterval", @@ -153,6 +144,30 @@ class AdjustmentInterval(BaseModel): """The start date of the adjustment interval.""" +class BillingCycleAnchorConfiguration(BaseModel): + day: int + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] = None + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] = None + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + class DiscountIntervalAmountDiscountInterval(BaseModel): amount_discount: str """Only available if discount_type is `amount`.""" @@ -590,6 +605,8 @@ class Subscription(BaseModel): the plan's behavior. If null, defaults to the customer's setting. """ + billing_cycle_anchor_configuration: BillingCycleAnchorConfiguration + billing_cycle_day: int """The day of the month on which the billing cycle is anchored. diff --git a/src/orb/types/subscription_cancel_params.py b/src/orb/types/subscription_cancel_params.py index 884f484d..6ce855b1 100755 --- a/src/orb/types/subscription_cancel_params.py +++ b/src/orb/types/subscription_cancel_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Required, Annotated - from typing import Union - from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SubscriptionCancelParams"] diff --git a/src/orb/types/subscription_create_params.py b/src/orb/types/subscription_create_params.py index a4b476e6..70278f13 100755 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -2,21 +2,15 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Literal, Required, TypeAlias - -from typing import Optional, Union, Dict, Iterable, List - +from typing import Dict, List, Union, Iterable, Optional from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = [ "SubscriptionCreateParams", + "BillingCycleAnchorConfiguration", "PriceOverride", "PriceOverrideOverrideUnitPrice", "PriceOverrideOverrideUnitPriceUnitConfig", @@ -57,6 +51,10 @@ "PriceOverrideOverridePackageWithAllocationPriceDiscount", "PriceOverrideOverrideUnitWithPercentPrice", "PriceOverrideOverrideUnitWithPercentPriceDiscount", + "PriceOverrideOverrideGroupedAllocationPrice", + "PriceOverrideOverrideGroupedAllocationPriceDiscount", + "PriceOverrideOverrideBulkWithProrationPrice", + "PriceOverrideOverrideBulkWithProrationPriceDiscount", ] @@ -67,6 +65,8 @@ class SubscriptionCreateParams(TypedDict, total=False): aws_region: Optional[str] + billing_cycle_anchor_configuration: Optional[BillingCycleAnchorConfiguration] + coupon_redemption_code: Optional[str] credits_overage_rate: Optional[float] @@ -116,6 +116,30 @@ class SubscriptionCreateParams(TypedDict, total=False): start_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] +class BillingCycleAnchorConfiguration(TypedDict, total=False): + day: Required[int] + """The day of the month on which the billing cycle is anchored. + + If the maximum number of days in a month is greater than this value, the last + day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April + means the billing period begins on the 30th. + """ + + month: Optional[int] + """The month on which the billing cycle is anchored (e.g. + + a quarterly price anchored in February would have cycles starting February, May, + August, and November). + """ + + year: Optional[int] + """The year on which the billing cycle is anchored (e.g. + + a 2 year billing cycle anchored on 2021 would have cycles starting on 2021, + 2023, 2025, etc.). + """ + + class PriceOverrideOverrideUnitPriceUnitConfig(TypedDict, total=False): unit_amount: Required[str] """Rate per unit of usage""" @@ -975,6 +999,120 @@ class PriceOverrideOverrideUnitWithPercentPrice(TypedDict, total=False): """The subscription's override minimum amount for the plan.""" +class PriceOverrideOverrideGroupedAllocationPriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "trial", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: Optional[List[str]] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + trial_amount_discount: Optional[str] + """Only available if discount_type is `trial`""" + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceOverrideOverrideGroupedAllocationPrice(TypedDict, total=False): + id: Required[str] + + grouped_allocation_config: Required[Dict[str, object]] + + model_type: Required[Literal["grouped_allocation"]] + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """The currency of the price. + + If not provided, the currency of the plan will be used. + """ + + discount: Optional[PriceOverrideOverrideGroupedAllocationPriceDiscount] + """The subscription's override discount for the plan.""" + + fixed_price_quantity: Optional[float] + """The starting quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] + """The subscription's override maximum amount for the plan.""" + + minimum_amount: Optional[str] + """The subscription's override minimum amount for the plan.""" + + +class PriceOverrideOverrideBulkWithProrationPriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "trial", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: Optional[List[str]] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + trial_amount_discount: Optional[str] + """Only available if discount_type is `trial`""" + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceOverrideOverrideBulkWithProrationPrice(TypedDict, total=False): + id: Required[str] + + bulk_with_proration_config: Required[Dict[str, object]] + + model_type: Required[Literal["bulk_with_proration"]] + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """The currency of the price. + + If not provided, the currency of the plan will be used. + """ + + discount: Optional[PriceOverrideOverrideBulkWithProrationPriceDiscount] + """The subscription's override discount for the plan.""" + + fixed_price_quantity: Optional[float] + """The starting quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] + """The subscription's override maximum amount for the plan.""" + + minimum_amount: Optional[str] + """The subscription's override minimum amount for the plan.""" + + PriceOverride: TypeAlias = Union[ PriceOverrideOverrideUnitPrice, PriceOverrideOverridePackagePrice, @@ -989,4 +1127,6 @@ class PriceOverrideOverrideUnitWithPercentPrice(TypedDict, total=False): PriceOverrideOverrideTieredWithMinimumPrice, PriceOverrideOverridePackageWithAllocationPrice, PriceOverrideOverrideUnitWithPercentPrice, + PriceOverrideOverrideGroupedAllocationPrice, + PriceOverrideOverrideBulkWithProrationPrice, ] diff --git a/src/orb/types/subscription_fetch_costs_params.py b/src/orb/types/subscription_fetch_costs_params.py index 7caeb829..38266115 100755 --- a/src/orb/types/subscription_fetch_costs_params.py +++ b/src/orb/types/subscription_fetch_costs_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Literal - -from typing import Optional, Union - +from typing import Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SubscriptionFetchCostsParams"] diff --git a/src/orb/types/subscription_fetch_costs_response.py b/src/orb/types/subscription_fetch_costs_response.py index 0027e74c..af400e65 100755 --- a/src/orb/types/subscription_fetch_costs_response.py +++ b/src/orb/types/subscription_fetch_costs_response.py @@ -1,16 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - -from .price import Price - -from typing import Optional, List - +from typing import List, Optional from datetime import datetime -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .price import Price +from .._models import BaseModel __all__ = ["SubscriptionFetchCostsResponse", "Data", "DataPerPriceCost"] diff --git a/src/orb/types/subscription_fetch_schedule_params.py b/src/orb/types/subscription_fetch_schedule_params.py index 106c0d49..3d7b2978 100755 --- a/src/orb/types/subscription_fetch_schedule_params.py +++ b/src/orb/types/subscription_fetch_schedule_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated - -from typing import Optional, Union - +from typing import Union, Optional from datetime import datetime +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SubscriptionFetchScheduleParams"] diff --git a/src/orb/types/subscription_fetch_schedule_response.py b/src/orb/types/subscription_fetch_schedule_response.py index 295646b7..38a3999c 100755 --- a/src/orb/types/subscription_fetch_schedule_response.py +++ b/src/orb/types/subscription_fetch_schedule_response.py @@ -1,14 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import Optional - from datetime import datetime -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo +from .._models import BaseModel __all__ = ["SubscriptionFetchScheduleResponse", "Plan"] diff --git a/src/orb/types/subscription_fetch_usage_params.py b/src/orb/types/subscription_fetch_usage_params.py index dd84c24f..6728382e 100755 --- a/src/orb/types/subscription_fetch_usage_params.py +++ b/src/orb/types/subscription_fetch_usage_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Annotated - -from typing import Optional, Union - +from typing import Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SubscriptionFetchUsageParams"] diff --git a/src/orb/types/subscription_list_params.py b/src/orb/types/subscription_list_params.py index 4f341ef9..16a3a1af 100755 --- a/src/orb/types/subscription_list_params.py +++ b/src/orb/types/subscription_list_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated, Literal - -from typing import Union, Optional, List - +from typing import List, Union, Optional from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SubscriptionListParams"] @@ -34,13 +27,9 @@ class SubscriptionListParams(TypedDict, total=False): request. """ - query_customer_id: Annotated[Optional[str], PropertyInfo(alias="customer_id")] - - query_customer_id: Annotated[Optional[List[str]], PropertyInfo(alias="customer_id")] - - query_external_customer_id: Annotated[Optional[str], PropertyInfo(alias="external_customer_id")] + customer_id: Optional[List[str]] - query_external_customer_id: Annotated[Optional[List[str]], PropertyInfo(alias="external_customer_id")] + external_customer_id: Optional[str] limit: int """The number of items to fetch. Defaults to 20.""" diff --git a/src/orb/types/subscription_price_intervals_params.py b/src/orb/types/subscription_price_intervals_params.py index a407cd25..f15230d1 100755 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -2,20 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Required, TypeAlias, Annotated - -from typing import Iterable, Union, Optional, Dict, List - +from typing import Dict, List, Union, Iterable, Optional from datetime import datetime - -from .shared.billing_cycle_relative_date import BillingCycleRelativeDate +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from .shared.billing_cycle_relative_date import BillingCycleRelativeDate __all__ = [ "SubscriptionPriceIntervalsParams", @@ -29,39 +21,79 @@ "AddPrice", "AddPriceNewFloatingUnitPrice", "AddPriceNewFloatingUnitPriceUnitConfig", + "AddPriceNewFloatingUnitPriceBillingCycleConfiguration", + "AddPriceNewFloatingUnitPriceInvoicingCycleConfiguration", "AddPriceNewFloatingPackagePrice", "AddPriceNewFloatingPackagePricePackageConfig", + "AddPriceNewFloatingPackagePriceBillingCycleConfiguration", + "AddPriceNewFloatingPackagePriceInvoicingCycleConfiguration", "AddPriceNewFloatingMatrixPrice", "AddPriceNewFloatingMatrixPriceMatrixConfig", "AddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue", + "AddPriceNewFloatingMatrixPriceBillingCycleConfiguration", + "AddPriceNewFloatingMatrixPriceInvoicingCycleConfiguration", "AddPriceNewFloatingMatrixWithAllocationPrice", "AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig", "AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue", + "AddPriceNewFloatingMatrixWithAllocationPriceBillingCycleConfiguration", + "AddPriceNewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration", "AddPriceNewFloatingTieredPrice", "AddPriceNewFloatingTieredPriceTieredConfig", "AddPriceNewFloatingTieredPriceTieredConfigTier", + "AddPriceNewFloatingTieredPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredPriceInvoicingCycleConfiguration", "AddPriceNewFloatingTieredBpsPrice", "AddPriceNewFloatingTieredBpsPriceTieredBpsConfig", "AddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier", + "AddPriceNewFloatingTieredBpsPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredBpsPriceInvoicingCycleConfiguration", "AddPriceNewFloatingBpsPrice", "AddPriceNewFloatingBpsPriceBpsConfig", + "AddPriceNewFloatingBpsPriceBillingCycleConfiguration", + "AddPriceNewFloatingBpsPriceInvoicingCycleConfiguration", "AddPriceNewFloatingBulkBpsPrice", "AddPriceNewFloatingBulkBpsPriceBulkBpsConfig", "AddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier", + "AddPriceNewFloatingBulkBpsPriceBillingCycleConfiguration", + "AddPriceNewFloatingBulkBpsPriceInvoicingCycleConfiguration", "AddPriceNewFloatingBulkPrice", "AddPriceNewFloatingBulkPriceBulkConfig", "AddPriceNewFloatingBulkPriceBulkConfigTier", + "AddPriceNewFloatingBulkPriceBillingCycleConfiguration", + "AddPriceNewFloatingBulkPriceInvoicingCycleConfiguration", "AddPriceNewFloatingThresholdTotalAmountPrice", + "AddPriceNewFloatingThresholdTotalAmountPriceBillingCycleConfiguration", + "AddPriceNewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration", "AddPriceNewFloatingTieredPackagePrice", + "AddPriceNewFloatingTieredPackagePriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredPackagePriceInvoicingCycleConfiguration", "AddPriceNewFloatingGroupedTieredPrice", + "AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration", + "AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration", "AddPriceNewFloatingTieredWithMinimumPrice", + "AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration", "AddPriceNewFloatingPackageWithAllocationPrice", + "AddPriceNewFloatingPackageWithAllocationPriceBillingCycleConfiguration", + "AddPriceNewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration", "AddPriceNewFloatingTieredPackageWithMinimumPrice", + "AddPriceNewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration", "AddPriceNewFloatingUnitWithPercentPrice", + "AddPriceNewFloatingUnitWithPercentPriceBillingCycleConfiguration", + "AddPriceNewFloatingUnitWithPercentPriceInvoicingCycleConfiguration", "AddPriceNewFloatingTieredWithProrationPrice", + "AddPriceNewFloatingTieredWithProrationPriceBillingCycleConfiguration", + "AddPriceNewFloatingTieredWithProrationPriceInvoicingCycleConfiguration", "AddPriceNewFloatingUnitWithProrationPrice", + "AddPriceNewFloatingUnitWithProrationPriceBillingCycleConfiguration", + "AddPriceNewFloatingUnitWithProrationPriceInvoicingCycleConfiguration", "AddPriceNewFloatingGroupedAllocationPrice", + "AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration", + "AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration", "AddPriceNewFloatingBulkWithProrationPrice", + "AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration", + "AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration", "AddAdjustment", "AddAdjustmentAdjustment", "AddAdjustmentAdjustmentNewPercentageDiscount", @@ -155,6 +187,22 @@ class AddPriceNewFloatingUnitPriceUnitConfig(TypedDict, total=False): """Rate per unit of usage""" +class AddPriceNewFloatingUnitPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingUnitPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingUnitPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -184,6 +232,12 @@ class AddPriceNewFloatingUnitPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingUnitPriceBillingCycleConfiguration] + """ + 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.""" @@ -199,6 +253,12 @@ class AddPriceNewFloatingUnitPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingUnitPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -219,6 +279,22 @@ class AddPriceNewFloatingPackagePricePackageConfig(TypedDict, total=False): """ +class AddPriceNewFloatingPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -248,6 +324,12 @@ class AddPriceNewFloatingPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingPackagePriceBillingCycleConfiguration] + """ + 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.""" @@ -263,6 +345,12 @@ class AddPriceNewFloatingPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -294,6 +382,22 @@ class AddPriceNewFloatingMatrixPriceMatrixConfig(TypedDict, total=False): """Matrix values for specified matrix grouping keys""" +class AddPriceNewFloatingMatrixPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingMatrixPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingMatrixPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -323,6 +427,12 @@ class AddPriceNewFloatingMatrixPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingMatrixPriceBillingCycleConfiguration] + """ + 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.""" @@ -338,6 +448,12 @@ class AddPriceNewFloatingMatrixPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingMatrixPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -372,6 +488,22 @@ class AddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig(Typ """Matrix values for specified matrix grouping keys""" +class AddPriceNewFloatingMatrixWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingMatrixWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -401,6 +533,12 @@ class AddPriceNewFloatingMatrixWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithAllocationPriceBillingCycleConfiguration] + """ + 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.""" @@ -416,6 +554,12 @@ class AddPriceNewFloatingMatrixWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingMatrixWithAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -440,6 +584,22 @@ class AddPriceNewFloatingTieredPriceTieredConfig(TypedDict, total=False): """Tiers for rating based on total usage quantities into the specified tier""" +class AddPriceNewFloatingTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -469,6 +629,12 @@ class AddPriceNewFloatingTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredPriceBillingCycleConfiguration] + """ + 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.""" @@ -484,6 +650,12 @@ class AddPriceNewFloatingTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -514,6 +686,22 @@ class AddPriceNewFloatingTieredBpsPriceTieredBpsConfig(TypedDict, total=False): """ +class AddPriceNewFloatingTieredBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingTieredBpsPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -543,6 +731,12 @@ class AddPriceNewFloatingTieredBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredBpsPriceBillingCycleConfiguration] + """ + 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.""" @@ -558,6 +752,12 @@ class AddPriceNewFloatingTieredBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -574,6 +774,22 @@ class AddPriceNewFloatingBpsPriceBpsConfig(TypedDict, total=False): """Optional currency amount maximum to cap spend per event""" +class AddPriceNewFloatingBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingBpsPrice(TypedDict, total=False): bps_config: Required[AddPriceNewFloatingBpsPriceBpsConfig] @@ -603,6 +819,12 @@ class AddPriceNewFloatingBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingBpsPriceBillingCycleConfiguration] + """ + 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.""" @@ -618,6 +840,12 @@ class AddPriceNewFloatingBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -645,6 +873,22 @@ class AddPriceNewFloatingBulkBpsPriceBulkBpsConfig(TypedDict, total=False): """ +class AddPriceNewFloatingBulkBpsPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBulkBpsPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingBulkBpsPrice(TypedDict, total=False): bulk_bps_config: Required[AddPriceNewFloatingBulkBpsPriceBulkBpsConfig] @@ -674,6 +918,12 @@ class AddPriceNewFloatingBulkBpsPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingBulkBpsPriceBillingCycleConfiguration] + """ + 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.""" @@ -689,6 +939,12 @@ class AddPriceNewFloatingBulkBpsPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingBulkBpsPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -710,6 +966,22 @@ class AddPriceNewFloatingBulkPriceBulkConfig(TypedDict, total=False): """Bulk tiers for rating based on total usage volume""" +class AddPriceNewFloatingBulkPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBulkPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingBulkPrice(TypedDict, total=False): bulk_config: Required[AddPriceNewFloatingBulkPriceBulkConfig] @@ -739,6 +1011,12 @@ class AddPriceNewFloatingBulkPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingBulkPriceBillingCycleConfiguration] + """ + 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.""" @@ -754,6 +1032,12 @@ class AddPriceNewFloatingBulkPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingBulkPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -762,6 +1046,22 @@ class AddPriceNewFloatingBulkPrice(TypedDict, total=False): """ +class AddPriceNewFloatingThresholdTotalAmountPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingThresholdTotalAmountPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -791,6 +1091,12 @@ class AddPriceNewFloatingThresholdTotalAmountPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingThresholdTotalAmountPriceBillingCycleConfiguration] + """ + 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.""" @@ -806,6 +1112,12 @@ class AddPriceNewFloatingThresholdTotalAmountPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingThresholdTotalAmountPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -814,6 +1126,22 @@ class AddPriceNewFloatingThresholdTotalAmountPrice(TypedDict, total=False): """ +class AddPriceNewFloatingTieredPackagePriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredPackagePriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingTieredPackagePrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -843,6 +1171,12 @@ class AddPriceNewFloatingTieredPackagePrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackagePriceBillingCycleConfiguration] + """ + 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.""" @@ -858,6 +1192,12 @@ class AddPriceNewFloatingTieredPackagePrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackagePriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -866,6 +1206,22 @@ class AddPriceNewFloatingTieredPackagePrice(TypedDict, total=False): """ +class AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingGroupedTieredPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -895,6 +1251,12 @@ class AddPriceNewFloatingGroupedTieredPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPriceBillingCycleConfiguration] + """ + 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.""" @@ -910,6 +1272,12 @@ class AddPriceNewFloatingGroupedTieredPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingGroupedTieredPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -918,6 +1286,22 @@ class AddPriceNewFloatingGroupedTieredPrice(TypedDict, total=False): """ +class AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingTieredWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -947,6 +1331,12 @@ class AddPriceNewFloatingTieredWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithMinimumPriceBillingCycleConfiguration] + """ + 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.""" @@ -962,6 +1352,12 @@ class AddPriceNewFloatingTieredWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithMinimumPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -970,6 +1366,22 @@ class AddPriceNewFloatingTieredWithMinimumPrice(TypedDict, total=False): """ +class AddPriceNewFloatingPackageWithAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingPackageWithAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -999,6 +1411,12 @@ class AddPriceNewFloatingPackageWithAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingPackageWithAllocationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1014,6 +1432,12 @@ class AddPriceNewFloatingPackageWithAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingPackageWithAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1022,6 +1446,22 @@ class AddPriceNewFloatingPackageWithAllocationPrice(TypedDict, total=False): """ +class AddPriceNewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1051,6 +1491,12 @@ class AddPriceNewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackageWithMinimumPriceBillingCycleConfiguration] + """ + 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.""" @@ -1066,6 +1512,12 @@ class AddPriceNewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredPackageWithMinimumPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1074,6 +1526,22 @@ class AddPriceNewFloatingTieredPackageWithMinimumPrice(TypedDict, total=False): """ +class AddPriceNewFloatingUnitWithPercentPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingUnitWithPercentPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingUnitWithPercentPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1103,6 +1571,12 @@ class AddPriceNewFloatingUnitWithPercentPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithPercentPriceBillingCycleConfiguration] + """ + 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.""" @@ -1118,6 +1592,12 @@ class AddPriceNewFloatingUnitWithPercentPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithPercentPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1126,6 +1606,22 @@ class AddPriceNewFloatingUnitWithPercentPrice(TypedDict, total=False): """ +class AddPriceNewFloatingTieredWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingTieredWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingTieredWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1155,6 +1651,12 @@ class AddPriceNewFloatingTieredWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithProrationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1170,6 +1672,12 @@ class AddPriceNewFloatingTieredWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingTieredWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1178,6 +1686,22 @@ class AddPriceNewFloatingTieredWithProrationPrice(TypedDict, total=False): """ +class AddPriceNewFloatingUnitWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingUnitWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingUnitWithProrationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1207,6 +1731,12 @@ class AddPriceNewFloatingUnitWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithProrationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1222,6 +1752,12 @@ class AddPriceNewFloatingUnitWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingUnitWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1230,6 +1766,22 @@ class AddPriceNewFloatingUnitWithProrationPrice(TypedDict, total=False): """ +class AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingGroupedAllocationPrice(TypedDict, total=False): cadence: Required[Literal["annual", "semi_annual", "monthly", "quarterly", "one_time", "custom"]] """The cadence to bill for this price on.""" @@ -1259,6 +1811,12 @@ class AddPriceNewFloatingGroupedAllocationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingGroupedAllocationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1274,6 +1832,12 @@ class AddPriceNewFloatingGroupedAllocationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingGroupedAllocationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. @@ -1282,6 +1846,22 @@ class AddPriceNewFloatingGroupedAllocationPrice(TypedDict, total=False): """ +class AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + +class AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration(TypedDict, total=False): + duration: Required[int] + """The duration of the billing period.""" + + duration_unit: Required[Literal["day", "month"]] + """The unit of billing period duration.""" + + class AddPriceNewFloatingBulkWithProrationPrice(TypedDict, total=False): bulk_with_proration_config: Required[Dict[str, object]] @@ -1311,6 +1891,12 @@ class AddPriceNewFloatingBulkWithProrationPrice(TypedDict, total=False): this is true, and in-arrears if this is false. """ + billing_cycle_configuration: Optional[AddPriceNewFloatingBulkWithProrationPriceBillingCycleConfiguration] + """ + 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.""" @@ -1326,6 +1912,12 @@ class AddPriceNewFloatingBulkWithProrationPrice(TypedDict, total=False): invoice_grouping_key: Optional[str] """The property used to group this price on an invoice""" + invoicing_cycle_configuration: Optional[AddPriceNewFloatingBulkWithProrationPriceInvoicingCycleConfiguration] + """Within each billing cycle, specifies the cadence at which invoices are produced. + + If unspecified, a single invoice is produced per billing cycle. + """ + metadata: Optional[Dict[str, Optional[str]]] """User-specified key/value pairs for the resource. diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index cbaa4056..4b2a090b 100755 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Literal, Required, Annotated, TypeAlias - -from typing import Optional, Union, Iterable, List, Dict - +from typing import Dict, List, Union, Iterable, Optional from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = [ "SubscriptionSchedulePlanChangeParams", "PriceOverride", @@ -57,6 +50,10 @@ "PriceOverrideOverridePackageWithAllocationPriceDiscount", "PriceOverrideOverrideUnitWithPercentPrice", "PriceOverrideOverrideUnitWithPercentPriceDiscount", + "PriceOverrideOverrideGroupedAllocationPrice", + "PriceOverrideOverrideGroupedAllocationPriceDiscount", + "PriceOverrideOverrideBulkWithProrationPrice", + "PriceOverrideOverrideBulkWithProrationPriceDiscount", ] @@ -978,6 +975,120 @@ class PriceOverrideOverrideUnitWithPercentPrice(TypedDict, total=False): """The subscription's override minimum amount for the plan.""" +class PriceOverrideOverrideGroupedAllocationPriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "trial", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: Optional[List[str]] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + trial_amount_discount: Optional[str] + """Only available if discount_type is `trial`""" + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceOverrideOverrideGroupedAllocationPrice(TypedDict, total=False): + id: Required[str] + + grouped_allocation_config: Required[Dict[str, object]] + + model_type: Required[Literal["grouped_allocation"]] + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """The currency of the price. + + If not provided, the currency of the plan will be used. + """ + + discount: Optional[PriceOverrideOverrideGroupedAllocationPriceDiscount] + """The subscription's override discount for the plan.""" + + fixed_price_quantity: Optional[float] + """The starting quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] + """The subscription's override maximum amount for the plan.""" + + minimum_amount: Optional[str] + """The subscription's override minimum amount for the plan.""" + + +class PriceOverrideOverrideBulkWithProrationPriceDiscount(TypedDict, total=False): + discount_type: Required[Literal["percentage", "trial", "usage", "amount"]] + + amount_discount: Optional[str] + """Only available if discount_type is `amount`.""" + + applies_to_price_ids: Optional[List[str]] + """List of price_ids that this discount applies to. + + For plan/plan phase discounts, this can be a subset of prices. + """ + + percentage_discount: Optional[float] + """Only available if discount_type is `percentage`. + + This is a number between 0 and 1. + """ + + trial_amount_discount: Optional[str] + """Only available if discount_type is `trial`""" + + usage_discount: Optional[float] + """Only available if discount_type is `usage`. + + Number of usage units that this discount is for + """ + + +class PriceOverrideOverrideBulkWithProrationPrice(TypedDict, total=False): + id: Required[str] + + bulk_with_proration_config: Required[Dict[str, object]] + + model_type: Required[Literal["bulk_with_proration"]] + + conversion_rate: Optional[float] + """The per unit conversion rate of the price currency to the invoicing currency.""" + + currency: Optional[str] + """The currency of the price. + + If not provided, the currency of the plan will be used. + """ + + discount: Optional[PriceOverrideOverrideBulkWithProrationPriceDiscount] + """The subscription's override discount for the plan.""" + + fixed_price_quantity: Optional[float] + """The starting quantity of the price, if the price is a fixed price.""" + + maximum_amount: Optional[str] + """The subscription's override maximum amount for the plan.""" + + minimum_amount: Optional[str] + """The subscription's override minimum amount for the plan.""" + + PriceOverride: TypeAlias = Union[ PriceOverrideOverrideUnitPrice, PriceOverrideOverridePackagePrice, @@ -992,4 +1103,6 @@ class PriceOverrideOverrideUnitWithPercentPrice(TypedDict, total=False): PriceOverrideOverrideTieredWithMinimumPrice, PriceOverrideOverridePackageWithAllocationPrice, PriceOverrideOverrideUnitWithPercentPrice, + PriceOverrideOverrideGroupedAllocationPrice, + PriceOverrideOverrideBulkWithProrationPrice, ] diff --git a/src/orb/types/subscription_trigger_phase_params.py b/src/orb/types/subscription_trigger_phase_params.py index d45f953d..504862ad 100755 --- a/src/orb/types/subscription_trigger_phase_params.py +++ b/src/orb/types/subscription_trigger_phase_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Annotated - from typing import Union - from datetime import date +from typing_extensions import Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SubscriptionTriggerPhaseParams"] diff --git a/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_params.py b/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_params.py index 4dce933b..ebe0f0a7 100755 --- a/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_params.py +++ b/src/orb/types/subscription_unschedule_fixed_fee_quantity_updates_params.py @@ -2,12 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo +from typing_extensions import Required, TypedDict __all__ = ["SubscriptionUnscheduleFixedFeeQuantityUpdatesParams"] diff --git a/src/orb/types/subscription_update_fixed_fee_quantity_params.py b/src/orb/types/subscription_update_fixed_fee_quantity_params.py index b65a44e9..2fa701f1 100755 --- a/src/orb/types/subscription_update_fixed_fee_quantity_params.py +++ b/src/orb/types/subscription_update_fixed_fee_quantity_params.py @@ -2,19 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict, Required, Literal, Annotated - from typing import Union - from datetime import date +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SubscriptionUpdateFixedFeeQuantityParams"] diff --git a/src/orb/types/subscription_update_params.py b/src/orb/types/subscription_update_params.py index 81cfbc36..59d0ab8d 100755 --- a/src/orb/types/subscription_update_params.py +++ b/src/orb/types/subscription_update_params.py @@ -2,15 +2,9 @@ from __future__ import annotations +from typing import Dict, Optional from typing_extensions import TypedDict -from typing import Optional, Dict - -from typing import List, Union, Dict, Optional -from typing_extensions import Literal, TypedDict, Required, Annotated -from .._types import FileTypes -from .._utils import PropertyInfo - __all__ = ["SubscriptionUpdateParams"] diff --git a/src/orb/types/subscription_usage.py b/src/orb/types/subscription_usage.py index a3dcc1a5..4a5c4f2e 100755 --- a/src/orb/types/subscription_usage.py +++ b/src/orb/types/subscription_usage.py @@ -1,19 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - +from typing import List, Union, Optional from datetime import datetime - -from typing import List, Optional - from typing_extensions import Literal, TypeAlias +from .._models import BaseModel from .shared.pagination_metadata import PaginationMetadata -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = [ "SubscriptionUsage", "UngroupedSubscriptionUsage", diff --git a/src/orb/types/subscriptions.py b/src/orb/types/subscriptions.py index 64b45dec..c80fef11 100755 --- a/src/orb/types/subscriptions.py +++ b/src/orb/types/subscriptions.py @@ -1,17 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel - from typing import List +from .._models import BaseModel from .subscription import Subscription - from .shared.pagination_metadata import PaginationMetadata -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo - __all__ = ["Subscriptions"] diff --git a/src/orb/types/top_level_ping_response.py b/src/orb/types/top_level_ping_response.py index 4c83db92..43ce3b3c 100755 --- a/src/orb/types/top_level_ping_response.py +++ b/src/orb/types/top_level_ping_response.py @@ -1,10 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .._models import BaseModel -from typing import Optional, Union, List, Dict, Any -from typing_extensions import Literal -from pydantic import Field as FieldInfo + +from .._models import BaseModel __all__ = ["TopLevelPingResponse"] diff --git a/tests/api_resources/coupons/test_subscriptions.py b/tests/api_resources/coupons/test_subscriptions.py index 4a1e19d3..4c190521 100755 --- a/tests/api_resources/coupons/test_subscriptions.py +++ b/tests/api_resources/coupons/test_subscriptions.py @@ -2,23 +2,15 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Subscription - -from orb.pagination import SyncPage, AsyncPage - +import os from typing import Any, cast -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb +from orb.types import Subscription from tests.utils import assert_matches_type -from orb.types.coupons import subscription_list_params +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/customers/credits/test_ledger.py b/tests/api_resources/customers/credits/test_ledger.py index 5a55f0a0..ff759955 100755 --- a/tests/api_resources/customers/credits/test_ledger.py +++ b/tests/api_resources/customers/credits/test_ledger.py @@ -2,96 +2,22 @@ from __future__ import annotations -from orb import Orb, AsyncOrb +import os +from typing import Any, cast + +import pytest +from orb import Orb, AsyncOrb +from orb._utils import parse_date, parse_datetime +from tests.utils import assert_matches_type +from orb.pagination import SyncPage, AsyncPage from orb.types.customers.credits import ( LedgerListResponse, LedgerCreateEntryResponse, - LedgerCreateEntryByExternalIDResponse, LedgerListByExternalIDResponse, + LedgerCreateEntryByExternalIDResponse, ) -from orb.pagination import SyncPage, AsyncPage - -from typing import Any, cast - -import os -import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter -from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types.customers.credits import ledger_list_params -from orb.types.customers.credits import ledger_create_entry_params -from orb.types.customers.credits import ledger_create_entry_by_external_id_params -from orb.types.customers.credits import ledger_list_by_external_id_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime - base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/customers/credits/test_top_ups.py b/tests/api_resources/customers/credits/test_top_ups.py index 08cf8863..b830664e 100755 --- a/tests/api_resources/customers/credits/test_top_ups.py +++ b/tests/api_resources/customers/credits/test_top_ups.py @@ -2,31 +2,20 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types.customers.credits import ( - TopUpCreateResponse, - TopUpListResponse, - TopUpCreateByExternalIDResponse, - TopUpListByExternalIDResponse, -) - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb from tests.utils import assert_matches_type -from orb.types.customers.credits import top_up_create_params -from orb.types.customers.credits import top_up_list_params -from orb.types.customers.credits import top_up_create_by_external_id_params -from orb.types.customers.credits import top_up_list_by_external_id_params +from orb.pagination import SyncPage, AsyncPage +from orb.types.customers.credits import ( + TopUpListResponse, + TopUpCreateResponse, + TopUpListByExternalIDResponse, + TopUpCreateByExternalIDResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/customers/test_balance_transactions.py b/tests/api_resources/customers/test_balance_transactions.py index d7b28793..77d23372 100755 --- a/tests/api_resources/customers/test_balance_transactions.py +++ b/tests/api_resources/customers/test_balance_transactions.py @@ -2,32 +2,19 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types.customers import BalanceTransactionCreateResponse, BalanceTransactionListResponse - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types.customers import balance_transaction_create_params -from orb.types.customers import balance_transaction_list_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime from orb._utils import parse_datetime +from tests.utils import assert_matches_type +from orb.pagination import SyncPage, AsyncPage +from orb.types.customers import ( + BalanceTransactionListResponse, + BalanceTransactionCreateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/customers/test_costs.py b/tests/api_resources/customers/test_costs.py index 7de2a84b..17d95e60 100755 --- a/tests/api_resources/customers/test_costs.py +++ b/tests/api_resources/customers/test_costs.py @@ -2,30 +2,18 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types.customers import CostListResponse, CostListByExternalIDResponse - +import os from typing import Any, cast -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types.customers import cost_list_params -from orb.types.customers import cost_list_by_external_id_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime from orb._utils import parse_datetime +from tests.utils import assert_matches_type +from orb.types.customers import ( + CostListResponse, + CostListByExternalIDResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/customers/test_credits.py b/tests/api_resources/customers/test_credits.py index a190a744..19de5732 100755 --- a/tests/api_resources/customers/test_credits.py +++ b/tests/api_resources/customers/test_credits.py @@ -2,24 +2,18 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types.customers import CreditListResponse, CreditListByExternalIDResponse - -from orb.pagination import SyncPage, AsyncPage - +import os from typing import Any, cast -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb from tests.utils import assert_matches_type -from orb.types.customers import credit_list_params -from orb.types.customers import credit_list_by_external_id_params +from orb.pagination import SyncPage, AsyncPage +from orb.types.customers import ( + CreditListResponse, + CreditListByExternalIDResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/events/test_backfills.py b/tests/api_resources/events/test_backfills.py index f586125a..bed65b8c 100755 --- a/tests/api_resources/events/test_backfills.py +++ b/tests/api_resources/events/test_backfills.py @@ -2,49 +2,23 @@ from __future__ import annotations -from orb import Orb, AsyncOrb +import os +from typing import Any, cast + +import pytest +from orb import Orb, AsyncOrb +from orb._utils import parse_datetime +from tests.utils import assert_matches_type +from orb.pagination import SyncPage, AsyncPage from orb.types.events import ( - BackfillCreateResponse, BackfillListResponse, BackfillCloseResponse, BackfillFetchResponse, + BackfillCreateResponse, BackfillRevertResponse, ) -from typing import Any, cast - -from orb.pagination import SyncPage, AsyncPage - -import os -import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter -from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types.events import backfill_create_params -from orb.types.events import backfill_list_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime - base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/plans/test_external_plan_id.py b/tests/api_resources/plans/test_external_plan_id.py index 286da6fd..a73b26ea 100755 --- a/tests/api_resources/plans/test_external_plan_id.py +++ b/tests/api_resources/plans/test_external_plan_id.py @@ -2,21 +2,14 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Plan - +import os from typing import Any, cast -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb +from orb.types import Plan from tests.utils import assert_matches_type -from orb.types.plans import external_plan_id_update_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/prices/test_external_price_id.py b/tests/api_resources/prices/test_external_price_id.py index 99623446..cfee75ae 100755 --- a/tests/api_resources/prices/test_external_price_id.py +++ b/tests/api_resources/prices/test_external_price_id.py @@ -2,21 +2,14 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Price - +import os from typing import Any, cast -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb +from orb.types import Price from tests.utils import assert_matches_type -from orb.types.prices import external_price_id_update_params base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_alerts.py b/tests/api_resources/test_alerts.py index 384f17d9..89ab0f66 100755 --- a/tests/api_resources/test_alerts.py +++ b/tests/api_resources/test_alerts.py @@ -2,35 +2,18 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Alert - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types import alert_update_params -from orb.types import alert_list_params -from orb.types import alert_create_for_customer_params -from orb.types import alert_create_for_external_customer_params -from orb.types import alert_create_for_subscription_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime +from orb.types import ( + Alert, +) from orb._utils import parse_datetime +from tests.utils import assert_matches_type +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_coupons.py b/tests/api_resources/test_coupons.py index cae33f77..8d59baa8 100755 --- a/tests/api_resources/test_coupons.py +++ b/tests/api_resources/test_coupons.py @@ -2,24 +2,15 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Coupon - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb +from orb.types import Coupon from tests.utils import assert_matches_type -from orb.types import coupon_create_params -from orb.types import coupon_list_params +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_credit_notes.py b/tests/api_resources/test_credit_notes.py index 5b4551e5..b44d927f 100755 --- a/tests/api_resources/test_credit_notes.py +++ b/tests/api_resources/test_credit_notes.py @@ -2,23 +2,15 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import CreditNote - -from orb.pagination import SyncPage, AsyncPage - +import os from typing import Any, cast -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb +from orb.types import CreditNote from tests.utils import assert_matches_type -from orb.types import credit_note_list_params +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_customers.py b/tests/api_resources/test_customers.py index 6b79608a..392cefaa 100755 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -2,34 +2,18 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Customer - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types import customer_create_params -from orb.types import customer_update_params -from orb.types import customer_list_params -from orb.types import customer_update_by_external_id_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime +from orb.types import ( + Customer, +) from orb._utils import parse_datetime +from tests.utils import assert_matches_type +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_events.py b/tests/api_resources/test_events.py index e3e4a813..7e77f4b4 100755 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -2,61 +2,20 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import EventUpdateResponse, EventDeprecateResponse, EventIngestResponse, EventSearchResponse - +import os from typing import Any, cast -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types import event_update_params -from orb.types import event_ingest_params -from orb.types import event_search_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime +from orb.types import ( + EventIngestResponse, + EventSearchResponse, + EventUpdateResponse, + EventDeprecateResponse, +) from orb._utils import parse_datetime +from tests.utils import assert_matches_type base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_invoice_line_items.py b/tests/api_resources/test_invoice_line_items.py index a8036405..55411e85 100755 --- a/tests/api_resources/test_invoice_line_items.py +++ b/tests/api_resources/test_invoice_line_items.py @@ -2,33 +2,15 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import InvoiceLineItemCreateResponse - +import os from typing import Any, cast -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types import invoice_line_item_create_params -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date +from orb.types import InvoiceLineItemCreateResponse from orb._utils import parse_date +from tests.utils import assert_matches_type base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index 204aa5ba..16fd1453 100755 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -2,76 +2,19 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Invoice, InvoiceFetchUpcomingResponse - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb +from orb.types import ( + Invoice, + InvoiceFetchUpcomingResponse, +) +from orb._utils import parse_date, parse_datetime from tests.utils import assert_matches_type -from orb.types import invoice_create_params -from orb.types import invoice_update_params -from orb.types import invoice_list_params -from orb.types import invoice_fetch_upcoming_params -from orb.types import invoice_mark_paid_params -from orb.types import shared -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_date +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_items.py b/tests/api_resources/test_items.py index ed4aaea8..fedf3cc2 100755 --- a/tests/api_resources/test_items.py +++ b/tests/api_resources/test_items.py @@ -2,25 +2,15 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Item - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb +from orb.types import Item from tests.utils import assert_matches_type -from orb.types import item_create_params -from orb.types import item_update_params -from orb.types import item_list_params +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_metrics.py b/tests/api_resources/test_metrics.py index 61a067f0..f111499e 100755 --- a/tests/api_resources/test_metrics.py +++ b/tests/api_resources/test_metrics.py @@ -2,33 +2,16 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import BillableMetric - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types import metric_create_params -from orb.types import metric_update_params -from orb.types import metric_list_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime +from orb.types import BillableMetric from orb._utils import parse_datetime +from tests.utils import assert_matches_type +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_plans.py b/tests/api_resources/test_plans.py index 83d904ed..938816b8 100755 --- a/tests/api_resources/test_plans.py +++ b/tests/api_resources/test_plans.py @@ -2,33 +2,16 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Plan - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types import plan_create_params -from orb.types import plan_update_params -from orb.types import plan_list_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime +from orb.types import Plan from orb._utils import parse_datetime +from tests.utils import assert_matches_type +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -67,11 +50,19 @@ def test_method_create_with_all_params(self, client: Orb) -> None: "unit_config": {"unit_amount": "unit_amount"}, "billable_metric_id": "billable_metric_id", "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, "conversion_rate": 0, "currency": "currency", "external_price_id": "external_price_id", "fixed_price_quantity": 0, "invoice_grouping_key": "invoice_grouping_key", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, "metadata": {"foo": "string"}, } ], @@ -285,11 +276,19 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No "unit_config": {"unit_amount": "unit_amount"}, "billable_metric_id": "billable_metric_id", "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, "conversion_rate": 0, "currency": "currency", "external_price_id": "external_price_id", "fixed_price_quantity": 0, "invoice_grouping_key": "invoice_grouping_key", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, "metadata": {"foo": "string"}, } ], diff --git a/tests/api_resources/test_prices.py b/tests/api_resources/test_prices.py index 9d4aca9c..9ea8a7f4 100755 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -2,46 +2,19 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Price, PriceEvaluateResponse - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.types import price_create_params -from orb.types import price_update_params -from orb.types import price_list_params -from orb.types import price_evaluate_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime +from orb.types import ( + Price, + PriceEvaluateResponse, +) from orb._utils import parse_datetime +from tests.utils import assert_matches_type +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -72,10 +45,18 @@ def test_method_create_with_all_params_overload_1(self, client: Orb) -> None: unit_config={"unit_amount": "unit_amount"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -143,10 +124,18 @@ def test_method_create_with_all_params_overload_2(self, client: Orb) -> None: }, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -248,10 +237,18 @@ def test_method_create_with_all_params_overload_3(self, client: Orb) -> None: name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -383,10 +380,18 @@ def test_method_create_with_all_params_overload_4(self, client: Orb) -> None: name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -517,10 +522,18 @@ def test_method_create_with_all_params_overload_5(self, client: Orb) -> None: }, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -648,10 +661,18 @@ def test_method_create_with_all_params_overload_6(self, client: Orb) -> None: }, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -746,10 +767,18 @@ def test_method_create_with_all_params_overload_7(self, client: Orb) -> None: name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -829,10 +858,18 @@ def test_method_create_with_all_params_overload_8(self, client: Orb) -> None: name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -915,10 +952,18 @@ def test_method_create_with_all_params_overload_9(self, client: Orb) -> None: name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -992,10 +1037,18 @@ def test_method_create_with_all_params_overload_10(self, client: Orb) -> None: threshold_total_amount_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1057,10 +1110,18 @@ def test_method_create_with_all_params_overload_11(self, client: Orb) -> None: tiered_package_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1122,10 +1183,18 @@ def test_method_create_with_all_params_overload_12(self, client: Orb) -> None: name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1187,10 +1256,18 @@ def test_method_create_with_all_params_overload_13(self, client: Orb) -> None: tiered_with_minimum_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1252,10 +1329,18 @@ def test_method_create_with_all_params_overload_14(self, client: Orb) -> None: package_with_allocation_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1317,10 +1402,18 @@ def test_method_create_with_all_params_overload_15(self, client: Orb) -> None: tiered_package_with_minimum_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1382,10 +1475,18 @@ def test_method_create_with_all_params_overload_16(self, client: Orb) -> None: unit_with_percent_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1447,10 +1548,18 @@ def test_method_create_with_all_params_overload_17(self, client: Orb) -> None: tiered_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1512,10 +1621,18 @@ def test_method_create_with_all_params_overload_18(self, client: Orb) -> None: unit_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1577,10 +1694,18 @@ def test_method_create_with_all_params_overload_19(self, client: Orb) -> None: name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1642,10 +1767,18 @@ def test_method_create_with_all_params_overload_20(self, client: Orb) -> None: name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1887,10 +2020,18 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn unit_config={"unit_amount": "unit_amount"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -1958,10 +2099,18 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn }, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2063,10 +2212,18 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2198,10 +2355,18 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2332,10 +2497,18 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn }, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2463,10 +2636,18 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn }, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2561,10 +2742,18 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2644,10 +2833,18 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2730,10 +2927,18 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2807,10 +3012,18 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy threshold_total_amount_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2872,10 +3085,18 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy tiered_package_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -2937,10 +3158,18 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3002,10 +3231,18 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy tiered_with_minimum_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3067,10 +3304,18 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy package_with_allocation_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3132,10 +3377,18 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy tiered_package_with_minimum_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3197,10 +3450,18 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy unit_with_percent_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3262,10 +3523,18 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy tiered_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3327,10 +3596,18 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy unit_with_proration_config={"foo": "bar"}, billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3392,10 +3669,18 @@ async def test_method_create_with_all_params_overload_19(self, async_client: Asy name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) @@ -3457,10 +3742,18 @@ async def test_method_create_with_all_params_overload_20(self, async_client: Asy name="Annual fee", billable_metric_id="billable_metric_id", billed_in_advance=True, + billing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, conversion_rate=0, external_price_id="external_price_id", fixed_price_quantity=0, invoice_grouping_key="invoice_grouping_key", + invoicing_cycle_configuration={ + "duration": 0, + "duration_unit": "day", + }, metadata={"foo": "string"}, ) assert_matches_type(Price, price, path=["response"]) diff --git a/tests/api_resources/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index 5fff2e20..1a2d6603 100755 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -2,165 +2,32 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import Subscription, SubscriptionFetchCostsResponse, SubscriptionFetchScheduleResponse, SubscriptionUsage - +import os from typing import Any, cast -from orb.pagination import SyncPage, AsyncPage - -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb +from orb.types import ( + Subscription, + SubscriptionUsage, + SubscriptionFetchCostsResponse, + SubscriptionFetchScheduleResponse, +) +from orb._utils import parse_date, parse_datetime from tests.utils import assert_matches_type -from orb.types import subscription_create_params -from orb.types import subscription_update_params -from orb.types import subscription_list_params -from orb.types import subscription_cancel_params -from orb.types import subscription_fetch_costs_params -from orb.types import subscription_fetch_schedule_params -from orb.types import subscription_fetch_usage_params -from orb.types import subscription_price_intervals_params -from orb.types import subscription_schedule_plan_change_params -from orb.types import subscription_trigger_phase_params -from orb.types import subscription_unschedule_fixed_fee_quantity_updates_params -from orb.types import subscription_update_fixed_fee_quantity_params -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_datetime -from orb._utils import parse_date -from orb._utils import parse_date +from orb.pagination import SyncPage, AsyncPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestSubscriptions: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=['loose', 'strict']) +class TestSubscriptions: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_create(self, client: Orb) -> None: subscription = client.subscriptions.create() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Orb) -> None: @@ -168,6 +35,11 @@ def test_method_create_with_all_params(self, client: Orb) -> None: align_billing_with_subscription_start_date=True, auto_collection=True, aws_region="aws_region", + billing_cycle_anchor_configuration={ + "day": 1, + "month": 1, + "year": 0, + }, coupon_redemption_code="coupon_redemption_code", credits_overage_rate=0, customer_id="customer_id", @@ -179,92 +51,87 @@ def test_method_create_with_all_params(self, client: Orb) -> None: external_plan_id="ZMwNQefe7J3ecf7W", initial_phase_order=0, invoicing_threshold="invoicing_threshold", - metadata={ - "foo": "string" - }, + metadata={"foo": "string"}, net_terms=0, per_credit_overage_amount=0, plan_id="ZMwNQefe7J3ecf7W", - price_overrides=[{ - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" - }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, - }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }, { - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" - }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, + price_overrides=[ + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }, { - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }], + ], start_date=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_create(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.create() assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_create(self, client: Orb) -> None: - with client.subscriptions.with_streaming_response.create() as response : + with client.subscriptions.with_streaming_response.create() as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -273,7 +140,7 @@ def test_method_update(self, client: Orb) -> None: subscription = client.subscriptions.update( subscription_id="subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Orb) -> None: @@ -282,49 +149,46 @@ def test_method_update_with_all_params(self, client: Orb) -> None: auto_collection=True, default_invoice_memo="default_invoice_memo", invoicing_threshold="10.00", - metadata={ - "foo": "string" - }, + metadata={"foo": "string"}, net_terms=0, ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_update(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.update( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_update(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.update( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_update(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.update( - subscription_id="", - ) + client.subscriptions.with_raw_response.update( + subscription_id="", + ) @parametrize def test_method_list(self, client: Orb) -> None: subscription = client.subscriptions.list() - assert_matches_type(SyncPage[Subscription], subscription, path=['response']) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: @@ -334,33 +198,30 @@ def test_method_list_with_all_params(self, client: Orb) -> None: created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"), created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"), cursor="cursor", - query_customer_id="customer_id", - query_customer_id=["string", "string", "string"], - query_external_customer_id="external_customer_id", - query_external_customer_id=["string", "string", "string"], + customer_id=["string", "string", "string"], + external_customer_id="external_customer_id", limit=1, status="active", ) - assert_matches_type(SyncPage[Subscription], subscription, path=['response']) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) @parametrize def test_raw_response_list(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.list() assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[Subscription], subscription, path=['response']) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) @parametrize def test_streaming_response_list(self, client: Orb) -> None: - with client.subscriptions.with_streaming_response.list() as response : + with client.subscriptions.with_streaming_response.list() as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[Subscription], subscription, path=['response']) + assert_matches_type(SyncPage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -370,7 +231,7 @@ def test_method_cancel(self, client: Orb) -> None: subscription_id="subscription_id", cancel_option="end_of_subscription_term", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_method_cancel_with_all_params(self, client: Orb) -> None: @@ -379,88 +240,86 @@ def test_method_cancel_with_all_params(self, client: Orb) -> None: cancel_option="end_of_subscription_term", cancellation_date=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_cancel(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.cancel( subscription_id="subscription_id", cancel_option="end_of_subscription_term", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_cancel(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.cancel( subscription_id="subscription_id", cancel_option="end_of_subscription_term", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_cancel(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.cancel( - subscription_id="", - cancel_option="end_of_subscription_term", - ) + client.subscriptions.with_raw_response.cancel( + subscription_id="", + cancel_option="end_of_subscription_term", + ) @parametrize def test_method_fetch(self, client: Orb) -> None: subscription = client.subscriptions.fetch( "subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_fetch(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.fetch( "subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_fetch(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.fetch( "subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_fetch(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.fetch( - "", - ) + client.subscriptions.with_raw_response.fetch( + "", + ) @parametrize def test_method_fetch_costs(self, client: Orb) -> None: subscription = client.subscriptions.fetch_costs( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=['response']) + assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=["response"]) @parametrize def test_method_fetch_costs_with_all_params(self, client: Orb) -> None: @@ -471,46 +330,45 @@ def test_method_fetch_costs_with_all_params(self, client: Orb) -> None: timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=['response']) + assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=["response"]) @parametrize def test_raw_response_fetch_costs(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.fetch_costs( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=['response']) + assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=["response"]) @parametrize def test_streaming_response_fetch_costs(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.fetch_costs( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=['response']) + assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_fetch_costs(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.fetch_costs( - subscription_id="", - ) + client.subscriptions.with_raw_response.fetch_costs( + subscription_id="", + ) @parametrize def test_method_fetch_schedule(self, client: Orb) -> None: subscription = client.subscriptions.fetch_schedule( subscription_id="subscription_id", ) - assert_matches_type(SyncPage[SubscriptionFetchScheduleResponse], subscription, path=['response']) + assert_matches_type(SyncPage[SubscriptionFetchScheduleResponse], subscription, path=["response"]) @parametrize def test_method_fetch_schedule_with_all_params(self, client: Orb) -> None: @@ -523,39 +381,38 @@ def test_method_fetch_schedule_with_all_params(self, client: Orb) -> None: start_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"), start_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(SyncPage[SubscriptionFetchScheduleResponse], subscription, path=['response']) + assert_matches_type(SyncPage[SubscriptionFetchScheduleResponse], subscription, path=["response"]) @parametrize def test_raw_response_fetch_schedule(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.fetch_schedule( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[SubscriptionFetchScheduleResponse], subscription, path=['response']) + assert_matches_type(SyncPage[SubscriptionFetchScheduleResponse], subscription, path=["response"]) @parametrize def test_streaming_response_fetch_schedule(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.fetch_schedule( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SyncPage[SubscriptionFetchScheduleResponse], subscription, path=['response']) + assert_matches_type(SyncPage[SubscriptionFetchScheduleResponse], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_fetch_schedule(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.fetch_schedule( - subscription_id="", - ) + client.subscriptions.with_raw_response.fetch_schedule( + subscription_id="", + ) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -563,7 +420,7 @@ def test_method_fetch_usage(self, client: Orb) -> None: subscription = client.subscriptions.fetch_usage( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionUsage, subscription, path=['response']) + assert_matches_type(SubscriptionUsage, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -581,32 +438,31 @@ def test_method_fetch_usage_with_all_params(self, client: Orb) -> None: timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(SubscriptionUsage, subscription, path=['response']) + assert_matches_type(SubscriptionUsage, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize def test_raw_response_fetch_usage(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.fetch_usage( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUsage, subscription, path=['response']) + assert_matches_type(SubscriptionUsage, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize def test_streaming_response_fetch_usage(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.fetch_usage( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUsage, subscription, path=['response']) + assert_matches_type(SubscriptionUsage, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -614,9 +470,9 @@ def test_streaming_response_fetch_usage(self, client: Orb) -> None: @parametrize def test_path_params_fetch_usage(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.fetch_usage( - subscription_id="", - ) + client.subscriptions.with_raw_response.fetch_usage( + subscription_id="", + ) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -624,281 +480,344 @@ def test_method_price_intervals(self, client: Orb) -> None: subscription = client.subscriptions.price_intervals( subscription_id="subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize def test_method_price_intervals_with_all_params(self, client: Orb) -> None: subscription = client.subscriptions.price_intervals( subscription_id="subscription_id", - add=[{ - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "allocation_price": { - "amount": "10.00", - "cadence": "one_time", - "currency": "USD", - "expires_at_end_of_cadence": True, - }, - "discounts": [{ - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }], - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "external_price_id": "external_price_id", - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "maximum_amount": 0, - "minimum_amount": 0, - "price": { - "cadence": "annual", - "currency": "currency", - "item_id": "item_id", - "model_type": "unit", - "name": "Annual fee", - "unit_config": { - "unit_amount": "unit_amount" + add=[ + { + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "allocation_price": { + "amount": "10.00", + "cadence": "one_time", + "currency": "USD", + "expires_at_end_of_cadence": True, }, - "billable_metric_id": "billable_metric_id", - "billed_in_advance": True, - "conversion_rate": 0, + "discounts": [ + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + ], + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": { - "foo": "string" + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "maximum_amount": 0, + "minimum_amount": 0, + "price": { + "cadence": "annual", + "currency": "currency", + "item_id": "item_id", + "model_type": "unit", + "name": "Annual fee", + "unit_config": {"unit_amount": "unit_amount"}, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "metadata": {"foo": "string"}, }, + "price_id": "h74gfhdjvn7ujokd", }, - "price_id": "h74gfhdjvn7ujokd", - }, { - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "allocation_price": { - "amount": "10.00", - "cadence": "one_time", - "currency": "USD", - "expires_at_end_of_cadence": True, + { + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "allocation_price": { + "amount": "10.00", + "cadence": "one_time", + "currency": "USD", + "expires_at_end_of_cadence": True, + }, + "discounts": [ + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + ], + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "external_price_id": "external_price_id", + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "maximum_amount": 0, + "minimum_amount": 0, + "price": { + "cadence": "annual", + "currency": "currency", + "item_id": "item_id", + "model_type": "unit", + "name": "Annual fee", + "unit_config": {"unit_amount": "unit_amount"}, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "metadata": {"foo": "string"}, + }, + "price_id": "h74gfhdjvn7ujokd", }, - "discounts": [{ - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }], - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "external_price_id": "external_price_id", - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "maximum_amount": 0, - "minimum_amount": 0, - "price": { - "cadence": "annual", - "currency": "currency", - "item_id": "item_id", - "model_type": "unit", - "name": "Annual fee", - "unit_config": { - "unit_amount": "unit_amount" + { + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "allocation_price": { + "amount": "10.00", + "cadence": "one_time", + "currency": "USD", + "expires_at_end_of_cadence": True, }, - "billable_metric_id": "billable_metric_id", - "billed_in_advance": True, - "conversion_rate": 0, + "discounts": [ + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + ], + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": { - "foo": "string" + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "maximum_amount": 0, + "minimum_amount": 0, + "price": { + "cadence": "annual", + "currency": "currency", + "item_id": "item_id", + "model_type": "unit", + "name": "Annual fee", + "unit_config": {"unit_amount": "unit_amount"}, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "metadata": {"foo": "string"}, }, + "price_id": "h74gfhdjvn7ujokd", }, - "price_id": "h74gfhdjvn7ujokd", - }, { - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "allocation_price": { - "amount": "10.00", - "cadence": "one_time", - "currency": "USD", - "expires_at_end_of_cadence": True, + ], + add_adjustments=[ + { + "adjustment": { + "adjustment_type": "percentage_discount", + "applies_to_price_ids": ["price_1", "price_2"], + "percentage_discount": 0, + }, + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "discounts": [{ - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }], - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "external_price_id": "external_price_id", - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "maximum_amount": 0, - "minimum_amount": 0, - "price": { - "cadence": "annual", - "currency": "currency", - "item_id": "item_id", - "model_type": "unit", - "name": "Annual fee", - "unit_config": { - "unit_amount": "unit_amount" + { + "adjustment": { + "adjustment_type": "percentage_discount", + "applies_to_price_ids": ["price_1", "price_2"], + "percentage_discount": 0, }, - "billable_metric_id": "billable_metric_id", - "billed_in_advance": True, - "conversion_rate": 0, - "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": { - "foo": "string" + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + { + "adjustment": { + "adjustment_type": "percentage_discount", + "applies_to_price_ids": ["price_1", "price_2"], + "percentage_discount": 0, }, + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + ], + edit=[ + { + "price_interval_id": "sdfs6wdjvn7ujokd", + "billing_cycle_day": 0, + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + { + "price_interval_id": "sdfs6wdjvn7ujokd", + "billing_cycle_day": 0, + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + { + "price_interval_id": "sdfs6wdjvn7ujokd", + "billing_cycle_day": 0, + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "price_id": "h74gfhdjvn7ujokd", - }], - add_adjustments=[{ - "adjustment": { - "adjustment_type": "percentage_discount", - "applies_to_price_ids": ["price_1", "price_2"], - "percentage_discount": 0, + ], + edit_adjustments=[ + { + "adjustment_interval_id": "sdfs6wdjvn7ujokd", + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "adjustment": { - "adjustment_type": "percentage_discount", - "applies_to_price_ids": ["price_1", "price_2"], - "percentage_discount": 0, + { + "adjustment_interval_id": "sdfs6wdjvn7ujokd", + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "adjustment": { - "adjustment_type": "percentage_discount", - "applies_to_price_ids": ["price_1", "price_2"], - "percentage_discount": 0, + { + "adjustment_interval_id": "sdfs6wdjvn7ujokd", + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }], - edit=[{ - "price_interval_id": "sdfs6wdjvn7ujokd", - "billing_cycle_day": 0, - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "price_interval_id": "sdfs6wdjvn7ujokd", - "billing_cycle_day": 0, - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "price_interval_id": "sdfs6wdjvn7ujokd", - "billing_cycle_day": 0, - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }], - edit_adjustments=[{ - "adjustment_interval_id": "sdfs6wdjvn7ujokd", - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "adjustment_interval_id": "sdfs6wdjvn7ujokd", - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "adjustment_interval_id": "sdfs6wdjvn7ujokd", - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }], - ) - assert_matches_type(Subscription, subscription, path=['response']) + ], + ) + assert_matches_type(Subscription, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize def test_raw_response_price_intervals(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.price_intervals( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize def test_streaming_response_price_intervals(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.price_intervals( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -906,9 +825,9 @@ def test_streaming_response_price_intervals(self, client: Orb) -> None: @parametrize def test_path_params_price_intervals(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.price_intervals( - subscription_id="", - ) + client.subscriptions.with_raw_response.price_intervals( + subscription_id="", + ) @parametrize def test_method_schedule_plan_change(self, client: Orb) -> None: @@ -916,7 +835,7 @@ def test_method_schedule_plan_change(self, client: Orb) -> None: subscription_id="subscription_id", change_option="requested_date", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: @@ -933,108 +852,105 @@ def test_method_schedule_plan_change_with_all_params(self, client: Orb) -> None: invoicing_threshold="10.00", per_credit_overage_amount=0, plan_id="ZMwNQefe7J3ecf7W", - price_overrides=[{ - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" - }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, - }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }, { - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" - }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, + price_overrides=[ + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }, { - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }], + ], ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_schedule_plan_change(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.schedule_plan_change( subscription_id="subscription_id", change_option="requested_date", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_schedule_plan_change(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.schedule_plan_change( subscription_id="subscription_id", change_option="requested_date", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_schedule_plan_change(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.schedule_plan_change( - subscription_id="", - change_option="requested_date", - ) + client.subscriptions.with_raw_response.schedule_plan_change( + subscription_id="", + change_option="requested_date", + ) @parametrize def test_method_trigger_phase(self, client: Orb) -> None: subscription = client.subscriptions.trigger_phase( subscription_id="subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_method_trigger_phase_with_all_params(self, client: Orb) -> None: @@ -1042,78 +958,76 @@ def test_method_trigger_phase_with_all_params(self, client: Orb) -> None: subscription_id="subscription_id", effective_date=parse_date("2019-12-27"), ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_trigger_phase(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.trigger_phase( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_trigger_phase(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.trigger_phase( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_trigger_phase(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.trigger_phase( - subscription_id="", - ) + client.subscriptions.with_raw_response.trigger_phase( + subscription_id="", + ) @parametrize def test_method_unschedule_cancellation(self, client: Orb) -> None: subscription = client.subscriptions.unschedule_cancellation( "subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_unschedule_cancellation(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.unschedule_cancellation( "subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_unschedule_cancellation(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.unschedule_cancellation( "subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_unschedule_cancellation(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.unschedule_cancellation( - "", - ) + client.subscriptions.with_raw_response.unschedule_cancellation( + "", + ) @parametrize def test_method_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None: @@ -1121,81 +1035,79 @@ def test_method_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None subscription_id="subscription_id", price_id="price_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.unschedule_fixed_fee_quantity_updates( subscription_id="subscription_id", price_id="price_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.unschedule_fixed_fee_quantity_updates( subscription_id="subscription_id", price_id="price_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_unschedule_fixed_fee_quantity_updates(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.unschedule_fixed_fee_quantity_updates( - subscription_id="", - price_id="price_id", - ) + client.subscriptions.with_raw_response.unschedule_fixed_fee_quantity_updates( + subscription_id="", + price_id="price_id", + ) @parametrize def test_method_unschedule_pending_plan_changes(self, client: Orb) -> None: subscription = client.subscriptions.unschedule_pending_plan_changes( "subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_unschedule_pending_plan_changes(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.unschedule_pending_plan_changes( "subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_unschedule_pending_plan_changes(self, client: Orb) -> None: with client.subscriptions.with_streaming_response.unschedule_pending_plan_changes( "subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_unschedule_pending_plan_changes(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.unschedule_pending_plan_changes( - "", - ) + client.subscriptions.with_raw_response.unschedule_pending_plan_changes( + "", + ) @parametrize def test_method_update_fixed_fee_quantity(self, client: Orb) -> None: @@ -1204,7 +1116,7 @@ def test_method_update_fixed_fee_quantity(self, client: Orb) -> None: price_id="price_id", quantity=0, ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_method_update_fixed_fee_quantity_with_all_params(self, client: Orb) -> None: @@ -1215,11 +1127,10 @@ def test_method_update_fixed_fee_quantity_with_all_params(self, client: Orb) -> change_option="immediate", effective_date=parse_date("2022-12-21"), ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_raw_response_update_fixed_fee_quantity(self, client: Orb) -> None: - response = client.subscriptions.with_raw_response.update_fixed_fee_quantity( subscription_id="subscription_id", price_id="price_id", @@ -1227,9 +1138,9 @@ def test_raw_response_update_fixed_fee_quantity(self, client: Orb) -> None: ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize def test_streaming_response_update_fixed_fee_quantity(self, client: Orb) -> None: @@ -1237,31 +1148,32 @@ def test_streaming_response_update_fixed_fee_quantity(self, client: Orb) -> None subscription_id="subscription_id", price_id="price_id", quantity=0, - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_update_fixed_fee_quantity(self, client: Orb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - client.subscriptions.with_raw_response.update_fixed_fee_quantity( - subscription_id="", - price_id="price_id", - quantity=0, - ) -class TestAsyncSubscriptions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=['loose', 'strict']) + client.subscriptions.with_raw_response.update_fixed_fee_quantity( + subscription_id="", + price_id="price_id", + quantity=0, + ) +class TestAsyncSubscriptions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize async def test_method_create(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.create() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1269,6 +1181,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No align_billing_with_subscription_start_date=True, auto_collection=True, aws_region="aws_region", + billing_cycle_anchor_configuration={ + "day": 1, + "month": 1, + "year": 0, + }, coupon_redemption_code="coupon_redemption_code", credits_overage_rate=0, customer_id="customer_id", @@ -1280,92 +1197,87 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No external_plan_id="ZMwNQefe7J3ecf7W", initial_phase_order=0, invoicing_threshold="invoicing_threshold", - metadata={ - "foo": "string" - }, + metadata={"foo": "string"}, net_terms=0, per_credit_overage_amount=0, plan_id="ZMwNQefe7J3ecf7W", - price_overrides=[{ - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" - }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, - }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }, { - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" - }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, + price_overrides=[ + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }, { - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }], + ], start_date=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.create() assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncOrb) -> None: - async with async_client.subscriptions.with_streaming_response.create() as response : + async with async_client.subscriptions.with_streaming_response.create() as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1374,7 +1286,7 @@ async def test_method_update(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.update( subscription_id="subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1383,49 +1295,46 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No auto_collection=True, default_invoice_memo="default_invoice_memo", invoicing_threshold="10.00", - metadata={ - "foo": "string" - }, + metadata={"foo": "string"}, net_terms=0, ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.update( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.update( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_update(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.update( - subscription_id="", - ) + await async_client.subscriptions.with_raw_response.update( + subscription_id="", + ) @parametrize async def test_method_list(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.list() - assert_matches_type(AsyncPage[Subscription], subscription, path=['response']) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1435,33 +1344,30 @@ async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"), created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"), cursor="cursor", - query_customer_id="customer_id", - query_customer_id=["string", "string", "string"], - query_external_customer_id="external_customer_id", - query_external_customer_id=["string", "string", "string"], + customer_id=["string", "string", "string"], + external_customer_id="external_customer_id", limit=1, status="active", ) - assert_matches_type(AsyncPage[Subscription], subscription, path=['response']) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.list() assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(AsyncPage[Subscription], subscription, path=['response']) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncOrb) -> None: - async with async_client.subscriptions.with_streaming_response.list() as response : + async with async_client.subscriptions.with_streaming_response.list() as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncPage[Subscription], subscription, path=['response']) + assert_matches_type(AsyncPage[Subscription], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1471,7 +1377,7 @@ async def test_method_cancel(self, async_client: AsyncOrb) -> None: subscription_id="subscription_id", cancel_option="end_of_subscription_term", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_method_cancel_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1480,88 +1386,86 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncOrb) -> No cancel_option="end_of_subscription_term", cancellation_date=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_cancel(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.cancel( subscription_id="subscription_id", cancel_option="end_of_subscription_term", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_cancel(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.cancel( subscription_id="subscription_id", cancel_option="end_of_subscription_term", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_cancel(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.cancel( - subscription_id="", - cancel_option="end_of_subscription_term", - ) + await async_client.subscriptions.with_raw_response.cancel( + subscription_id="", + cancel_option="end_of_subscription_term", + ) @parametrize async def test_method_fetch(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.fetch( "subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_fetch(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.fetch( "subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_fetch(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.fetch( "subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_fetch(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.fetch( - "", - ) + await async_client.subscriptions.with_raw_response.fetch( + "", + ) @parametrize async def test_method_fetch_costs(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.fetch_costs( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=['response']) + assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=["response"]) @parametrize async def test_method_fetch_costs_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1572,46 +1476,45 @@ async def test_method_fetch_costs_with_all_params(self, async_client: AsyncOrb) timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=['response']) + assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=["response"]) @parametrize async def test_raw_response_fetch_costs(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.fetch_costs( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=['response']) + assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=["response"]) @parametrize async def test_streaming_response_fetch_costs(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.fetch_costs( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=['response']) + assert_matches_type(SubscriptionFetchCostsResponse, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_fetch_costs(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.fetch_costs( - subscription_id="", - ) + await async_client.subscriptions.with_raw_response.fetch_costs( + subscription_id="", + ) @parametrize async def test_method_fetch_schedule(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.fetch_schedule( subscription_id="subscription_id", ) - assert_matches_type(AsyncPage[SubscriptionFetchScheduleResponse], subscription, path=['response']) + assert_matches_type(AsyncPage[SubscriptionFetchScheduleResponse], subscription, path=["response"]) @parametrize async def test_method_fetch_schedule_with_all_params(self, async_client: AsyncOrb) -> None: @@ -1624,39 +1527,38 @@ async def test_method_fetch_schedule_with_all_params(self, async_client: AsyncOr start_date_lt=parse_datetime("2019-12-27T18:11:19.117Z"), start_date_lte=parse_datetime("2019-12-27T18:11:19.117Z"), ) - assert_matches_type(AsyncPage[SubscriptionFetchScheduleResponse], subscription, path=['response']) + assert_matches_type(AsyncPage[SubscriptionFetchScheduleResponse], subscription, path=["response"]) @parametrize async def test_raw_response_fetch_schedule(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.fetch_schedule( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(AsyncPage[SubscriptionFetchScheduleResponse], subscription, path=['response']) + assert_matches_type(AsyncPage[SubscriptionFetchScheduleResponse], subscription, path=["response"]) @parametrize async def test_streaming_response_fetch_schedule(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.fetch_schedule( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(AsyncPage[SubscriptionFetchScheduleResponse], subscription, path=['response']) + assert_matches_type(AsyncPage[SubscriptionFetchScheduleResponse], subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_fetch_schedule(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.fetch_schedule( - subscription_id="", - ) + await async_client.subscriptions.with_raw_response.fetch_schedule( + subscription_id="", + ) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -1664,7 +1566,7 @@ async def test_method_fetch_usage(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.fetch_usage( subscription_id="subscription_id", ) - assert_matches_type(SubscriptionUsage, subscription, path=['response']) + assert_matches_type(SubscriptionUsage, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -1682,32 +1584,31 @@ async def test_method_fetch_usage_with_all_params(self, async_client: AsyncOrb) timeframe_start=parse_datetime("2022-02-01T05:00:00Z"), view_mode="periodic", ) - assert_matches_type(SubscriptionUsage, subscription, path=['response']) + assert_matches_type(SubscriptionUsage, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize async def test_raw_response_fetch_usage(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.fetch_usage( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(SubscriptionUsage, subscription, path=['response']) + assert_matches_type(SubscriptionUsage, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize async def test_streaming_response_fetch_usage(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.fetch_usage( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(SubscriptionUsage, subscription, path=['response']) + assert_matches_type(SubscriptionUsage, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1715,9 +1616,9 @@ async def test_streaming_response_fetch_usage(self, async_client: AsyncOrb) -> N @parametrize async def test_path_params_fetch_usage(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.fetch_usage( - subscription_id="", - ) + await async_client.subscriptions.with_raw_response.fetch_usage( + subscription_id="", + ) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize @@ -1725,281 +1626,344 @@ async def test_method_price_intervals(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.price_intervals( subscription_id="subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize async def test_method_price_intervals_with_all_params(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.price_intervals( subscription_id="subscription_id", - add=[{ - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "allocation_price": { - "amount": "10.00", - "cadence": "one_time", - "currency": "USD", - "expires_at_end_of_cadence": True, - }, - "discounts": [{ - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }], - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "external_price_id": "external_price_id", - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "maximum_amount": 0, - "minimum_amount": 0, - "price": { - "cadence": "annual", - "currency": "currency", - "item_id": "item_id", - "model_type": "unit", - "name": "Annual fee", - "unit_config": { - "unit_amount": "unit_amount" + add=[ + { + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "allocation_price": { + "amount": "10.00", + "cadence": "one_time", + "currency": "USD", + "expires_at_end_of_cadence": True, }, - "billable_metric_id": "billable_metric_id", - "billed_in_advance": True, - "conversion_rate": 0, + "discounts": [ + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + ], + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": { - "foo": "string" + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "maximum_amount": 0, + "minimum_amount": 0, + "price": { + "cadence": "annual", + "currency": "currency", + "item_id": "item_id", + "model_type": "unit", + "name": "Annual fee", + "unit_config": {"unit_amount": "unit_amount"}, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "metadata": {"foo": "string"}, }, + "price_id": "h74gfhdjvn7ujokd", }, - "price_id": "h74gfhdjvn7ujokd", - }, { - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "allocation_price": { - "amount": "10.00", - "cadence": "one_time", - "currency": "USD", - "expires_at_end_of_cadence": True, + { + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "allocation_price": { + "amount": "10.00", + "cadence": "one_time", + "currency": "USD", + "expires_at_end_of_cadence": True, + }, + "discounts": [ + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + ], + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "external_price_id": "external_price_id", + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "maximum_amount": 0, + "minimum_amount": 0, + "price": { + "cadence": "annual", + "currency": "currency", + "item_id": "item_id", + "model_type": "unit", + "name": "Annual fee", + "unit_config": {"unit_amount": "unit_amount"}, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "metadata": {"foo": "string"}, + }, + "price_id": "h74gfhdjvn7ujokd", }, - "discounts": [{ - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }], - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "external_price_id": "external_price_id", - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "maximum_amount": 0, - "minimum_amount": 0, - "price": { - "cadence": "annual", - "currency": "currency", - "item_id": "item_id", - "model_type": "unit", - "name": "Annual fee", - "unit_config": { - "unit_amount": "unit_amount" + { + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "allocation_price": { + "amount": "10.00", + "cadence": "one_time", + "currency": "USD", + "expires_at_end_of_cadence": True, }, - "billable_metric_id": "billable_metric_id", - "billed_in_advance": True, - "conversion_rate": 0, + "discounts": [ + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + { + "amount_discount": 0, + "discount_type": "amount", + }, + ], + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": { - "foo": "string" + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "maximum_amount": 0, + "minimum_amount": 0, + "price": { + "cadence": "annual", + "currency": "currency", + "item_id": "item_id", + "model_type": "unit", + "name": "Annual fee", + "unit_config": {"unit_amount": "unit_amount"}, + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "billing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "conversion_rate": 0, + "external_price_id": "external_price_id", + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "invoicing_cycle_configuration": { + "duration": 0, + "duration_unit": "day", + }, + "metadata": {"foo": "string"}, }, + "price_id": "h74gfhdjvn7ujokd", }, - "price_id": "h74gfhdjvn7ujokd", - }, { - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "allocation_price": { - "amount": "10.00", - "cadence": "one_time", - "currency": "USD", - "expires_at_end_of_cadence": True, + ], + add_adjustments=[ + { + "adjustment": { + "adjustment_type": "percentage_discount", + "applies_to_price_ids": ["price_1", "price_2"], + "percentage_discount": 0, + }, + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "discounts": [{ - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }, { - "amount_discount": 0, - "discount_type": "amount", - }], - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "external_price_id": "external_price_id", - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "maximum_amount": 0, - "minimum_amount": 0, - "price": { - "cadence": "annual", - "currency": "currency", - "item_id": "item_id", - "model_type": "unit", - "name": "Annual fee", - "unit_config": { - "unit_amount": "unit_amount" + { + "adjustment": { + "adjustment_type": "percentage_discount", + "applies_to_price_ids": ["price_1", "price_2"], + "percentage_discount": 0, }, - "billable_metric_id": "billable_metric_id", - "billed_in_advance": True, - "conversion_rate": 0, - "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": { - "foo": "string" + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + { + "adjustment": { + "adjustment_type": "percentage_discount", + "applies_to_price_ids": ["price_1", "price_2"], + "percentage_discount": 0, }, + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + ], + edit=[ + { + "price_interval_id": "sdfs6wdjvn7ujokd", + "billing_cycle_day": 0, + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + { + "price_interval_id": "sdfs6wdjvn7ujokd", + "billing_cycle_day": 0, + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + { + "price_interval_id": "sdfs6wdjvn7ujokd", + "billing_cycle_day": 0, + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "fixed_fee_quantity_transitions": [ + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + { + "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "quantity": 5, + }, + ], + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "price_id": "h74gfhdjvn7ujokd", - }], - add_adjustments=[{ - "adjustment": { - "adjustment_type": "percentage_discount", - "applies_to_price_ids": ["price_1", "price_2"], - "percentage_discount": 0, + ], + edit_adjustments=[ + { + "adjustment_interval_id": "sdfs6wdjvn7ujokd", + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "adjustment": { - "adjustment_type": "percentage_discount", - "applies_to_price_ids": ["price_1", "price_2"], - "percentage_discount": 0, + { + "adjustment_interval_id": "sdfs6wdjvn7ujokd", + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "adjustment": { - "adjustment_type": "percentage_discount", - "applies_to_price_ids": ["price_1", "price_2"], - "percentage_discount": 0, + { + "adjustment_interval_id": "sdfs6wdjvn7ujokd", + "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), + "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), }, - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }], - edit=[{ - "price_interval_id": "sdfs6wdjvn7ujokd", - "billing_cycle_day": 0, - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "price_interval_id": "sdfs6wdjvn7ujokd", - "billing_cycle_day": 0, - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "price_interval_id": "sdfs6wdjvn7ujokd", - "billing_cycle_day": 0, - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "fixed_fee_quantity_transitions": [{ - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }, { - "effective_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "quantity": 5, - }], - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }], - edit_adjustments=[{ - "adjustment_interval_id": "sdfs6wdjvn7ujokd", - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "adjustment_interval_id": "sdfs6wdjvn7ujokd", - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }, { - "adjustment_interval_id": "sdfs6wdjvn7ujokd", - "end_date": parse_datetime("2019-12-27T18:11:19.117Z"), - "start_date": parse_datetime("2019-12-27T18:11:19.117Z"), - }], - ) - assert_matches_type(Subscription, subscription, path=['response']) + ], + ) + assert_matches_type(Subscription, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize async def test_raw_response_price_intervals(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.price_intervals( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @pytest.mark.skip(reason="Incorrect example breaks Prism") @parametrize async def test_streaming_response_price_intervals(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.price_intervals( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @@ -2007,9 +1971,9 @@ async def test_streaming_response_price_intervals(self, async_client: AsyncOrb) @parametrize async def test_path_params_price_intervals(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.price_intervals( - subscription_id="", - ) + await async_client.subscriptions.with_raw_response.price_intervals( + subscription_id="", + ) @parametrize async def test_method_schedule_plan_change(self, async_client: AsyncOrb) -> None: @@ -2017,7 +1981,7 @@ async def test_method_schedule_plan_change(self, async_client: AsyncOrb) -> None subscription_id="subscription_id", change_option="requested_date", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_method_schedule_plan_change_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2034,108 +1998,105 @@ async def test_method_schedule_plan_change_with_all_params(self, async_client: A invoicing_threshold="10.00", per_credit_overage_amount=0, plan_id="ZMwNQefe7J3ecf7W", - price_overrides=[{ - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" - }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, - }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }, { - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" - }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, + price_overrides=[ + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }, { - "id": "id", - "model_type": "unit", - "unit_config": { - "unit_amount": "unit_amount" + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "conversion_rate": 0, - "currency": "currency", - "discount": { - "discount_type": "percentage", - "amount_discount": "amount_discount", - "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], - "percentage_discount": 0.15, - "trial_amount_discount": "trial_amount_discount", - "usage_discount": 0, + { + "id": "id", + "model_type": "unit", + "unit_config": {"unit_amount": "unit_amount"}, + "conversion_rate": 0, + "currency": "currency", + "discount": { + "discount_type": "percentage", + "amount_discount": "amount_discount", + "applies_to_price_ids": ["h74gfhdjvn7ujokd", "7hfgtgjnbvc3ujkl"], + "percentage_discount": 0.15, + "trial_amount_discount": "trial_amount_discount", + "usage_discount": 0, + }, + "fixed_price_quantity": 2, + "maximum_amount": "1.23", + "minimum_amount": "1.23", }, - "fixed_price_quantity": 2, - "maximum_amount": "1.23", - "minimum_amount": "1.23", - }], + ], ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_schedule_plan_change(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.schedule_plan_change( subscription_id="subscription_id", change_option="requested_date", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_schedule_plan_change(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.schedule_plan_change( subscription_id="subscription_id", change_option="requested_date", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_schedule_plan_change(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.schedule_plan_change( - subscription_id="", - change_option="requested_date", - ) + await async_client.subscriptions.with_raw_response.schedule_plan_change( + subscription_id="", + change_option="requested_date", + ) @parametrize async def test_method_trigger_phase(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.trigger_phase( subscription_id="subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_method_trigger_phase_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2143,78 +2104,76 @@ async def test_method_trigger_phase_with_all_params(self, async_client: AsyncOrb subscription_id="subscription_id", effective_date=parse_date("2019-12-27"), ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_trigger_phase(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.trigger_phase( subscription_id="subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_trigger_phase(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.trigger_phase( subscription_id="subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_trigger_phase(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.trigger_phase( - subscription_id="", - ) + await async_client.subscriptions.with_raw_response.trigger_phase( + subscription_id="", + ) @parametrize async def test_method_unschedule_cancellation(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.unschedule_cancellation( "subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_unschedule_cancellation(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.unschedule_cancellation( "subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_unschedule_cancellation(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.unschedule_cancellation( "subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_unschedule_cancellation(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.unschedule_cancellation( - "", - ) + await async_client.subscriptions.with_raw_response.unschedule_cancellation( + "", + ) @parametrize async def test_method_unschedule_fixed_fee_quantity_updates(self, async_client: AsyncOrb) -> None: @@ -2222,81 +2181,79 @@ async def test_method_unschedule_fixed_fee_quantity_updates(self, async_client: subscription_id="subscription_id", price_id="price_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_unschedule_fixed_fee_quantity_updates(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.unschedule_fixed_fee_quantity_updates( subscription_id="subscription_id", price_id="price_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_unschedule_fixed_fee_quantity_updates(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.unschedule_fixed_fee_quantity_updates( subscription_id="subscription_id", price_id="price_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_unschedule_fixed_fee_quantity_updates(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.unschedule_fixed_fee_quantity_updates( - subscription_id="", - price_id="price_id", - ) + await async_client.subscriptions.with_raw_response.unschedule_fixed_fee_quantity_updates( + subscription_id="", + price_id="price_id", + ) @parametrize async def test_method_unschedule_pending_plan_changes(self, async_client: AsyncOrb) -> None: subscription = await async_client.subscriptions.unschedule_pending_plan_changes( "subscription_id", ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_unschedule_pending_plan_changes(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.unschedule_pending_plan_changes( "subscription_id", ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_unschedule_pending_plan_changes(self, async_client: AsyncOrb) -> None: async with async_client.subscriptions.with_streaming_response.unschedule_pending_plan_changes( "subscription_id", - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_unschedule_pending_plan_changes(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.unschedule_pending_plan_changes( - "", - ) + await async_client.subscriptions.with_raw_response.unschedule_pending_plan_changes( + "", + ) @parametrize async def test_method_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> None: @@ -2305,7 +2262,7 @@ async def test_method_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> price_id="price_id", quantity=0, ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_method_update_fixed_fee_quantity_with_all_params(self, async_client: AsyncOrb) -> None: @@ -2316,11 +2273,10 @@ async def test_method_update_fixed_fee_quantity_with_all_params(self, async_clie change_option="immediate", effective_date=parse_date("2022-12-21"), ) - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_raw_response_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> None: - response = await async_client.subscriptions.with_raw_response.update_fixed_fee_quantity( subscription_id="subscription_id", price_id="price_id", @@ -2328,9 +2284,9 @@ async def test_raw_response_update_fixed_fee_quantity(self, async_client: AsyncO ) assert response.is_closed is True - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) @parametrize async def test_streaming_response_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> None: @@ -2338,20 +2294,20 @@ async def test_streaming_response_update_fixed_fee_quantity(self, async_client: subscription_id="subscription_id", price_id="price_id", quantity=0, - ) as response : + ) as response: assert not response.is_closed - assert response.http_request.headers.get('X-Stainless-Lang') == 'python' + assert response.http_request.headers.get("X-Stainless-Lang") == "python" subscription = await response.parse() - assert_matches_type(Subscription, subscription, path=['response']) + assert_matches_type(Subscription, subscription, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_update_fixed_fee_quantity(self, async_client: AsyncOrb) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `subscription_id` but received ''"): - await async_client.subscriptions.with_raw_response.update_fixed_fee_quantity( - subscription_id="", - price_id="price_id", - quantity=0, - ) \ No newline at end of file + await async_client.subscriptions.with_raw_response.update_fixed_fee_quantity( + subscription_id="", + price_id="price_id", + quantity=0, + ) diff --git a/tests/api_resources/test_top_level.py b/tests/api_resources/test_top_level.py index a2c495b9..6971f1e7 100755 --- a/tests/api_resources/test_top_level.py +++ b/tests/api_resources/test_top_level.py @@ -2,19 +2,13 @@ from __future__ import annotations -from orb import Orb, AsyncOrb - -from orb.types import TopLevelPingResponse - +import os from typing import Any, cast -import os import pytest -import httpx -from typing_extensions import get_args -from typing import Optional -from respx import MockRouter + from orb import Orb, AsyncOrb +from orb.types import TopLevelPingResponse from tests.utils import assert_matches_type base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/conftest.py b/tests/conftest.py index 32f6e574..a718a9e3 100755 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,14 +1,12 @@ from __future__ import annotations +import os import asyncio import logging -from typing import Iterator +from typing import TYPE_CHECKING, Iterator, AsyncIterator import pytest -import os -from typing import TYPE_CHECKING, AsyncIterator - from orb import Orb, AsyncOrb if TYPE_CHECKING: diff --git a/tests/test_client.py b/tests/test_client.py index 33e3a9f1..9d34c15d 100755 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -2,41 +2,28 @@ from __future__ import annotations -import httpx - -from orb import Orb, AsyncOrb - -from orb._exceptions import APITimeoutError, APIStatusError, OrbError, APIResponseValidationError - -from typing import Any, cast - -from orb._types import Omit - -from pydantic import ValidationError - -import asyncio import gc -import inspect -import json import os +import json +import asyncio +import inspect import tracemalloc -from typing import Dict, Any, Union, cast +from typing import Any, Union, cast from unittest import mock import httpx import pytest from respx import MockRouter +from pydantic import ValidationError from orb import Orb, AsyncOrb, APIResponseValidationError -from orb._models import FinalRequestOptions, BaseModel -from orb._types import NOT_GIVEN, Headers, NotGiven, Query, Body, Timeout, Omit -from orb._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, RequestOptions, make_request_options -from orb._streaming import Stream, AsyncStream +from orb._types import Omit +from orb._models import BaseModel, FinalRequestOptions from orb._constants import RAW_RESPONSE_HEADER -from orb._response import APIResponse, AsyncAPIResponse +from orb._exceptions import OrbError, APIStatusError, APITimeoutError, APIResponseValidationError +from orb._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options + from .utils import update_env -from typing import cast -from typing import cast base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = "My API Key" diff --git a/tests/test_legacy_response.py b/tests/test_legacy_response.py index 777b96fb..3ec62d81 100755 --- a/tests/test_legacy_response.py +++ b/tests/test_legacy_response.py @@ -6,7 +6,7 @@ import pytest import pydantic -from orb import BaseModel, Orb +from orb import Orb, BaseModel from orb._streaming import Stream from orb._base_client import FinalRequestOptions from orb._legacy_response import LegacyAPIResponse diff --git a/tests/test_response.py b/tests/test_response.py index 96e79141..52ea7467 100755 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -6,7 +6,7 @@ import pytest import pydantic -from orb import BaseModel, Orb, AsyncOrb +from orb import Orb, AsyncOrb, BaseModel from orb._response import ( APIResponse, BaseAPIResponse, diff --git a/tests/utils.py b/tests/utils.py index 4953ec8c..1fa786ba 100755 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,7 +8,7 @@ from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type -from orb._types import NoneType, Omit +from orb._types import Omit, NoneType from orb._utils import ( is_dict, is_list,