Skip to content

Commit 24ba362

Browse files
feat(api): api update
1 parent e1282bb commit 24ba362

File tree

9 files changed

+245
-10
lines changed

9 files changed

+245
-10
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 228
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b6b193549e9c795e807b299e7161628dc1e504d43d6be27113b1f3a1e491914f.yml
3-
openapi_spec_hash: 9d0ff6cc1ec60a6772598cff20f8db1d
4-
config_hash: eb2035151c7b49c2f12caf55469b8f9a
1+
configured_endpoints: 229
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-a0eb4b9ef698e80be2fc9e995d6096b96de35e4985c8586e0773fa55a6b50943.yml
3+
openapi_spec_hash: a36c0bee01bf3af40ebcd7075308f170
4+
config_hash: ca1425272e17fa23d4466d33492334fa

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ Methods:
441441

442442
- <code title="get /inbound_mail_items/{inbound_mail_item_id}">client.inbound_mail_items.<a href="./src/increase/resources/inbound_mail_items.py">retrieve</a>(inbound_mail_item_id) -> <a href="./src/increase/types/inbound_mail_item.py">InboundMailItem</a></code>
443443
- <code title="get /inbound_mail_items">client.inbound_mail_items.<a href="./src/increase/resources/inbound_mail_items.py">list</a>(\*\*<a href="src/increase/types/inbound_mail_item_list_params.py">params</a>) -> <a href="./src/increase/types/inbound_mail_item.py">SyncPage[InboundMailItem]</a></code>
444+
- <code title="post /inbound_mail_items/{inbound_mail_item_id}/action">client.inbound_mail_items.<a href="./src/increase/resources/inbound_mail_items.py">action</a>(inbound_mail_item_id, \*\*<a href="src/increase/types/inbound_mail_item_action_params.py">params</a>) -> <a href="./src/increase/types/inbound_mail_item.py">InboundMailItem</a></code>
444445

445446
# RoutingNumbers
446447

src/increase/resources/inbound_mail_items.py

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

33
from __future__ import annotations
44

5+
from typing import Iterable
6+
57
import httpx
68

7-
from ..types import inbound_mail_item_list_params
9+
from ..types import inbound_mail_item_list_params, inbound_mail_item_action_params
810
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9-
from .._utils import maybe_transform
11+
from .._utils import maybe_transform, async_maybe_transform
1012
from .._compat import cached_property
1113
from .._resource import SyncAPIResource, AsyncAPIResource
1214
from .._response import (
@@ -133,6 +135,54 @@ def list(
133135
model=InboundMailItem,
134136
)
135137

138+
def action(
139+
self,
140+
inbound_mail_item_id: str,
141+
*,
142+
checks: Iterable[inbound_mail_item_action_params.Check],
143+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
144+
# The extra values given here take precedence over values defined on the client or passed to this method.
145+
extra_headers: Headers | None = None,
146+
extra_query: Query | None = None,
147+
extra_body: Body | None = None,
148+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
149+
idempotency_key: str | None = None,
150+
) -> InboundMailItem:
151+
"""
152+
Action a Inbound Mail Item
153+
154+
Args:
155+
inbound_mail_item_id: The identifier of the Inbound Mail Item to action.
156+
157+
checks: The actions to perform on the Inbound Mail Item.
158+
159+
extra_headers: Send extra headers
160+
161+
extra_query: Add additional query parameters to the request
162+
163+
extra_body: Add additional JSON properties to the request
164+
165+
timeout: Override the client-level default timeout for this request, in seconds
166+
167+
idempotency_key: Specify a custom idempotency key for this request
168+
"""
169+
if not inbound_mail_item_id:
170+
raise ValueError(
171+
f"Expected a non-empty value for `inbound_mail_item_id` but received {inbound_mail_item_id!r}"
172+
)
173+
return self._post(
174+
f"/inbound_mail_items/{inbound_mail_item_id}/action",
175+
body=maybe_transform({"checks": checks}, inbound_mail_item_action_params.InboundMailItemActionParams),
176+
options=make_request_options(
177+
extra_headers=extra_headers,
178+
extra_query=extra_query,
179+
extra_body=extra_body,
180+
timeout=timeout,
181+
idempotency_key=idempotency_key,
182+
),
183+
cast_to=InboundMailItem,
184+
)
185+
136186

137187
class AsyncInboundMailItemsResource(AsyncAPIResource):
138188
@cached_property
@@ -245,6 +295,56 @@ def list(
245295
model=InboundMailItem,
246296
)
247297

298+
async def action(
299+
self,
300+
inbound_mail_item_id: str,
301+
*,
302+
checks: Iterable[inbound_mail_item_action_params.Check],
303+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
304+
# The extra values given here take precedence over values defined on the client or passed to this method.
305+
extra_headers: Headers | None = None,
306+
extra_query: Query | None = None,
307+
extra_body: Body | None = None,
308+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
309+
idempotency_key: str | None = None,
310+
) -> InboundMailItem:
311+
"""
312+
Action a Inbound Mail Item
313+
314+
Args:
315+
inbound_mail_item_id: The identifier of the Inbound Mail Item to action.
316+
317+
checks: The actions to perform on the Inbound Mail Item.
318+
319+
extra_headers: Send extra headers
320+
321+
extra_query: Add additional query parameters to the request
322+
323+
extra_body: Add additional JSON properties to the request
324+
325+
timeout: Override the client-level default timeout for this request, in seconds
326+
327+
idempotency_key: Specify a custom idempotency key for this request
328+
"""
329+
if not inbound_mail_item_id:
330+
raise ValueError(
331+
f"Expected a non-empty value for `inbound_mail_item_id` but received {inbound_mail_item_id!r}"
332+
)
333+
return await self._post(
334+
f"/inbound_mail_items/{inbound_mail_item_id}/action",
335+
body=await async_maybe_transform(
336+
{"checks": checks}, inbound_mail_item_action_params.InboundMailItemActionParams
337+
),
338+
options=make_request_options(
339+
extra_headers=extra_headers,
340+
extra_query=extra_query,
341+
extra_body=extra_body,
342+
timeout=timeout,
343+
idempotency_key=idempotency_key,
344+
),
345+
cast_to=InboundMailItem,
346+
)
347+
248348

249349
class InboundMailItemsResourceWithRawResponse:
250350
def __init__(self, inbound_mail_items: InboundMailItemsResource) -> None:
@@ -256,6 +356,9 @@ def __init__(self, inbound_mail_items: InboundMailItemsResource) -> None:
256356
self.list = to_raw_response_wrapper(
257357
inbound_mail_items.list,
258358
)
359+
self.action = to_raw_response_wrapper(
360+
inbound_mail_items.action,
361+
)
259362

260363

261364
class AsyncInboundMailItemsResourceWithRawResponse:
@@ -268,6 +371,9 @@ def __init__(self, inbound_mail_items: AsyncInboundMailItemsResource) -> None:
268371
self.list = async_to_raw_response_wrapper(
269372
inbound_mail_items.list,
270373
)
374+
self.action = async_to_raw_response_wrapper(
375+
inbound_mail_items.action,
376+
)
271377

272378

273379
class InboundMailItemsResourceWithStreamingResponse:
@@ -280,6 +386,9 @@ def __init__(self, inbound_mail_items: InboundMailItemsResource) -> None:
280386
self.list = to_streamed_response_wrapper(
281387
inbound_mail_items.list,
282388
)
389+
self.action = to_streamed_response_wrapper(
390+
inbound_mail_items.action,
391+
)
283392

284393

285394
class AsyncInboundMailItemsResourceWithStreamingResponse:
@@ -292,3 +401,6 @@ def __init__(self, inbound_mail_items: AsyncInboundMailItemsResource) -> None:
292401
self.list = async_to_streamed_response_wrapper(
293402
inbound_mail_items.list,
294403
)
404+
self.action = async_to_streamed_response_wrapper(
405+
inbound_mail_items.action,
406+
)

src/increase/resources/lockboxes.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def update(
137137
self,
138138
lockbox_id: str,
139139
*,
140-
check_deposit_behavior: Literal["enabled", "disabled"] | Omit = omit,
140+
check_deposit_behavior: Literal["enabled", "disabled", "pend_for_processing"] | Omit = omit,
141141
description: str | Omit = omit,
142142
recipient_name: str | Omit = omit,
143143
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -158,6 +158,8 @@ def update(
158158
159159
- `enabled` - Checks mailed to this Lockbox will be deposited.
160160
- `disabled` - Checks mailed to this Lockbox will not be deposited.
161+
- `pend_for_processing` - Checks mailed to this Lockbox will be pending until
162+
actioned.
161163
162164
description: The description you choose for the Lockbox.
163165
@@ -370,7 +372,7 @@ async def update(
370372
self,
371373
lockbox_id: str,
372374
*,
373-
check_deposit_behavior: Literal["enabled", "disabled"] | Omit = omit,
375+
check_deposit_behavior: Literal["enabled", "disabled", "pend_for_processing"] | Omit = omit,
374376
description: str | Omit = omit,
375377
recipient_name: str | Omit = omit,
376378
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -391,6 +393,8 @@ async def update(
391393
392394
- `enabled` - Checks mailed to this Lockbox will be deposited.
393395
- `disabled` - Checks mailed to this Lockbox will not be deposited.
396+
- `pend_for_processing` - Checks mailed to this Lockbox will be pending until
397+
actioned.
394398
395399
description: The description you choose for the Lockbox.
396400

src/increase/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
from .external_account_update_params import ExternalAccountUpdateParams as ExternalAccountUpdateParams
128128
from .ach_prenotification_list_params import ACHPrenotificationListParams as ACHPrenotificationListParams
129129
from .bookkeeping_account_list_params import BookkeepingAccountListParams as BookkeepingAccountListParams
130+
from .inbound_mail_item_action_params import InboundMailItemActionParams as InboundMailItemActionParams
130131
from .intrafi_exclusion_create_params import IntrafiExclusionCreateParams as IntrafiExclusionCreateParams
131132
from .pending_transaction_list_params import PendingTransactionListParams as PendingTransactionListParams
132133
from .card_push_transfer_create_params import CardPushTransferCreateParams as CardPushTransferCreateParams
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Iterable
6+
from typing_extensions import Literal, Required, TypedDict
7+
8+
__all__ = ["InboundMailItemActionParams", "Check"]
9+
10+
11+
class InboundMailItemActionParams(TypedDict, total=False):
12+
checks: Required[Iterable[Check]]
13+
"""The actions to perform on the Inbound Mail Item."""
14+
15+
16+
class Check(TypedDict, total=False):
17+
action: Required[Literal["deposit", "ignore"]]
18+
"""The action to perform on the Inbound Mail Item.
19+
20+
- `deposit` - The check will be deposited.
21+
- `ignore` - The check will be ignored.
22+
"""
23+
24+
account: str
25+
"""The identifier of the Account to deposit the check into.
26+
27+
If not provided, the check will be deposited into the Account associated with
28+
the Lockbox.
29+
"""

src/increase/types/lockbox.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ class Lockbox(BaseModel):
5050
address: Address
5151
"""The mailing address for the Lockbox."""
5252

53-
check_deposit_behavior: Literal["enabled", "disabled"]
53+
check_deposit_behavior: Literal["enabled", "disabled", "pend_for_processing"]
5454
"""Indicates if checks mailed to this lockbox will be deposited.
5555
5656
- `enabled` - Checks mailed to this Lockbox will be deposited.
5757
- `disabled` - Checks mailed to this Lockbox will not be deposited.
58+
- `pend_for_processing` - Checks mailed to this Lockbox will be pending until
59+
actioned.
5860
"""
5961

6062
created_at: datetime

src/increase/types/lockbox_update_params.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88

99

1010
class LockboxUpdateParams(TypedDict, total=False):
11-
check_deposit_behavior: Literal["enabled", "disabled"]
11+
check_deposit_behavior: Literal["enabled", "disabled", "pend_for_processing"]
1212
"""This indicates if checks mailed to this lockbox will be deposited.
1313
1414
- `enabled` - Checks mailed to this Lockbox will be deposited.
1515
- `disabled` - Checks mailed to this Lockbox will not be deposited.
16+
- `pend_for_processing` - Checks mailed to this Lockbox will be pending until
17+
actioned.
1618
"""
1719

1820
description: str

tests/api_resources/test_inbound_mail_items.py

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,48 @@ def test_streaming_response_list(self, client: Increase) -> None:
9797

9898
assert cast(Any, response.is_closed) is True
9999

100+
@parametrize
101+
def test_method_action(self, client: Increase) -> None:
102+
inbound_mail_item = client.inbound_mail_items.action(
103+
inbound_mail_item_id="inbound_mail_item_q6rrg7mmqpplx80zceev",
104+
checks=[{"action": "deposit"}, {"action": "ignore"}],
105+
)
106+
assert_matches_type(InboundMailItem, inbound_mail_item, path=["response"])
107+
108+
@parametrize
109+
def test_raw_response_action(self, client: Increase) -> None:
110+
response = client.inbound_mail_items.with_raw_response.action(
111+
inbound_mail_item_id="inbound_mail_item_q6rrg7mmqpplx80zceev",
112+
checks=[{"action": "deposit"}, {"action": "ignore"}],
113+
)
114+
115+
assert response.is_closed is True
116+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
117+
inbound_mail_item = response.parse()
118+
assert_matches_type(InboundMailItem, inbound_mail_item, path=["response"])
119+
120+
@parametrize
121+
def test_streaming_response_action(self, client: Increase) -> None:
122+
with client.inbound_mail_items.with_streaming_response.action(
123+
inbound_mail_item_id="inbound_mail_item_q6rrg7mmqpplx80zceev",
124+
checks=[{"action": "deposit"}, {"action": "ignore"}],
125+
) as response:
126+
assert not response.is_closed
127+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
128+
129+
inbound_mail_item = response.parse()
130+
assert_matches_type(InboundMailItem, inbound_mail_item, path=["response"])
131+
132+
assert cast(Any, response.is_closed) is True
133+
134+
@parametrize
135+
def test_path_params_action(self, client: Increase) -> None:
136+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `inbound_mail_item_id` but received ''"):
137+
client.inbound_mail_items.with_raw_response.action(
138+
inbound_mail_item_id="",
139+
checks=[{"action": "deposit"}, {"action": "ignore"}],
140+
)
141+
100142

101143
class TestAsyncInboundMailItems:
102144
parametrize = pytest.mark.parametrize(
@@ -180,3 +222,45 @@ async def test_streaming_response_list(self, async_client: AsyncIncrease) -> Non
180222
assert_matches_type(AsyncPage[InboundMailItem], inbound_mail_item, path=["response"])
181223

182224
assert cast(Any, response.is_closed) is True
225+
226+
@parametrize
227+
async def test_method_action(self, async_client: AsyncIncrease) -> None:
228+
inbound_mail_item = await async_client.inbound_mail_items.action(
229+
inbound_mail_item_id="inbound_mail_item_q6rrg7mmqpplx80zceev",
230+
checks=[{"action": "deposit"}, {"action": "ignore"}],
231+
)
232+
assert_matches_type(InboundMailItem, inbound_mail_item, path=["response"])
233+
234+
@parametrize
235+
async def test_raw_response_action(self, async_client: AsyncIncrease) -> None:
236+
response = await async_client.inbound_mail_items.with_raw_response.action(
237+
inbound_mail_item_id="inbound_mail_item_q6rrg7mmqpplx80zceev",
238+
checks=[{"action": "deposit"}, {"action": "ignore"}],
239+
)
240+
241+
assert response.is_closed is True
242+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
243+
inbound_mail_item = await response.parse()
244+
assert_matches_type(InboundMailItem, inbound_mail_item, path=["response"])
245+
246+
@parametrize
247+
async def test_streaming_response_action(self, async_client: AsyncIncrease) -> None:
248+
async with async_client.inbound_mail_items.with_streaming_response.action(
249+
inbound_mail_item_id="inbound_mail_item_q6rrg7mmqpplx80zceev",
250+
checks=[{"action": "deposit"}, {"action": "ignore"}],
251+
) as response:
252+
assert not response.is_closed
253+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
254+
255+
inbound_mail_item = await response.parse()
256+
assert_matches_type(InboundMailItem, inbound_mail_item, path=["response"])
257+
258+
assert cast(Any, response.is_closed) is True
259+
260+
@parametrize
261+
async def test_path_params_action(self, async_client: AsyncIncrease) -> None:
262+
with pytest.raises(ValueError, match=r"Expected a non-empty value for `inbound_mail_item_id` but received ''"):
263+
await async_client.inbound_mail_items.with_raw_response.action(
264+
inbound_mail_item_id="",
265+
checks=[{"action": "deposit"}, {"action": "ignore"}],
266+
)

0 commit comments

Comments
 (0)