Skip to content

Commit e938254

Browse files
feat(api): api update (#990)
1 parent 4cdb976 commit e938254

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 201
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-d4eedf5add319b076d462be8b764246f0c3251ff60708906a90494e05ed8e93c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-a39e9d1d0001ea729c1ee2e06ac456278e4fc9064790da323630e54ab02bf056.yml

src/increase/resources/accounts.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from typing import Union
66
from datetime import datetime
7-
from typing_extensions import Literal
87

98
import httpx
109

@@ -206,7 +205,7 @@ def list(
206205
informational_entity_id: str | NotGiven = NOT_GIVEN,
207206
limit: int | NotGiven = NOT_GIVEN,
208207
program_id: str | NotGiven = NOT_GIVEN,
209-
status: Literal["closed", "open"] | NotGiven = NOT_GIVEN,
208+
status: account_list_params.Status | NotGiven = NOT_GIVEN,
210209
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
211210
# The extra values given here take precedence over values defined on the client or passed to this method.
212211
extra_headers: Headers | None = None,
@@ -234,11 +233,6 @@ def list(
234233
235234
program_id: Filter Accounts for those in a specific Program.
236235
237-
status: Filter Accounts for those with the specified status.
238-
239-
- `closed` - Closed Accounts on which no new activity can occur.
240-
- `open` - Open Accounts that are ready to use.
241-
242236
extra_headers: Send extra headers
243237
244238
extra_query: Add additional query parameters to the request
@@ -530,7 +524,7 @@ def list(
530524
informational_entity_id: str | NotGiven = NOT_GIVEN,
531525
limit: int | NotGiven = NOT_GIVEN,
532526
program_id: str | NotGiven = NOT_GIVEN,
533-
status: Literal["closed", "open"] | NotGiven = NOT_GIVEN,
527+
status: account_list_params.Status | NotGiven = NOT_GIVEN,
534528
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
535529
# The extra values given here take precedence over values defined on the client or passed to this method.
536530
extra_headers: Headers | None = None,
@@ -558,11 +552,6 @@ def list(
558552
559553
program_id: Filter Accounts for those in a specific Program.
560554
561-
status: Filter Accounts for those with the specified status.
562-
563-
- `closed` - Closed Accounts on which no new activity can occur.
564-
- `open` - Open Accounts that are ready to use.
565-
566555
extra_headers: Send extra headers
567556
568557
extra_query: Add additional query parameters to the request

src/increase/types/account_list_params.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
from __future__ import annotations
44

5-
from typing import Union
5+
from typing import List, Union
66
from datetime import datetime
77
from typing_extensions import Literal, Annotated, TypedDict
88

99
from .._utils import PropertyInfo
1010

11-
__all__ = ["AccountListParams", "CreatedAt"]
11+
__all__ = ["AccountListParams", "CreatedAt", "Status"]
1212

1313

1414
class AccountListParams(TypedDict, total=False):
@@ -40,12 +40,7 @@ class AccountListParams(TypedDict, total=False):
4040
program_id: str
4141
"""Filter Accounts for those in a specific Program."""
4242

43-
status: Literal["closed", "open"]
44-
"""Filter Accounts for those with the specified status.
45-
46-
- `closed` - Closed Accounts on which no new activity can occur.
47-
- `open` - Open Accounts that are ready to use.
48-
"""
43+
status: Status
4944

5045

5146
class CreatedAt(TypedDict, total=False):
@@ -72,3 +67,16 @@ class CreatedAt(TypedDict, total=False):
7267
Return results on or before this
7368
[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
7469
"""
70+
71+
72+
_StatusReservedKeywords = TypedDict(
73+
"_StatusReservedKeywords",
74+
{
75+
"in": List[Literal["closed", "open"]],
76+
},
77+
total=False,
78+
)
79+
80+
81+
class Status(_StatusReservedKeywords, total=False):
82+
pass

tests/api_resources/test_accounts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def test_method_list_with_all_params(self, client: Increase) -> None:
167167
informational_entity_id="informational_entity_id",
168168
limit=1,
169169
program_id="program_id",
170-
status="closed",
170+
status={"in": ["closed"]},
171171
)
172172
assert_matches_type(SyncPage[Account], account, path=["response"])
173173

@@ -424,7 +424,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncIncrease) ->
424424
informational_entity_id="informational_entity_id",
425425
limit=1,
426426
program_id="program_id",
427-
status="closed",
427+
status={"in": ["closed"]},
428428
)
429429
assert_matches_type(AsyncPage[Account], account, path=["response"])
430430

0 commit comments

Comments
 (0)