diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 427b8ec4..21f60560 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.9.0" + ".": "2.10.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 2cbd598e..34c0ae51 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-af2e129bdcee200185e3fb82837268c03686680beafec3e04b3b17ba32782b48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7ae6544b3567d683dd64c5caff02b49ffc0dc4897d0a91738b0162f36a7ddee7.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index df55ac38..caa6dc14 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 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) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#365](https://github.com/orbcorp/orb-python/issues/365)) ([c83347c](https://github.com/orbcorp/orb-python/commit/c83347cf6b6b6301a3b62c2bd53da44788d08cd9)) + ## 2.9.0 (2024-08-23) Full Changelog: [v2.8.0...v2.9.0](https://github.com/orbcorp/orb-python/compare/v2.8.0...v2.9.0) diff --git a/README.md b/README.md index 3936ac2c..7a652310 100755 --- a/README.md +++ b/README.md @@ -56,14 +56,12 @@ 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()) ``` @@ -106,7 +104,6 @@ from orb import AsyncOrb client = AsyncOrb() - async def main() -> None: all_coupons = [] # Iterate through items across all pages, issuing requests as needed. @@ -114,7 +111,6 @@ async def main() -> None: all_coupons.append(coupon) print(all_coupons) - asyncio.run(main()) ``` @@ -135,9 +131,7 @@ 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) @@ -210,7 +204,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: @@ -250,7 +244,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", ) @@ -276,7 +270,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", ) @@ -349,11 +343,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. @@ -407,10 +401,7 @@ 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 c441ce56..848f3303 100755 --- a/api.md +++ b/api.md @@ -99,12 +99,7 @@ Methods: Types: ```python -from orb.types.customers.credits import ( - LedgerListResponse, - LedgerCreateEntryResponse, - LedgerCreateEntryByExternalIDResponse, - LedgerListByExternalIDResponse, -) +from orb.types.customers.credits import LedgerListResponse, LedgerCreateEntryResponse, LedgerCreateEntryByExternalIDResponse, LedgerListByExternalIDResponse ``` Methods: @@ -119,12 +114,7 @@ Methods: Types: ```python -from orb.types.customers.credits import ( - TopUpCreateResponse, - TopUpListResponse, - TopUpCreateByExternalIDResponse, - TopUpListByExternalIDResponse, -) +from orb.types.customers.credits import TopUpCreateResponse, TopUpListResponse, TopUpCreateByExternalIDResponse, TopUpListByExternalIDResponse ``` Methods: @@ -154,12 +144,7 @@ Methods: Types: ```python -from orb.types import ( - EventUpdateResponse, - EventDeprecateResponse, - EventIngestResponse, - EventSearchResponse, -) +from orb.types import EventUpdateResponse, EventDeprecateResponse, EventIngestResponse, EventSearchResponse ``` Methods: @@ -174,13 +159,7 @@ Methods: Types: ```python -from orb.types.events import ( - BackfillCreateResponse, - BackfillListResponse, - BackfillCloseResponse, - BackfillFetchResponse, - BackfillRevertResponse, -) +from orb.types.events import BackfillCreateResponse, BackfillListResponse, BackfillCloseResponse, BackfillFetchResponse, BackfillRevertResponse ``` Methods: @@ -302,13 +281,7 @@ 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 f4073a02..ae55d62c 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "2.9.0" +version = "2.10.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 801a1e71..a231855a 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 ._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 ._version import __version__, __title__ +from ._client import Timeout, Transport, RequestOptions, Client, AsyncClient, Stream, AsyncStream, Orb, AsyncOrb from ._exceptions import ( - APIError, OrbError, - URLNotFound, - ConflictError, - NotFoundError, + APIError, APIStatusError, - RateLimitError, APITimeoutError, - BadRequestError, - RequestTooLarge, - TooManyRequests, - ResourceConflict, - ResourceNotFound, - ResourceTooLarge, APIConnectionError, + APIResponseValidationError, + BadRequestError, AuthenticationError, - ConstraintViolation, - FeatureNotAvailable, - InternalServerError, PermissionDeniedError, - OrbAuthenticationError, - OrbInternalServerError, - RequestValidationError, + NotFoundError, + ConflictError, UnprocessableEntityError, + RateLimitError, + InternalServerError, + ConstraintViolation, DuplicateResourceCreation, - APIResponseValidationError, + RequestValidationError, + OrbAuthenticationError, + FeatureNotAvailable, + ResourceNotFound, + URLNotFound, + ResourceConflict, + RequestTooLarge, + ResourceTooLarge, + TooManyRequests, + OrbInternalServerError, ) +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: - __locals[__name].__module__ = "orb" + setattr(__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 6b3f24c5..1d9fefe7 100755 --- a/src/orb/_client.py +++ b/src/orb/_client.py @@ -2,36 +2,67 @@ 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 -from typing import Any, Union, Mapping -from typing_extensions import Self, override +import asyncio +import warnings +from typing import Optional, Union, Dict, Any, Mapping, overload, cast +from typing_extensions import Literal import httpx -from . import resources, _exceptions +from ._version import __version__ 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, - Timeout, NotGiven, + Timeout, 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 4a413c75..f78a4d74 100755 --- a/src/orb/_exceptions.py +++ b/src/orb/_exceptions.py @@ -2,14 +2,78 @@ from __future__ import annotations -from typing import Any, List, Mapping, Optional, cast +import httpx + from typing_extensions import Literal -import httpx +from typing import Optional, Mapping, Any, List 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 f2b14588..1b3815df 100755 --- a/src/orb/_resource.py +++ b/src/orb/_resource.py @@ -3,9 +3,8 @@ from __future__ import annotations import time -from typing import TYPE_CHECKING - import anyio +from typing import TYPE_CHECKING if TYPE_CHECKING: from ._client import Orb, AsyncOrb diff --git a/src/orb/_response.py b/src/orb/_response.py index bde0a041..bcdd1212 100755 --- a/src/orb/_response.py +++ b/src/orb/_response.py @@ -18,7 +18,7 @@ cast, overload, ) -from typing_extensions import Awaitable, ParamSpec, override, get_origin +from typing_extensions import Awaitable, ParamSpec, TypeGuard, override, get_origin import anyio import httpx @@ -26,6 +26,7 @@ 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 757492e8..b42a5b59 100755 --- a/src/orb/_streaming.py +++ b/src/orb/_streaming.py @@ -9,7 +9,9 @@ import httpx -from ._utils import extract_type_var_from_base +from ._utils import is_mapping, is_dict, extract_type_var_from_base +from ._exceptions import APIError +from ._response import APIResponse, AsyncAPIResponse if TYPE_CHECKING: from ._client import Orb, AsyncOrb diff --git a/src/orb/_types.py b/src/orb/_types.py index a6120d6a..73e09695 100755 --- a/src/orb/_types.py +++ b/src/orb/_types.py @@ -1,6 +1,7 @@ from __future__ import annotations from os import PathLike +from abc import ABC, abstractmethod from typing import ( IO, TYPE_CHECKING, @@ -13,8 +14,10 @@ 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 85159688..78d42cfd 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.9.0" # x-release-please-version +__version__ = "2.10.0" # x-release-please-version diff --git a/src/orb/pagination.py b/src/orb/pagination.py index df68690f..83d06998 100755 --- a/src/orb/pagination.py +++ b/src/orb/pagination.py @@ -1,10 +1,21 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Generic, TypeVar, Optional +from ._models import BaseModel + +from typing import Optional, List + 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 ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage +from ._utils import PropertyInfo, is_mapping +from ._base_client import BasePage, BaseSyncPage, BaseAsyncPage, PageInfo __all__ = ["PagePaginationMetadata", "SyncPage", "AsyncPage"] diff --git a/src/orb/resources/__init__.py b/src/orb/resources/__init__.py index f5515f6c..5fe32868 100755 --- a/src/orb/resources/__init__.py +++ b/src/orb/resources/__init__.py @@ -1,112 +1,100 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .items import ( - Items, - AsyncItems, - ItemsWithRawResponse, - AsyncItemsWithRawResponse, - ItemsWithStreamingResponse, - AsyncItemsWithStreamingResponse, +from .top_level import ( + TopLevel, + AsyncTopLevel, + TopLevelWithRawResponse, + AsyncTopLevelWithRawResponse, + TopLevelWithStreamingResponse, + AsyncTopLevelWithStreamingResponse, ) -from .plans import ( - Plans, - AsyncPlans, - PlansWithRawResponse, - AsyncPlansWithRawResponse, - PlansWithStreamingResponse, - AsyncPlansWithStreamingResponse, +from .coupons import Coupons, AsyncCoupons +from .coupons import ( + CouponsWithRawResponse, + AsyncCouponsWithRawResponse, + CouponsWithStreamingResponse, + AsyncCouponsWithStreamingResponse, ) -from .alerts import ( - Alerts, - AsyncAlerts, - AlertsWithRawResponse, - AsyncAlertsWithRawResponse, - AlertsWithStreamingResponse, - AsyncAlertsWithStreamingResponse, +from .credit_notes import CreditNotes, AsyncCreditNotes +from .credit_notes import ( + CreditNotesWithRawResponse, + AsyncCreditNotesWithRawResponse, + CreditNotesWithStreamingResponse, + AsyncCreditNotesWithStreamingResponse, +) +from .customers import Customers, AsyncCustomers +from .customers import ( + CustomersWithRawResponse, + AsyncCustomersWithRawResponse, + CustomersWithStreamingResponse, + AsyncCustomersWithStreamingResponse, ) +from .events import Events, AsyncEvents from .events import ( - Events, - AsyncEvents, EventsWithRawResponse, AsyncEventsWithRawResponse, EventsWithStreamingResponse, AsyncEventsWithStreamingResponse, ) -from .prices import ( - Prices, - AsyncPrices, - PricesWithRawResponse, - AsyncPricesWithRawResponse, - PricesWithStreamingResponse, - AsyncPricesWithStreamingResponse, -) -from .coupons import ( - Coupons, - AsyncCoupons, - CouponsWithRawResponse, - AsyncCouponsWithRawResponse, - CouponsWithStreamingResponse, - AsyncCouponsWithStreamingResponse, -) -from .metrics import ( - Metrics, - AsyncMetrics, - MetricsWithRawResponse, - AsyncMetricsWithRawResponse, - MetricsWithStreamingResponse, - AsyncMetricsWithStreamingResponse, +from .invoice_line_items import InvoiceLineItems, AsyncInvoiceLineItems +from .invoice_line_items import ( + InvoiceLineItemsWithRawResponse, + AsyncInvoiceLineItemsWithRawResponse, + InvoiceLineItemsWithStreamingResponse, + AsyncInvoiceLineItemsWithStreamingResponse, ) +from .invoices import Invoices, AsyncInvoices from .invoices import ( - Invoices, - AsyncInvoices, InvoicesWithRawResponse, AsyncInvoicesWithRawResponse, InvoicesWithStreamingResponse, AsyncInvoicesWithStreamingResponse, ) -from .webhooks import ( - Webhooks, - AsyncWebhooks, +from .items import Items, AsyncItems +from .items import ( + ItemsWithRawResponse, + AsyncItemsWithRawResponse, + ItemsWithStreamingResponse, + AsyncItemsWithStreamingResponse, ) -from .customers import ( - Customers, - AsyncCustomers, - CustomersWithRawResponse, - AsyncCustomersWithRawResponse, - CustomersWithStreamingResponse, - AsyncCustomersWithStreamingResponse, +from .metrics import Metrics, AsyncMetrics +from .metrics import ( + MetricsWithRawResponse, + AsyncMetricsWithRawResponse, + MetricsWithStreamingResponse, + AsyncMetricsWithStreamingResponse, ) -from .top_level import ( - TopLevel, - AsyncTopLevel, - TopLevelWithRawResponse, - AsyncTopLevelWithRawResponse, - TopLevelWithStreamingResponse, - AsyncTopLevelWithStreamingResponse, +from .plans import Plans, AsyncPlans +from .plans import ( + PlansWithRawResponse, + AsyncPlansWithRawResponse, + PlansWithStreamingResponse, + AsyncPlansWithStreamingResponse, ) -from .credit_notes import ( - CreditNotes, - AsyncCreditNotes, - CreditNotesWithRawResponse, - AsyncCreditNotesWithRawResponse, - CreditNotesWithStreamingResponse, - AsyncCreditNotesWithStreamingResponse, +from .prices import Prices, AsyncPrices +from .prices import ( + PricesWithRawResponse, + AsyncPricesWithRawResponse, + PricesWithStreamingResponse, + AsyncPricesWithStreamingResponse, ) +from .subscriptions import Subscriptions, AsyncSubscriptions from .subscriptions import ( - Subscriptions, - AsyncSubscriptions, SubscriptionsWithRawResponse, AsyncSubscriptionsWithRawResponse, SubscriptionsWithStreamingResponse, AsyncSubscriptionsWithStreamingResponse, ) -from .invoice_line_items import ( - InvoiceLineItems, - AsyncInvoiceLineItems, - InvoiceLineItemsWithRawResponse, - AsyncInvoiceLineItemsWithRawResponse, - InvoiceLineItemsWithStreamingResponse, - AsyncInvoiceLineItemsWithStreamingResponse, +from .alerts import Alerts, AsyncAlerts +from .alerts import ( + AlertsWithRawResponse, + AsyncAlertsWithRawResponse, + AlertsWithStreamingResponse, + AsyncAlertsWithStreamingResponse, +) +from .webhooks import ( + Webhooks, + AsyncWebhooks, ) __all__ = [ diff --git a/src/orb/resources/alerts.py b/src/orb/resources/alerts.py index c168f120..2be41e36 100755 --- a/src/orb/resources/alerts.py +++ b/src/orb/resources/alerts.py @@ -2,31 +2,47 @@ from __future__ import annotations -from typing import Union, Iterable, Optional +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 datetime import datetime + from typing_extensions import Literal -import httpx +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper -from .. import _legacy_response from ..types import ( - alert_list_params, alert_update_params, alert_create_for_customer_params, - alert_create_for_subscription_params, alert_create_for_external_customer_params, + alert_create_for_subscription_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) -from .._compat import cached_property + +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 .._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 +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 __all__ = ["Alerts", "AsyncAlerts"] diff --git a/src/orb/resources/coupons/__init__.py b/src/orb/resources/coupons/__init__.py index 06fce4d1..377a0d26 100755 --- a/src/orb/resources/coupons/__init__.py +++ b/src/orb/resources/coupons/__init__.py @@ -1,21 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .coupons import ( - Coupons, - AsyncCoupons, - CouponsWithRawResponse, - AsyncCouponsWithRawResponse, - CouponsWithStreamingResponse, - AsyncCouponsWithStreamingResponse, -) +from .subscriptions import Subscriptions, AsyncSubscriptions from .subscriptions import ( - Subscriptions, - AsyncSubscriptions, SubscriptionsWithRawResponse, AsyncSubscriptionsWithRawResponse, SubscriptionsWithStreamingResponse, AsyncSubscriptionsWithStreamingResponse, ) +from .coupons import Coupons, AsyncCoupons +from .coupons import ( + CouponsWithRawResponse, + AsyncCouponsWithRawResponse, + CouponsWithStreamingResponse, + AsyncCouponsWithStreamingResponse, +) __all__ = [ "Subscriptions", diff --git a/src/orb/resources/coupons/coupons.py b/src/orb/resources/coupons/coupons.py index 74d8d9f0..4b3e15df 100755 --- a/src/orb/resources/coupons/coupons.py +++ b/src/orb/resources/coupons/coupons.py @@ -2,21 +2,37 @@ 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 -import httpx +from ...pagination import SyncPage, AsyncPage + +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper + +from ...types import coupon_create_params from ... import _legacy_response -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 + +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 ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper -from ...pagination import SyncPage, AsyncPage +from ...types import shared_params +from ...types import coupon_create_params +from ...types import coupon_list_params from .subscriptions import ( Subscriptions, AsyncSubscriptions, @@ -25,8 +41,6 @@ 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 a4184554..c9f0d115 100755 --- a/src/orb/resources/coupons/subscriptions.py +++ b/src/orb/resources/coupons/subscriptions.py @@ -2,20 +2,32 @@ 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 -import httpx +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ... import _legacy_response -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import maybe_transform -from ..._compat import cached_property + +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 ..._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 import shared_params 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 c4aa0f94..5dc13a59 100755 --- a/src/orb/resources/credit_notes.py +++ b/src/orb/resources/credit_notes.py @@ -2,20 +2,32 @@ 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 -import httpx +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from .. import _legacy_response -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 + +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 .._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 +from ..types import shared_params +from ..types import credit_note_list_params __all__ = ["CreditNotes", "AsyncCreditNotes"] diff --git a/src/orb/resources/customers/__init__.py b/src/orb/resources/customers/__init__.py index ffe4db5c..bcf0e4e5 100755 --- a/src/orb/resources/customers/__init__.py +++ b/src/orb/resources/customers/__init__.py @@ -1,37 +1,33 @@ # 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 .customers import ( - Customers, - AsyncCustomers, - CustomersWithRawResponse, - AsyncCustomersWithRawResponse, - CustomersWithStreamingResponse, - AsyncCustomersWithStreamingResponse, -) +from .balance_transactions import BalanceTransactions, AsyncBalanceTransactions from .balance_transactions import ( - BalanceTransactions, - AsyncBalanceTransactions, BalanceTransactionsWithRawResponse, AsyncBalanceTransactionsWithRawResponse, BalanceTransactionsWithStreamingResponse, AsyncBalanceTransactionsWithStreamingResponse, ) +from .customers import Customers, AsyncCustomers +from .customers import ( + CustomersWithRawResponse, + AsyncCustomersWithRawResponse, + CustomersWithStreamingResponse, + AsyncCustomersWithStreamingResponse, +) __all__ = [ "Costs", diff --git a/src/orb/resources/customers/balance_transactions.py b/src/orb/resources/customers/balance_transactions.py index dfc7c425..48b8c6a0 100755 --- a/src/orb/resources/customers/balance_transactions.py +++ b/src/orb/resources/customers/balance_transactions.py @@ -2,26 +2,39 @@ from __future__ import annotations -from typing import Union, Optional -from datetime import datetime +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 -import httpx +from typing import Optional, Union + +from ...types.customers.balance_transaction_list_response import BalanceTransactionListResponse + +from ...pagination import SyncPage, AsyncPage + +from datetime import datetime + +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper 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 + +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 ..._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 +from ...types import shared_params +from ...types.customers import balance_transaction_create_params +from ...types.customers import balance_transaction_list_params __all__ = ["BalanceTransactions", "AsyncBalanceTransactions"] diff --git a/src/orb/resources/customers/costs.py b/src/orb/resources/customers/costs.py index 4315389e..43f3cc15 100755 --- a/src/orb/resources/customers/costs.py +++ b/src/orb/resources/customers/costs.py @@ -2,25 +2,37 @@ from __future__ import annotations -from typing import Union, Optional +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 datetime import datetime + from typing_extensions import Literal -import httpx +from ...types.customers.cost_list_by_external_id_response import CostListByExternalIDResponse + +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper 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 + +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 ..._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 +from ...types import shared_params +from ...types.customers import cost_list_params +from ...types.customers import cost_list_by_external_id_params __all__ = ["Costs", "AsyncCosts"] diff --git a/src/orb/resources/customers/credits/__init__.py b/src/orb/resources/customers/credits/__init__.py index cb1b48d7..74276b06 100755 --- a/src/orb/resources/customers/credits/__init__.py +++ b/src/orb/resources/customers/credits/__init__.py @@ -1,29 +1,26 @@ # 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 .credits import ( - Credits, - AsyncCredits, - CreditsWithRawResponse, - AsyncCreditsWithRawResponse, - CreditsWithStreamingResponse, - AsyncCreditsWithStreamingResponse, -) +from .top_ups import TopUps, AsyncTopUps from .top_ups import ( - TopUps, - AsyncTopUps, TopUpsWithRawResponse, AsyncTopUpsWithRawResponse, TopUpsWithStreamingResponse, AsyncTopUpsWithStreamingResponse, ) +from .credits import Credits, AsyncCredits +from .credits import ( + CreditsWithRawResponse, + AsyncCreditsWithRawResponse, + CreditsWithStreamingResponse, + AsyncCreditsWithStreamingResponse, +) __all__ = [ "Ledger", diff --git a/src/orb/resources/customers/credits/credits.py b/src/orb/resources/customers/credits/credits.py index 6167390b..8dfc16e4 100755 --- a/src/orb/resources/customers/credits/credits.py +++ b/src/orb/resources/customers/credits/credits.py @@ -2,11 +2,39 @@ 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 -import httpx +from ....types.customers.credit_list_by_external_id_response import CreditListByExternalIDResponse + +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.customers import credit_list_params +from ....types.customers import credit_list_by_external_id_params from .ledger import ( Ledger, AsyncLedger, @@ -23,16 +51,6 @@ 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 f9853958..e20cbdd4 100755 --- a/src/orb/resources/customers/credits/ledger.py +++ b/src/orb/resources/customers/credits/ledger.py @@ -2,37 +2,62 @@ 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 ...._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.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 ....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 ....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 111fa566..e4f61899 100755 --- a/src/orb/resources/customers/credits/top_ups.py +++ b/src/orb/resources/customers/credits/top_ups.py @@ -2,33 +2,46 @@ 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 -import httpx +from ....types.customers.credits.top_up_list_response import TopUpListResponse -from .... import _legacy_response -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 ....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 +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 + +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 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 + __all__ = ["TopUps", "AsyncTopUps"] diff --git a/src/orb/resources/customers/customers.py b/src/orb/resources/customers/customers.py index b8603320..fda3b97f 100755 --- a/src/orb/resources/customers/customers.py +++ b/src/orb/resources/customers/customers.py @@ -2,13 +2,47 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional -from datetime import datetime +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 -import httpx +from ...pagination import SyncPage, AsyncPage + +from datetime import datetime + +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 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, @@ -17,12 +51,6 @@ 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, @@ -31,18 +59,6 @@ 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 ead1b010..25ebcbb1 100755 --- a/src/orb/resources/events/__init__.py +++ b/src/orb/resources/events/__init__.py @@ -1,21 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .events import ( - Events, - AsyncEvents, - EventsWithRawResponse, - AsyncEventsWithRawResponse, - EventsWithStreamingResponse, - AsyncEventsWithStreamingResponse, -) +from .backfills import Backfills, AsyncBackfills from .backfills import ( - Backfills, - AsyncBackfills, BackfillsWithRawResponse, AsyncBackfillsWithRawResponse, BackfillsWithStreamingResponse, AsyncBackfillsWithStreamingResponse, ) +from .events import Events, AsyncEvents +from .events import ( + EventsWithRawResponse, + AsyncEventsWithRawResponse, + EventsWithStreamingResponse, + AsyncEventsWithStreamingResponse, +) __all__ = [ "Backfills", diff --git a/src/orb/resources/events/backfills.py b/src/orb/resources/events/backfills.py index e742f6d5..f1f653a8 100755 --- a/src/orb/resources/events/backfills.py +++ b/src/orb/resources/events/backfills.py @@ -2,29 +2,44 @@ 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 -import httpx +from ...types.events.backfill_list_response import BackfillListResponse -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 0c7edc7b..d8c26014 100755 --- a/src/orb/resources/events/events.py +++ b/src/orb/resources/events/events.py @@ -2,19 +2,44 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +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 datetime import datetime -import httpx +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 from ... import _legacy_response -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 + +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 .backfills import ( Backfills, AsyncBackfills, @@ -23,13 +48,6 @@ 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 3cc42cab..dbeca6eb 100755 --- a/src/orb/resources/invoice_line_items.py +++ b/src/orb/resources/invoice_line_items.py @@ -2,23 +2,32 @@ 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 -import httpx +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from .. import _legacy_response -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 + +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 .._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 +from ..types import shared_params +from ..types import invoice_line_item_create_params __all__ = ["InvoiceLineItems", "AsyncInvoiceLineItems"] diff --git a/src/orb/resources/invoices.py b/src/orb/resources/invoices.py index f522e06f..385b1181 100755 --- a/src/orb/resources/invoices.py +++ b/src/orb/resources/invoices.py @@ -2,34 +2,48 @@ 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 2121f1de..3858639f 100755 --- a/src/orb/resources/items.py +++ b/src/orb/resources/items.py @@ -2,23 +2,36 @@ from __future__ import annotations -from typing import Iterable, Optional - import httpx -from .. import _legacy_response -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 .._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 + +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 ..types import item_update_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 item_create_params +from ..types import item_update_params +from ..types import item_list_params __all__ = ["Items", "AsyncItems"] diff --git a/src/orb/resources/metrics.py b/src/orb/resources/metrics.py index 0c60af6b..d3f5a1a8 100755 --- a/src/orb/resources/metrics.py +++ b/src/orb/resources/metrics.py @@ -2,24 +2,36 @@ from __future__ import annotations -from typing import Dict, Union, Optional +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 datetime import datetime -import httpx +from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from .. import _legacy_response -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 + +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 .._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 +from ..types import shared_params +from ..types import metric_create_params +from ..types import metric_update_params +from ..types import metric_list_params __all__ = ["Metrics", "AsyncMetrics"] diff --git a/src/orb/resources/plans/__init__.py b/src/orb/resources/plans/__init__.py index fa461833..4751b8ba 100755 --- a/src/orb/resources/plans/__init__.py +++ b/src/orb/resources/plans/__init__.py @@ -1,21 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .plans import ( - Plans, - AsyncPlans, - PlansWithRawResponse, - AsyncPlansWithRawResponse, - PlansWithStreamingResponse, - AsyncPlansWithStreamingResponse, -) +from .external_plan_id import ExternalPlanID, AsyncExternalPlanID from .external_plan_id import ( - ExternalPlanID, - AsyncExternalPlanID, ExternalPlanIDWithRawResponse, AsyncExternalPlanIDWithRawResponse, ExternalPlanIDWithStreamingResponse, AsyncExternalPlanIDWithStreamingResponse, ) +from .plans import Plans, AsyncPlans +from .plans import ( + PlansWithRawResponse, + AsyncPlansWithRawResponse, + PlansWithStreamingResponse, + AsyncPlansWithStreamingResponse, +) __all__ = [ "ExternalPlanID", diff --git a/src/orb/resources/plans/external_plan_id.py b/src/orb/resources/plans/external_plan_id.py index 9b99ce1d..b1fd4838 100755 --- a/src/orb/resources/plans/external_plan_id.py +++ b/src/orb/resources/plans/external_plan_id.py @@ -2,23 +2,31 @@ from __future__ import annotations -from typing import Dict, Optional - 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.plan import Plan -from ...types.plans import external_plan_id_update_params + +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.plans import external_plan_id_update_params + __all__ = ["ExternalPlanID", "AsyncExternalPlanID"] diff --git a/src/orb/resources/plans/plans.py b/src/orb/resources/plans/plans.py index e32f43a5..bd8bb2da 100755 --- a/src/orb/resources/plans/plans.py +++ b/src/orb/resources/plans/plans.py @@ -2,25 +2,42 @@ from __future__ import annotations -from typing import Dict, Union, Iterable, Optional -from datetime import datetime +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 -import httpx +from ...pagination import SyncPage, AsyncPage + +from datetime import datetime + +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper + +from ...types import plan_create_params from ... import _legacy_response -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 + +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 ..._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 ...types import shared_params +from ...types import plan_create_params +from ...types import plan_update_params +from ...types import plan_list_params from .external_plan_id import ( ExternalPlanID, AsyncExternalPlanID, diff --git a/src/orb/resources/prices/__init__.py b/src/orb/resources/prices/__init__.py index cbad4d69..d7a04525 100755 --- a/src/orb/resources/prices/__init__.py +++ b/src/orb/resources/prices/__init__.py @@ -1,21 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .prices import ( - Prices, - AsyncPrices, - PricesWithRawResponse, - AsyncPricesWithRawResponse, - PricesWithStreamingResponse, - AsyncPricesWithStreamingResponse, -) +from .external_price_id import ExternalPriceID, AsyncExternalPriceID from .external_price_id import ( - ExternalPriceID, - AsyncExternalPriceID, ExternalPriceIDWithRawResponse, AsyncExternalPriceIDWithRawResponse, ExternalPriceIDWithStreamingResponse, AsyncExternalPriceIDWithStreamingResponse, ) +from .prices import Prices, AsyncPrices +from .prices import ( + PricesWithRawResponse, + AsyncPricesWithRawResponse, + PricesWithStreamingResponse, + AsyncPricesWithStreamingResponse, +) __all__ = [ "ExternalPriceID", diff --git a/src/orb/resources/prices/external_price_id.py b/src/orb/resources/prices/external_price_id.py index e2ba2682..fd9e0c12 100755 --- a/src/orb/resources/prices/external_price_id.py +++ b/src/orb/resources/prices/external_price_id.py @@ -2,22 +2,38 @@ 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 75ca65ef..bc89fa2b 100755 --- a/src/orb/resources/prices/prices.py +++ b/src/orb/resources/prices/prices.py @@ -2,26 +2,45 @@ from __future__ import annotations -from typing import Any, Dict, List, Union, Optional, cast, overload -from datetime import datetime +import httpx + +from .external_price_id import ExternalPriceID, AsyncExternalPriceID + +from ..._compat import cached_property + from typing_extensions import Literal -import httpx +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 datetime import datetime + +from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper + +from ...types import price_create_params from ... import _legacy_response -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 + +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 ..._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 ...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 .external_price_id import ( ExternalPriceID, AsyncExternalPriceID, @@ -30,7 +49,20 @@ ExternalPriceIDWithStreamingResponse, AsyncExternalPriceIDWithStreamingResponse, ) -from ...types.price_evaluate_response import PriceEvaluateResponse +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__ = ["Prices", "AsyncPrices"] diff --git a/src/orb/resources/subscriptions.py b/src/orb/resources/subscriptions.py index 13a13180..a2bc29a3 100755 --- a/src/orb/resources/subscriptions.py +++ b/src/orb/resources/subscriptions.py @@ -2,44 +2,61 @@ from __future__ import annotations -from typing import Any, Dict, 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 .._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 .._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 ..pagination import SyncPage, AsyncPage + from ..types.subscription_fetch_costs_response import SubscriptionFetchCostsResponse + from ..types.subscription_fetch_schedule_response import SubscriptionFetchScheduleResponse -__all__ = ["Subscriptions", "AsyncSubscriptions"] +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 @@ -50,37 +67,35 @@ 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, + 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 @@ -499,58 +514,47 @@ def create( """ 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, + "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 @@ -588,56 +592,51 @@ def update( 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, - customer_id: Optional[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]: + 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]: """ This endpoint returns a list of all subscriptions for an account as a [paginated](../reference/pagination) list, ordered starting from the most recently created subscription. For a full discussion of the subscription resource, see [Subscription](../guides/concepts#subscription). - Subscriptions can be filtered to a single customer by passing in the - `customer_id` query parameter or the `external_customer_id` query parameter. + Subscriptions can be filtered for a specific customer by using either the + customer_id or external_customer_id query parameters. To filter subscriptions + for multiple customers, use the customer_id[] or external_customer_id[] query + parameters. Args: cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned @@ -655,44 +654,33 @@ def list( """ 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": customer_id, - "external_customer_id": 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": query_customer_id, + "external_customer_id": query_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 @@ -774,37 +762,28 @@ def cancel( 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. @@ -819,30 +798,28 @@ def fetch( 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 @@ -876,44 +853,35 @@ def fetch_costs( 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 @@ -935,51 +903,42 @@ def fetch_schedule( 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 @@ -1204,52 +1163,40 @@ def fetch_usage( 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 @@ -1344,54 +1291,43 @@ def price_intervals( 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 @@ -1479,49 +1415,40 @@ def schedule_plan_change( 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). @@ -1541,34 +1468,28 @@ def trigger_phase( 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. @@ -1589,32 +1510,26 @@ def unschedule_cancellation( 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. @@ -1635,35 +1550,28 @@ def unschedule_fixed_fee_quantity_updates( 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. @@ -1680,35 +1588,29 @@ def unschedule_pending_plan_changes( 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. @@ -1747,29 +1649,21 @@ def update_fixed_fee_quantity( 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: @@ -1779,37 +1673,35 @@ 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, + 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 @@ -2228,58 +2120,47 @@ async def create( """ 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, + "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 @@ -2317,56 +2198,51 @@ async def update( 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, - customer_id: Optional[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]]: + 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]]: """ This endpoint returns a list of all subscriptions for an account as a [paginated](../reference/pagination) list, ordered starting from the most recently created subscription. For a full discussion of the subscription resource, see [Subscription](../guides/concepts#subscription). - Subscriptions can be filtered to a single customer by passing in the - `customer_id` query parameter or the `external_customer_id` query parameter. + Subscriptions can be filtered for a specific customer by using either the + customer_id or external_customer_id query parameters. To filter subscriptions + for multiple customers, use the customer_id[] or external_customer_id[] query + parameters. Args: cursor: Cursor for pagination. This can be populated by the `next_cursor` value returned @@ -2384,44 +2260,33 @@ def list( """ 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": customer_id, - "external_customer_id": 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": query_customer_id, + "external_customer_id": query_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 @@ -2503,37 +2368,28 @@ async def cancel( 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. @@ -2548,30 +2404,28 @@ async def fetch( 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 @@ -2605,44 +2459,35 @@ async def fetch_costs( 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 @@ -2664,51 +2509,42 @@ def fetch_schedule( 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 @@ -2933,52 +2769,40 @@ async def fetch_usage( 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 @@ -3073,54 +2897,43 @@ async def price_intervals( 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 @@ -3208,49 +3021,40 @@ async def schedule_plan_change( 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). @@ -3270,34 +3074,28 @@ async def trigger_phase( 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. @@ -3318,32 +3116,26 @@ async def unschedule_cancellation( 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. @@ -3364,35 +3156,28 @@ async def unschedule_fixed_fee_quantity_updates( 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. @@ -3409,35 +3194,29 @@ async def unschedule_pending_plan_changes( 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. @@ -3476,29 +3255,21 @@ async def update_fixed_fee_quantity( 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 @@ -3549,7 +3320,6 @@ def __init__(self, subscriptions: Subscriptions) -> None: subscriptions.update_fixed_fee_quantity, ) - class AsyncSubscriptionsWithRawResponse: def __init__(self, subscriptions: AsyncSubscriptions) -> None: self._subscriptions = subscriptions @@ -3600,7 +3370,6 @@ def __init__(self, subscriptions: AsyncSubscriptions) -> None: subscriptions.update_fixed_fee_quantity, ) - class SubscriptionsWithStreamingResponse: def __init__(self, subscriptions: Subscriptions) -> None: self._subscriptions = subscriptions @@ -3651,7 +3420,6 @@ def __init__(self, subscriptions: Subscriptions) -> None: subscriptions.update_fixed_fee_quantity, ) - class AsyncSubscriptionsWithStreamingResponse: def __init__(self, subscriptions: AsyncSubscriptions) -> None: self._subscriptions = subscriptions @@ -3700,4 +3468,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 4968a63a..dc76e888 100755 --- a/src/orb/resources/top_level.py +++ b/src/orb/resources/top_level.py @@ -4,14 +4,24 @@ import httpx -from .. import _legacy_response -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven 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.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 .._resource import SyncAPIResource, AsyncAPIResource +from ..types import shared_params + __all__ = ["TopLevel", "AsyncTopLevel"] diff --git a/src/orb/types/__init__.py b/src/orb/types/__init__.py index 3c43ed44..9cec085d 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 .invoice import Invoice as Invoice -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 .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 .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 .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 .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 .price_create_params import PriceCreateParams as PriceCreateParams from .price_update_params import PriceUpdateParams as PriceUpdateParams -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_list_params import PriceListParams as PriceListParams from .price_evaluate_params import PriceEvaluateParams as PriceEvaluateParams -from .customer_create_params import CustomerCreateParams as CustomerCreateParams -from .customer_update_params import CustomerUpdateParams as CustomerUpdateParams -from .credit_note_list_params import CreditNoteListParams as CreditNoteListParams -from .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 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 .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_list_params import SubscriptionListParams as SubscriptionListParams +from .subscription_cancel_params import SubscriptionCancelParams as SubscriptionCancelParams from .subscription_fetch_costs_params import SubscriptionFetchCostsParams as SubscriptionFetchCostsParams -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_fetch_usage_params import SubscriptionFetchUsageParams as SubscriptionFetchUsageParams 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 .alert_create_for_external_customer_params import ( - AlertCreateForExternalCustomerParams as AlertCreateForExternalCustomerParams, +from .subscription_trigger_phase_params import SubscriptionTriggerPhaseParams as SubscriptionTriggerPhaseParams +from .subscription_unschedule_fixed_fee_quantity_updates_params import ( + SubscriptionUnscheduleFixedFeeQuantityUpdatesParams as SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, ) from .subscription_update_fixed_fee_quantity_params import ( SubscriptionUpdateFixedFeeQuantityParams as SubscriptionUpdateFixedFeeQuantityParams, ) -from .subscription_unschedule_fixed_fee_quantity_updates_params import ( - SubscriptionUnscheduleFixedFeeQuantityUpdatesParams as SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, +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 .alert_create_for_subscription_params import AlertCreateForSubscriptionParams as AlertCreateForSubscriptionParams diff --git a/src/orb/types/alert.py b/src/orb/types/alert.py index 7a7dd4b2..2d8df205 100755 --- a/src/orb/types/alert.py +++ b/src/orb/types/alert.py @@ -1,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from .._models import BaseModel + from datetime import datetime + +from typing import Optional, Dict, List + from typing_extensions import Literal -from .._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 5eeec557..4381f398 100755 --- a/src/orb/types/alert_create_for_customer_params.py +++ b/src/orb/types/alert_create_for_customer_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +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 __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 6732f61c..c59ea353 100755 --- a/src/orb/types/alert_create_for_external_customer_params.py +++ b/src/orb/types/alert_create_for_external_customer_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +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 __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 767408dc..be320a26 100755 --- a/src/orb/types/alert_create_for_subscription_params.py +++ b/src/orb/types/alert_create_for_subscription_params.py @@ -2,8 +2,14 @@ from __future__ import annotations +from typing_extensions import TypedDict, Required, Literal + from typing import Iterable, Optional -from typing_extensions import Literal, Required, 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__ = ["AlertCreateForSubscriptionParams", "Threshold"] diff --git a/src/orb/types/alert_list_params.py b/src/orb/types/alert_list_params.py index ccd37423..25908ddb 100755 --- a/src/orb/types/alert_list_params.py +++ b/src/orb/types/alert_list_params.py @@ -2,12 +2,19 @@ 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 6be6b1d2..a9dab69f 100755 --- a/src/orb/types/alert_update_params.py +++ b/src/orb/types/alert_update_params.py @@ -2,8 +2,14 @@ from __future__ import annotations +from typing_extensions import TypedDict, Required + from typing import Iterable -from typing_extensions import Required, 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__ = ["AlertUpdateParams", "Threshold"] diff --git a/src/orb/types/billable_metric.py b/src/orb/types/billable_metric.py index ac70464c..ef13a797 100755 --- a/src/orb/types/billable_metric.py +++ b/src/orb/types/billable_metric.py @@ -1,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional -from typing_extensions import Literal +from .._models import BaseModel + +from typing import Optional, Dict from .item import Item -from .._models import BaseModel + +from typing_extensions import Literal + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["BillableMetric"] diff --git a/src/orb/types/coupon.py b/src/orb/types/coupon.py index 5003327d..1575c0e1 100755 --- a/src/orb/types/coupon.py +++ b/src/orb/types/coupon.py @@ -1,11 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias +from .._models import BaseModel + +from typing import List, Optional + +from typing_extensions import Literal, TypeAlias, Annotated from .._utils import PropertyInfo -from .._models import BaseModel + +from datetime import datetime + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["Coupon", "Discount", "DiscountPercentageDiscount", "DiscountAmountDiscount"] diff --git a/src/orb/types/coupon_create_params.py b/src/orb/types/coupon_create_params.py index 50746cd1..34b693e4 100755 --- a/src/orb/types/coupon_create_params.py +++ b/src/orb/types/coupon_create_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Union, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +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 __all__ = ["CouponCreateParams", "Discount", "DiscountNewCouponPercentageDiscount", "DiscountNewCouponAmountDiscount"] diff --git a/src/orb/types/coupon_list_params.py b/src/orb/types/coupon_list_params.py index 7f70e5ad..e84c560f 100755 --- a/src/orb/types/coupon_list_params.py +++ b/src/orb/types/coupon_list_params.py @@ -2,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __all__ = ["CouponListParams"] diff --git a/src/orb/types/coupons/subscription_list_params.py b/src/orb/types/coupons/subscription_list_params.py index 6d948e53..5bd4531b 100755 --- a/src/orb/types/coupons/subscription_list_params.py +++ b/src/orb/types/coupons/subscription_list_params.py @@ -2,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __all__ = ["SubscriptionListParams"] diff --git a/src/orb/types/credit_note.py b/src/orb/types/credit_note.py index d883c425..e99ff0f3 100755 --- a/src/orb/types/credit_note.py +++ b/src/orb/types/credit_note.py @@ -1,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime +from .._models import BaseModel + +from typing import Optional, List + from typing_extensions import Literal -from .._models import BaseModel +from datetime import datetime + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = [ "CreditNote", diff --git a/src/orb/types/credit_note_list_params.py b/src/orb/types/credit_note_list_params.py index fa1314af..7345fdd6 100755 --- a/src/orb/types/credit_note_list_params.py +++ b/src/orb/types/credit_note_list_params.py @@ -2,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __all__ = ["CreditNoteListParams"] diff --git a/src/orb/types/customer.py b/src/orb/types/customer.py index 679a29a4..5f322439 100755 --- a/src/orb/types/customer.py +++ b/src/orb/types/customer.py @@ -1,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional -from datetime import datetime +from .._models import BaseModel + +from typing import Optional, List, Dict + from typing_extensions import Literal -from .._models import BaseModel +from datetime import datetime + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = [ "Customer", diff --git a/src/orb/types/customer_create_params.py b/src/orb/types/customer_create_params.py index 24f380f9..3dbdf9da 100755 --- a/src/orb/types/customer_create_params.py +++ b/src/orb/types/customer_create_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Dict, List, Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +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 __all__ = [ "CustomerCreateParams", diff --git a/src/orb/types/customer_list_params.py b/src/orb/types/customer_list_params.py index 518ee766..a1832df0 100755 --- a/src/orb/types/customer_list_params.py +++ b/src/orb/types/customer_list_params.py @@ -2,12 +2,19 @@ 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 66f25cb3..38bbf976 100755 --- a/src/orb/types/customer_update_by_external_id_params.py +++ b/src/orb/types/customer_update_by_external_id_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Dict, List, Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +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 __all__ = [ "CustomerUpdateByExternalIDParams", diff --git a/src/orb/types/customer_update_params.py b/src/orb/types/customer_update_params.py index b36781be..e9d719a2 100755 --- a/src/orb/types/customer_update_params.py +++ b/src/orb/types/customer_update_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Dict, List, Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +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 __all__ = [ "CustomerUpdateParams", diff --git a/src/orb/types/customers/__init__.py b/src/orb/types/customers/__init__.py index ba43a9b2..e98ad3fd 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_params import CostListParams as CostListParams 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 .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 .credit_list_params import CreditListParams as CreditListParams from .credit_list_by_external_id_params import CreditListByExternalIDParams as CreditListByExternalIDParams from .balance_transaction_create_response import BalanceTransactionCreateResponse as BalanceTransactionCreateResponse -from .credit_list_by_external_id_response import CreditListByExternalIDResponse as CreditListByExternalIDResponse +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 diff --git a/src/orb/types/customers/balance_transaction_create_params.py b/src/orb/types/customers/balance_transaction_create_params.py index 0e440728..2bcc4846 100755 --- a/src/orb/types/customers/balance_transaction_create_params.py +++ b/src/orb/types/customers/balance_transaction_create_params.py @@ -2,8 +2,14 @@ from __future__ import annotations +from typing_extensions import TypedDict, Required, Literal + from typing import Optional -from typing_extensions import Literal, Required, 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__ = ["BalanceTransactionCreateParams"] diff --git a/src/orb/types/customers/balance_transaction_create_response.py b/src/orb/types/customers/balance_transaction_create_response.py index 09f688d0..2d1a563f 100755 --- a/src/orb/types/customers/balance_transaction_create_response.py +++ b/src/orb/types/customers/balance_transaction_create_response.py @@ -1,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional -from datetime import datetime +from ..._models import BaseModel + from typing_extensions import Literal -from ..._models import BaseModel +from datetime import datetime + +from typing import Optional + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 c3d5eb61..4a37bbb1 100755 --- a/src/orb/types/customers/balance_transaction_list_params.py +++ b/src/orb/types/customers/balance_transaction_list_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import Union, Optional +from typing_extensions import TypedDict, Annotated + +from typing import Optional, Union + 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 d5d3bb38..9de2d7e6 100755 --- a/src/orb/types/customers/balance_transaction_list_response.py +++ b/src/orb/types/customers/balance_transaction_list_response.py @@ -1,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional -from datetime import datetime +from ..._models import BaseModel + from typing_extensions import Literal -from ..._models import BaseModel +from datetime import datetime + +from typing import Optional + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 dad37e47..b9638001 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,12 +2,19 @@ from __future__ import annotations -from typing import Union, Optional +from typing_extensions import TypedDict, Annotated, Literal + +from typing import Optional, Union + 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 8345151d..d736e7c2 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,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime +from ..._models import BaseModel from ..price import Price -from ..._models import BaseModel + +from typing import Optional, List + +from datetime import datetime + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 741fd8d9..94fdf164 100755 --- a/src/orb/types/customers/cost_list_params.py +++ b/src/orb/types/customers/cost_list_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import Union, Optional +from typing_extensions import TypedDict, Annotated, Literal + +from typing import Optional, Union + 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 fe384554..21406085 100755 --- a/src/orb/types/customers/cost_list_response.py +++ b/src/orb/types/customers/cost_list_response.py @@ -1,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime +from ..._models import BaseModel from ..price import Price -from ..._models import BaseModel + +from typing import Optional, List + +from datetime import datetime + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 b192dc5c..e4d306aa 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,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __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 d88e900b..7bba0e00 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,10 +1,16 @@ # 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 ..._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["CreditListByExternalIDResponse"] diff --git a/src/orb/types/customers/credit_list_params.py b/src/orb/types/customers/credit_list_params.py index 9e8d7ba7..7517876d 100755 --- a/src/orb/types/customers/credit_list_params.py +++ b/src/orb/types/customers/credit_list_params.py @@ -2,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __all__ = ["CreditListParams"] diff --git a/src/orb/types/customers/credit_list_response.py b/src/orb/types/customers/credit_list_response.py index 7ccbfcf1..e6031598 100755 --- a/src/orb/types/customers/credit_list_response.py +++ b/src/orb/types/customers/credit_list_response.py @@ -1,10 +1,16 @@ # 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 ..._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["CreditListResponse"] diff --git a/src/orb/types/customers/credits/__init__.py b/src/orb/types/customers/credits/__init__.py index 9baa17d8..4bdfca02 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_list_by_external_id_params import LedgerListByExternalIDParams as LedgerListByExternalIDParams -from .top_up_list_by_external_id_params import TopUpListByExternalIDParams as TopUpListByExternalIDParams +from .ledger_create_entry_by_external_id_response import ( + LedgerCreateEntryByExternalIDResponse as LedgerCreateEntryByExternalIDResponse, +) from .ledger_list_by_external_id_response import LedgerListByExternalIDResponse as LedgerListByExternalIDResponse -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_list_params import LedgerListParams as LedgerListParams +from .ledger_create_entry_params import LedgerCreateEntryParams as LedgerCreateEntryParams from .ledger_create_entry_by_external_id_params import ( LedgerCreateEntryByExternalIDParams as LedgerCreateEntryByExternalIDParams, ) -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_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 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 07e8217c..969a7e60 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,10 +2,17 @@ from __future__ import annotations -from typing import Dict, Union, Optional -from datetime import date, datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import TypedDict, Required, Literal, Annotated, TypeAlias +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 82acb578..d3f56841 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,11 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Union, Optional +from ...._models import BaseModel + +from typing import Optional, Dict + from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias + +from typing_extensions import Literal, TypeAlias, Annotated from ...._utils import PropertyInfo -from ...._models import BaseModel + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 46ce0a9e..6d198666 100755 --- a/src/orb/types/customers/credits/ledger_create_entry_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_params.py @@ -2,10 +2,17 @@ from __future__ import annotations -from typing import Dict, Union, Optional -from datetime import date, datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from typing_extensions import TypedDict, Required, Literal, Annotated, TypeAlias +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 17dc5228..dd962a66 100755 --- a/src/orb/types/customers/credits/ledger_create_entry_response.py +++ b/src/orb/types/customers/credits/ledger_create_entry_response.py @@ -1,11 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Union, Optional +from ...._models import BaseModel + +from typing import Optional, Dict + from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias + +from typing_extensions import Literal, TypeAlias, Annotated from ...._utils import PropertyInfo -from ...._models import BaseModel + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 165d85bb..4c00ce12 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,12 +2,19 @@ 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 fd5d03a2..88d09cc3 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,11 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Union, Optional +from ...._models import BaseModel + +from typing import Optional, Dict + from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias + +from typing_extensions import Literal, TypeAlias, Annotated from ...._utils import PropertyInfo -from ...._models import BaseModel + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 24be2285..3978a803 100755 --- a/src/orb/types/customers/credits/ledger_list_params.py +++ b/src/orb/types/customers/credits/ledger_list_params.py @@ -2,12 +2,19 @@ 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 c02858de..8432f3d7 100755 --- a/src/orb/types/customers/credits/ledger_list_response.py +++ b/src/orb/types/customers/credits/ledger_list_response.py @@ -1,11 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Union, Optional +from ...._models import BaseModel + +from typing import Optional, Dict + from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias + +from typing_extensions import Literal, TypeAlias, Annotated from ...._utils import PropertyInfo -from ...._models import BaseModel + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 bbddd72e..22137d4a 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,8 +2,14 @@ from __future__ import annotations +from typing_extensions import TypedDict, Required, Literal + from typing import Optional -from typing_extensions import Literal, Required, 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__ = ["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 9b889e61..fab31e17 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,9 +1,14 @@ # 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 ...._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 571263d6..8332740e 100755 --- a/src/orb/types/customers/credits/top_up_create_params.py +++ b/src/orb/types/customers/credits/top_up_create_params.py @@ -2,8 +2,14 @@ from __future__ import annotations +from typing_extensions import TypedDict, Required, Literal + from typing import Optional -from typing_extensions import Literal, Required, 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__ = ["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 d9497888..f7295ef3 100755 --- a/src/orb/types/customers/credits/top_up_create_response.py +++ b/src/orb/types/customers/credits/top_up_create_response.py @@ -1,9 +1,14 @@ # 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 ...._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 97821b60..1cb68660 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,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __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 fc3088ad..71b6a356 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,9 +1,14 @@ # 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 ...._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 bf551c42..67a55738 100755 --- a/src/orb/types/customers/credits/top_up_list_params.py +++ b/src/orb/types/customers/credits/top_up_list_params.py @@ -2,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __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 69a59f4d..f51e1ec4 100755 --- a/src/orb/types/customers/credits/top_up_list_response.py +++ b/src/orb/types/customers/credits/top_up_list_response.py @@ -1,9 +1,14 @@ # 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 ...._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["TopUpListResponse", "InvoiceSettings"] diff --git a/src/orb/types/evaluate_price_group.py b/src/orb/types/evaluate_price_group.py index 2a6af81a..80754824 100755 --- a/src/orb/types/evaluate_price_group.py +++ b/src/orb/types/evaluate_price_group.py @@ -1,8 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .._models import BaseModel + from typing import List, Union -from .._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["EvaluatePriceGroup"] diff --git a/src/orb/types/event_deprecate_response.py b/src/orb/types/event_deprecate_response.py index 08b4aecb..23ea3b77 100755 --- a/src/orb/types/event_deprecate_response.py +++ b/src/orb/types/event_deprecate_response.py @@ -1,9 +1,11 @@ # 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 + __all__ = ["EventDeprecateResponse"] diff --git a/src/orb/types/event_ingest_params.py b/src/orb/types/event_ingest_params.py index 505fbfe6..21bc0543 100755 --- a/src/orb/types/event_ingest_params.py +++ b/src/orb/types/event_ingest_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import Union, Iterable, Optional +from typing_extensions import TypedDict, Required, Annotated + +from typing import Iterable, Optional, 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__ = ["EventIngestParams", "Event"] diff --git a/src/orb/types/event_ingest_response.py b/src/orb/types/event_ingest_response.py index 933e18c8..94ea1475 100755 --- a/src/orb/types/event_ingest_response.py +++ b/src/orb/types/event_ingest_response.py @@ -1,8 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .._models import BaseModel + from typing import List, Optional -from .._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["EventIngestResponse", "ValidationFailed", "Debug"] diff --git a/src/orb/types/event_search_params.py b/src/orb/types/event_search_params.py index e422ae4f..dc4edd70 100755 --- a/src/orb/types/event_search_params.py +++ b/src/orb/types/event_search_params.py @@ -2,12 +2,19 @@ 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 62a5a9ee..874c3cd2 100755 --- a/src/orb/types/event_search_response.py +++ b/src/orb/types/event_search_response.py @@ -1,9 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from .._models import BaseModel + +from typing import Optional, List + from datetime import datetime -from .._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["EventSearchResponse", "Data"] diff --git a/src/orb/types/event_update_params.py b/src/orb/types/event_update_params.py index 3de8f966..7fbe183d 100755 --- a/src/orb/types/event_update_params.py +++ b/src/orb/types/event_update_params.py @@ -2,12 +2,19 @@ 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 aa91fd81..99a82d8d 100755 --- a/src/orb/types/event_update_response.py +++ b/src/orb/types/event_update_response.py @@ -1,9 +1,11 @@ # 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 + __all__ = ["EventUpdateResponse"] diff --git a/src/orb/types/events/__init__.py b/src/orb/types/events/__init__.py index a13aa150..ad8fa1fb 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_list_params import BackfillListParams as BackfillListParams -from .backfill_create_params import BackfillCreateParams as BackfillCreateParams +from .backfill_create_response import BackfillCreateResponse as BackfillCreateResponse 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 393fc793..b9de7314 100755 --- a/src/orb/types/events/backfill_close_response.py +++ b/src/orb/types/events/backfill_close_response.py @@ -1,10 +1,16 @@ # 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 ..._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["BackfillCloseResponse"] diff --git a/src/orb/types/events/backfill_create_params.py b/src/orb/types/events/backfill_create_params.py index 1c526f39..bcd7e873 100755 --- a/src/orb/types/events/backfill_create_params.py +++ b/src/orb/types/events/backfill_create_params.py @@ -2,12 +2,19 @@ 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 d8b9f837..097b91de 100755 --- a/src/orb/types/events/backfill_create_response.py +++ b/src/orb/types/events/backfill_create_response.py @@ -1,10 +1,16 @@ # 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 ..._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["BackfillCreateResponse"] diff --git a/src/orb/types/events/backfill_fetch_response.py b/src/orb/types/events/backfill_fetch_response.py index c82d950b..b3bcce37 100755 --- a/src/orb/types/events/backfill_fetch_response.py +++ b/src/orb/types/events/backfill_fetch_response.py @@ -1,10 +1,16 @@ # 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 ..._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["BackfillFetchResponse"] diff --git a/src/orb/types/events/backfill_list_params.py b/src/orb/types/events/backfill_list_params.py index 4b6adaef..510de04f 100755 --- a/src/orb/types/events/backfill_list_params.py +++ b/src/orb/types/events/backfill_list_params.py @@ -2,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __all__ = ["BackfillListParams"] diff --git a/src/orb/types/events/backfill_list_response.py b/src/orb/types/events/backfill_list_response.py index 2df11980..a4f73ff3 100755 --- a/src/orb/types/events/backfill_list_response.py +++ b/src/orb/types/events/backfill_list_response.py @@ -1,10 +1,16 @@ # 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 ..._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["BackfillListResponse"] diff --git a/src/orb/types/events/backfill_revert_response.py b/src/orb/types/events/backfill_revert_response.py index 39ad6836..7d32dbe4 100755 --- a/src/orb/types/events/backfill_revert_response.py +++ b/src/orb/types/events/backfill_revert_response.py @@ -1,10 +1,16 @@ # 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 ..._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["BackfillRevertResponse"] diff --git a/src/orb/types/invoice.py b/src/orb/types/invoice.py index 5781f30d..85448b29 100755 --- a/src/orb/types/invoice.py +++ b/src/orb/types/invoice.py @@ -1,14 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from .._models import BaseModel + +from typing import Optional, List, Dict + from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias -from .price import Price +from typing_extensions import Literal, TypeAlias, Annotated + 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 78e22ea8..045dcbe4 100755 --- a/src/orb/types/invoice_create_params.py +++ b/src/orb/types/invoice_create_params.py @@ -2,13 +2,21 @@ from __future__ import annotations -from typing import Dict, Union, Iterable, Optional -from datetime import date, datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import TypedDict, Required, Annotated, Literal + +from typing import Union, Iterable, Optional, Dict + +from datetime import datetime, date 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 0d219ef7..8bfda1c7 100755 --- a/src/orb/types/invoice_fetch_upcoming_params.py +++ b/src/orb/types/invoice_fetch_upcoming_params.py @@ -4,6 +4,11 @@ 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 f1398c16..c4efb69d 100755 --- a/src/orb/types/invoice_fetch_upcoming_response.py +++ b/src/orb/types/invoice_fetch_upcoming_response.py @@ -1,14 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from .._models import BaseModel + +from typing import Optional, List, Dict + from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias -from .price import Price +from typing_extensions import Literal, TypeAlias, Annotated + 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 03016bfd..3739be8d 100755 --- a/src/orb/types/invoice_line_item_create_params.py +++ b/src/orb/types/invoice_line_item_create_params.py @@ -2,12 +2,19 @@ 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 7ac86286..13443894 100755 --- a/src/orb/types/invoice_line_item_create_response.py +++ b/src/orb/types/invoice_line_item_create_response.py @@ -1,14 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias +from .._models import BaseModel + +from typing import List, Optional + +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 datetime import datetime + +from .price import Price + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo + __all__ = [ "InvoiceLineItemCreateResponse", "Maximum", diff --git a/src/orb/types/invoice_list_params.py b/src/orb/types/invoice_list_params.py index 31bc4111..4382a962 100755 --- a/src/orb/types/invoice_list_params.py +++ b/src/orb/types/invoice_list_params.py @@ -2,10 +2,17 @@ from __future__ import annotations -from typing import List, Union, Optional +from typing_extensions import TypedDict, Annotated, Literal + +from typing import Optional, Union, List + +from .._utils import PropertyInfo + 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 28a20dda..496595c2 100755 --- a/src/orb/types/invoice_mark_paid_params.py +++ b/src/orb/types/invoice_mark_paid_params.py @@ -2,12 +2,19 @@ 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 e0e5c347..c8fe744d 100755 --- a/src/orb/types/invoice_update_params.py +++ b/src/orb/types/invoice_update_params.py @@ -2,9 +2,15 @@ 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 ad22a1dd..de224c05 100755 --- a/src/orb/types/item.py +++ b/src/orb/types/item.py @@ -1,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List -from datetime import datetime +from .._models import BaseModel + from typing_extensions import Literal -from .._models import BaseModel +from datetime import datetime + +from typing import List + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["Item", "ExternalConnection"] diff --git a/src/orb/types/item_create_params.py b/src/orb/types/item_create_params.py index 8b45e468..1ca4f960 100755 --- a/src/orb/types/item_create_params.py +++ b/src/orb/types/item_create_params.py @@ -2,7 +2,12 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +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 __all__ = ["ItemCreateParams"] diff --git a/src/orb/types/item_list_params.py b/src/orb/types/item_list_params.py index d2317a13..df4e06ec 100755 --- a/src/orb/types/item_list_params.py +++ b/src/orb/types/item_list_params.py @@ -2,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __all__ = ["ItemListParams"] diff --git a/src/orb/types/item_update_params.py b/src/orb/types/item_update_params.py index a94f7c59..14dcac6a 100755 --- a/src/orb/types/item_update_params.py +++ b/src/orb/types/item_update_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +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 __all__ = ["ItemUpdateParams", "ExternalConnection"] diff --git a/src/orb/types/metric_create_params.py b/src/orb/types/metric_create_params.py index 5e53ddf9..d84189bd 100755 --- a/src/orb/types/metric_create_params.py +++ b/src/orb/types/metric_create_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Dict, Optional -from typing_extensions import Required, TypedDict +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 __all__ = ["MetricCreateParams"] diff --git a/src/orb/types/metric_list_params.py b/src/orb/types/metric_list_params.py index 90e5db42..11b9dc08 100755 --- a/src/orb/types/metric_list_params.py +++ b/src/orb/types/metric_list_params.py @@ -2,12 +2,19 @@ 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 5c182e03..32ec5df8 100755 --- a/src/orb/types/metric_update_params.py +++ b/src/orb/types/metric_update_params.py @@ -2,9 +2,15 @@ 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 f3b3b805..35ed4b31 100755 --- a/src/orb/types/plan.py +++ b/src/orb/types/plan.py @@ -1,12 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional -from datetime import datetime +from .._models import BaseModel + +from typing import Optional, List, Dict + +from .shared.discount import Discount + from typing_extensions import Literal +from datetime import datetime + from .price import Price -from .._models import BaseModel -from .shared.discount import Discount + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = [ "Plan", diff --git a/src/orb/types/plan_create_params.py b/src/orb/types/plan_create_params.py index 4fe3268b..6fd8a17c 100755 --- a/src/orb/types/plan_create_params.py +++ b/src/orb/types/plan_create_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +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 __all__ = [ "PlanCreateParams", diff --git a/src/orb/types/plan_list_params.py b/src/orb/types/plan_list_params.py index 0611f905..95eb522d 100755 --- a/src/orb/types/plan_list_params.py +++ b/src/orb/types/plan_list_params.py @@ -2,12 +2,19 @@ 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 5fc717f0..639b0e08 100755 --- a/src/orb/types/plan_update_params.py +++ b/src/orb/types/plan_update_params.py @@ -2,9 +2,15 @@ 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 d7017899..65d43981 100755 --- a/src/orb/types/plans/external_plan_id_update_params.py +++ b/src/orb/types/plans/external_plan_id_update_params.py @@ -2,9 +2,15 @@ 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 401c88b5..3230e31f 100755 --- a/src/orb/types/price.py +++ b/src/orb/types/price.py @@ -1,14 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from .._models import BaseModel + +from typing_extensions import Literal, TypeAlias, Annotated + +from typing import List, Optional, Dict + from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias -from pydantic import Field as FieldInfo +from .shared.discount import Discount from .._utils import PropertyInfo -from .._models import BaseModel -from .shared.discount import Discount + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = [ "Price", diff --git a/src/orb/types/price_create_params.py b/src/orb/types/price_create_params.py index f3d07860..ad95be72 100755 --- a/src/orb/types/price_create_params.py +++ b/src/orb/types/price_create_params.py @@ -2,8 +2,14 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +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 __all__ = [ "PriceCreateParams", diff --git a/src/orb/types/price_evaluate_params.py b/src/orb/types/price_evaluate_params.py index 32b7c838..5d6df76d 100755 --- a/src/orb/types/price_evaluate_params.py +++ b/src/orb/types/price_evaluate_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import List, Union, Optional +from typing_extensions import TypedDict, Annotated, Required + +from typing import Union, Optional, List + 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 793ed493..4a669d78 100755 --- a/src/orb/types/price_evaluate_response.py +++ b/src/orb/types/price_evaluate_response.py @@ -1,10 +1,15 @@ # 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 d908c7f5..02a0ef6a 100755 --- a/src/orb/types/price_list_params.py +++ b/src/orb/types/price_list_params.py @@ -2,9 +2,15 @@ from __future__ import annotations -from typing import Optional 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 + __all__ = ["PriceListParams"] diff --git a/src/orb/types/price_update_params.py b/src/orb/types/price_update_params.py index d6396a1b..bf8a44c6 100755 --- a/src/orb/types/price_update_params.py +++ b/src/orb/types/price_update_params.py @@ -2,9 +2,15 @@ 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 9b431435..f84e963d 100755 --- a/src/orb/types/prices/external_price_id_update_params.py +++ b/src/orb/types/prices/external_price_id_update_params.py @@ -2,9 +2,15 @@ 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 98c8e5c0..3f790a1d 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 b4e6a488..35de9f7a 100755 --- a/src/orb/types/shared/billing_cycle_relative_date.py +++ b/src/orb/types/shared/billing_cycle_relative_date.py @@ -2,6 +2,13 @@ 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 866b378c..3fba654d 100755 --- a/src/orb/types/shared/discount.py +++ b/src/orb/types/shared/discount.py @@ -1,9 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from typing_extensions import Literal, Annotated, TypeAlias +from ..._models import BaseModel + +from typing import List, Optional + +from typing_extensions import Literal, TypeAlias, Annotated 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 8390ceb5..36b4a3d3 100755 --- a/src/orb/types/shared/pagination_metadata.py +++ b/src/orb/types/shared/pagination_metadata.py @@ -1,7 +1,14 @@ # 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 ed0e0225..4cc25f45 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 .discount import Discount as Discount from .billing_cycle_relative_date import BillingCycleRelativeDate as BillingCycleRelativeDate +from .discount import Discount as Discount diff --git a/src/orb/types/shared_params/discount.py b/src/orb/types/shared_params/discount.py index 17e76491..3c6958e6 100755 --- a/src/orb/types/shared_params/discount.py +++ b/src/orb/types/shared_params/discount.py @@ -2,8 +2,9 @@ from __future__ import annotations -from typing import List, Union, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import List, Optional, Union + +from typing_extensions import Literal, TypedDict, Required, TypeAlias __all__ = ["Discount", "PercentageDiscount", "TrialDiscount", "UsageDiscount", "AmountDiscount"] diff --git a/src/orb/types/subscription.py b/src/orb/types/subscription.py index 0586dfde..e2d5825d 100755 --- a/src/orb/types/subscription.py +++ b/src/orb/types/subscription.py @@ -1,15 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Union, Optional +from .._models import BaseModel + +from typing_extensions import Literal, TypeAlias, Annotated + +from typing import List, Optional, Dict + +from .._utils import PropertyInfo + 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", diff --git a/src/orb/types/subscription_cancel_params.py b/src/orb/types/subscription_cancel_params.py index 6ce855b1..884f484d 100755 --- a/src/orb/types/subscription_cancel_params.py +++ b/src/orb/types/subscription_cancel_params.py @@ -2,12 +2,19 @@ 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 391685d9..a4b476e6 100755 --- a/src/orb/types/subscription_create_params.py +++ b/src/orb/types/subscription_create_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import TypedDict, Annotated, Literal, Required, TypeAlias + +from typing import Optional, Union, Dict, Iterable, List + 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", "PriceOverride", diff --git a/src/orb/types/subscription_fetch_costs_params.py b/src/orb/types/subscription_fetch_costs_params.py index 38266115..7caeb829 100755 --- a/src/orb/types/subscription_fetch_costs_params.py +++ b/src/orb/types/subscription_fetch_costs_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import Union, Optional +from typing_extensions import TypedDict, Annotated, Literal + +from typing import Optional, Union + 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 af400e65..0027e74c 100755 --- a/src/orb/types/subscription_fetch_costs_response.py +++ b/src/orb/types/subscription_fetch_costs_response.py @@ -1,10 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime +from .._models import BaseModel from .price import Price -from .._models import BaseModel + +from typing import Optional, List + +from datetime import datetime + +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __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 3d7b2978..106c0d49 100755 --- a/src/orb/types/subscription_fetch_schedule_params.py +++ b/src/orb/types/subscription_fetch_schedule_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import Union, Optional +from typing_extensions import TypedDict, Annotated + +from typing import Optional, Union + 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 38a3999c..295646b7 100755 --- a/src/orb/types/subscription_fetch_schedule_response.py +++ b/src/orb/types/subscription_fetch_schedule_response.py @@ -1,9 +1,14 @@ # 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 .._models import BaseModel +from typing import Optional, Union, List, Dict, Any +from typing_extensions import Literal +from pydantic import Field as FieldInfo __all__ = ["SubscriptionFetchScheduleResponse", "Plan"] diff --git a/src/orb/types/subscription_fetch_usage_params.py b/src/orb/types/subscription_fetch_usage_params.py index 6728382e..dd84c24f 100755 --- a/src/orb/types/subscription_fetch_usage_params.py +++ b/src/orb/types/subscription_fetch_usage_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import Union, Optional +from typing_extensions import TypedDict, Literal, Annotated + +from typing import Optional, Union + 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 7fd530d2..4f341ef9 100755 --- a/src/orb/types/subscription_list_params.py +++ b/src/orb/types/subscription_list_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import Union, Optional +from typing_extensions import TypedDict, Annotated, Literal + +from typing import Union, Optional, List + 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"] @@ -27,9 +34,13 @@ class SubscriptionListParams(TypedDict, total=False): request. """ - customer_id: Optional[str] + 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")] - external_customer_id: Optional[str] + query_external_customer_id: Annotated[Optional[List[str]], PropertyInfo(alias="external_customer_id")] 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 1b18fc71..a407cd25 100755 --- a/src/orb/types/subscription_price_intervals_params.py +++ b/src/orb/types/subscription_price_intervals_params.py @@ -2,13 +2,21 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import TypedDict, Literal, Required, TypeAlias, Annotated + +from typing import Iterable, Union, Optional, Dict, List + from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict -from .._utils import PropertyInfo from .shared.billing_cycle_relative_date import BillingCycleRelativeDate +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__ = [ "SubscriptionPriceIntervalsParams", "Add", diff --git a/src/orb/types/subscription_schedule_plan_change_params.py b/src/orb/types/subscription_schedule_plan_change_params.py index fbdfc7ba..cbaa4056 100755 --- a/src/orb/types/subscription_schedule_plan_change_params.py +++ b/src/orb/types/subscription_schedule_plan_change_params.py @@ -2,12 +2,19 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import TypedDict, Literal, Required, Annotated, TypeAlias + +from typing import Optional, Union, Iterable, List, Dict + 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", diff --git a/src/orb/types/subscription_trigger_phase_params.py b/src/orb/types/subscription_trigger_phase_params.py index 504862ad..d45f953d 100755 --- a/src/orb/types/subscription_trigger_phase_params.py +++ b/src/orb/types/subscription_trigger_phase_params.py @@ -2,12 +2,19 @@ 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 ebe0f0a7..4dce933b 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,7 +2,12 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +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 __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 2fa701f1..b65a44e9 100755 --- a/src/orb/types/subscription_update_fixed_fee_quantity_params.py +++ b/src/orb/types/subscription_update_fixed_fee_quantity_params.py @@ -2,12 +2,19 @@ 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 59d0ab8d..81cfbc36 100755 --- a/src/orb/types/subscription_update_params.py +++ b/src/orb/types/subscription_update_params.py @@ -2,9 +2,15 @@ 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 4a5c4f2e..a3dcc1a5 100755 --- a/src/orb/types/subscription_usage.py +++ b/src/orb/types/subscription_usage.py @@ -1,12 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from .._models import BaseModel + 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 c80fef11..64b45dec 100755 --- a/src/orb/types/subscriptions.py +++ b/src/orb/types/subscriptions.py @@ -1,11 +1,17 @@ # 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 43ce3b3c..4c83db92 100755 --- a/src/orb/types/top_level_ping_response.py +++ b/src/orb/types/top_level_ping_response.py @@ -1,9 +1,11 @@ # 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 + __all__ = ["TopLevelPingResponse"] diff --git a/tests/api_resources/coupons/test_subscriptions.py b/tests/api_resources/coupons/test_subscriptions.py index 4c190521..4a1e19d3 100755 --- a/tests/api_resources/coupons/test_subscriptions.py +++ b/tests/api_resources/coupons/test_subscriptions.py @@ -2,15 +2,23 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Subscription + +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 orb.types import Subscription from tests.utils import assert_matches_type -from orb.pagination import SyncPage, AsyncPage +from orb.types.coupons import subscription_list_params 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 ff759955..5a55f0a0 100755 --- a/tests/api_resources/customers/credits/test_ledger.py +++ b/tests/api_resources/customers/credits/test_ledger.py @@ -2,22 +2,96 @@ from __future__ import annotations -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, - LedgerListByExternalIDResponse, LedgerCreateEntryByExternalIDResponse, + LedgerListByExternalIDResponse, ) +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 b830664e..08cf8863 100755 --- a/tests/api_resources/customers/credits/test_top_ups.py +++ b/tests/api_resources/customers/credits/test_top_ups.py @@ -2,21 +2,32 @@ from __future__ import annotations -import os -from typing import Any, cast - -import pytest - from orb import Orb, AsyncOrb -from tests.utils import assert_matches_type -from orb.pagination import SyncPage, AsyncPage + from orb.types.customers.credits import ( - TopUpListResponse, TopUpCreateResponse, - TopUpListByExternalIDResponse, + TopUpListResponse, TopUpCreateByExternalIDResponse, + TopUpListByExternalIDResponse, ) +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 + 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 77d23372..d7b28793 100755 --- a/tests/api_resources/customers/test_balance_transactions.py +++ b/tests/api_resources/customers/test_balance_transactions.py @@ -2,19 +2,32 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types.customers import BalanceTransactionCreateResponse, BalanceTransactionListResponse + from typing import Any, cast -import pytest +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._utils import parse_datetime from tests.utils import assert_matches_type -from orb.pagination import SyncPage, AsyncPage -from orb.types.customers import ( - BalanceTransactionListResponse, - BalanceTransactionCreateResponse, -) +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 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 17d95e60..7de2a84b 100755 --- a/tests/api_resources/customers/test_costs.py +++ b/tests/api_resources/customers/test_costs.py @@ -2,18 +2,30 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types.customers import CostListResponse, CostListByExternalIDResponse + 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._utils import parse_datetime from tests.utils import assert_matches_type -from orb.types.customers import ( - CostListResponse, - CostListByExternalIDResponse, -) +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 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 19de5732..a190a744 100755 --- a/tests/api_resources/customers/test_credits.py +++ b/tests/api_resources/customers/test_credits.py @@ -2,18 +2,24 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types.customers import CreditListResponse, CreditListByExternalIDResponse + +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.pagination import SyncPage, AsyncPage -from orb.types.customers import ( - CreditListResponse, - CreditListByExternalIDResponse, -) +from orb.types.customers import credit_list_params +from orb.types.customers import credit_list_by_external_id_params 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 bed65b8c..f586125a 100755 --- a/tests/api_resources/events/test_backfills.py +++ b/tests/api_resources/events/test_backfills.py @@ -2,23 +2,49 @@ from __future__ import annotations -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 a73b26ea..286da6fd 100755 --- a/tests/api_resources/plans/test_external_plan_id.py +++ b/tests/api_resources/plans/test_external_plan_id.py @@ -2,14 +2,21 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Plan + 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 cfee75ae..99623446 100755 --- a/tests/api_resources/prices/test_external_price_id.py +++ b/tests/api_resources/prices/test_external_price_id.py @@ -2,14 +2,21 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Price + 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 89ab0f66..384f17d9 100755 --- a/tests/api_resources/test_alerts.py +++ b/tests/api_resources/test_alerts.py @@ -2,18 +2,35 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Alert + from typing import Any, cast -import pytest +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 ( - Alert, -) -from orb._utils import parse_datetime from tests.utils import assert_matches_type -from orb.pagination import SyncPage, AsyncPage +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._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/test_coupons.py b/tests/api_resources/test_coupons.py index 8d59baa8..cae33f77 100755 --- a/tests/api_resources/test_coupons.py +++ b/tests/api_resources/test_coupons.py @@ -2,15 +2,24 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Coupon + from typing import Any, cast -import pytest +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.pagination import SyncPage, AsyncPage +from orb.types import coupon_create_params +from orb.types import coupon_list_params 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 b44d927f..5b4551e5 100755 --- a/tests/api_resources/test_credit_notes.py +++ b/tests/api_resources/test_credit_notes.py @@ -2,15 +2,23 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import CreditNote + +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 orb.types import CreditNote from tests.utils import assert_matches_type -from orb.pagination import SyncPage, AsyncPage +from orb.types import credit_note_list_params 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 392cefaa..6b79608a 100755 --- a/tests/api_resources/test_customers.py +++ b/tests/api_resources/test_customers.py @@ -2,18 +2,34 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Customer + from typing import Any, cast -import pytest +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 ( - Customer, -) -from orb._utils import parse_datetime from tests.utils import assert_matches_type -from orb.pagination import SyncPage, AsyncPage +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._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/test_events.py b/tests/api_resources/test_events.py index 7e77f4b4..e3e4a813 100755 --- a/tests/api_resources/test_events.py +++ b/tests/api_resources/test_events.py @@ -2,20 +2,61 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import EventUpdateResponse, EventDeprecateResponse, EventIngestResponse, EventSearchResponse + 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 ( - EventIngestResponse, - EventSearchResponse, - EventUpdateResponse, - EventDeprecateResponse, -) -from orb._utils import parse_datetime 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._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/test_invoice_line_items.py b/tests/api_resources/test_invoice_line_items.py index 55411e85..a8036405 100755 --- a/tests/api_resources/test_invoice_line_items.py +++ b/tests/api_resources/test_invoice_line_items.py @@ -2,15 +2,33 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import InvoiceLineItemCreateResponse + 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 InvoiceLineItemCreateResponse -from orb._utils import parse_date 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._utils import parse_date 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 16fd1453..204aa5ba 100755 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -2,19 +2,76 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Invoice, InvoiceFetchUpcomingResponse + from typing import Any, cast -import pytest +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.pagination import SyncPage, AsyncPage +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 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 fedf3cc2..ed4aaea8 100755 --- a/tests/api_resources/test_items.py +++ b/tests/api_resources/test_items.py @@ -2,15 +2,25 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Item + from typing import Any, cast -import pytest +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.pagination import SyncPage, AsyncPage +from orb.types import item_create_params +from orb.types import item_update_params +from orb.types import item_list_params 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 f111499e..61a067f0 100755 --- a/tests/api_resources/test_metrics.py +++ b/tests/api_resources/test_metrics.py @@ -2,16 +2,33 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import BillableMetric + from typing import Any, cast -import pytest +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 BillableMetric -from orb._utils import parse_datetime from tests.utils import assert_matches_type -from orb.pagination import SyncPage, AsyncPage +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._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/test_plans.py b/tests/api_resources/test_plans.py index d0dec0a4..83d904ed 100755 --- a/tests/api_resources/test_plans.py +++ b/tests/api_resources/test_plans.py @@ -2,16 +2,33 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Plan + from typing import Any, cast -import pytest +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 Plan -from orb._utils import parse_datetime from tests.utils import assert_matches_type -from orb.pagination import SyncPage, AsyncPage +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._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/test_prices.py b/tests/api_resources/test_prices.py index 9e0da726..9d4aca9c 100755 --- a/tests/api_resources/test_prices.py +++ b/tests/api_resources/test_prices.py @@ -2,19 +2,46 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Price, PriceEvaluateResponse + from typing import Any, cast -import pytest +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 ( - Price, - PriceEvaluateResponse, -) -from orb._utils import parse_datetime from tests.utils import assert_matches_type -from orb.pagination import SyncPage, AsyncPage +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._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/test_subscriptions.py b/tests/api_resources/test_subscriptions.py index c60435d6..5fff2e20 100755 --- a/tests/api_resources/test_subscriptions.py +++ b/tests/api_resources/test_subscriptions.py @@ -2,32 +2,165 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import Subscription, SubscriptionFetchCostsResponse, SubscriptionFetchScheduleResponse, SubscriptionUsage + from typing import Any, cast -import pytest +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.pagination import SyncPage, AsyncPage +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 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"]) + 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: @@ -46,87 +179,92 @@ 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", + price_overrides=[{ + "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", + }, { + "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, + }, + "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 @@ -135,7 +273,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: @@ -144,46 +282,49 @@ 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: @@ -193,30 +334,33 @@ 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", - customer_id="customer_id", - external_customer_id="external_customer_id", + 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"], 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 @@ -226,7 +370,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: @@ -235,86 +379,88 @@ 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: @@ -325,45 +471,46 @@ 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: @@ -376,38 +523,39 @@ 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 @@ -415,7 +563,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 @@ -433,31 +581,32 @@ 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 @@ -465,9 +614,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 @@ -475,320 +624,281 @@ 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"}, - "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"}, - }, - "price_id": "h74gfhdjvn7ujokd", + 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, }, - { - "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" }, - "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"), + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "conversion_rate": 0, "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, - "conversion_rate": 0, - "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": {"foo": "string"}, + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "metadata": { + "foo": "string" }, - "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, + "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, + }, + "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" }, - "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"), + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "conversion_rate": 0, "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, - "conversion_rate": 0, - "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": {"foo": "string"}, + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "metadata": { + "foo": "string" }, - "price_id": "h74gfhdjvn7ujokd", }, - ], - 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"), + "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, }, - { - "adjustment": { - "adjustment_type": "percentage_discount", - "applies_to_price_ids": ["price_1", "price_2"], - "percentage_discount": 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_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"), - "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, + "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"), }, - ], - 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_id": "h74gfhdjvn7ujokd", + }], + add_adjustments=[{ + "adjustment": { + "adjustment_type": "percentage_discount", + "applies_to_price_ids": ["price_1", "price_2"], + "percentage_discount": 0, }, - { - "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"), + "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, }, - { - "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"), + "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, }, - ], - 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"]) + "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']) @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 @@ -796,9 +906,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: @@ -806,7 +916,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: @@ -823,105 +933,108 @@ 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", + price_overrides=[{ + "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", + }, { + "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, + }, + "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: @@ -929,76 +1042,78 @@ 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: @@ -1006,79 +1121,81 @@ 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: @@ -1087,7 +1204,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: @@ -1098,10 +1215,11 @@ 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", @@ -1109,9 +1227,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: @@ -1119,32 +1237,31 @@ 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, - ) - - + 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 = 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: @@ -1163,87 +1280,92 @@ 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", + price_overrides=[{ + "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", + }, { + "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, + }, + "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 @@ -1252,7 +1374,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: @@ -1261,46 +1383,49 @@ 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: @@ -1310,30 +1435,33 @@ 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", - customer_id="customer_id", - external_customer_id="external_customer_id", + 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"], 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 @@ -1343,7 +1471,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: @@ -1352,86 +1480,88 @@ 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: @@ -1442,45 +1572,46 @@ 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: @@ -1493,38 +1624,39 @@ 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 @@ -1532,7 +1664,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 @@ -1550,31 +1682,32 @@ 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 @@ -1582,9 +1715,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 @@ -1592,320 +1725,281 @@ 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"}, - "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"}, - }, - "price_id": "h74gfhdjvn7ujokd", + 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, }, - { - "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" }, - "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"), + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "conversion_rate": 0, "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, - "conversion_rate": 0, - "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": {"foo": "string"}, + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "metadata": { + "foo": "string" }, - "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, + "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, + }, + "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" }, - "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"), + "billable_metric_id": "billable_metric_id", + "billed_in_advance": True, + "conversion_rate": 0, "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, - "conversion_rate": 0, - "external_price_id": "external_price_id", - "fixed_price_quantity": 0, - "invoice_grouping_key": "invoice_grouping_key", - "metadata": {"foo": "string"}, + "fixed_price_quantity": 0, + "invoice_grouping_key": "invoice_grouping_key", + "metadata": { + "foo": "string" }, - "price_id": "h74gfhdjvn7ujokd", }, - ], - 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"), + "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, }, - { - "adjustment": { - "adjustment_type": "percentage_discount", - "applies_to_price_ids": ["price_1", "price_2"], - "percentage_discount": 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_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"), - "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, + "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"), - }, - ], - 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"), - }, - ], - ) - assert_matches_type(Subscription, subscription, path=["response"]) + "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']) @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 @@ -1913,9 +2007,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: @@ -1923,7 +2017,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: @@ -1940,105 +2034,108 @@ 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", + price_overrides=[{ + "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", + }, { + "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, + }, + "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: @@ -2046,76 +2143,78 @@ 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: @@ -2123,79 +2222,81 @@ 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: @@ -2204,7 +2305,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: @@ -2215,10 +2316,11 @@ 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", @@ -2226,9 +2328,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: @@ -2236,20 +2338,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, - ) + 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 diff --git a/tests/api_resources/test_top_level.py b/tests/api_resources/test_top_level.py index 6971f1e7..a2c495b9 100755 --- a/tests/api_resources/test_top_level.py +++ b/tests/api_resources/test_top_level.py @@ -2,13 +2,19 @@ from __future__ import annotations -import os +from orb import Orb, AsyncOrb + +from orb.types import TopLevelPingResponse + 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 a718a9e3..32f6e574 100755 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,12 +1,14 @@ from __future__ import annotations -import os import asyncio import logging -from typing import TYPE_CHECKING, Iterator, AsyncIterator +from typing import Iterator 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 9d34c15d..33e3a9f1 100755 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -2,28 +2,41 @@ from __future__ import annotations -import gc -import os -import json +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 tracemalloc -from typing import Any, Union, cast +from typing import Dict, 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._types import Omit -from orb._models import BaseModel, FinalRequestOptions +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._constants import RAW_RESPONSE_HEADER -from orb._exceptions import OrbError, APIStatusError, APITimeoutError, APIResponseValidationError -from orb._base_client import DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, make_request_options - +from orb._response import APIResponse, AsyncAPIResponse 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 3ec62d81..777b96fb 100755 --- a/tests/test_legacy_response.py +++ b/tests/test_legacy_response.py @@ -6,7 +6,7 @@ import pytest import pydantic -from orb import Orb, BaseModel +from orb import BaseModel, Orb 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 52ea7467..96e79141 100755 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -6,7 +6,7 @@ import pytest import pydantic -from orb import Orb, AsyncOrb, BaseModel +from orb import BaseModel, Orb, AsyncOrb from orb._response import ( APIResponse, BaseAPIResponse, diff --git a/tests/utils.py b/tests/utils.py index 1fa786ba..4953ec8c 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 Omit, NoneType +from orb._types import NoneType, Omit from orb._utils import ( is_dict, is_list,