Skip to content

Commit a054810

Browse files
feat(api): api update (#590)
1 parent 3f9f6f2 commit a054810

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e3aeba4569f0d304b27804cc2cdd9888f3f58628fe426e206ab49e164e5417bd.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-aeb94d91af916dbff0132ee7c4501df9223609b19fef0398a1a495e7a432ee36.yml

src/orb/resources/credit_notes.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from __future__ import annotations
44

5-
from typing import Iterable, Optional
5+
from typing import Union, Iterable, Optional
6+
from datetime import datetime
67
from typing_extensions import Literal
78

89
import httpx
@@ -101,6 +102,10 @@ def create(
101102
def list(
102103
self,
103104
*,
105+
created_at_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
106+
created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
107+
created_at_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
108+
created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
104109
cursor: Optional[str] | NotGiven = NOT_GIVEN,
105110
limit: int | NotGiven = NOT_GIVEN,
106111
# 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(
140145
timeout=timeout,
141146
query=maybe_transform(
142147
{
148+
"created_at_gt": created_at_gt,
149+
"created_at_gte": created_at_gte,
150+
"created_at_lt": created_at_lt,
151+
"created_at_lte": created_at_lte,
143152
"cursor": cursor,
144153
"limit": limit,
145154
},
@@ -261,6 +270,10 @@ async def create(
261270
def list(
262271
self,
263272
*,
273+
created_at_gt: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
274+
created_at_gte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
275+
created_at_lt: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
276+
created_at_lte: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
264277
cursor: Optional[str] | NotGiven = NOT_GIVEN,
265278
limit: int | NotGiven = NOT_GIVEN,
266279
# 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(
300313
timeout=timeout,
301314
query=maybe_transform(
302315
{
316+
"created_at_gt": created_at_gt,
317+
"created_at_gte": created_at_gte,
318+
"created_at_lt": created_at_lt,
319+
"created_at_lte": created_at_lte,
303320
"cursor": cursor,
304321
"limit": limit,
305322
},

src/orb/types/credit_note_list_params.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
6-
from typing_extensions import TypedDict
5+
from typing import Union, Optional
6+
from datetime import datetime
7+
from typing_extensions import Annotated, TypedDict
8+
9+
from .._utils import PropertyInfo
710

811
__all__ = ["CreditNoteListParams"]
912

1013

1114
class CreditNoteListParams(TypedDict, total=False):
15+
created_at_gt: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[gt]", format="iso8601")]
16+
17+
created_at_gte: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[gte]", format="iso8601")]
18+
19+
created_at_lt: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[lt]", format="iso8601")]
20+
21+
created_at_lte: Annotated[Union[str, datetime, None], PropertyInfo(alias="created_at[lte]", format="iso8601")]
22+
1223
cursor: Optional[str]
1324
"""Cursor for pagination.
1425

tests/api_resources/test_credit_notes.py

+9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from orb import Orb, AsyncOrb
1111
from orb.types import CreditNote
12+
from orb._utils import parse_datetime
1213
from tests.utils import assert_matches_type
1314
from orb.pagination import SyncPage, AsyncPage
1415

@@ -86,6 +87,10 @@ def test_method_list(self, client: Orb) -> None:
8687
@parametrize
8788
def test_method_list_with_all_params(self, client: Orb) -> None:
8889
credit_note = client.credit_notes.list(
90+
created_at_gt=parse_datetime("2019-12-27T18:11:19.117Z"),
91+
created_at_gte=parse_datetime("2019-12-27T18:11:19.117Z"),
92+
created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"),
93+
created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"),
8994
cursor="cursor",
9095
limit=1,
9196
)
@@ -221,6 +226,10 @@ async def test_method_list(self, async_client: AsyncOrb) -> None:
221226
@parametrize
222227
async def test_method_list_with_all_params(self, async_client: AsyncOrb) -> None:
223228
credit_note = await async_client.credit_notes.list(
229+
created_at_gt=parse_datetime("2019-12-27T18:11:19.117Z"),
230+
created_at_gte=parse_datetime("2019-12-27T18:11:19.117Z"),
231+
created_at_lt=parse_datetime("2019-12-27T18:11:19.117Z"),
232+
created_at_lte=parse_datetime("2019-12-27T18:11:19.117Z"),
224233
cursor="cursor",
225234
limit=1,
226235
)

0 commit comments

Comments
 (0)