Skip to content

Commit ccf980b

Browse files
feat(api): api update
1 parent 048e16f commit ccf980b

File tree

6 files changed

+293
-5
lines changed

6 files changed

+293
-5
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: 233
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-1ed184e346fa8c739f7de410b940df9f160681dd818eed4ec1e48b40451007d0.yml
3-
openapi_spec_hash: 0bc3978204acc7949c98e1d098bf5e1c
4-
config_hash: ca482105d83c23b2986f1c9c441c4343
1+
configured_endpoints: 234
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-e4cf84ebe7ee8dbfbaa709d310fb62f12631f4b69f7aa73be2a88f149c726dc3.yml
3+
openapi_spec_hash: 123949338534df87debdfbd846fc40b1
4+
config_hash: 890ca5fa6b8209d4eaac90550c7dc62c

api.md

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

972972
- <code title="post /simulations/inbound_check_deposits">client.simulations.inbound_check_deposits.<a href="./src/increase/resources/simulations/inbound_check_deposits.py">create</a>(\*\*<a href="src/increase/types/simulations/inbound_check_deposit_create_params.py">params</a>) -> <a href="./src/increase/types/inbound_check_deposit.py">InboundCheckDeposit</a></code>
973+
- <code title="post /simulations/inbound_check_deposits/{inbound_check_deposit_id}/adjustment">client.simulations.inbound_check_deposits.<a href="./src/increase/resources/simulations/inbound_check_deposits.py">adjustment</a>(inbound_check_deposit_id, \*\*<a href="src/increase/types/simulations/inbound_check_deposit_adjustment_params.py">params</a>) -> <a href="./src/increase/types/inbound_check_deposit.py">InboundCheckDeposit</a></code>
973974

974975
## RealTimePaymentsTransfers
975976

src/increase/resources/simulations/inbound_check_deposits.py

Lines changed: 157 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
async_to_streamed_response_wrapper,
1818
)
1919
from ..._base_client import make_request_options
20-
from ...types.simulations import inbound_check_deposit_create_params
20+
from ...types.simulations import inbound_check_deposit_create_params, inbound_check_deposit_adjustment_params
2121
from ...types.inbound_check_deposit import InboundCheckDeposit
2222

2323
__all__ = ["InboundCheckDepositsResource", "AsyncInboundCheckDepositsResource"]
@@ -115,6 +115,78 @@ def create(
115115
cast_to=InboundCheckDeposit,
116116
)
117117

118+
def adjustment(
119+
self,
120+
inbound_check_deposit_id: str,
121+
*,
122+
amount: int | Omit = omit,
123+
reason: Literal["late_return", "wrong_payee_credit", "adjusted_amount", "non_conforming_item", "paid"]
124+
| Omit = omit,
125+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
126+
# The extra values given here take precedence over values defined on the client or passed to this method.
127+
extra_headers: Headers | None = None,
128+
extra_query: Query | None = None,
129+
extra_body: Body | None = None,
130+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
131+
idempotency_key: str | None = None,
132+
) -> InboundCheckDeposit:
133+
"""Simulates an adjustment on an Inbound Check Deposit.
134+
135+
The Inbound Check Deposit
136+
must have a `status` of `accepted`.
137+
138+
Args:
139+
inbound_check_deposit_id: The identifier of the Inbound Check Deposit to adjust.
140+
141+
amount: The adjustment amount in cents. Defaults to the amount of the Inbound Check
142+
Deposit.
143+
144+
reason: The reason for the adjustment. Defaults to `wrong_payee_credit`.
145+
146+
- `late_return` - The return was initiated too late and the receiving
147+
institution has responded with a Late Return Claim.
148+
- `wrong_payee_credit` - The check was deposited to the wrong payee and the
149+
depositing institution has reimbursed the funds with a Wrong Payee Credit.
150+
- `adjusted_amount` - The check was deposited with a different amount than what
151+
was written on the check.
152+
- `non_conforming_item` - The recipient was not able to process the check. This
153+
usually happens for e.g., low quality images.
154+
- `paid` - The check has already been deposited elsewhere and so this is a
155+
duplicate.
156+
157+
extra_headers: Send extra headers
158+
159+
extra_query: Add additional query parameters to the request
160+
161+
extra_body: Add additional JSON properties to the request
162+
163+
timeout: Override the client-level default timeout for this request, in seconds
164+
165+
idempotency_key: Specify a custom idempotency key for this request
166+
"""
167+
if not inbound_check_deposit_id:
168+
raise ValueError(
169+
f"Expected a non-empty value for `inbound_check_deposit_id` but received {inbound_check_deposit_id!r}"
170+
)
171+
return self._post(
172+
f"/simulations/inbound_check_deposits/{inbound_check_deposit_id}/adjustment",
173+
body=maybe_transform(
174+
{
175+
"amount": amount,
176+
"reason": reason,
177+
},
178+
inbound_check_deposit_adjustment_params.InboundCheckDepositAdjustmentParams,
179+
),
180+
options=make_request_options(
181+
extra_headers=extra_headers,
182+
extra_query=extra_query,
183+
extra_body=extra_body,
184+
timeout=timeout,
185+
idempotency_key=idempotency_key,
186+
),
187+
cast_to=InboundCheckDeposit,
188+
)
189+
118190

119191
class AsyncInboundCheckDepositsResource(AsyncAPIResource):
120192
@cached_property
@@ -208,6 +280,78 @@ async def create(
208280
cast_to=InboundCheckDeposit,
209281
)
210282

283+
async def adjustment(
284+
self,
285+
inbound_check_deposit_id: str,
286+
*,
287+
amount: int | Omit = omit,
288+
reason: Literal["late_return", "wrong_payee_credit", "adjusted_amount", "non_conforming_item", "paid"]
289+
| Omit = omit,
290+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
291+
# The extra values given here take precedence over values defined on the client or passed to this method.
292+
extra_headers: Headers | None = None,
293+
extra_query: Query | None = None,
294+
extra_body: Body | None = None,
295+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
296+
idempotency_key: str | None = None,
297+
) -> InboundCheckDeposit:
298+
"""Simulates an adjustment on an Inbound Check Deposit.
299+
300+
The Inbound Check Deposit
301+
must have a `status` of `accepted`.
302+
303+
Args:
304+
inbound_check_deposit_id: The identifier of the Inbound Check Deposit to adjust.
305+
306+
amount: The adjustment amount in cents. Defaults to the amount of the Inbound Check
307+
Deposit.
308+
309+
reason: The reason for the adjustment. Defaults to `wrong_payee_credit`.
310+
311+
- `late_return` - The return was initiated too late and the receiving
312+
institution has responded with a Late Return Claim.
313+
- `wrong_payee_credit` - The check was deposited to the wrong payee and the
314+
depositing institution has reimbursed the funds with a Wrong Payee Credit.
315+
- `adjusted_amount` - The check was deposited with a different amount than what
316+
was written on the check.
317+
- `non_conforming_item` - The recipient was not able to process the check. This
318+
usually happens for e.g., low quality images.
319+
- `paid` - The check has already been deposited elsewhere and so this is a
320+
duplicate.
321+
322+
extra_headers: Send extra headers
323+
324+
extra_query: Add additional query parameters to the request
325+
326+
extra_body: Add additional JSON properties to the request
327+
328+
timeout: Override the client-level default timeout for this request, in seconds
329+
330+
idempotency_key: Specify a custom idempotency key for this request
331+
"""
332+
if not inbound_check_deposit_id:
333+
raise ValueError(
334+
f"Expected a non-empty value for `inbound_check_deposit_id` but received {inbound_check_deposit_id!r}"
335+
)
336+
return await self._post(
337+
f"/simulations/inbound_check_deposits/{inbound_check_deposit_id}/adjustment",
338+
body=await async_maybe_transform(
339+
{
340+
"amount": amount,
341+
"reason": reason,
342+
},
343+
inbound_check_deposit_adjustment_params.InboundCheckDepositAdjustmentParams,
344+
),
345+
options=make_request_options(
346+
extra_headers=extra_headers,
347+
extra_query=extra_query,
348+
extra_body=extra_body,
349+
timeout=timeout,
350+
idempotency_key=idempotency_key,
351+
),
352+
cast_to=InboundCheckDeposit,
353+
)
354+
211355

212356
class InboundCheckDepositsResourceWithRawResponse:
213357
def __init__(self, inbound_check_deposits: InboundCheckDepositsResource) -> None:
@@ -216,6 +360,9 @@ def __init__(self, inbound_check_deposits: InboundCheckDepositsResource) -> None
216360
self.create = to_raw_response_wrapper(
217361
inbound_check_deposits.create,
218362
)
363+
self.adjustment = to_raw_response_wrapper(
364+
inbound_check_deposits.adjustment,
365+
)
219366

220367

221368
class AsyncInboundCheckDepositsResourceWithRawResponse:
@@ -225,6 +372,9 @@ def __init__(self, inbound_check_deposits: AsyncInboundCheckDepositsResource) ->
225372
self.create = async_to_raw_response_wrapper(
226373
inbound_check_deposits.create,
227374
)
375+
self.adjustment = async_to_raw_response_wrapper(
376+
inbound_check_deposits.adjustment,
377+
)
228378

229379

230380
class InboundCheckDepositsResourceWithStreamingResponse:
@@ -234,6 +384,9 @@ def __init__(self, inbound_check_deposits: InboundCheckDepositsResource) -> None
234384
self.create = to_streamed_response_wrapper(
235385
inbound_check_deposits.create,
236386
)
387+
self.adjustment = to_streamed_response_wrapper(
388+
inbound_check_deposits.adjustment,
389+
)
237390

238391

239392
class AsyncInboundCheckDepositsResourceWithStreamingResponse:
@@ -243,3 +396,6 @@ def __init__(self, inbound_check_deposits: AsyncInboundCheckDepositsResource) ->
243396
self.create = async_to_streamed_response_wrapper(
244397
inbound_check_deposits.create,
245398
)
399+
self.adjustment = async_to_streamed_response_wrapper(
400+
inbound_check_deposits.adjustment,
401+
)

src/increase/types/simulations/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
from .physical_card_advance_shipment_params import (
3333
PhysicalCardAdvanceShipmentParams as PhysicalCardAdvanceShipmentParams,
3434
)
35+
from .inbound_check_deposit_adjustment_params import (
36+
InboundCheckDepositAdjustmentParams as InboundCheckDepositAdjustmentParams,
37+
)
3538
from .digital_wallet_token_request_create_params import (
3639
DigitalWalletTokenRequestCreateParams as DigitalWalletTokenRequestCreateParams,
3740
)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, TypedDict
6+
7+
__all__ = ["InboundCheckDepositAdjustmentParams"]
8+
9+
10+
class InboundCheckDepositAdjustmentParams(TypedDict, total=False):
11+
amount: int
12+
"""The adjustment amount in cents.
13+
14+
Defaults to the amount of the Inbound Check Deposit.
15+
"""
16+
17+
reason: Literal["late_return", "wrong_payee_credit", "adjusted_amount", "non_conforming_item", "paid"]
18+
"""The reason for the adjustment. Defaults to `wrong_payee_credit`.
19+
20+
- `late_return` - The return was initiated too late and the receiving
21+
institution has responded with a Late Return Claim.
22+
- `wrong_payee_credit` - The check was deposited to the wrong payee and the
23+
depositing institution has reimbursed the funds with a Wrong Payee Credit.
24+
- `adjusted_amount` - The check was deposited with a different amount than what
25+
was written on the check.
26+
- `non_conforming_item` - The recipient was not able to process the check. This
27+
usually happens for e.g., low quality images.
28+
- `paid` - The check has already been deposited elsewhere and so this is a
29+
duplicate.
30+
"""

tests/api_resources/simulations/test_inbound_check_deposits.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,55 @@ def test_streaming_response_create(self, client: Increase) -> None:
6464

6565
assert cast(Any, response.is_closed) is True
6666

67+
@parametrize
68+
def test_method_adjustment(self, client: Increase) -> None:
69+
inbound_check_deposit = client.simulations.inbound_check_deposits.adjustment(
70+
inbound_check_deposit_id="inbound_check_deposit_zoshvqybq0cjjm31mra",
71+
)
72+
assert_matches_type(InboundCheckDeposit, inbound_check_deposit, path=["response"])
73+
74+
@parametrize
75+
def test_method_adjustment_with_all_params(self, client: Increase) -> None:
76+
inbound_check_deposit = client.simulations.inbound_check_deposits.adjustment(
77+
inbound_check_deposit_id="inbound_check_deposit_zoshvqybq0cjjm31mra",
78+
amount=1000,
79+
reason="late_return",
80+
)
81+
assert_matches_type(InboundCheckDeposit, inbound_check_deposit, path=["response"])
82+
83+
@parametrize
84+
def test_raw_response_adjustment(self, client: Increase) -> None:
85+
response = client.simulations.inbound_check_deposits.with_raw_response.adjustment(
86+
inbound_check_deposit_id="inbound_check_deposit_zoshvqybq0cjjm31mra",
87+
)
88+
89+
assert response.is_closed is True
90+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
91+
inbound_check_deposit = response.parse()
92+
assert_matches_type(InboundCheckDeposit, inbound_check_deposit, path=["response"])
93+
94+
@parametrize
95+
def test_streaming_response_adjustment(self, client: Increase) -> None:
96+
with client.simulations.inbound_check_deposits.with_streaming_response.adjustment(
97+
inbound_check_deposit_id="inbound_check_deposit_zoshvqybq0cjjm31mra",
98+
) as response:
99+
assert not response.is_closed
100+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
101+
102+
inbound_check_deposit = response.parse()
103+
assert_matches_type(InboundCheckDeposit, inbound_check_deposit, path=["response"])
104+
105+
assert cast(Any, response.is_closed) is True
106+
107+
@parametrize
108+
def test_path_params_adjustment(self, client: Increase) -> None:
109+
with pytest.raises(
110+
ValueError, match=r"Expected a non-empty value for `inbound_check_deposit_id` but received ''"
111+
):
112+
client.simulations.inbound_check_deposits.with_raw_response.adjustment(
113+
inbound_check_deposit_id="",
114+
)
115+
67116

68117
class TestAsyncInboundCheckDeposits:
69118
parametrize = pytest.mark.parametrize(
@@ -116,3 +165,52 @@ async def test_streaming_response_create(self, async_client: AsyncIncrease) -> N
116165
assert_matches_type(InboundCheckDeposit, inbound_check_deposit, path=["response"])
117166

118167
assert cast(Any, response.is_closed) is True
168+
169+
@parametrize
170+
async def test_method_adjustment(self, async_client: AsyncIncrease) -> None:
171+
inbound_check_deposit = await async_client.simulations.inbound_check_deposits.adjustment(
172+
inbound_check_deposit_id="inbound_check_deposit_zoshvqybq0cjjm31mra",
173+
)
174+
assert_matches_type(InboundCheckDeposit, inbound_check_deposit, path=["response"])
175+
176+
@parametrize
177+
async def test_method_adjustment_with_all_params(self, async_client: AsyncIncrease) -> None:
178+
inbound_check_deposit = await async_client.simulations.inbound_check_deposits.adjustment(
179+
inbound_check_deposit_id="inbound_check_deposit_zoshvqybq0cjjm31mra",
180+
amount=1000,
181+
reason="late_return",
182+
)
183+
assert_matches_type(InboundCheckDeposit, inbound_check_deposit, path=["response"])
184+
185+
@parametrize
186+
async def test_raw_response_adjustment(self, async_client: AsyncIncrease) -> None:
187+
response = await async_client.simulations.inbound_check_deposits.with_raw_response.adjustment(
188+
inbound_check_deposit_id="inbound_check_deposit_zoshvqybq0cjjm31mra",
189+
)
190+
191+
assert response.is_closed is True
192+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
193+
inbound_check_deposit = await response.parse()
194+
assert_matches_type(InboundCheckDeposit, inbound_check_deposit, path=["response"])
195+
196+
@parametrize
197+
async def test_streaming_response_adjustment(self, async_client: AsyncIncrease) -> None:
198+
async with async_client.simulations.inbound_check_deposits.with_streaming_response.adjustment(
199+
inbound_check_deposit_id="inbound_check_deposit_zoshvqybq0cjjm31mra",
200+
) as response:
201+
assert not response.is_closed
202+
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
203+
204+
inbound_check_deposit = await response.parse()
205+
assert_matches_type(InboundCheckDeposit, inbound_check_deposit, path=["response"])
206+
207+
assert cast(Any, response.is_closed) is True
208+
209+
@parametrize
210+
async def test_path_params_adjustment(self, async_client: AsyncIncrease) -> None:
211+
with pytest.raises(
212+
ValueError, match=r"Expected a non-empty value for `inbound_check_deposit_id` but received ''"
213+
):
214+
await async_client.simulations.inbound_check_deposits.with_raw_response.adjustment(
215+
inbound_check_deposit_id="",
216+
)

0 commit comments

Comments
 (0)