diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2307bc63..4d14a67e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.38.1" + ".": "1.39.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bd54ed9..6a9c8d4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 1.39.0 (2024-01-17) + +Full Changelog: [v1.38.1...v1.39.0](https://github.com/orbcorp/orb-python/compare/v1.38.1...v1.39.0) + +### Features + +* **api:** updates ([#139](https://github.com/orbcorp/orb-python/issues/139)) ([ab7998f](https://github.com/orbcorp/orb-python/commit/ab7998fa311038357c124fe556b9cd1a664d826b)) + + +### Chores + +* add write_to_file binary helper method ([#138](https://github.com/orbcorp/orb-python/issues/138)) ([f48014d](https://github.com/orbcorp/orb-python/commit/f48014d0792e01dde7206088ab672c6012d00deb)) +* **internal:** updates to proxy helper ([#136](https://github.com/orbcorp/orb-python/issues/136)) ([15d29d5](https://github.com/orbcorp/orb-python/commit/15d29d513cd6b58fee06b6165bc2ce16fba7e096)) + ## 1.38.1 (2024-01-16) Full Changelog: [v1.38.0...v1.38.1](https://github.com/orbcorp/orb-python/compare/v1.38.0...v1.38.1) diff --git a/pyproject.toml b/pyproject.toml index cdd1618c..1a237c16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "1.38.1" +version = "1.39.0" description = "The official Python library for the orb API" readme = "README.md" license = "Apache-2.0" diff --git a/src/orb/_legacy_response.py b/src/orb/_legacy_response.py index 81675977..bf9c8938 100644 --- a/src/orb/_legacy_response.py +++ b/src/orb/_legacy_response.py @@ -336,6 +336,22 @@ def iter_lines(self) -> Iterator[str]: def iter_raw(self, chunk_size: int | None = None) -> Iterator[bytes]: return self.response.iter_raw(chunk_size) + def write_to_file( + self, + file: str | os.PathLike[str], + ) -> None: + """Write the output to the given file. + + Accepts a filename or any path-like object, e.g. pathlib.Path + + Note: if you want to stream the data to the file instead of writing + all at once then you should use `.with_streaming_response` when making + the API request, e.g. `client.with_streaming_response.foo().stream_to_file('my_filename.txt')` + """ + with open(file, mode="wb") as f: + for data in self.response.iter_bytes(): + f.write(data) + @deprecated( "Due to a bug, this method doesn't actually stream the response content, `.with_streaming_response.method()` should be used instead" ) diff --git a/src/orb/_utils/_proxy.py b/src/orb/_utils/_proxy.py index 3c9e790a..6f05efcd 100644 --- a/src/orb/_utils/_proxy.py +++ b/src/orb/_utils/_proxy.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from typing import Generic, TypeVar, Iterable, cast -from typing_extensions import ClassVar, override +from typing_extensions import override T = TypeVar("T") @@ -13,11 +13,6 @@ class LazyProxy(Generic[T], ABC): This includes forwarding attribute access and othe methods. """ - should_cache: ClassVar[bool] = False - - def __init__(self) -> None: - self.__proxied: T | None = None - # Note: we have to special case proxies that themselves return proxies # to support using a proxy as a catch-all for any random access, e.g. `proxy.foo.bar.baz` @@ -57,18 +52,7 @@ def __class__(self) -> type: return proxied.__class__ def __get_proxied__(self) -> T: - if not self.should_cache: - return self.__load__() - - proxied = self.__proxied - if proxied is not None: - return proxied - - self.__proxied = proxied = self.__load__() - return proxied - - def __set_proxied__(self, value: T) -> None: - self.__proxied = value + return self.__load__() def __as_proxied__(self) -> T: """Helper method that returns the current proxy, typed as the loaded object""" diff --git a/src/orb/_version.py b/src/orb/_version.py index 7a6e6ee3..1fc6dedb 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. __title__ = "orb" -__version__ = "1.38.1" # x-release-please-version +__version__ = "1.39.0" # x-release-please-version diff --git a/src/orb/resources/customers/credits/ledger.py b/src/orb/resources/customers/credits/ledger.py index c4ec7541..e1d64934 100644 --- a/src/orb/resources/customers/credits/ledger.py +++ b/src/orb/resources/customers/credits/ledger.py @@ -211,8 +211,8 @@ def create_entry( entry_type: Literal["increment"], currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, @@ -347,11 +347,10 @@ def create_entry( For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. - effective_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should become available for use. + effective_date: An ISO 8601 format date that denotes when this credit balance should become + available for use. - expiry_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should expire. + expiry_date: An ISO 8601 format date that denotes when this credit balance should expire. invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify @@ -539,7 +538,7 @@ def create_entry( customer_id: Optional[str], *, entry_type: Literal["expiration_change"], - expiry_date: Union[str, date, None], + expiry_date: Union[str, datetime, None], target_expiry_date: Union[str, date], amount: Optional[float] | NotGiven = NOT_GIVEN, block_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -666,8 +665,7 @@ def create_entry( return to the customer, up to the block's initial balance. Args: - expiry_date: A future date (specified in YYYY-MM-DD format) that identifies the origination - credit block to expire + expiry_date: An ISO 8601 format date that identifies the origination credit block to expire target_expiry_date: A future date (specified in YYYY-MM-DD format) used for expiration change, denoting when credits transferred (as part of a partial block expiration) should @@ -1042,8 +1040,8 @@ def create_entry( | Literal["amendment"], currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, @@ -1104,8 +1102,8 @@ def create_entry_by_external_id( entry_type: Literal["increment"], currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, invoice_settings: Optional[ ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings ] @@ -1242,11 +1240,10 @@ def create_entry_by_external_id( For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. - effective_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should become available for use. + effective_date: An ISO 8601 format date that denotes when this credit balance should become + available for use. - expiry_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should expire. + expiry_date: An ISO 8601 format date that denotes when this credit balance should expire. invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify @@ -1434,7 +1431,7 @@ def create_entry_by_external_id( external_customer_id: Optional[str], *, entry_type: Literal["expiration_change"], - expiry_date: Union[str, date, None], + expiry_date: Union[str, datetime, None], target_expiry_date: Union[str, date], amount: Optional[float] | NotGiven = NOT_GIVEN, block_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1561,8 +1558,7 @@ def create_entry_by_external_id( return to the customer, up to the block's initial balance. Args: - expiry_date: A future date (specified in YYYY-MM-DD format) that identifies the origination - credit block to expire + expiry_date: An ISO 8601 format date that identifies the origination credit block to expire target_expiry_date: A future date (specified in YYYY-MM-DD format) used for expiration change, denoting when credits transferred (as part of a partial block expiration) should @@ -1937,8 +1933,8 @@ def create_entry_by_external_id( | Literal["amendment"], currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, invoice_settings: Optional[ ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings ] @@ -2337,8 +2333,8 @@ async def create_entry( entry_type: Literal["increment"], currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, @@ -2473,11 +2469,10 @@ async def create_entry( For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. - effective_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should become available for use. + effective_date: An ISO 8601 format date that denotes when this credit balance should become + available for use. - expiry_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should expire. + expiry_date: An ISO 8601 format date that denotes when this credit balance should expire. invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify @@ -2665,7 +2660,7 @@ async def create_entry( customer_id: Optional[str], *, entry_type: Literal["expiration_change"], - expiry_date: Union[str, date, None], + expiry_date: Union[str, datetime, None], target_expiry_date: Union[str, date], amount: Optional[float] | NotGiven = NOT_GIVEN, block_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -2792,8 +2787,7 @@ async def create_entry( return to the customer, up to the block's initial balance. Args: - expiry_date: A future date (specified in YYYY-MM-DD format) that identifies the origination - credit block to expire + expiry_date: An ISO 8601 format date that identifies the origination credit block to expire target_expiry_date: A future date (specified in YYYY-MM-DD format) used for expiration change, denoting when credits transferred (as part of a partial block expiration) should @@ -3168,8 +3162,8 @@ async def create_entry( | Literal["amendment"], currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, invoice_settings: Optional[ledger_create_entry_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN, @@ -3230,8 +3224,8 @@ async def create_entry_by_external_id( entry_type: Literal["increment"], currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, invoice_settings: Optional[ ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings ] @@ -3368,11 +3362,10 @@ async def create_entry_by_external_id( For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc. - effective_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should become available for use. + effective_date: An ISO 8601 format date that denotes when this credit balance should become + available for use. - expiry_date: A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should expire. + expiry_date: An ISO 8601 format date that denotes when this credit balance should expire. invoice_settings: Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify @@ -3560,7 +3553,7 @@ async def create_entry_by_external_id( external_customer_id: Optional[str], *, entry_type: Literal["expiration_change"], - expiry_date: Union[str, date, None], + expiry_date: Union[str, datetime, None], target_expiry_date: Union[str, date], amount: Optional[float] | NotGiven = NOT_GIVEN, block_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -3687,8 +3680,7 @@ async def create_entry_by_external_id( return to the customer, up to the block's initial balance. Args: - expiry_date: A future date (specified in YYYY-MM-DD format) that identifies the origination - credit block to expire + expiry_date: An ISO 8601 format date that identifies the origination credit block to expire target_expiry_date: A future date (specified in YYYY-MM-DD format) used for expiration change, denoting when credits transferred (as part of a partial block expiration) should @@ -4063,8 +4055,8 @@ async def create_entry_by_external_id( | Literal["amendment"], currency: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - effective_date: Union[str, date, None] | NotGiven = NOT_GIVEN, - expiry_date: Union[str, date, None] | NotGiven = NOT_GIVEN, + effective_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + expiry_date: Union[str, datetime, None] | NotGiven = NOT_GIVEN, invoice_settings: Optional[ ledger_create_entry_by_external_id_params.AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings ] 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 233e7628..d26b5e31 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_by_external_id_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Union, Optional -from datetime import date +from datetime import date, datetime from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -42,17 +42,14 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): for noting corrections as a result of an incident, etc. """ - effective_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + effective_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] """ - A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should become available for use. + An ISO 8601 format date that denotes when this credit balance should become + available for use. """ - expiry_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] - """ - A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should expire. - """ + expiry_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """An ISO 8601 format date that denotes when this credit balance should expire.""" invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] """ @@ -128,11 +125,8 @@ class AddDecrementCreditLedgerEntryRequestParams(TypedDict, total=False): class AddExpirationChangeCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["expiration_change"]] - expiry_date: Required[Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]] - """ - A future date (specified in YYYY-MM-DD format) that identifies the origination - credit block to expire - """ + expiry_date: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]] + """An ISO 8601 format date that identifies the origination credit block to expire""" target_expiry_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """ 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 2ad3f7e8..f08ea5db 100644 --- a/src/orb/types/customers/credits/ledger_create_entry_params.py +++ b/src/orb/types/customers/credits/ledger_create_entry_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Union, Optional -from datetime import date +from datetime import date, datetime from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -42,17 +42,14 @@ class AddIncrementCreditLedgerEntryRequestParams(TypedDict, total=False): for noting corrections as a result of an incident, etc. """ - effective_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] + effective_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] """ - A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should become available for use. + An ISO 8601 format date that denotes when this credit balance should become + available for use. """ - expiry_date: Annotated[Union[str, date, None], PropertyInfo(format="iso8601")] - """ - A future date (specified in YYYY-MM-DD format) that denotes when this credit - balance should expire. - """ + expiry_date: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """An ISO 8601 format date that denotes when this credit balance should expire.""" invoice_settings: Optional[AddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] """ @@ -128,11 +125,8 @@ class AddDecrementCreditLedgerEntryRequestParams(TypedDict, total=False): class AddExpirationChangeCreditLedgerEntryRequestParams(TypedDict, total=False): entry_type: Required[Literal["expiration_change"]] - expiry_date: Required[Annotated[Union[str, date, None], PropertyInfo(format="iso8601")]] - """ - A future date (specified in YYYY-MM-DD format) that identifies the origination - credit block to expire - """ + expiry_date: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]] + """An ISO 8601 format date that identifies the origination credit block to expire""" target_expiry_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] """ diff --git a/tests/api_resources/customers/credits/test_ledger.py b/tests/api_resources/customers/credits/test_ledger.py index 6fb3bfc3..9e189c34 100644 --- a/tests/api_resources/customers/credits/test_ledger.py +++ b/tests/api_resources/customers/credits/test_ledger.py @@ -100,8 +100,8 @@ def test_method_create_entry_with_all_params_overload_1(self, client: Orb) -> No entry_type="increment", currency="string", description="string", - effective_date=parse_date("2019-12-27"), - expiry_date=parse_date("2019-12-27"), + effective_date=parse_datetime("2019-12-27T18:11:19.117Z"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), invoice_settings={ "auto_collection": True, "net_terms": 0, @@ -212,7 +212,7 @@ def test_method_create_entry_overload_3(self, client: Orb) -> None: ledger = client.customers.credits.ledger.create_entry( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @@ -222,7 +222,7 @@ def test_method_create_entry_with_all_params_overload_3(self, client: Orb) -> No ledger = client.customers.credits.ledger.create_entry( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), amount=0, block_id="string", @@ -237,7 +237,7 @@ def test_raw_response_create_entry_overload_3(self, client: Orb) -> None: response = client.customers.credits.ledger.with_raw_response.create_entry( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) @@ -251,7 +251,7 @@ def test_streaming_response_create_entry_overload_3(self, client: Orb) -> None: with client.customers.credits.ledger.with_streaming_response.create_entry( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) as response: assert not response.is_closed @@ -268,7 +268,7 @@ def test_path_params_create_entry_overload_3(self, client: Orb) -> None: client.customers.credits.ledger.with_raw_response.create_entry( "", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) @@ -416,8 +416,8 @@ def test_method_create_entry_by_external_id_with_all_params_overload_1(self, cli entry_type="increment", currency="string", description="string", - effective_date=parse_date("2019-12-27"), - expiry_date=parse_date("2019-12-27"), + effective_date=parse_datetime("2019-12-27T18:11:19.117Z"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), invoice_settings={ "auto_collection": True, "net_terms": 0, @@ -528,7 +528,7 @@ def test_method_create_entry_by_external_id_overload_3(self, client: Orb) -> Non ledger = client.customers.credits.ledger.create_entry_by_external_id( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @@ -538,7 +538,7 @@ def test_method_create_entry_by_external_id_with_all_params_overload_3(self, cli ledger = client.customers.credits.ledger.create_entry_by_external_id( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), amount=0, block_id="string", @@ -553,7 +553,7 @@ def test_raw_response_create_entry_by_external_id_overload_3(self, client: Orb) response = client.customers.credits.ledger.with_raw_response.create_entry_by_external_id( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) @@ -567,7 +567,7 @@ def test_streaming_response_create_entry_by_external_id_overload_3(self, client: with client.customers.credits.ledger.with_streaming_response.create_entry_by_external_id( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) as response: assert not response.is_closed @@ -584,7 +584,7 @@ def test_path_params_create_entry_by_external_id_overload_3(self, client: Orb) - client.customers.credits.ledger.with_raw_response.create_entry_by_external_id( "", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) @@ -848,8 +848,8 @@ async def test_method_create_entry_with_all_params_overload_1(self, client: Asyn entry_type="increment", currency="string", description="string", - effective_date=parse_date("2019-12-27"), - expiry_date=parse_date("2019-12-27"), + effective_date=parse_datetime("2019-12-27T18:11:19.117Z"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), invoice_settings={ "auto_collection": True, "net_terms": 0, @@ -960,7 +960,7 @@ async def test_method_create_entry_overload_3(self, client: AsyncOrb) -> None: ledger = await client.customers.credits.ledger.create_entry( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) assert_matches_type(LedgerCreateEntryResponse, ledger, path=["response"]) @@ -970,7 +970,7 @@ async def test_method_create_entry_with_all_params_overload_3(self, client: Asyn ledger = await client.customers.credits.ledger.create_entry( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), amount=0, block_id="string", @@ -985,7 +985,7 @@ async def test_raw_response_create_entry_overload_3(self, client: AsyncOrb) -> N response = await client.customers.credits.ledger.with_raw_response.create_entry( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) @@ -999,7 +999,7 @@ async def test_streaming_response_create_entry_overload_3(self, client: AsyncOrb async with client.customers.credits.ledger.with_streaming_response.create_entry( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) as response: assert not response.is_closed @@ -1016,7 +1016,7 @@ async def test_path_params_create_entry_overload_3(self, client: AsyncOrb) -> No await client.customers.credits.ledger.with_raw_response.create_entry( "", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) @@ -1164,8 +1164,8 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_1(sel entry_type="increment", currency="string", description="string", - effective_date=parse_date("2019-12-27"), - expiry_date=parse_date("2019-12-27"), + effective_date=parse_datetime("2019-12-27T18:11:19.117Z"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), invoice_settings={ "auto_collection": True, "net_terms": 0, @@ -1276,7 +1276,7 @@ async def test_method_create_entry_by_external_id_overload_3(self, client: Async ledger = await client.customers.credits.ledger.create_entry_by_external_id( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) assert_matches_type(LedgerCreateEntryByExternalIDResponse, ledger, path=["response"]) @@ -1286,7 +1286,7 @@ async def test_method_create_entry_by_external_id_with_all_params_overload_3(sel ledger = await client.customers.credits.ledger.create_entry_by_external_id( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), amount=0, block_id="string", @@ -1301,7 +1301,7 @@ async def test_raw_response_create_entry_by_external_id_overload_3(self, client: response = await client.customers.credits.ledger.with_raw_response.create_entry_by_external_id( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) @@ -1315,7 +1315,7 @@ async def test_streaming_response_create_entry_by_external_id_overload_3(self, c async with client.customers.credits.ledger.with_streaming_response.create_entry_by_external_id( "string", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), ) as response: assert not response.is_closed @@ -1332,7 +1332,7 @@ async def test_path_params_create_entry_by_external_id_overload_3(self, client: await client.customers.credits.ledger.with_raw_response.create_entry_by_external_id( "", entry_type="expiration_change", - expiry_date=parse_date("2019-12-27"), + expiry_date=parse_datetime("2019-12-27T18:11:19.117Z"), target_expiry_date=parse_date("2019-12-27"), )