diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1f7dbf48e..33b7181e0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.364.0" + ".": "0.365.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 381812862..2363e1cfc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-569770c31254c7f2a732392f0a960ab529ea93d792991d0ad4b77ddb03cef90b.yml -openapi_spec_hash: ad8426915b3eb92c26351e2d87a6d891 -config_hash: f0b80170c2ea09811aeae3f1e94bc422 +configured_endpoints: 228 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-e809e9e4e5bc9c602a2ecebfbdb4a77d6c88c6f70f0b47a7a4d1dd1df4aaa66d.yml +openapi_spec_hash: cb6cb9fa09a8e52f6eb89271b559823d +config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/CHANGELOG.md b/CHANGELOG.md index e0c519054..a1332ec26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.365.0 (2025-10-24) + +Full Changelog: [v0.364.0...v0.365.0](https://github.com/Increase/increase-python/compare/v0.364.0...v0.365.0) + +### Features + +* **api:** api update ([3c9346f](https://github.com/Increase/increase-python/commit/3c9346fa448c9aa614280d8f4b7930014802650c)) + ## 0.364.0 (2025-10-23) Full Changelog: [v0.363.0...v0.364.0](https://github.com/Increase/increase-python/compare/v0.363.0...v0.364.0) diff --git a/api.md b/api.md index 7af830e22..60db0da3c 100644 --- a/api.md +++ b/api.md @@ -371,6 +371,35 @@ Methods: - client.inbound_real_time_payments_transfers.retrieve(inbound_real_time_payments_transfer_id) -> InboundRealTimePaymentsTransfer - client.inbound_real_time_payments_transfers.list(\*\*params) -> SyncPage[InboundRealTimePaymentsTransfer] +# FednowTransfers + +Types: + +```python +from increase.types import FednowTransfer +``` + +Methods: + +- client.fednow_transfers.create(\*\*params) -> FednowTransfer +- client.fednow_transfers.retrieve(fednow_transfer_id) -> FednowTransfer +- client.fednow_transfers.list(\*\*params) -> SyncPage[FednowTransfer] +- client.fednow_transfers.approve(fednow_transfer_id) -> FednowTransfer +- client.fednow_transfers.cancel(fednow_transfer_id) -> FednowTransfer + +# InboundFednowTransfers + +Types: + +```python +from increase.types import InboundFednowTransfer +``` + +Methods: + +- client.inbound_fednow_transfers.retrieve(inbound_fednow_transfer_id) -> InboundFednowTransfer +- client.inbound_fednow_transfers.list(\*\*params) -> SyncPage[InboundFednowTransfer] + # CheckDeposits Types: @@ -940,6 +969,12 @@ Methods: - client.simulations.inbound_real_time_payments_transfers.create(\*\*params) -> InboundRealTimePaymentsTransfer +## InboundFednowTransfers + +Methods: + +- client.simulations.inbound_fednow_transfers.create(\*\*params) -> InboundFednowTransfer + ## CheckDeposits Methods: diff --git a/pyproject.toml b/pyproject.toml index b024c6735..e24cc72af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.364.0" +version = "0.365.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_client.py b/src/increase/_client.py index 78d8ae88e..63e639fda 100644 --- a/src/increase/_client.py +++ b/src/increase/_client.py @@ -51,6 +51,7 @@ check_transfers, routing_numbers, card_validations, + fednow_transfers, intrafi_balances, account_transfers, external_accounts, @@ -76,6 +77,7 @@ physical_card_profiles, supplemental_documents, wire_drawdown_requests, + inbound_fednow_transfers, card_purchase_supplements, intrafi_account_enrollments, real_time_payments_transfers, @@ -135,6 +137,8 @@ class Increase(SyncAPIClient): inbound_check_deposits: inbound_check_deposits.InboundCheckDepositsResource real_time_payments_transfers: real_time_payments_transfers.RealTimePaymentsTransfersResource inbound_real_time_payments_transfers: inbound_real_time_payments_transfers.InboundRealTimePaymentsTransfersResource + fednow_transfers: fednow_transfers.FednowTransfersResource + inbound_fednow_transfers: inbound_fednow_transfers.InboundFednowTransfersResource check_deposits: check_deposits.CheckDepositsResource lockboxes: lockboxes.LockboxesResource inbound_mail_items: inbound_mail_items.InboundMailItemsResource @@ -284,6 +288,8 @@ def __init__( self.inbound_real_time_payments_transfers = ( inbound_real_time_payments_transfers.InboundRealTimePaymentsTransfersResource(self) ) + self.fednow_transfers = fednow_transfers.FednowTransfersResource(self) + self.inbound_fednow_transfers = inbound_fednow_transfers.InboundFednowTransfersResource(self) self.check_deposits = check_deposits.CheckDepositsResource(self) self.lockboxes = lockboxes.LockboxesResource(self) self.inbound_mail_items = inbound_mail_items.InboundMailItemsResource(self) @@ -500,6 +506,8 @@ class AsyncIncrease(AsyncAPIClient): inbound_real_time_payments_transfers: ( inbound_real_time_payments_transfers.AsyncInboundRealTimePaymentsTransfersResource ) + fednow_transfers: fednow_transfers.AsyncFednowTransfersResource + inbound_fednow_transfers: inbound_fednow_transfers.AsyncInboundFednowTransfersResource check_deposits: check_deposits.AsyncCheckDepositsResource lockboxes: lockboxes.AsyncLockboxesResource inbound_mail_items: inbound_mail_items.AsyncInboundMailItemsResource @@ -651,6 +659,8 @@ def __init__( self.inbound_real_time_payments_transfers = ( inbound_real_time_payments_transfers.AsyncInboundRealTimePaymentsTransfersResource(self) ) + self.fednow_transfers = fednow_transfers.AsyncFednowTransfersResource(self) + self.inbound_fednow_transfers = inbound_fednow_transfers.AsyncInboundFednowTransfersResource(self) self.check_deposits = check_deposits.AsyncCheckDepositsResource(self) self.lockboxes = lockboxes.AsyncLockboxesResource(self) self.inbound_mail_items = inbound_mail_items.AsyncInboundMailItemsResource(self) @@ -900,6 +910,10 @@ def __init__(self, client: Increase) -> None: client.inbound_real_time_payments_transfers ) ) + self.fednow_transfers = fednow_transfers.FednowTransfersResourceWithRawResponse(client.fednow_transfers) + self.inbound_fednow_transfers = inbound_fednow_transfers.InboundFednowTransfersResourceWithRawResponse( + client.inbound_fednow_transfers + ) self.check_deposits = check_deposits.CheckDepositsResourceWithRawResponse(client.check_deposits) self.lockboxes = lockboxes.LockboxesResourceWithRawResponse(client.lockboxes) self.inbound_mail_items = inbound_mail_items.InboundMailItemsResourceWithRawResponse(client.inbound_mail_items) @@ -1011,6 +1025,10 @@ def __init__(self, client: AsyncIncrease) -> None: client.inbound_real_time_payments_transfers ) ) + self.fednow_transfers = fednow_transfers.AsyncFednowTransfersResourceWithRawResponse(client.fednow_transfers) + self.inbound_fednow_transfers = inbound_fednow_transfers.AsyncInboundFednowTransfersResourceWithRawResponse( + client.inbound_fednow_transfers + ) self.check_deposits = check_deposits.AsyncCheckDepositsResourceWithRawResponse(client.check_deposits) self.lockboxes = lockboxes.AsyncLockboxesResourceWithRawResponse(client.lockboxes) self.inbound_mail_items = inbound_mail_items.AsyncInboundMailItemsResourceWithRawResponse( @@ -1136,6 +1154,10 @@ def __init__(self, client: Increase) -> None: client.inbound_real_time_payments_transfers ) ) + self.fednow_transfers = fednow_transfers.FednowTransfersResourceWithStreamingResponse(client.fednow_transfers) + self.inbound_fednow_transfers = inbound_fednow_transfers.InboundFednowTransfersResourceWithStreamingResponse( + client.inbound_fednow_transfers + ) self.check_deposits = check_deposits.CheckDepositsResourceWithStreamingResponse(client.check_deposits) self.lockboxes = lockboxes.LockboxesResourceWithStreamingResponse(client.lockboxes) self.inbound_mail_items = inbound_mail_items.InboundMailItemsResourceWithStreamingResponse( @@ -1263,6 +1285,14 @@ def __init__(self, client: AsyncIncrease) -> None: client.inbound_real_time_payments_transfers ) ) + self.fednow_transfers = fednow_transfers.AsyncFednowTransfersResourceWithStreamingResponse( + client.fednow_transfers + ) + self.inbound_fednow_transfers = ( + inbound_fednow_transfers.AsyncInboundFednowTransfersResourceWithStreamingResponse( + client.inbound_fednow_transfers + ) + ) self.check_deposits = check_deposits.AsyncCheckDepositsResourceWithStreamingResponse(client.check_deposits) self.lockboxes = lockboxes.AsyncLockboxesResourceWithStreamingResponse(client.lockboxes) self.inbound_mail_items = inbound_mail_items.AsyncInboundMailItemsResourceWithStreamingResponse( diff --git a/src/increase/_version.py b/src/increase/_version.py index 7e9f5de9b..5a2cbdc4b 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.364.0" # x-release-please-version +__version__ = "0.365.0" # x-release-please-version diff --git a/src/increase/resources/__init__.py b/src/increase/resources/__init__.py index d00f033c3..9915c8358 100644 --- a/src/increase/resources/__init__.py +++ b/src/increase/resources/__init__.py @@ -201,6 +201,14 @@ CardValidationsResourceWithStreamingResponse, AsyncCardValidationsResourceWithStreamingResponse, ) +from .fednow_transfers import ( + FednowTransfersResource, + AsyncFednowTransfersResource, + FednowTransfersResourceWithRawResponse, + AsyncFednowTransfersResourceWithRawResponse, + FednowTransfersResourceWithStreamingResponse, + AsyncFednowTransfersResourceWithStreamingResponse, +) from .intrafi_balances import ( IntrafiBalancesResource, AsyncIntrafiBalancesResource, @@ -401,6 +409,14 @@ WireDrawdownRequestsResourceWithStreamingResponse, AsyncWireDrawdownRequestsResourceWithStreamingResponse, ) +from .inbound_fednow_transfers import ( + InboundFednowTransfersResource, + AsyncInboundFednowTransfersResource, + InboundFednowTransfersResourceWithRawResponse, + AsyncInboundFednowTransfersResourceWithRawResponse, + InboundFednowTransfersResourceWithStreamingResponse, + AsyncInboundFednowTransfersResourceWithStreamingResponse, +) from .card_purchase_supplements import ( CardPurchaseSupplementsResource, AsyncCardPurchaseSupplementsResource, @@ -595,6 +611,18 @@ "AsyncInboundRealTimePaymentsTransfersResourceWithRawResponse", "InboundRealTimePaymentsTransfersResourceWithStreamingResponse", "AsyncInboundRealTimePaymentsTransfersResourceWithStreamingResponse", + "FednowTransfersResource", + "AsyncFednowTransfersResource", + "FednowTransfersResourceWithRawResponse", + "AsyncFednowTransfersResourceWithRawResponse", + "FednowTransfersResourceWithStreamingResponse", + "AsyncFednowTransfersResourceWithStreamingResponse", + "InboundFednowTransfersResource", + "AsyncInboundFednowTransfersResource", + "InboundFednowTransfersResourceWithRawResponse", + "AsyncInboundFednowTransfersResourceWithRawResponse", + "InboundFednowTransfersResourceWithStreamingResponse", + "AsyncInboundFednowTransfersResourceWithStreamingResponse", "CheckDepositsResource", "AsyncCheckDepositsResource", "CheckDepositsResourceWithRawResponse", diff --git a/src/increase/resources/fednow_transfers.py b/src/increase/resources/fednow_transfers.py new file mode 100644 index 000000000..1ae25dc75 --- /dev/null +++ b/src/increase/resources/fednow_transfers.py @@ -0,0 +1,702 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import fednow_transfer_list_params, fednow_transfer_create_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.fednow_transfer import FednowTransfer + +__all__ = ["FednowTransfersResource", "AsyncFednowTransfersResource"] + + +class FednowTransfersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> FednowTransfersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers + """ + return FednowTransfersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> FednowTransfersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/Increase/increase-python#with_streaming_response + """ + return FednowTransfersResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + amount: int, + creditor_name: str, + debtor_name: str, + source_account_number_id: str, + unstructured_remittance_information: str, + account_number: str | Omit = omit, + creditor_address: fednow_transfer_create_params.CreditorAddress | Omit = omit, + debtor_address: fednow_transfer_create_params.DebtorAddress | Omit = omit, + external_account_id: str | Omit = omit, + require_approval: bool | Omit = omit, + routing_number: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> FednowTransfer: + """ + Create a FedNow Transfer + + Args: + account_id: The identifier for the account that will send the transfer. + + amount: The amount, in minor units, to send to the creditor. + + creditor_name: The creditor's name. + + debtor_name: The debtor's name. + + source_account_number_id: The Account Number to include in the transfer as the debtor's account number. + + unstructured_remittance_information: Unstructured remittance information to include in the transfer. + + account_number: The creditor's account number. + + creditor_address: The creditor's address. + + debtor_address: The debtor's address. + + external_account_id: The ID of an External Account to initiate a transfer to. If this parameter is + provided, `account_number` and `routing_number` must be absent. + + require_approval: Whether the transfer requires explicit approval via the dashboard or API. + + routing_number: The creditor's bank account routing number. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/fednow_transfers", + body=maybe_transform( + { + "account_id": account_id, + "amount": amount, + "creditor_name": creditor_name, + "debtor_name": debtor_name, + "source_account_number_id": source_account_number_id, + "unstructured_remittance_information": unstructured_remittance_information, + "account_number": account_number, + "creditor_address": creditor_address, + "debtor_address": debtor_address, + "external_account_id": external_account_id, + "require_approval": require_approval, + "routing_number": routing_number, + }, + fednow_transfer_create_params.FednowTransferCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=FednowTransfer, + ) + + def retrieve( + self, + fednow_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> FednowTransfer: + """ + Retrieve a FedNow Transfer + + Args: + fednow_transfer_id: The identifier of the FedNow Transfer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not fednow_transfer_id: + raise ValueError(f"Expected a non-empty value for `fednow_transfer_id` but received {fednow_transfer_id!r}") + return self._get( + f"/fednow_transfers/{fednow_transfer_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FednowTransfer, + ) + + def list( + self, + *, + account_id: str | Omit = omit, + created_at: fednow_transfer_list_params.CreatedAt | Omit = omit, + cursor: str | Omit = omit, + external_account_id: str | Omit = omit, + idempotency_key: str | Omit = omit, + limit: int | Omit = omit, + status: fednow_transfer_list_params.Status | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPage[FednowTransfer]: + """ + List FedNow Transfers + + Args: + account_id: Filter FedNow Transfers to those that originated from the specified Account. + + cursor: Return the page of entries after this one. + + external_account_id: Filter FedNow Transfers to those made to the specified External Account. + + idempotency_key: Filter records to the one with the specified `idempotency_key` you chose for + that object. This value is unique across Increase and is used to ensure that a + request is only processed once. Learn more about + [idempotency](https://increase.com/documentation/idempotency-keys). + + limit: Limit the size of the list that is returned. The default (and maximum) is 100 + objects. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/fednow_transfers", + page=SyncPage[FednowTransfer], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "account_id": account_id, + "created_at": created_at, + "cursor": cursor, + "external_account_id": external_account_id, + "idempotency_key": idempotency_key, + "limit": limit, + "status": status, + }, + fednow_transfer_list_params.FednowTransferListParams, + ), + ), + model=FednowTransfer, + ) + + def approve( + self, + fednow_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> FednowTransfer: + """ + Approve a FedNow Transfer + + Args: + fednow_transfer_id: The identifier of the FedNow Transfer to approve. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not fednow_transfer_id: + raise ValueError(f"Expected a non-empty value for `fednow_transfer_id` but received {fednow_transfer_id!r}") + return self._post( + f"/fednow_transfers/{fednow_transfer_id}/approve", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=FednowTransfer, + ) + + def cancel( + self, + fednow_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> FednowTransfer: + """ + Cancel a pending FedNow Transfer + + Args: + fednow_transfer_id: The identifier of the pending FedNow Transfer to cancel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not fednow_transfer_id: + raise ValueError(f"Expected a non-empty value for `fednow_transfer_id` but received {fednow_transfer_id!r}") + return self._post( + f"/fednow_transfers/{fednow_transfer_id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=FednowTransfer, + ) + + +class AsyncFednowTransfersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncFednowTransfersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers + """ + return AsyncFednowTransfersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncFednowTransfersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/Increase/increase-python#with_streaming_response + """ + return AsyncFednowTransfersResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + amount: int, + creditor_name: str, + debtor_name: str, + source_account_number_id: str, + unstructured_remittance_information: str, + account_number: str | Omit = omit, + creditor_address: fednow_transfer_create_params.CreditorAddress | Omit = omit, + debtor_address: fednow_transfer_create_params.DebtorAddress | Omit = omit, + external_account_id: str | Omit = omit, + require_approval: bool | Omit = omit, + routing_number: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> FednowTransfer: + """ + Create a FedNow Transfer + + Args: + account_id: The identifier for the account that will send the transfer. + + amount: The amount, in minor units, to send to the creditor. + + creditor_name: The creditor's name. + + debtor_name: The debtor's name. + + source_account_number_id: The Account Number to include in the transfer as the debtor's account number. + + unstructured_remittance_information: Unstructured remittance information to include in the transfer. + + account_number: The creditor's account number. + + creditor_address: The creditor's address. + + debtor_address: The debtor's address. + + external_account_id: The ID of an External Account to initiate a transfer to. If this parameter is + provided, `account_number` and `routing_number` must be absent. + + require_approval: Whether the transfer requires explicit approval via the dashboard or API. + + routing_number: The creditor's bank account routing number. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/fednow_transfers", + body=await async_maybe_transform( + { + "account_id": account_id, + "amount": amount, + "creditor_name": creditor_name, + "debtor_name": debtor_name, + "source_account_number_id": source_account_number_id, + "unstructured_remittance_information": unstructured_remittance_information, + "account_number": account_number, + "creditor_address": creditor_address, + "debtor_address": debtor_address, + "external_account_id": external_account_id, + "require_approval": require_approval, + "routing_number": routing_number, + }, + fednow_transfer_create_params.FednowTransferCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=FednowTransfer, + ) + + async def retrieve( + self, + fednow_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> FednowTransfer: + """ + Retrieve a FedNow Transfer + + Args: + fednow_transfer_id: The identifier of the FedNow Transfer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not fednow_transfer_id: + raise ValueError(f"Expected a non-empty value for `fednow_transfer_id` but received {fednow_transfer_id!r}") + return await self._get( + f"/fednow_transfers/{fednow_transfer_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FednowTransfer, + ) + + def list( + self, + *, + account_id: str | Omit = omit, + created_at: fednow_transfer_list_params.CreatedAt | Omit = omit, + cursor: str | Omit = omit, + external_account_id: str | Omit = omit, + idempotency_key: str | Omit = omit, + limit: int | Omit = omit, + status: fednow_transfer_list_params.Status | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[FednowTransfer, AsyncPage[FednowTransfer]]: + """ + List FedNow Transfers + + Args: + account_id: Filter FedNow Transfers to those that originated from the specified Account. + + cursor: Return the page of entries after this one. + + external_account_id: Filter FedNow Transfers to those made to the specified External Account. + + idempotency_key: Filter records to the one with the specified `idempotency_key` you chose for + that object. This value is unique across Increase and is used to ensure that a + request is only processed once. Learn more about + [idempotency](https://increase.com/documentation/idempotency-keys). + + limit: Limit the size of the list that is returned. The default (and maximum) is 100 + objects. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/fednow_transfers", + page=AsyncPage[FednowTransfer], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "account_id": account_id, + "created_at": created_at, + "cursor": cursor, + "external_account_id": external_account_id, + "idempotency_key": idempotency_key, + "limit": limit, + "status": status, + }, + fednow_transfer_list_params.FednowTransferListParams, + ), + ), + model=FednowTransfer, + ) + + async def approve( + self, + fednow_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> FednowTransfer: + """ + Approve a FedNow Transfer + + Args: + fednow_transfer_id: The identifier of the FedNow Transfer to approve. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not fednow_transfer_id: + raise ValueError(f"Expected a non-empty value for `fednow_transfer_id` but received {fednow_transfer_id!r}") + return await self._post( + f"/fednow_transfers/{fednow_transfer_id}/approve", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=FednowTransfer, + ) + + async def cancel( + self, + fednow_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> FednowTransfer: + """ + Cancel a pending FedNow Transfer + + Args: + fednow_transfer_id: The identifier of the pending FedNow Transfer to cancel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not fednow_transfer_id: + raise ValueError(f"Expected a non-empty value for `fednow_transfer_id` but received {fednow_transfer_id!r}") + return await self._post( + f"/fednow_transfers/{fednow_transfer_id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=FednowTransfer, + ) + + +class FednowTransfersResourceWithRawResponse: + def __init__(self, fednow_transfers: FednowTransfersResource) -> None: + self._fednow_transfers = fednow_transfers + + self.create = to_raw_response_wrapper( + fednow_transfers.create, + ) + self.retrieve = to_raw_response_wrapper( + fednow_transfers.retrieve, + ) + self.list = to_raw_response_wrapper( + fednow_transfers.list, + ) + self.approve = to_raw_response_wrapper( + fednow_transfers.approve, + ) + self.cancel = to_raw_response_wrapper( + fednow_transfers.cancel, + ) + + +class AsyncFednowTransfersResourceWithRawResponse: + def __init__(self, fednow_transfers: AsyncFednowTransfersResource) -> None: + self._fednow_transfers = fednow_transfers + + self.create = async_to_raw_response_wrapper( + fednow_transfers.create, + ) + self.retrieve = async_to_raw_response_wrapper( + fednow_transfers.retrieve, + ) + self.list = async_to_raw_response_wrapper( + fednow_transfers.list, + ) + self.approve = async_to_raw_response_wrapper( + fednow_transfers.approve, + ) + self.cancel = async_to_raw_response_wrapper( + fednow_transfers.cancel, + ) + + +class FednowTransfersResourceWithStreamingResponse: + def __init__(self, fednow_transfers: FednowTransfersResource) -> None: + self._fednow_transfers = fednow_transfers + + self.create = to_streamed_response_wrapper( + fednow_transfers.create, + ) + self.retrieve = to_streamed_response_wrapper( + fednow_transfers.retrieve, + ) + self.list = to_streamed_response_wrapper( + fednow_transfers.list, + ) + self.approve = to_streamed_response_wrapper( + fednow_transfers.approve, + ) + self.cancel = to_streamed_response_wrapper( + fednow_transfers.cancel, + ) + + +class AsyncFednowTransfersResourceWithStreamingResponse: + def __init__(self, fednow_transfers: AsyncFednowTransfersResource) -> None: + self._fednow_transfers = fednow_transfers + + self.create = async_to_streamed_response_wrapper( + fednow_transfers.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + fednow_transfers.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + fednow_transfers.list, + ) + self.approve = async_to_streamed_response_wrapper( + fednow_transfers.approve, + ) + self.cancel = async_to_streamed_response_wrapper( + fednow_transfers.cancel, + ) diff --git a/src/increase/resources/inbound_fednow_transfers.py b/src/increase/resources/inbound_fednow_transfers.py new file mode 100644 index 000000000..9a314e19f --- /dev/null +++ b/src/increase/resources/inbound_fednow_transfers.py @@ -0,0 +1,304 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import inbound_fednow_transfer_list_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.inbound_fednow_transfer import InboundFednowTransfer + +__all__ = ["InboundFednowTransfersResource", "AsyncInboundFednowTransfersResource"] + + +class InboundFednowTransfersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> InboundFednowTransfersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers + """ + return InboundFednowTransfersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> InboundFednowTransfersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/Increase/increase-python#with_streaming_response + """ + return InboundFednowTransfersResourceWithStreamingResponse(self) + + def retrieve( + self, + inbound_fednow_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> InboundFednowTransfer: + """ + Retrieve an Inbound FedNow Transfer + + Args: + inbound_fednow_transfer_id: The identifier of the Inbound FedNow Transfer to get details for. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not inbound_fednow_transfer_id: + raise ValueError( + f"Expected a non-empty value for `inbound_fednow_transfer_id` but received {inbound_fednow_transfer_id!r}" + ) + return self._get( + f"/inbound_fednow_transfers/{inbound_fednow_transfer_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InboundFednowTransfer, + ) + + def list( + self, + *, + account_id: str | Omit = omit, + account_number_id: str | Omit = omit, + created_at: inbound_fednow_transfer_list_params.CreatedAt | Omit = omit, + cursor: str | Omit = omit, + limit: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncPage[InboundFednowTransfer]: + """ + List Inbound FedNow Transfers + + Args: + account_id: Filter Inbound FedNow Transfers to those belonging to the specified Account. + + account_number_id: Filter Inbound FedNow Transfers to ones belonging to the specified Account + Number. + + cursor: Return the page of entries after this one. + + limit: Limit the size of the list that is returned. The default (and maximum) is 100 + objects. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/inbound_fednow_transfers", + page=SyncPage[InboundFednowTransfer], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "account_id": account_id, + "account_number_id": account_number_id, + "created_at": created_at, + "cursor": cursor, + "limit": limit, + }, + inbound_fednow_transfer_list_params.InboundFednowTransferListParams, + ), + ), + model=InboundFednowTransfer, + ) + + +class AsyncInboundFednowTransfersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncInboundFednowTransfersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers + """ + return AsyncInboundFednowTransfersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncInboundFednowTransfersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/Increase/increase-python#with_streaming_response + """ + return AsyncInboundFednowTransfersResourceWithStreamingResponse(self) + + async def retrieve( + self, + inbound_fednow_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> InboundFednowTransfer: + """ + Retrieve an Inbound FedNow Transfer + + Args: + inbound_fednow_transfer_id: The identifier of the Inbound FedNow Transfer to get details for. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not inbound_fednow_transfer_id: + raise ValueError( + f"Expected a non-empty value for `inbound_fednow_transfer_id` but received {inbound_fednow_transfer_id!r}" + ) + return await self._get( + f"/inbound_fednow_transfers/{inbound_fednow_transfer_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InboundFednowTransfer, + ) + + def list( + self, + *, + account_id: str | Omit = omit, + account_number_id: str | Omit = omit, + created_at: inbound_fednow_transfer_list_params.CreatedAt | Omit = omit, + cursor: str | Omit = omit, + limit: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[InboundFednowTransfer, AsyncPage[InboundFednowTransfer]]: + """ + List Inbound FedNow Transfers + + Args: + account_id: Filter Inbound FedNow Transfers to those belonging to the specified Account. + + account_number_id: Filter Inbound FedNow Transfers to ones belonging to the specified Account + Number. + + cursor: Return the page of entries after this one. + + limit: Limit the size of the list that is returned. The default (and maximum) is 100 + objects. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/inbound_fednow_transfers", + page=AsyncPage[InboundFednowTransfer], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "account_id": account_id, + "account_number_id": account_number_id, + "created_at": created_at, + "cursor": cursor, + "limit": limit, + }, + inbound_fednow_transfer_list_params.InboundFednowTransferListParams, + ), + ), + model=InboundFednowTransfer, + ) + + +class InboundFednowTransfersResourceWithRawResponse: + def __init__(self, inbound_fednow_transfers: InboundFednowTransfersResource) -> None: + self._inbound_fednow_transfers = inbound_fednow_transfers + + self.retrieve = to_raw_response_wrapper( + inbound_fednow_transfers.retrieve, + ) + self.list = to_raw_response_wrapper( + inbound_fednow_transfers.list, + ) + + +class AsyncInboundFednowTransfersResourceWithRawResponse: + def __init__(self, inbound_fednow_transfers: AsyncInboundFednowTransfersResource) -> None: + self._inbound_fednow_transfers = inbound_fednow_transfers + + self.retrieve = async_to_raw_response_wrapper( + inbound_fednow_transfers.retrieve, + ) + self.list = async_to_raw_response_wrapper( + inbound_fednow_transfers.list, + ) + + +class InboundFednowTransfersResourceWithStreamingResponse: + def __init__(self, inbound_fednow_transfers: InboundFednowTransfersResource) -> None: + self._inbound_fednow_transfers = inbound_fednow_transfers + + self.retrieve = to_streamed_response_wrapper( + inbound_fednow_transfers.retrieve, + ) + self.list = to_streamed_response_wrapper( + inbound_fednow_transfers.list, + ) + + +class AsyncInboundFednowTransfersResourceWithStreamingResponse: + def __init__(self, inbound_fednow_transfers: AsyncInboundFednowTransfersResource) -> None: + self._inbound_fednow_transfers = inbound_fednow_transfers + + self.retrieve = async_to_streamed_response_wrapper( + inbound_fednow_transfers.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + inbound_fednow_transfers.list, + ) diff --git a/src/increase/resources/simulations/__init__.py b/src/increase/resources/simulations/__init__.py index c1a47a541..27f9585d1 100644 --- a/src/increase/resources/simulations/__init__.py +++ b/src/increase/resources/simulations/__init__.py @@ -200,6 +200,14 @@ CardFuelConfirmationsResourceWithStreamingResponse, AsyncCardFuelConfirmationsResourceWithStreamingResponse, ) +from .inbound_fednow_transfers import ( + InboundFednowTransfersResource, + AsyncInboundFednowTransfersResource, + InboundFednowTransfersResourceWithRawResponse, + AsyncInboundFednowTransfersResourceWithRawResponse, + InboundFednowTransfersResourceWithStreamingResponse, + AsyncInboundFednowTransfersResourceWithStreamingResponse, +) from .real_time_payments_transfers import ( RealTimePaymentsTransfersResource, AsyncRealTimePaymentsTransfersResource, @@ -380,6 +388,12 @@ "AsyncInboundRealTimePaymentsTransfersResourceWithRawResponse", "InboundRealTimePaymentsTransfersResourceWithStreamingResponse", "AsyncInboundRealTimePaymentsTransfersResourceWithStreamingResponse", + "InboundFednowTransfersResource", + "AsyncInboundFednowTransfersResource", + "InboundFednowTransfersResourceWithRawResponse", + "AsyncInboundFednowTransfersResourceWithRawResponse", + "InboundFednowTransfersResourceWithStreamingResponse", + "AsyncInboundFednowTransfersResourceWithStreamingResponse", "CheckDepositsResource", "AsyncCheckDepositsResource", "CheckDepositsResourceWithRawResponse", diff --git a/src/increase/resources/simulations/inbound_fednow_transfers.py b/src/increase/resources/simulations/inbound_fednow_transfers.py new file mode 100644 index 000000000..013c5e352 --- /dev/null +++ b/src/increase/resources/simulations/inbound_fednow_transfers.py @@ -0,0 +1,233 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.simulations import inbound_fednow_transfer_create_params +from ...types.inbound_fednow_transfer import InboundFednowTransfer + +__all__ = ["InboundFednowTransfersResource", "AsyncInboundFednowTransfersResource"] + + +class InboundFednowTransfersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> InboundFednowTransfersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers + """ + return InboundFednowTransfersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> InboundFednowTransfersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/Increase/increase-python#with_streaming_response + """ + return InboundFednowTransfersResourceWithStreamingResponse(self) + + def create( + self, + *, + account_number_id: str, + amount: int, + debtor_account_number: str | Omit = omit, + debtor_name: str | Omit = omit, + debtor_routing_number: str | Omit = omit, + unstructured_remittance_information: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> InboundFednowTransfer: + """ + Simulates an [Inbound FedNow Transfer](#inbound-fednow-transfers) to your + account. + + Args: + account_number_id: The identifier of the Account Number the inbound FedNow Transfer is for. + + amount: The transfer amount in USD cents. Must be positive. + + debtor_account_number: The account number of the account that sent the transfer. + + debtor_name: The name provided by the sender of the transfer. + + debtor_routing_number: The routing number of the account that sent the transfer. + + unstructured_remittance_information: Additional information included with the transfer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/simulations/inbound_fednow_transfers", + body=maybe_transform( + { + "account_number_id": account_number_id, + "amount": amount, + "debtor_account_number": debtor_account_number, + "debtor_name": debtor_name, + "debtor_routing_number": debtor_routing_number, + "unstructured_remittance_information": unstructured_remittance_information, + }, + inbound_fednow_transfer_create_params.InboundFednowTransferCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=InboundFednowTransfer, + ) + + +class AsyncInboundFednowTransfersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncInboundFednowTransfersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers + """ + return AsyncInboundFednowTransfersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncInboundFednowTransfersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/Increase/increase-python#with_streaming_response + """ + return AsyncInboundFednowTransfersResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_number_id: str, + amount: int, + debtor_account_number: str | Omit = omit, + debtor_name: str | Omit = omit, + debtor_routing_number: str | Omit = omit, + unstructured_remittance_information: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> InboundFednowTransfer: + """ + Simulates an [Inbound FedNow Transfer](#inbound-fednow-transfers) to your + account. + + Args: + account_number_id: The identifier of the Account Number the inbound FedNow Transfer is for. + + amount: The transfer amount in USD cents. Must be positive. + + debtor_account_number: The account number of the account that sent the transfer. + + debtor_name: The name provided by the sender of the transfer. + + debtor_routing_number: The routing number of the account that sent the transfer. + + unstructured_remittance_information: Additional information included with the transfer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/simulations/inbound_fednow_transfers", + body=await async_maybe_transform( + { + "account_number_id": account_number_id, + "amount": amount, + "debtor_account_number": debtor_account_number, + "debtor_name": debtor_name, + "debtor_routing_number": debtor_routing_number, + "unstructured_remittance_information": unstructured_remittance_information, + }, + inbound_fednow_transfer_create_params.InboundFednowTransferCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=InboundFednowTransfer, + ) + + +class InboundFednowTransfersResourceWithRawResponse: + def __init__(self, inbound_fednow_transfers: InboundFednowTransfersResource) -> None: + self._inbound_fednow_transfers = inbound_fednow_transfers + + self.create = to_raw_response_wrapper( + inbound_fednow_transfers.create, + ) + + +class AsyncInboundFednowTransfersResourceWithRawResponse: + def __init__(self, inbound_fednow_transfers: AsyncInboundFednowTransfersResource) -> None: + self._inbound_fednow_transfers = inbound_fednow_transfers + + self.create = async_to_raw_response_wrapper( + inbound_fednow_transfers.create, + ) + + +class InboundFednowTransfersResourceWithStreamingResponse: + def __init__(self, inbound_fednow_transfers: InboundFednowTransfersResource) -> None: + self._inbound_fednow_transfers = inbound_fednow_transfers + + self.create = to_streamed_response_wrapper( + inbound_fednow_transfers.create, + ) + + +class AsyncInboundFednowTransfersResourceWithStreamingResponse: + def __init__(self, inbound_fednow_transfers: AsyncInboundFednowTransfersResource) -> None: + self._inbound_fednow_transfers = inbound_fednow_transfers + + self.create = async_to_streamed_response_wrapper( + inbound_fednow_transfers.create, + ) diff --git a/src/increase/resources/simulations/simulations.py b/src/increase/resources/simulations/simulations.py index 4b1ea1a12..4dda2f035 100644 --- a/src/increase/resources/simulations/simulations.py +++ b/src/increase/resources/simulations/simulations.py @@ -196,6 +196,14 @@ CardFuelConfirmationsResourceWithStreamingResponse, AsyncCardFuelConfirmationsResourceWithStreamingResponse, ) +from .inbound_fednow_transfers import ( + InboundFednowTransfersResource, + AsyncInboundFednowTransfersResource, + InboundFednowTransfersResourceWithRawResponse, + AsyncInboundFednowTransfersResourceWithRawResponse, + InboundFednowTransfersResourceWithStreamingResponse, + AsyncInboundFednowTransfersResourceWithStreamingResponse, +) from .real_time_payments_transfers import ( RealTimePaymentsTransfersResource, AsyncRealTimePaymentsTransfersResource, @@ -333,6 +341,10 @@ def real_time_payments_transfers(self) -> RealTimePaymentsTransfersResource: def inbound_real_time_payments_transfers(self) -> InboundRealTimePaymentsTransfersResource: return InboundRealTimePaymentsTransfersResource(self._client) + @cached_property + def inbound_fednow_transfers(self) -> InboundFednowTransfersResource: + return InboundFednowTransfersResource(self._client) + @cached_property def check_deposits(self) -> CheckDepositsResource: return CheckDepositsResource(self._client) @@ -470,6 +482,10 @@ def real_time_payments_transfers(self) -> AsyncRealTimePaymentsTransfersResource def inbound_real_time_payments_transfers(self) -> AsyncInboundRealTimePaymentsTransfersResource: return AsyncInboundRealTimePaymentsTransfersResource(self._client) + @cached_property + def inbound_fednow_transfers(self) -> AsyncInboundFednowTransfersResource: + return AsyncInboundFednowTransfersResource(self._client) + @cached_property def check_deposits(self) -> AsyncCheckDepositsResource: return AsyncCheckDepositsResource(self._client) @@ -612,6 +628,10 @@ def inbound_real_time_payments_transfers(self) -> InboundRealTimePaymentsTransfe self._simulations.inbound_real_time_payments_transfers ) + @cached_property + def inbound_fednow_transfers(self) -> InboundFednowTransfersResourceWithRawResponse: + return InboundFednowTransfersResourceWithRawResponse(self._simulations.inbound_fednow_transfers) + @cached_property def check_deposits(self) -> CheckDepositsResourceWithRawResponse: return CheckDepositsResourceWithRawResponse(self._simulations.check_deposits) @@ -737,6 +757,10 @@ def inbound_real_time_payments_transfers(self) -> AsyncInboundRealTimePaymentsTr self._simulations.inbound_real_time_payments_transfers ) + @cached_property + def inbound_fednow_transfers(self) -> AsyncInboundFednowTransfersResourceWithRawResponse: + return AsyncInboundFednowTransfersResourceWithRawResponse(self._simulations.inbound_fednow_transfers) + @cached_property def check_deposits(self) -> AsyncCheckDepositsResourceWithRawResponse: return AsyncCheckDepositsResourceWithRawResponse(self._simulations.check_deposits) @@ -864,6 +888,10 @@ def inbound_real_time_payments_transfers(self) -> InboundRealTimePaymentsTransfe self._simulations.inbound_real_time_payments_transfers ) + @cached_property + def inbound_fednow_transfers(self) -> InboundFednowTransfersResourceWithStreamingResponse: + return InboundFednowTransfersResourceWithStreamingResponse(self._simulations.inbound_fednow_transfers) + @cached_property def check_deposits(self) -> CheckDepositsResourceWithStreamingResponse: return CheckDepositsResourceWithStreamingResponse(self._simulations.check_deposits) @@ -997,6 +1025,10 @@ def inbound_real_time_payments_transfers( self._simulations.inbound_real_time_payments_transfers ) + @cached_property + def inbound_fednow_transfers(self) -> AsyncInboundFednowTransfersResourceWithStreamingResponse: + return AsyncInboundFednowTransfersResourceWithStreamingResponse(self._simulations.inbound_fednow_transfers) + @cached_property def check_deposits(self) -> AsyncCheckDepositsResourceWithStreamingResponse: return AsyncCheckDepositsResourceWithStreamingResponse(self._simulations.check_deposits) diff --git a/src/increase/types/__init__.py b/src/increase/types/__init__.py index 7c32ee8e1..c9662e0a1 100644 --- a/src/increase/types/__init__.py +++ b/src/increase/types/__init__.py @@ -28,6 +28,7 @@ from .check_transfer import CheckTransfer as CheckTransfer from .card_iframe_url import CardIframeURL as CardIframeURL from .card_validation import CardValidation as CardValidation +from .fednow_transfer import FednowTransfer as FednowTransfer from .intrafi_balance import IntrafiBalance as IntrafiBalance from .account_transfer import AccountTransfer as AccountTransfer from .card_list_params import CardListParams as CardListParams @@ -78,6 +79,7 @@ from .document_create_params import DocumentCreateParams as DocumentCreateParams from .card_token_capabilities import CardTokenCapabilities as CardTokenCapabilities from .file_link_create_params import FileLinkCreateParams as FileLinkCreateParams +from .inbound_fednow_transfer import InboundFednowTransfer as InboundFednowTransfer from .transaction_list_params import TransactionListParams as TransactionListParams from .ach_transfer_list_params import ACHTransferListParams as ACHTransferListParams from .card_dispute_list_params import CardDisputeListParams as CardDisputeListParams @@ -96,6 +98,7 @@ from .routing_number_list_params import RoutingNumberListParams as RoutingNumberListParams from .card_validation_list_params import CardValidationListParams as CardValidationListParams from .check_deposit_create_params import CheckDepositCreateParams as CheckDepositCreateParams +from .fednow_transfer_list_params import FednowTransferListParams as FednowTransferListParams from .physical_card_create_params import PhysicalCardCreateParams as PhysicalCardCreateParams from .physical_card_update_params import PhysicalCardUpdateParams as PhysicalCardUpdateParams from .real_time_payments_transfer import RealTimePaymentsTransfer as RealTimePaymentsTransfer @@ -112,6 +115,7 @@ from .account_statement_list_params import AccountStatementListParams as AccountStatementListParams from .bookkeeping_entry_list_params import BookkeepingEntryListParams as BookkeepingEntryListParams from .card_validation_create_params import CardValidationCreateParams as CardValidationCreateParams +from .fednow_transfer_create_params import FednowTransferCreateParams as FednowTransferCreateParams from .inbound_mail_item_list_params import InboundMailItemListParams as InboundMailItemListParams from .inbound_wire_drawdown_request import InboundWireDrawdownRequest as InboundWireDrawdownRequest from .intrafi_exclusion_list_params import IntrafiExclusionListParams as IntrafiExclusionListParams @@ -153,6 +157,7 @@ from .bookkeeping_entry_set_create_params import BookkeepingEntrySetCreateParams as BookkeepingEntrySetCreateParams from .inbound_ach_transfer_decline_params import InboundACHTransferDeclineParams as InboundACHTransferDeclineParams from .inbound_check_deposit_return_params import InboundCheckDepositReturnParams as InboundCheckDepositReturnParams +from .inbound_fednow_transfer_list_params import InboundFednowTransferListParams as InboundFednowTransferListParams from .inbound_real_time_payments_transfer import InboundRealTimePaymentsTransfer as InboundRealTimePaymentsTransfer from .physical_card_profile_create_params import PhysicalCardProfileCreateParams as PhysicalCardProfileCreateParams from .supplemental_document_create_params import SupplementalDocumentCreateParams as SupplementalDocumentCreateParams diff --git a/src/increase/types/fednow_transfer.py b/src/increase/types/fednow_transfer.py new file mode 100644 index 000000000..2336f52bf --- /dev/null +++ b/src/increase/types/fednow_transfer.py @@ -0,0 +1,267 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = [ + "FednowTransfer", + "Acknowledgement", + "CreatedBy", + "CreatedByAPIKey", + "CreatedByOAuthApplication", + "CreatedByUser", + "Rejection", + "Submission", +] + + +class Acknowledgement(BaseModel): + acknowledged_at: datetime + """When the transfer was acknowledged.""" + + +class CreatedByAPIKey(BaseModel): + description: Optional[str] = None + """The description set for the API key when it was created.""" + + +class CreatedByOAuthApplication(BaseModel): + name: str + """The name of the OAuth Application.""" + + +class CreatedByUser(BaseModel): + email: str + """The email address of the User.""" + + +class CreatedBy(BaseModel): + api_key: Optional[CreatedByAPIKey] = None + """If present, details about the API key that created the transfer.""" + + category: Literal["api_key", "oauth_application", "user"] + """The type of object that created this transfer. + + - `api_key` - An API key. Details will be under the `api_key` object. + - `oauth_application` - An OAuth application you connected to Increase. Details + will be under the `oauth_application` object. + - `user` - A User in the Increase dashboard. Details will be under the `user` + object. + """ + + oauth_application: Optional[CreatedByOAuthApplication] = None + """If present, details about the OAuth Application that created the transfer.""" + + user: Optional[CreatedByUser] = None + """If present, details about the User that created the transfer.""" + + +class Rejection(BaseModel): + reject_reason_additional_information: Optional[str] = None + """Additional information about the rejection provided by the recipient bank.""" + + reject_reason_code: Literal[ + "account_closed", + "account_blocked", + "invalid_creditor_account_type", + "invalid_creditor_account_number", + "invalid_creditor_financial_institution_identifier", + "end_customer_deceased", + "narrative", + "transaction_forbidden", + "transaction_type_not_supported", + "amount_exceeds_bank_limits", + "invalid_creditor_address", + "invalid_debtor_address", + "timeout", + "processing_error", + "other", + ] + """ + The reason the transfer was rejected as provided by the recipient bank or the + FedNow network. + + - `account_closed` - The destination account is closed. Corresponds to the + FedNow reason code `AC04`. + - `account_blocked` - The destination account is currently blocked from + receiving transactions. Corresponds to the FedNow reason code `AC06`. + - `invalid_creditor_account_type` - The destination account is ineligible to + receive FedNow transfers. Corresponds to the FedNow reason code `AC14`. + - `invalid_creditor_account_number` - The destination account does not exist. + Corresponds to the FedNow reason code `AC03`. + - `invalid_creditor_financial_institution_identifier` - The destination routing + number is invalid. Corresponds to the FedNow reason code `RC04`. + - `end_customer_deceased` - The destination account holder is deceased. + Corresponds to the FedNow reason code `MD07`. + - `narrative` - The reason is provided as narrative information in the + additional information field. Corresponds to the FedNow reason code `NARR`. + - `transaction_forbidden` - FedNow transfers are not allowed to the destination + account. Corresponds to the FedNow reason code `AG01`. + - `transaction_type_not_supported` - FedNow transfers are not enabled for the + destination account. Corresponds to the FedNow reason code `AG03`. + - `amount_exceeds_bank_limits` - The amount is higher than the recipient is + authorized to send or receive. Corresponds to the FedNow reason code `E990`. + - `invalid_creditor_address` - The creditor's address is required, but missing + or invalid. Corresponds to the FedNow reason code `BE04`. + - `invalid_debtor_address` - The debtor's address is required, but missing or + invalid. Corresponds to the FedNow reason code `BE07`. + - `timeout` - There was a timeout processing the transfer. Corresponds to the + FedNow reason code `E997`. + - `processing_error` - The transfer was rejected due to an internal Increase + issue. We have been notified. + - `other` - Some other error or issue has occurred. + """ + + rejected_at: Optional[datetime] = None + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the transfer was rejected. + """ + + +class Submission(BaseModel): + message_identification: str + """The FedNow network identification of the message submitted.""" + + submitted_at: Optional[datetime] = None + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the transfer was submitted to FedNow. + """ + + +class FednowTransfer(BaseModel): + id: str + """The FedNow Transfer's identifier.""" + + account_id: str + """The Account from which the transfer was sent.""" + + account_number: str + """The destination account number.""" + + acknowledgement: Optional[Acknowledgement] = None + """ + If the transfer is acknowledged by the recipient bank, this will contain + supplemental details. + """ + + amount: int + """The transfer amount in USD cents.""" + + created_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the transfer was created. + """ + + created_by: Optional[CreatedBy] = None + """What object created the transfer, either via the API or the dashboard.""" + + creditor_name: str + """The name of the transfer's recipient. + + This is set by the sender when creating the transfer. + """ + + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's + currency. For FedNow transfers this is always equal to `USD`. + + - `CAD` - Canadian Dollar (CAD) + - `CHF` - Swiss Franc (CHF) + - `EUR` - Euro (EUR) + - `GBP` - British Pound (GBP) + - `JPY` - Japanese Yen (JPY) + - `USD` - US Dollar (USD) + """ + + debtor_name: str + """The name of the transfer's sender. + + If not provided, defaults to the name of the account's entity. + """ + + external_account_id: Optional[str] = None + """The identifier of the External Account the transfer was made to, if any.""" + + idempotency_key: Optional[str] = None + """The idempotency key you chose for this object. + + This value is unique across Increase and is used to ensure that a request is + only processed once. Learn more about + [idempotency](https://increase.com/documentation/idempotency-keys). + """ + + pending_transaction_id: Optional[str] = None + """The ID for the pending transaction representing the transfer.""" + + rejection: Optional[Rejection] = None + """ + If the transfer is rejected by FedNow or the destination financial institution, + this will contain supplemental details. + """ + + routing_number: str + """ + The destination American Bankers' Association (ABA) Routing Transit Number + (RTN). + """ + + source_account_number_id: str + """The Account Number the recipient will see as having sent the transfer.""" + + status: Literal[ + "pending_reviewing", + "canceled", + "reviewing_rejected", + "requires_attention", + "pending_approval", + "pending_submitting", + "pending_response", + "complete", + "rejected", + ] + """The lifecycle status of the transfer. + + - `pending_reviewing` - The transfer is pending review by Increase. + - `canceled` - The transfer has been canceled. + - `reviewing_rejected` - The transfer has been rejected by Increase. + - `requires_attention` - The transfer requires attention from an Increase + operator. + - `pending_approval` - The transfer is pending approval. + - `pending_submitting` - The transfer is queued to be submitted to FedNow. + - `pending_response` - The transfer has been submitted and is pending a response + from FedNow. + - `complete` - The transfer has been sent successfully and is complete. + - `rejected` - The transfer was rejected by the network or the recipient's bank. + """ + + submission: Optional[Submission] = None + """ + After the transfer is submitted to FedNow, this will contain supplemental + details. + """ + + transaction_id: Optional[str] = None + """The Transaction funding the transfer once it is complete.""" + + type: Literal["fednow_transfer"] + """A constant representing the object's type. + + For this resource it will always be `fednow_transfer`. + """ + + unique_end_to_end_transaction_reference: str + """ + The Unique End-to-end Transaction Reference + ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr)) + of the transfer. + """ + + unstructured_remittance_information: str + """Unstructured information that will show on the recipient's bank statement.""" diff --git a/src/increase/types/fednow_transfer_create_params.py b/src/increase/types/fednow_transfer_create_params.py new file mode 100644 index 000000000..082a0c9d2 --- /dev/null +++ b/src/increase/types/fednow_transfer_create_params.py @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["FednowTransferCreateParams", "CreditorAddress", "DebtorAddress"] + + +class FednowTransferCreateParams(TypedDict, total=False): + account_id: Required[str] + """The identifier for the account that will send the transfer.""" + + amount: Required[int] + """The amount, in minor units, to send to the creditor.""" + + creditor_name: Required[str] + """The creditor's name.""" + + debtor_name: Required[str] + """The debtor's name.""" + + source_account_number_id: Required[str] + """The Account Number to include in the transfer as the debtor's account number.""" + + unstructured_remittance_information: Required[str] + """Unstructured remittance information to include in the transfer.""" + + account_number: str + """The creditor's account number.""" + + creditor_address: CreditorAddress + """The creditor's address.""" + + debtor_address: DebtorAddress + """The debtor's address.""" + + external_account_id: str + """The ID of an External Account to initiate a transfer to. + + If this parameter is provided, `account_number` and `routing_number` must be + absent. + """ + + require_approval: bool + """Whether the transfer requires explicit approval via the dashboard or API.""" + + routing_number: str + """The creditor's bank account routing number.""" + + +class CreditorAddress(TypedDict, total=False): + city: Required[str] + """The city, district, town, or village of the address.""" + + postal_code: Required[str] + """The postal code component of the address.""" + + state: Required[str] + """The US state component of the address.""" + + line1: str + """The first line of the address. This is usually the street number and street.""" + + +class DebtorAddress(TypedDict, total=False): + city: Required[str] + """The city, district, town, or village of the address.""" + + postal_code: Required[str] + """The postal code component of the address.""" + + state: Required[str] + """The US state component of the address.""" + + line1: str + """The first line of the address. This is usually the street number and street.""" diff --git a/src/increase/types/fednow_transfer_list_params.py b/src/increase/types/fednow_transfer_list_params.py new file mode 100644 index 000000000..d3cd2ae3a --- /dev/null +++ b/src/increase/types/fednow_transfer_list_params.py @@ -0,0 +1,91 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union +from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["FednowTransferListParams", "CreatedAt", "Status"] + + +class FednowTransferListParams(TypedDict, total=False): + account_id: str + """Filter FedNow Transfers to those that originated from the specified Account.""" + + created_at: CreatedAt + + cursor: str + """Return the page of entries after this one.""" + + external_account_id: str + """Filter FedNow Transfers to those made to the specified External Account.""" + + idempotency_key: str + """ + Filter records to the one with the specified `idempotency_key` you chose for + that object. This value is unique across Increase and is used to ensure that a + request is only processed once. Learn more about + [idempotency](https://increase.com/documentation/idempotency-keys). + """ + + limit: int + """Limit the size of the list that is returned. + + The default (and maximum) is 100 objects. + """ + + status: Status + + +class CreatedAt(TypedDict, total=False): + after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + timestamp. + """ + + before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + timestamp. + """ + + on_or_after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results on or after this + [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + """ + + on_or_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results on or before this + [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + """ + + +_StatusReservedKeywords = TypedDict( + "_StatusReservedKeywords", + { + "in": List[ + Literal[ + "pending_reviewing", + "canceled", + "reviewing_rejected", + "requires_attention", + "pending_approval", + "pending_submitting", + "pending_response", + "complete", + "rejected", + ] + ], + }, + total=False, +) + + +class Status(_StatusReservedKeywords, total=False): + pass diff --git a/src/increase/types/inbound_fednow_transfer.py b/src/increase/types/inbound_fednow_transfer.py new file mode 100644 index 000000000..78c915104 --- /dev/null +++ b/src/increase/types/inbound_fednow_transfer.py @@ -0,0 +1,115 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["InboundFednowTransfer", "Confirmation", "Decline"] + + +class Confirmation(BaseModel): + transfer_id: str + """The identifier of the FedNow Transfer that led to this Transaction.""" + + +class Decline(BaseModel): + reason: Literal[ + "account_number_canceled", + "account_number_disabled", + "account_restricted", + "group_locked", + "entity_not_active", + "fednow_not_enabled", + ] + """Why the transfer was declined. + + - `account_number_canceled` - The account number is canceled. + - `account_number_disabled` - The account number is disabled. + - `account_restricted` - Your account is restricted. + - `group_locked` - Your account is inactive. + - `entity_not_active` - The account's entity is not active. + - `fednow_not_enabled` - Your account is not enabled to receive FedNow + transfers. + """ + + transfer_id: str + """The identifier of the FedNow Transfer that led to this declined transaction.""" + + +class InboundFednowTransfer(BaseModel): + id: str + """The inbound FedNow transfer's identifier.""" + + account_id: str + """The Account to which the transfer was sent.""" + + account_number_id: str + """The identifier of the Account Number to which this transfer was sent.""" + + amount: int + """The amount in USD cents.""" + + confirmation: Optional[Confirmation] = None + """If your transfer is confirmed, this will contain details of the confirmation.""" + + created_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the transfer was created. + """ + + creditor_name: str + """The name the sender of the transfer specified as the recipient of the transfer.""" + + currency: Literal["CAD", "CHF", "EUR", "GBP", "JPY", "USD"] + """ + The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's + currency. This will always be "USD" for a FedNow transfer. + + - `CAD` - Canadian Dollar (CAD) + - `CHF` - Swiss Franc (CHF) + - `EUR` - Euro (EUR) + - `GBP` - British Pound (GBP) + - `JPY` - Japanese Yen (JPY) + - `USD` - US Dollar (USD) + """ + + debtor_account_number: str + """The account number of the account that sent the transfer.""" + + debtor_name: str + """The name provided by the sender of the transfer.""" + + debtor_routing_number: str + """The routing number of the account that sent the transfer.""" + + decline: Optional[Decline] = None + """If your transfer is declined, this will contain details of the decline.""" + + status: Literal["pending_confirming", "timed_out", "confirmed", "declined", "requires_attention"] + """The lifecycle status of the transfer. + + - `pending_confirming` - The transfer is pending confirmation. + - `timed_out` - The transfer was not responded to in time. + - `confirmed` - The transfer has been received successfully and is confirmed. + - `declined` - The transfer has been declined. + - `requires_attention` - The transfer requires attention from an Increase + operator. + """ + + transaction_id: Optional[str] = None + """ + The identifier of the Transaction object created when the transfer was + confirmed. + """ + + type: Literal["inbound_fednow_transfer"] + """A constant representing the object's type. + + For this resource it will always be `inbound_fednow_transfer`. + """ + + unstructured_remittance_information: Optional[str] = None + """Additional information included with the transfer.""" diff --git a/src/increase/types/inbound_fednow_transfer_list_params.py b/src/increase/types/inbound_fednow_transfer_list_params.py new file mode 100644 index 000000000..130016d11 --- /dev/null +++ b/src/increase/types/inbound_fednow_transfer_list_params.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["InboundFednowTransferListParams", "CreatedAt"] + + +class InboundFednowTransferListParams(TypedDict, total=False): + account_id: str + """Filter Inbound FedNow Transfers to those belonging to the specified Account.""" + + account_number_id: str + """ + Filter Inbound FedNow Transfers to ones belonging to the specified Account + Number. + """ + + created_at: CreatedAt + + cursor: str + """Return the page of entries after this one.""" + + limit: int + """Limit the size of the list that is returned. + + The default (and maximum) is 100 objects. + """ + + +class CreatedAt(TypedDict, total=False): + after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + timestamp. + """ + + before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + timestamp. + """ + + on_or_after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results on or after this + [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + """ + + on_or_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """ + Return results on or before this + [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + """ diff --git a/src/increase/types/simulations/__init__.py b/src/increase/types/simulations/__init__.py index 083108fa5..1b04cffc6 100644 --- a/src/increase/types/simulations/__init__.py +++ b/src/increase/types/simulations/__init__.py @@ -22,6 +22,9 @@ from .inbound_check_deposit_create_params import InboundCheckDepositCreateParams as InboundCheckDepositCreateParams from .inbound_wire_transfer_create_params import InboundWireTransferCreateParams as InboundWireTransferCreateParams from .card_fuel_confirmation_create_params import CardFuelConfirmationCreateParams as CardFuelConfirmationCreateParams +from .inbound_fednow_transfer_create_params import ( + InboundFednowTransferCreateParams as InboundFednowTransferCreateParams, +) from .physical_card_advance_shipment_params import ( PhysicalCardAdvanceShipmentParams as PhysicalCardAdvanceShipmentParams, ) diff --git a/src/increase/types/simulations/inbound_fednow_transfer_create_params.py b/src/increase/types/simulations/inbound_fednow_transfer_create_params.py new file mode 100644 index 000000000..19bd4878d --- /dev/null +++ b/src/increase/types/simulations/inbound_fednow_transfer_create_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["InboundFednowTransferCreateParams"] + + +class InboundFednowTransferCreateParams(TypedDict, total=False): + account_number_id: Required[str] + """The identifier of the Account Number the inbound FedNow Transfer is for.""" + + amount: Required[int] + """The transfer amount in USD cents. Must be positive.""" + + debtor_account_number: str + """The account number of the account that sent the transfer.""" + + debtor_name: str + """The name provided by the sender of the transfer.""" + + debtor_routing_number: str + """The routing number of the account that sent the transfer.""" + + unstructured_remittance_information: str + """Additional information included with the transfer.""" diff --git a/tests/api_resources/simulations/test_inbound_fednow_transfers.py b/tests/api_resources/simulations/test_inbound_fednow_transfers.py new file mode 100644 index 000000000..9de1d1f0b --- /dev/null +++ b/tests/api_resources/simulations/test_inbound_fednow_transfers.py @@ -0,0 +1,116 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from increase import Increase, AsyncIncrease +from tests.utils import assert_matches_type +from increase.types import InboundFednowTransfer + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestInboundFednowTransfers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Increase) -> None: + inbound_fednow_transfer = client.simulations.inbound_fednow_transfers.create( + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, + ) + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Increase) -> None: + inbound_fednow_transfer = client.simulations.inbound_fednow_transfers.create( + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, + debtor_account_number="x", + debtor_name="x", + debtor_routing_number="xxxxxxxxx", + unstructured_remittance_information="x", + ) + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Increase) -> None: + response = client.simulations.inbound_fednow_transfers.with_raw_response.create( + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + inbound_fednow_transfer = response.parse() + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Increase) -> None: + with client.simulations.inbound_fednow_transfers.with_streaming_response.create( + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + inbound_fednow_transfer = response.parse() + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncInboundFednowTransfers: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncIncrease) -> None: + inbound_fednow_transfer = await async_client.simulations.inbound_fednow_transfers.create( + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, + ) + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncIncrease) -> None: + inbound_fednow_transfer = await async_client.simulations.inbound_fednow_transfers.create( + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, + debtor_account_number="x", + debtor_name="x", + debtor_routing_number="xxxxxxxxx", + unstructured_remittance_information="x", + ) + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncIncrease) -> None: + response = await async_client.simulations.inbound_fednow_transfers.with_raw_response.create( + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + inbound_fednow_transfer = await response.parse() + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncIncrease) -> None: + async with async_client.simulations.inbound_fednow_transfers.with_streaming_response.create( + account_number_id="account_number_v18nkfqm6afpsrvy82b2", + amount=1000, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + inbound_fednow_transfer = await response.parse() + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_fednow_transfers.py b/tests/api_resources/test_fednow_transfers.py new file mode 100644 index 000000000..c13a3ee40 --- /dev/null +++ b/tests/api_resources/test_fednow_transfers.py @@ -0,0 +1,488 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from increase import Increase, AsyncIncrease +from tests.utils import assert_matches_type +from increase.types import FednowTransfer +from increase._utils import parse_datetime +from increase.pagination import SyncPage, AsyncPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestFednowTransfers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Increase) -> None: + fednow_transfer = client.fednow_transfers.create( + account_id="account_in71c4amph0vgo2qllky", + amount=100, + creditor_name="Ian Crease", + debtor_name="National Phonograph Company", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + unstructured_remittance_information="Invoice 29582", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Increase) -> None: + fednow_transfer = client.fednow_transfers.create( + account_id="account_in71c4amph0vgo2qllky", + amount=100, + creditor_name="Ian Crease", + debtor_name="National Phonograph Company", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + unstructured_remittance_information="Invoice 29582", + account_number="987654321", + creditor_address={ + "city": "New York", + "postal_code": "10045", + "state": "NY", + "line1": "33 Liberty Street", + }, + debtor_address={ + "city": "x", + "postal_code": "x", + "state": "x", + "line1": "x", + }, + external_account_id="external_account_id", + require_approval=True, + routing_number="101050001", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Increase) -> None: + response = client.fednow_transfers.with_raw_response.create( + account_id="account_in71c4amph0vgo2qllky", + amount=100, + creditor_name="Ian Crease", + debtor_name="National Phonograph Company", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + unstructured_remittance_information="Invoice 29582", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Increase) -> None: + with client.fednow_transfers.with_streaming_response.create( + account_id="account_in71c4amph0vgo2qllky", + amount=100, + creditor_name="Ian Crease", + debtor_name="National Phonograph Company", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + unstructured_remittance_information="Invoice 29582", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Increase) -> None: + fednow_transfer = client.fednow_transfers.retrieve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Increase) -> None: + response = client.fednow_transfers.with_raw_response.retrieve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Increase) -> None: + with client.fednow_transfers.with_streaming_response.retrieve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Increase) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `fednow_transfer_id` but received ''"): + client.fednow_transfers.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Increase) -> None: + fednow_transfer = client.fednow_transfers.list() + assert_matches_type(SyncPage[FednowTransfer], fednow_transfer, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Increase) -> None: + fednow_transfer = client.fednow_transfers.list( + account_id="account_id", + created_at={ + "after": parse_datetime("2019-12-27T18:11:19.117Z"), + "before": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_after": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_before": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + cursor="cursor", + external_account_id="external_account_id", + idempotency_key="x", + limit=1, + status={"in": ["pending_reviewing"]}, + ) + assert_matches_type(SyncPage[FednowTransfer], fednow_transfer, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Increase) -> None: + response = client.fednow_transfers.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = response.parse() + assert_matches_type(SyncPage[FednowTransfer], fednow_transfer, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Increase) -> None: + with client.fednow_transfers.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = response.parse() + assert_matches_type(SyncPage[FednowTransfer], fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_approve(self, client: Increase) -> None: + fednow_transfer = client.fednow_transfers.approve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + def test_raw_response_approve(self, client: Increase) -> None: + response = client.fednow_transfers.with_raw_response.approve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + def test_streaming_response_approve(self, client: Increase) -> None: + with client.fednow_transfers.with_streaming_response.approve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_approve(self, client: Increase) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `fednow_transfer_id` but received ''"): + client.fednow_transfers.with_raw_response.approve( + "", + ) + + @parametrize + def test_method_cancel(self, client: Increase) -> None: + fednow_transfer = client.fednow_transfers.cancel( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + def test_raw_response_cancel(self, client: Increase) -> None: + response = client.fednow_transfers.with_raw_response.cancel( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + def test_streaming_response_cancel(self, client: Increase) -> None: + with client.fednow_transfers.with_streaming_response.cancel( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_cancel(self, client: Increase) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `fednow_transfer_id` but received ''"): + client.fednow_transfers.with_raw_response.cancel( + "", + ) + + +class TestAsyncFednowTransfers: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncIncrease) -> None: + fednow_transfer = await async_client.fednow_transfers.create( + account_id="account_in71c4amph0vgo2qllky", + amount=100, + creditor_name="Ian Crease", + debtor_name="National Phonograph Company", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + unstructured_remittance_information="Invoice 29582", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncIncrease) -> None: + fednow_transfer = await async_client.fednow_transfers.create( + account_id="account_in71c4amph0vgo2qllky", + amount=100, + creditor_name="Ian Crease", + debtor_name="National Phonograph Company", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + unstructured_remittance_information="Invoice 29582", + account_number="987654321", + creditor_address={ + "city": "New York", + "postal_code": "10045", + "state": "NY", + "line1": "33 Liberty Street", + }, + debtor_address={ + "city": "x", + "postal_code": "x", + "state": "x", + "line1": "x", + }, + external_account_id="external_account_id", + require_approval=True, + routing_number="101050001", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncIncrease) -> None: + response = await async_client.fednow_transfers.with_raw_response.create( + account_id="account_in71c4amph0vgo2qllky", + amount=100, + creditor_name="Ian Crease", + debtor_name="National Phonograph Company", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + unstructured_remittance_information="Invoice 29582", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = await response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncIncrease) -> None: + async with async_client.fednow_transfers.with_streaming_response.create( + account_id="account_in71c4amph0vgo2qllky", + amount=100, + creditor_name="Ian Crease", + debtor_name="National Phonograph Company", + source_account_number_id="account_number_v18nkfqm6afpsrvy82b2", + unstructured_remittance_information="Invoice 29582", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = await response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncIncrease) -> None: + fednow_transfer = await async_client.fednow_transfers.retrieve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncIncrease) -> None: + response = await async_client.fednow_transfers.with_raw_response.retrieve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = await response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncIncrease) -> None: + async with async_client.fednow_transfers.with_streaming_response.retrieve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = await response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncIncrease) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `fednow_transfer_id` but received ''"): + await async_client.fednow_transfers.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncIncrease) -> None: + fednow_transfer = await async_client.fednow_transfers.list() + assert_matches_type(AsyncPage[FednowTransfer], fednow_transfer, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncIncrease) -> None: + fednow_transfer = await async_client.fednow_transfers.list( + account_id="account_id", + created_at={ + "after": parse_datetime("2019-12-27T18:11:19.117Z"), + "before": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_after": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_before": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + cursor="cursor", + external_account_id="external_account_id", + idempotency_key="x", + limit=1, + status={"in": ["pending_reviewing"]}, + ) + assert_matches_type(AsyncPage[FednowTransfer], fednow_transfer, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncIncrease) -> None: + response = await async_client.fednow_transfers.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = await response.parse() + assert_matches_type(AsyncPage[FednowTransfer], fednow_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncIncrease) -> None: + async with async_client.fednow_transfers.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = await response.parse() + assert_matches_type(AsyncPage[FednowTransfer], fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_approve(self, async_client: AsyncIncrease) -> None: + fednow_transfer = await async_client.fednow_transfers.approve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + async def test_raw_response_approve(self, async_client: AsyncIncrease) -> None: + response = await async_client.fednow_transfers.with_raw_response.approve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = await response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_approve(self, async_client: AsyncIncrease) -> None: + async with async_client.fednow_transfers.with_streaming_response.approve( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = await response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_approve(self, async_client: AsyncIncrease) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `fednow_transfer_id` but received ''"): + await async_client.fednow_transfers.with_raw_response.approve( + "", + ) + + @parametrize + async def test_method_cancel(self, async_client: AsyncIncrease) -> None: + fednow_transfer = await async_client.fednow_transfers.cancel( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + async def test_raw_response_cancel(self, async_client: AsyncIncrease) -> None: + response = await async_client.fednow_transfers.with_raw_response.cancel( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + fednow_transfer = await response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_cancel(self, async_client: AsyncIncrease) -> None: + async with async_client.fednow_transfers.with_streaming_response.cancel( + "fednow_transfer_4i0mptrdu1mueg1196bg", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + fednow_transfer = await response.parse() + assert_matches_type(FednowTransfer, fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_cancel(self, async_client: AsyncIncrease) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `fednow_transfer_id` but received ''"): + await async_client.fednow_transfers.with_raw_response.cancel( + "", + ) diff --git a/tests/api_resources/test_inbound_fednow_transfers.py b/tests/api_resources/test_inbound_fednow_transfers.py new file mode 100644 index 000000000..7ea08107c --- /dev/null +++ b/tests/api_resources/test_inbound_fednow_transfers.py @@ -0,0 +1,188 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from increase import Increase, AsyncIncrease +from tests.utils import assert_matches_type +from increase.types import InboundFednowTransfer +from increase._utils import parse_datetime +from increase.pagination import SyncPage, AsyncPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestInboundFednowTransfers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Increase) -> None: + inbound_fednow_transfer = client.inbound_fednow_transfers.retrieve( + "inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20", + ) + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Increase) -> None: + response = client.inbound_fednow_transfers.with_raw_response.retrieve( + "inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + inbound_fednow_transfer = response.parse() + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Increase) -> None: + with client.inbound_fednow_transfers.with_streaming_response.retrieve( + "inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + inbound_fednow_transfer = response.parse() + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Increase) -> None: + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `inbound_fednow_transfer_id` but received ''" + ): + client.inbound_fednow_transfers.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Increase) -> None: + inbound_fednow_transfer = client.inbound_fednow_transfers.list() + assert_matches_type(SyncPage[InboundFednowTransfer], inbound_fednow_transfer, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Increase) -> None: + inbound_fednow_transfer = client.inbound_fednow_transfers.list( + account_id="account_id", + account_number_id="account_number_id", + created_at={ + "after": parse_datetime("2019-12-27T18:11:19.117Z"), + "before": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_after": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_before": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + cursor="cursor", + limit=1, + ) + assert_matches_type(SyncPage[InboundFednowTransfer], inbound_fednow_transfer, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Increase) -> None: + response = client.inbound_fednow_transfers.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + inbound_fednow_transfer = response.parse() + assert_matches_type(SyncPage[InboundFednowTransfer], inbound_fednow_transfer, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Increase) -> None: + with client.inbound_fednow_transfers.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + inbound_fednow_transfer = response.parse() + assert_matches_type(SyncPage[InboundFednowTransfer], inbound_fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncInboundFednowTransfers: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncIncrease) -> None: + inbound_fednow_transfer = await async_client.inbound_fednow_transfers.retrieve( + "inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20", + ) + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncIncrease) -> None: + response = await async_client.inbound_fednow_transfers.with_raw_response.retrieve( + "inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + inbound_fednow_transfer = await response.parse() + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncIncrease) -> None: + async with async_client.inbound_fednow_transfers.with_streaming_response.retrieve( + "inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + inbound_fednow_transfer = await response.parse() + assert_matches_type(InboundFednowTransfer, inbound_fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncIncrease) -> None: + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `inbound_fednow_transfer_id` but received ''" + ): + await async_client.inbound_fednow_transfers.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncIncrease) -> None: + inbound_fednow_transfer = await async_client.inbound_fednow_transfers.list() + assert_matches_type(AsyncPage[InboundFednowTransfer], inbound_fednow_transfer, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncIncrease) -> None: + inbound_fednow_transfer = await async_client.inbound_fednow_transfers.list( + account_id="account_id", + account_number_id="account_number_id", + created_at={ + "after": parse_datetime("2019-12-27T18:11:19.117Z"), + "before": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_after": parse_datetime("2019-12-27T18:11:19.117Z"), + "on_or_before": parse_datetime("2019-12-27T18:11:19.117Z"), + }, + cursor="cursor", + limit=1, + ) + assert_matches_type(AsyncPage[InboundFednowTransfer], inbound_fednow_transfer, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncIncrease) -> None: + response = await async_client.inbound_fednow_transfers.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + inbound_fednow_transfer = await response.parse() + assert_matches_type(AsyncPage[InboundFednowTransfer], inbound_fednow_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncIncrease) -> None: + async with async_client.inbound_fednow_transfers.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + inbound_fednow_transfer = await response.parse() + assert_matches_type(AsyncPage[InboundFednowTransfer], inbound_fednow_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True