diff --git a/.stats.yml b/.stats.yml index c9a15c8a..85c391c8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e3aeba4569f0d304b27804cc2cdd9888f3f58628fe426e206ab49e164e5417bd.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-aeb94d91af916dbff0132ee7c4501df9223609b19fef0398a1a495e7a432ee36.yml diff --git a/src/orb/resources/credit_notes.py b/src/orb/resources/credit_notes.py index cba989c3..efac90c7 100644 --- a/src/orb/resources/credit_notes.py +++ b/src/orb/resources/credit_notes.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import Iterable, Optional +from typing import Union, Iterable, Optional +from datetime import datetime from typing_extensions import Literal import httpx @@ -101,6 +102,10 @@ def create( 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, limit: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -140,6 +145,10 @@ def list( 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, "limit": limit, }, @@ -261,6 +270,10 @@ async def create( 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, limit: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -300,6 +313,10 @@ def list( 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, "limit": limit, }, diff --git a/src/orb/types/credit_note_list_params.py b/src/orb/types/credit_note_list_params.py index fa1314af..eeeccfc8 100644 --- a/src/orb/types/credit_note_list_params.py +++ b/src/orb/types/credit_note_list_params.py @@ -2,13 +2,24 @@ from __future__ import annotations -from typing import Optional -from typing_extensions import TypedDict +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["CreditNoteListParams"] class CreditNoteListParams(TypedDict, total=False): + created_at_gt: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[gt]", format="iso8601")] + + created_at_gte: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[gte]", format="iso8601")] + + created_at_lt: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[lt]", format="iso8601")] + + created_at_lte: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[lte]", format="iso8601")] + cursor: Optional[str] """Cursor for pagination. diff --git a/tests/api_resources/test_credit_notes.py b/tests/api_resources/test_credit_notes.py index 08d07146..5d423210 100644 --- a/tests/api_resources/test_credit_notes.py +++ b/tests/api_resources/test_credit_notes.py @@ -9,6 +9,7 @@ from orb import Orb, AsyncOrb from orb.types import CreditNote +from orb._utils import parse_datetime from tests.utils import assert_matches_type from orb.pagination import SyncPage, AsyncPage @@ -86,6 +87,10 @@ def test_method_list(self, client: Orb) -> None: @parametrize def test_method_list_with_all_params(self, client: Orb) -> None: credit_note = client.credit_notes.list( + created_at_gt=parse_datetime("2019-12-27T18:11:19.117Z"), + created_at_gte=parse_datetime("2019-12-27T18:11:19.117Z"), + created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"), + created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"), cursor="cursor", limit=1, ) @@ -221,6 +226,10 @@ async def test_method_list(self, async_client: AsyncOrb) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None: credit_note = await async_client.credit_notes.list( + created_at_gt=parse_datetime("2019-12-27T18:11:19.117Z"), + created_at_gte=parse_datetime("2019-12-27T18:11:19.117Z"), + created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"), + created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"), cursor="cursor", limit=1, )