diff --git a/.stats.yml b/.stats.yml index f9d1086b6..2aae27b8b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 140 +configured_endpoints: 145 diff --git a/api.md b/api.md index d8f383d93..e3294a5ad 100644 --- a/api.md +++ b/api.md @@ -689,3 +689,24 @@ Methods: - client.simulations.real_time_payments_transfers.complete(real_time_payments_transfer_id, \*\*params) -> RealTimePaymentsTransfer - client.simulations.real_time_payments_transfers.create_inbound(\*\*params) -> InboundRealTimePaymentsTransferSimulationResult + +## PhysicalCards + +Methods: + +- client.simulations.physical_cards.shipment_advance(physical_card_id, \*\*params) -> PhysicalCard + +# PhysicalCards + +Types: + +```python +from increase.types import PhysicalCard +``` + +Methods: + +- client.physical_cards.create(\*\*params) -> PhysicalCard +- client.physical_cards.retrieve(physical_card_id) -> PhysicalCard +- client.physical_cards.update(physical_card_id, \*\*params) -> PhysicalCard +- client.physical_cards.list(\*\*params) -> SyncPage[PhysicalCard] diff --git a/src/increase/_client.py b/src/increase/_client.py index 9dd394c8e..2da5cd821 100644 --- a/src/increase/_client.py +++ b/src/increase/_client.py @@ -90,6 +90,7 @@ class Increase(SyncAPIClient): routing_numbers: resources.RoutingNumbers account_statements: resources.AccountStatements simulations: resources.Simulations + physical_cards: resources.PhysicalCards # client options api_key: str @@ -194,6 +195,7 @@ def __init__( self.routing_numbers = resources.RoutingNumbers(self) self.account_statements = resources.AccountStatements(self) self.simulations = resources.Simulations(self) + self.physical_cards = resources.PhysicalCards(self) @property def qs(self) -> Querystring: @@ -386,6 +388,7 @@ class AsyncIncrease(AsyncAPIClient): routing_numbers: resources.AsyncRoutingNumbers account_statements: resources.AsyncAccountStatements simulations: resources.AsyncSimulations + physical_cards: resources.AsyncPhysicalCards # client options api_key: str @@ -490,6 +493,7 @@ def __init__( self.routing_numbers = resources.AsyncRoutingNumbers(self) self.account_statements = resources.AsyncAccountStatements(self) self.simulations = resources.AsyncSimulations(self) + self.physical_cards = resources.AsyncPhysicalCards(self) @property def qs(self) -> Querystring: diff --git a/src/increase/resources/__init__.py b/src/increase/resources/__init__.py index 3f6ee190a..1a6fb0af0 100644 --- a/src/increase/resources/__init__.py +++ b/src/increase/resources/__init__.py @@ -15,6 +15,7 @@ from .card_disputes import CardDisputes, AsyncCardDisputes from .card_profiles import CardProfiles, AsyncCardProfiles from .check_deposits import CheckDeposits, AsyncCheckDeposits +from .physical_cards import PhysicalCards, AsyncPhysicalCards from .wire_transfers import WireTransfers, AsyncWireTransfers from .account_numbers import AccountNumbers, AsyncAccountNumbers from .balance_lookups import BalanceLookups, AsyncBalanceLookups @@ -125,4 +126,6 @@ "AsyncAccountStatements", "Simulations", "AsyncSimulations", + "PhysicalCards", + "AsyncPhysicalCards", ] diff --git a/src/increase/resources/event_subscriptions.py b/src/increase/resources/event_subscriptions.py index a1c4ba1e5..2109e2bd0 100644 --- a/src/increase/resources/event_subscriptions.py +++ b/src/increase/resources/event_subscriptions.py @@ -54,6 +54,8 @@ def create( "document.created", "entity.created", "entity.updated", + "export.created", + "export.updated", "external_account.created", "file.created", "group.updated", @@ -63,10 +65,16 @@ def create( "inbound_ach_transfer_return.created", "inbound_ach_transfer_return.updated", "inbound_wire_drawdown_request.created", + "intrafi_account_enrollment.created", + "intrafi_account_enrollment.updated", + "intrafi_exclusion.created", + "intrafi_exclusion.updated", "oauth_connection.created", "oauth_connection.deactivated", "pending_transaction.created", "pending_transaction.updated", + "physical_card.created", + "physical_card.updated", "real_time_decision.card_authorization_requested", "real_time_decision.digital_wallet_token_requested", "real_time_decision.digital_wallet_authentication_requested", @@ -133,6 +141,8 @@ def create( - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `export.created` - Occurs whenever an Export is created. + - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. @@ -148,6 +158,12 @@ def create( Transfer Return is updated. - `inbound_wire_drawdown_request.created` - Occurs whenever an Inbound Wire Drawdown Request is created. + - `intrafi_account_enrollment.created` - Occurs whenever an IntraFi Account + Enrollment is created. + - `intrafi_account_enrollment.updated` - Occurs whenever an IntraFi Account + Enrollment is updated. + - `intrafi_exclusion.created` - Occurs whenever an IntraFi Exclusion is created. + - `intrafi_exclusion.updated` - Occurs whenever an IntraFi Exclusion is updated. - `oauth_connection.created` - Occurs whenever an OAuth Connection is created. - `oauth_connection.deactivated` - Occurs whenever an OAuth Connection is deactivated. @@ -155,6 +171,8 @@ def create( created. - `pending_transaction.updated` - Occurs whenever a Pending Transaction is updated. + - `physical_card.created` - Occurs whenever a Physical Card is created. + - `physical_card.updated` - Occurs whenever a Physical Card is updated. - `real_time_decision.card_authorization_requested` - Occurs whenever a Real-Time Decision is created in response to a card authorization. - `real_time_decision.digital_wallet_token_requested` - Occurs whenever a @@ -379,6 +397,8 @@ async def create( "document.created", "entity.created", "entity.updated", + "export.created", + "export.updated", "external_account.created", "file.created", "group.updated", @@ -388,10 +408,16 @@ async def create( "inbound_ach_transfer_return.created", "inbound_ach_transfer_return.updated", "inbound_wire_drawdown_request.created", + "intrafi_account_enrollment.created", + "intrafi_account_enrollment.updated", + "intrafi_exclusion.created", + "intrafi_exclusion.updated", "oauth_connection.created", "oauth_connection.deactivated", "pending_transaction.created", "pending_transaction.updated", + "physical_card.created", + "physical_card.updated", "real_time_decision.card_authorization_requested", "real_time_decision.digital_wallet_token_requested", "real_time_decision.digital_wallet_authentication_requested", @@ -458,6 +484,8 @@ async def create( - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `export.created` - Occurs whenever an Export is created. + - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. @@ -473,6 +501,12 @@ async def create( Transfer Return is updated. - `inbound_wire_drawdown_request.created` - Occurs whenever an Inbound Wire Drawdown Request is created. + - `intrafi_account_enrollment.created` - Occurs whenever an IntraFi Account + Enrollment is created. + - `intrafi_account_enrollment.updated` - Occurs whenever an IntraFi Account + Enrollment is updated. + - `intrafi_exclusion.created` - Occurs whenever an IntraFi Exclusion is created. + - `intrafi_exclusion.updated` - Occurs whenever an IntraFi Exclusion is updated. - `oauth_connection.created` - Occurs whenever an OAuth Connection is created. - `oauth_connection.deactivated` - Occurs whenever an OAuth Connection is deactivated. @@ -480,6 +514,8 @@ async def create( created. - `pending_transaction.updated` - Occurs whenever a Pending Transaction is updated. + - `physical_card.created` - Occurs whenever a Physical Card is created. + - `physical_card.updated` - Occurs whenever a Physical Card is updated. - `real_time_decision.card_authorization_requested` - Occurs whenever a Real-Time Decision is created in response to a card authorization. - `real_time_decision.digital_wallet_token_requested` - Occurs whenever a diff --git a/src/increase/resources/physical_cards.py b/src/increase/resources/physical_cards.py new file mode 100644 index 000000000..fa58724fa --- /dev/null +++ b/src/increase/resources/physical_cards.py @@ -0,0 +1,409 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing_extensions import Literal + +from ..types import ( + PhysicalCard, + physical_card_list_params, + physical_card_create_params, + physical_card_update_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import maybe_transform +from .._resource import SyncAPIResource, AsyncAPIResource +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options + +__all__ = ["PhysicalCards", "AsyncPhysicalCards"] + + +class PhysicalCards(SyncAPIResource): + def create( + self, + *, + card_id: str, + card_profile_id: str, + cardholder: physical_card_create_params.Cardholder, + shipment: physical_card_create_params.Shipment, + # 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 | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> PhysicalCard: + """ + Create a Physical Card + + Args: + card_id: The underlying card representing this physical card. + + card_profile_id: The card profile to use for this physical card. + + cardholder: Details about the cardholder, as it will appear on the physical card. + + shipment: The details used to ship this physical card. + + 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( + "/physical_cards", + body=maybe_transform( + { + "card_id": card_id, + "card_profile_id": card_profile_id, + "cardholder": cardholder, + "shipment": shipment, + }, + physical_card_create_params.PhysicalCardCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=PhysicalCard, + ) + + def retrieve( + self, + physical_card_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 | None | NotGiven = NOT_GIVEN, + ) -> PhysicalCard: + """ + Retrieve a Physical Card + + Args: + physical_card_id: The identifier of the Physical Card. + + 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( + f"/physical_cards/{physical_card_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PhysicalCard, + ) + + def update( + self, + physical_card_id: str, + *, + status: Literal["active", "disabled", "canceled"], + # 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 | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> PhysicalCard: + """ + Update a Physical Card + + Args: + physical_card_id: The Physical Card identifier. + + status: The status to update the Physical Card to. + + - `active` - The physical card is active. + - `disabled` - The physical card is temporarily disabled. + - `canceled` - The physical card is permanently canceled. + + 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._patch( + f"/physical_cards/{physical_card_id}", + body=maybe_transform({"status": status}, physical_card_update_params.PhysicalCardUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=PhysicalCard, + ) + + def list( + self, + *, + card_id: str | NotGiven = NOT_GIVEN, + created_at: physical_card_list_params.CreatedAt | NotGiven = NOT_GIVEN, + cursor: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + # 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 | None | NotGiven = NOT_GIVEN, + ) -> SyncPage[PhysicalCard]: + """ + List Physical Cards + + Args: + card_id: Filter Physical Cards to ones belonging to the specified Card. + + 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( + "/physical_cards", + page=SyncPage[PhysicalCard], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "card_id": card_id, + "created_at": created_at, + "cursor": cursor, + "limit": limit, + }, + physical_card_list_params.PhysicalCardListParams, + ), + ), + model=PhysicalCard, + ) + + +class AsyncPhysicalCards(AsyncAPIResource): + async def create( + self, + *, + card_id: str, + card_profile_id: str, + cardholder: physical_card_create_params.Cardholder, + shipment: physical_card_create_params.Shipment, + # 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 | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> PhysicalCard: + """ + Create a Physical Card + + Args: + card_id: The underlying card representing this physical card. + + card_profile_id: The card profile to use for this physical card. + + cardholder: Details about the cardholder, as it will appear on the physical card. + + shipment: The details used to ship this physical card. + + 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( + "/physical_cards", + body=maybe_transform( + { + "card_id": card_id, + "card_profile_id": card_profile_id, + "cardholder": cardholder, + "shipment": shipment, + }, + physical_card_create_params.PhysicalCardCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=PhysicalCard, + ) + + async def retrieve( + self, + physical_card_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 | None | NotGiven = NOT_GIVEN, + ) -> PhysicalCard: + """ + Retrieve a Physical Card + + Args: + physical_card_id: The identifier of the Physical Card. + + 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 await self._get( + f"/physical_cards/{physical_card_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PhysicalCard, + ) + + async def update( + self, + physical_card_id: str, + *, + status: Literal["active", "disabled", "canceled"], + # 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 | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> PhysicalCard: + """ + Update a Physical Card + + Args: + physical_card_id: The Physical Card identifier. + + status: The status to update the Physical Card to. + + - `active` - The physical card is active. + - `disabled` - The physical card is temporarily disabled. + - `canceled` - The physical card is permanently canceled. + + 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._patch( + f"/physical_cards/{physical_card_id}", + body=maybe_transform({"status": status}, physical_card_update_params.PhysicalCardUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=PhysicalCard, + ) + + def list( + self, + *, + card_id: str | NotGiven = NOT_GIVEN, + created_at: physical_card_list_params.CreatedAt | NotGiven = NOT_GIVEN, + cursor: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + # 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 | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[PhysicalCard, AsyncPage[PhysicalCard]]: + """ + List Physical Cards + + Args: + card_id: Filter Physical Cards to ones belonging to the specified Card. + + 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( + "/physical_cards", + page=AsyncPage[PhysicalCard], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "card_id": card_id, + "created_at": created_at, + "cursor": cursor, + "limit": limit, + }, + physical_card_list_params.PhysicalCardListParams, + ), + ), + model=PhysicalCard, + ) diff --git a/src/increase/resources/simulations/__init__.py b/src/increase/resources/simulations/__init__.py index ead6c7cb4..c288a2d2b 100644 --- a/src/increase/resources/simulations/__init__.py +++ b/src/increase/resources/simulations/__init__.py @@ -9,6 +9,7 @@ from .card_disputes import CardDisputes, AsyncCardDisputes from .card_profiles import CardProfiles, AsyncCardProfiles from .check_deposits import CheckDeposits, AsyncCheckDeposits +from .physical_cards import PhysicalCards, AsyncPhysicalCards from .wire_transfers import WireTransfers, AsyncWireTransfers from .check_transfers import CheckTransfers, AsyncCheckTransfers from .account_transfers import AccountTransfers, AsyncAccountTransfers @@ -63,6 +64,8 @@ "AsyncCards", "RealTimePaymentsTransfers", "AsyncRealTimePaymentsTransfers", + "PhysicalCards", + "AsyncPhysicalCards", "Simulations", "AsyncSimulations", ] diff --git a/src/increase/resources/simulations/physical_cards.py b/src/increase/resources/simulations/physical_cards.py new file mode 100644 index 000000000..64e1dedb7 --- /dev/null +++ b/src/increase/resources/simulations/physical_cards.py @@ -0,0 +1,140 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing_extensions import Literal + +from ...types import PhysicalCard +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import maybe_transform +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._base_client import make_request_options +from ...types.simulations import physical_card_shipment_advance_params + +__all__ = ["PhysicalCards", "AsyncPhysicalCards"] + + +class PhysicalCards(SyncAPIResource): + def shipment_advance( + self, + physical_card_id: str, + *, + shipment_status: Literal["pending", "canceled", "submitted", "acknowledged", "rejected", "shipped", "returned"], + # 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 | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> PhysicalCard: + """ + This endpoint allows you to simulate advancing the shipment status of a Physical + Card, to simulate e.g., that a physical card was attempted shipped but then + failed delivery. + + Args: + physical_card_id: The Physical Card you would like to action. + + shipment_status: The shipment status to move the Physical Card to. + + - `pending` - The physical card has not yet been shipped. + - `canceled` - The physical card shipment was canceled prior to submission. + - `submitted` - The physical card shipment has been submitted to the card + fulfillment provider. + - `acknowledged` - The physical card shipment has been acknowledged by the card + fulfillment provider and will be processed in their next batch. + - `rejected` - The physical card shipment was rejected by the card printer due + to an error. + - `shipped` - The physical card has been shipped. + - `returned` - The physical card shipment was returned to the sender and + destroyed by the production facility. + + 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( + f"/simulations/physical_cards/{physical_card_id}/shipment_advance", + body=maybe_transform( + {"shipment_status": shipment_status}, + physical_card_shipment_advance_params.PhysicalCardShipmentAdvanceParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=PhysicalCard, + ) + + +class AsyncPhysicalCards(AsyncAPIResource): + async def shipment_advance( + self, + physical_card_id: str, + *, + shipment_status: Literal["pending", "canceled", "submitted", "acknowledged", "rejected", "shipped", "returned"], + # 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 | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> PhysicalCard: + """ + This endpoint allows you to simulate advancing the shipment status of a Physical + Card, to simulate e.g., that a physical card was attempted shipped but then + failed delivery. + + Args: + physical_card_id: The Physical Card you would like to action. + + shipment_status: The shipment status to move the Physical Card to. + + - `pending` - The physical card has not yet been shipped. + - `canceled` - The physical card shipment was canceled prior to submission. + - `submitted` - The physical card shipment has been submitted to the card + fulfillment provider. + - `acknowledged` - The physical card shipment has been acknowledged by the card + fulfillment provider and will be processed in their next batch. + - `rejected` - The physical card shipment was rejected by the card printer due + to an error. + - `shipped` - The physical card has been shipped. + - `returned` - The physical card shipment was returned to the sender and + destroyed by the production facility. + + 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( + f"/simulations/physical_cards/{physical_card_id}/shipment_advance", + body=maybe_transform( + {"shipment_status": shipment_status}, + physical_card_shipment_advance_params.PhysicalCardShipmentAdvanceParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=PhysicalCard, + ) diff --git a/src/increase/resources/simulations/simulations.py b/src/increase/resources/simulations/simulations.py index 8027b6fcf..48e55f9f2 100644 --- a/src/increase/resources/simulations/simulations.py +++ b/src/increase/resources/simulations/simulations.py @@ -13,6 +13,7 @@ from .card_disputes import CardDisputes, AsyncCardDisputes from .card_profiles import CardProfiles, AsyncCardProfiles from .check_deposits import CheckDeposits, AsyncCheckDeposits +from .physical_cards import PhysicalCards, AsyncPhysicalCards from .wire_transfers import WireTransfers, AsyncWireTransfers from .check_transfers import CheckTransfers, AsyncCheckTransfers from .account_transfers import AccountTransfers, AsyncAccountTransfers @@ -56,6 +57,7 @@ class Simulations(SyncAPIResource): wire_transfers: WireTransfers cards: Cards real_time_payments_transfers: RealTimePaymentsTransfers + physical_cards: PhysicalCards def __init__(self, client: Increase) -> None: super().__init__(client) @@ -76,6 +78,7 @@ def __init__(self, client: Increase) -> None: self.wire_transfers = WireTransfers(client) self.cards = Cards(client) self.real_time_payments_transfers = RealTimePaymentsTransfers(client) + self.physical_cards = PhysicalCards(client) class AsyncSimulations(AsyncAPIResource): @@ -96,6 +99,7 @@ class AsyncSimulations(AsyncAPIResource): wire_transfers: AsyncWireTransfers cards: AsyncCards real_time_payments_transfers: AsyncRealTimePaymentsTransfers + physical_cards: AsyncPhysicalCards def __init__(self, client: AsyncIncrease) -> None: super().__init__(client) @@ -116,3 +120,4 @@ def __init__(self, client: AsyncIncrease) -> None: self.wire_transfers = AsyncWireTransfers(client) self.cards = AsyncCards(client) self.real_time_payments_transfers = AsyncRealTimePaymentsTransfers(client) + self.physical_cards = AsyncPhysicalCards(client) diff --git a/src/increase/types/__init__.py b/src/increase/types/__init__.py index 2c62fa5af..7607ebd12 100644 --- a/src/increase/types/__init__.py +++ b/src/increase/types/__init__.py @@ -17,6 +17,7 @@ from .card_dispute import CardDispute as CardDispute from .card_profile import CardProfile as CardProfile from .check_deposit import CheckDeposit as CheckDeposit +from .physical_card import PhysicalCard as PhysicalCard from .wire_transfer import WireTransfer as WireTransfer from .account_number import AccountNumber as AccountNumber from .check_transfer import CheckTransfer as CheckTransfer @@ -57,6 +58,7 @@ from .card_profile_list_params import CardProfileListParams as CardProfileListParams from .card_purchase_supplement import CardPurchaseSupplement as CardPurchaseSupplement from .check_deposit_list_params import CheckDepositListParams as CheckDepositListParams +from .physical_card_list_params import PhysicalCardListParams as PhysicalCardListParams from .wire_transfer_list_params import WireTransferListParams as WireTransferListParams from .account_number_list_params import ( AccountNumberListParams as AccountNumberListParams, @@ -79,6 +81,12 @@ from .check_deposit_create_params import ( CheckDepositCreateParams as CheckDepositCreateParams, ) +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, ) diff --git a/src/increase/types/event.py b/src/increase/types/event.py index c6d53abfc..3ba4f5a65 100644 --- a/src/increase/types/event.py +++ b/src/increase/types/event.py @@ -48,6 +48,8 @@ class Event(BaseModel): "document.created", "entity.created", "entity.updated", + "export.created", + "export.updated", "external_account.created", "file.created", "group.updated", @@ -57,10 +59,16 @@ class Event(BaseModel): "inbound_ach_transfer_return.created", "inbound_ach_transfer_return.updated", "inbound_wire_drawdown_request.created", + "intrafi_account_enrollment.created", + "intrafi_account_enrollment.updated", + "intrafi_exclusion.created", + "intrafi_exclusion.updated", "oauth_connection.created", "oauth_connection.deactivated", "pending_transaction.created", "pending_transaction.updated", + "physical_card.created", + "physical_card.updated", "real_time_decision.card_authorization_requested", "real_time_decision.digital_wallet_token_requested", "real_time_decision.digital_wallet_authentication_requested", @@ -113,6 +121,8 @@ class Event(BaseModel): - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `export.created` - Occurs whenever an Export is created. + - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. @@ -128,6 +138,12 @@ class Event(BaseModel): Transfer Return is updated. - `inbound_wire_drawdown_request.created` - Occurs whenever an Inbound Wire Drawdown Request is created. + - `intrafi_account_enrollment.created` - Occurs whenever an IntraFi Account + Enrollment is created. + - `intrafi_account_enrollment.updated` - Occurs whenever an IntraFi Account + Enrollment is updated. + - `intrafi_exclusion.created` - Occurs whenever an IntraFi Exclusion is created. + - `intrafi_exclusion.updated` - Occurs whenever an IntraFi Exclusion is updated. - `oauth_connection.created` - Occurs whenever an OAuth Connection is created. - `oauth_connection.deactivated` - Occurs whenever an OAuth Connection is deactivated. @@ -135,6 +151,8 @@ class Event(BaseModel): created. - `pending_transaction.updated` - Occurs whenever a Pending Transaction is updated. + - `physical_card.created` - Occurs whenever a Physical Card is created. + - `physical_card.updated` - Occurs whenever a Physical Card is updated. - `real_time_decision.card_authorization_requested` - Occurs whenever a Real-Time Decision is created in response to a card authorization. - `real_time_decision.digital_wallet_token_requested` - Occurs whenever a diff --git a/src/increase/types/event_list_params.py b/src/increase/types/event_list_params.py index 1f7d0bf40..00f7433b7 100644 --- a/src/increase/types/event_list_params.py +++ b/src/increase/types/event_list_params.py @@ -63,6 +63,8 @@ class EventListParams(TypedDict, total=False): "document.created", "entity.created", "entity.updated", + "export.created", + "export.updated", "external_account.created", "file.created", "group.updated", @@ -72,10 +74,16 @@ class EventListParams(TypedDict, total=False): "inbound_ach_transfer_return.created", "inbound_ach_transfer_return.updated", "inbound_wire_drawdown_request.created", + "intrafi_account_enrollment.created", + "intrafi_account_enrollment.updated", + "intrafi_exclusion.created", + "intrafi_exclusion.updated", "oauth_connection.created", "oauth_connection.deactivated", "pending_transaction.created", "pending_transaction.updated", + "physical_card.created", + "physical_card.updated", "real_time_decision.card_authorization_requested", "real_time_decision.digital_wallet_token_requested", "real_time_decision.digital_wallet_authentication_requested", diff --git a/src/increase/types/event_subscription.py b/src/increase/types/event_subscription.py index 5ba1056ff..bf1b40f09 100644 --- a/src/increase/types/event_subscription.py +++ b/src/increase/types/event_subscription.py @@ -47,6 +47,8 @@ class EventSubscription(BaseModel): "document.created", "entity.created", "entity.updated", + "export.created", + "export.updated", "external_account.created", "file.created", "group.updated", @@ -56,10 +58,16 @@ class EventSubscription(BaseModel): "inbound_ach_transfer_return.created", "inbound_ach_transfer_return.updated", "inbound_wire_drawdown_request.created", + "intrafi_account_enrollment.created", + "intrafi_account_enrollment.updated", + "intrafi_exclusion.created", + "intrafi_exclusion.updated", "oauth_connection.created", "oauth_connection.deactivated", "pending_transaction.created", "pending_transaction.updated", + "physical_card.created", + "physical_card.updated", "real_time_decision.card_authorization_requested", "real_time_decision.digital_wallet_token_requested", "real_time_decision.digital_wallet_authentication_requested", @@ -112,6 +120,8 @@ class EventSubscription(BaseModel): - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `export.created` - Occurs whenever an Export is created. + - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. @@ -127,6 +137,12 @@ class EventSubscription(BaseModel): Transfer Return is updated. - `inbound_wire_drawdown_request.created` - Occurs whenever an Inbound Wire Drawdown Request is created. + - `intrafi_account_enrollment.created` - Occurs whenever an IntraFi Account + Enrollment is created. + - `intrafi_account_enrollment.updated` - Occurs whenever an IntraFi Account + Enrollment is updated. + - `intrafi_exclusion.created` - Occurs whenever an IntraFi Exclusion is created. + - `intrafi_exclusion.updated` - Occurs whenever an IntraFi Exclusion is updated. - `oauth_connection.created` - Occurs whenever an OAuth Connection is created. - `oauth_connection.deactivated` - Occurs whenever an OAuth Connection is deactivated. @@ -134,6 +150,8 @@ class EventSubscription(BaseModel): created. - `pending_transaction.updated` - Occurs whenever a Pending Transaction is updated. + - `physical_card.created` - Occurs whenever a Physical Card is created. + - `physical_card.updated` - Occurs whenever a Physical Card is updated. - `real_time_decision.card_authorization_requested` - Occurs whenever a Real-Time Decision is created in response to a card authorization. - `real_time_decision.digital_wallet_token_requested` - Occurs whenever a diff --git a/src/increase/types/event_subscription_create_params.py b/src/increase/types/event_subscription_create_params.py index 9035ec3a1..a35431c8d 100644 --- a/src/increase/types/event_subscription_create_params.py +++ b/src/increase/types/event_subscription_create_params.py @@ -41,6 +41,8 @@ class EventSubscriptionCreateParams(TypedDict, total=False): "document.created", "entity.created", "entity.updated", + "export.created", + "export.updated", "external_account.created", "file.created", "group.updated", @@ -50,10 +52,16 @@ class EventSubscriptionCreateParams(TypedDict, total=False): "inbound_ach_transfer_return.created", "inbound_ach_transfer_return.updated", "inbound_wire_drawdown_request.created", + "intrafi_account_enrollment.created", + "intrafi_account_enrollment.updated", + "intrafi_exclusion.created", + "intrafi_exclusion.updated", "oauth_connection.created", "oauth_connection.deactivated", "pending_transaction.created", "pending_transaction.updated", + "physical_card.created", + "physical_card.updated", "real_time_decision.card_authorization_requested", "real_time_decision.digital_wallet_token_requested", "real_time_decision.digital_wallet_authentication_requested", @@ -105,6 +113,8 @@ class EventSubscriptionCreateParams(TypedDict, total=False): - `document.created` - Occurs whenever a Document is created. - `entity.created` - Occurs whenever an Entity is created. - `entity.updated` - Occurs whenever an Entity is updated. + - `export.created` - Occurs whenever an Export is created. + - `export.updated` - Occurs whenever an Export is updated. - `external_account.created` - Occurs whenever an External Account is created. - `file.created` - Occurs whenever a File is created. - `group.updated` - Occurs whenever a Group is updated. @@ -120,6 +130,12 @@ class EventSubscriptionCreateParams(TypedDict, total=False): Transfer Return is updated. - `inbound_wire_drawdown_request.created` - Occurs whenever an Inbound Wire Drawdown Request is created. + - `intrafi_account_enrollment.created` - Occurs whenever an IntraFi Account + Enrollment is created. + - `intrafi_account_enrollment.updated` - Occurs whenever an IntraFi Account + Enrollment is updated. + - `intrafi_exclusion.created` - Occurs whenever an IntraFi Exclusion is created. + - `intrafi_exclusion.updated` - Occurs whenever an IntraFi Exclusion is updated. - `oauth_connection.created` - Occurs whenever an OAuth Connection is created. - `oauth_connection.deactivated` - Occurs whenever an OAuth Connection is deactivated. @@ -127,6 +143,8 @@ class EventSubscriptionCreateParams(TypedDict, total=False): created. - `pending_transaction.updated` - Occurs whenever a Pending Transaction is updated. + - `physical_card.created` - Occurs whenever a Physical Card is created. + - `physical_card.updated` - Occurs whenever a Physical Card is updated. - `real_time_decision.card_authorization_requested` - Occurs whenever a Real-Time Decision is created in response to a card authorization. - `real_time_decision.digital_wallet_token_requested` - Occurs whenever a diff --git a/src/increase/types/file.py b/src/increase/types/file.py index 4a622644c..0951221a9 100644 --- a/src/increase/types/file.py +++ b/src/increase/types/file.py @@ -35,6 +35,9 @@ class File(BaseModel): filename: Optional[str] """The filename that was provided upon upload or generated by Increase.""" + mime_type: str + """The MIME type of the file.""" + purpose: Literal[ "check_image_front", "check_image_back", diff --git a/src/increase/types/physical_card.py b/src/increase/types/physical_card.py new file mode 100644 index 000000000..7b14a9765 --- /dev/null +++ b/src/increase/types/physical_card.py @@ -0,0 +1,124 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["PhysicalCard", "Cardholder", "Shipment", "ShipmentAddress", "ShipmentTracking"] + + +class Cardholder(BaseModel): + first_name: str + """The cardholder's first name.""" + + last_name: str + """The cardholder's last name.""" + + +class ShipmentAddress(BaseModel): + city: str + """The city of the shipping address.""" + + line1: str + """The first line of the shipping address.""" + + line2: Optional[str] + """The second line of the shipping address.""" + + line3: Optional[str] + """The third line of the shipping address.""" + + name: str + """The name of the recipient.""" + + postal_code: str + """The postal code of the shipping address.""" + + state: str + """The US state of the shipping address.""" + + +class ShipmentTracking(BaseModel): + number: str + """The tracking number.""" + + return_reason: Optional[str] + """For returned shipments, this describes why the package was returned.""" + + shipped_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the fulfillment provider marked the card as ready for pick-up by the shipment + carrier. + """ + + +class Shipment(BaseModel): + address: ShipmentAddress + """The location to where the card's packing label is addressed.""" + + method: Literal["usps", "fedex_priority_overnight", "fedex_2_day"] + """The shipping method. + + - `usps` - USPS Post with tracking. + - `fedex_priority_overnight` - FedEx Priority Overnight, no signature. + - `fedex_2_day` - FedEx 2-day. + """ + + status: Literal["pending", "canceled", "submitted", "acknowledged", "rejected", "shipped", "returned"] + """The status of this shipment. + + - `pending` - The physical card has not yet been shipped. + - `canceled` - The physical card shipment was canceled prior to submission. + - `submitted` - The physical card shipment has been submitted to the card + fulfillment provider. + - `acknowledged` - The physical card shipment has been acknowledged by the card + fulfillment provider and will be processed in their next batch. + - `rejected` - The physical card shipment was rejected by the card printer due + to an error. + - `shipped` - The physical card has been shipped. + - `returned` - The physical card shipment was returned to the sender and + destroyed by the production facility. + """ + + tracking: Optional[ShipmentTracking] + """Tracking details for the shipment.""" + + +class PhysicalCard(BaseModel): + id: str + """The physical card identifier.""" + + card_id: str + """The identifier for the Card this Physical Card represents.""" + + card_profile_id: Optional[str] + """The Card Profile used for this Physical Card.""" + + cardholder: Optional[Cardholder] + """Details about the cardholder, as it appears on the printed card.""" + + created_at: datetime + """ + The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which + the Physical Card was created. + """ + + shipment: Shipment + """The details used to ship this physical card.""" + + status: Literal["active", "disabled", "canceled"] + """The status of the Physical Card. + + - `active` - The physical card is active. + - `disabled` - The physical card is temporarily disabled. + - `canceled` - The physical card is permanently canceled. + """ + + type: Literal["physical_card"] + """A constant representing the object's type. + + For this resource it will always be `physical_card`. + """ diff --git a/src/increase/types/physical_card_create_params.py b/src/increase/types/physical_card_create_params.py new file mode 100644 index 000000000..378b68b9f --- /dev/null +++ b/src/increase/types/physical_card_create_params.py @@ -0,0 +1,68 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["PhysicalCardCreateParams", "Cardholder", "Shipment", "ShipmentAddress"] + + +class PhysicalCardCreateParams(TypedDict, total=False): + card_id: Required[str] + """The underlying card representing this physical card.""" + + card_profile_id: Required[str] + """The card profile to use for this physical card.""" + + cardholder: Required[Cardholder] + """Details about the cardholder, as it will appear on the physical card.""" + + shipment: Required[Shipment] + """The details used to ship this physical card.""" + + +class Cardholder(TypedDict, total=False): + first_name: Required[str] + """The cardholder's first name.""" + + last_name: Required[str] + """The cardholder's last name.""" + + +class ShipmentAddress(TypedDict, total=False): + city: Required[str] + """The city of the shipping address.""" + + line1: Required[str] + """The first line of the shipping address.""" + + name: Required[str] + """The name of the recipient.""" + + postal_code: Required[str] + """The postal code of the shipping address.""" + + state: Required[str] + """The US state of the shipping address.""" + + line2: str + """The second line of the shipping address.""" + + line3: str + """The third line of the shipping address.""" + + phone_number: str + """The phone number of the receipient.""" + + +class Shipment(TypedDict, total=False): + address: Required[ShipmentAddress] + """The address to where the card should be shipped.""" + + method: Required[Literal["usps", "fedex_priority_overnight", "fedex_2_day"]] + """The shipping method to use. + + - `usps` - USPS Post with tracking. + - `fedex_priority_overnight` - FedEx Priority Overnight, no signature. + - `fedex_2_day` - FedEx 2-day. + """ diff --git a/src/increase/types/physical_card_list_params.py b/src/increase/types/physical_card_list_params.py new file mode 100644 index 000000000..e4791b237 --- /dev/null +++ b/src/increase/types/physical_card_list_params.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["PhysicalCardListParams", "CreatedAt"] + + +class PhysicalCardListParams(TypedDict, total=False): + card_id: str + """Filter Physical Cards to ones belonging to the specified Card.""" + + 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/physical_card_update_params.py b/src/increase/types/physical_card_update_params.py new file mode 100644 index 000000000..7abc7bc6a --- /dev/null +++ b/src/increase/types/physical_card_update_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["PhysicalCardUpdateParams"] + + +class PhysicalCardUpdateParams(TypedDict, total=False): + status: Required[Literal["active", "disabled", "canceled"]] + """The status to update the Physical Card to. + + - `active` - The physical card is active. + - `disabled` - The physical card is temporarily disabled. + - `canceled` - The physical card is permanently canceled. + """ diff --git a/src/increase/types/simulations/__init__.py b/src/increase/types/simulations/__init__.py index 0bd4ad423..7f36f5561 100644 --- a/src/increase/types/simulations/__init__.py +++ b/src/increase/types/simulations/__init__.py @@ -36,6 +36,9 @@ from .wire_transfer_create_inbound_params import ( WireTransferCreateInboundParams as WireTransferCreateInboundParams, ) +from .physical_card_shipment_advance_params import ( + PhysicalCardShipmentAdvanceParams as PhysicalCardShipmentAdvanceParams, +) from .digital_wallet_token_request_create_params import ( DigitalWalletTokenRequestCreateParams as DigitalWalletTokenRequestCreateParams, ) diff --git a/src/increase/types/simulations/ach_transfer_simulation.py b/src/increase/types/simulations/ach_transfer_simulation.py index 08916b1cf..bcf3f7fcf 100644 --- a/src/increase/types/simulations/ach_transfer_simulation.py +++ b/src/increase/types/simulations/ach_transfer_simulation.py @@ -3267,8 +3267,8 @@ class TransactionSource(BaseModel): "ach_transfer_return", "card_dispute_acceptance", "card_refund", - "card_revenue_payment", "card_settlement", + "card_revenue_payment", "check_deposit_acceptance", "check_deposit_return", "check_transfer_deposit", @@ -3280,8 +3280,8 @@ class TransactionSource(BaseModel): "inbound_check", "inbound_international_ach_transfer", "inbound_real_time_payments_transfer_confirmation", - "inbound_wire_drawdown_payment", "inbound_wire_drawdown_payment_reversal", + "inbound_wire_drawdown_payment", "inbound_wire_reversal", "inbound_wire_transfer", "interest_payment", @@ -3308,10 +3308,10 @@ class TransactionSource(BaseModel): - `card_dispute_acceptance` - Card Dispute Acceptance: details will be under the `card_dispute_acceptance` object. - `card_refund` - Card Refund: details will be under the `card_refund` object. - - `card_revenue_payment` - Card Revenue Payment: details will be under the - `card_revenue_payment` object. - `card_settlement` - Card Settlement: details will be under the `card_settlement` object. + - `card_revenue_payment` - Card Revenue Payment: details will be under the + `card_revenue_payment` object. - `check_deposit_acceptance` - Check Deposit Acceptance: details will be under the `check_deposit_acceptance` object. - `check_deposit_return` - Check Deposit Return: details will be under the @@ -3335,11 +3335,11 @@ class TransactionSource(BaseModel): - `inbound_real_time_payments_transfer_confirmation` - Inbound Real-Time Payments Transfer Confirmation: details will be under the `inbound_real_time_payments_transfer_confirmation` object. - - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will - be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_drawdown_payment_reversal` - Inbound Wire Drawdown Payment Reversal: details will be under the `inbound_wire_drawdown_payment_reversal` object. + - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will + be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_reversal` - Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. - `inbound_wire_transfer` - Inbound Wire Transfer: details will be under the diff --git a/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py b/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py index ab20b280c..ccab080af 100644 --- a/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py +++ b/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py @@ -3262,8 +3262,8 @@ class TransactionSource(BaseModel): "ach_transfer_return", "card_dispute_acceptance", "card_refund", - "card_revenue_payment", "card_settlement", + "card_revenue_payment", "check_deposit_acceptance", "check_deposit_return", "check_transfer_deposit", @@ -3275,8 +3275,8 @@ class TransactionSource(BaseModel): "inbound_check", "inbound_international_ach_transfer", "inbound_real_time_payments_transfer_confirmation", - "inbound_wire_drawdown_payment", "inbound_wire_drawdown_payment_reversal", + "inbound_wire_drawdown_payment", "inbound_wire_reversal", "inbound_wire_transfer", "interest_payment", @@ -3303,10 +3303,10 @@ class TransactionSource(BaseModel): - `card_dispute_acceptance` - Card Dispute Acceptance: details will be under the `card_dispute_acceptance` object. - `card_refund` - Card Refund: details will be under the `card_refund` object. - - `card_revenue_payment` - Card Revenue Payment: details will be under the - `card_revenue_payment` object. - `card_settlement` - Card Settlement: details will be under the `card_settlement` object. + - `card_revenue_payment` - Card Revenue Payment: details will be under the + `card_revenue_payment` object. - `check_deposit_acceptance` - Check Deposit Acceptance: details will be under the `check_deposit_acceptance` object. - `check_deposit_return` - Check Deposit Return: details will be under the @@ -3330,11 +3330,11 @@ class TransactionSource(BaseModel): - `inbound_real_time_payments_transfer_confirmation` - Inbound Real-Time Payments Transfer Confirmation: details will be under the `inbound_real_time_payments_transfer_confirmation` object. - - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will - be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_drawdown_payment_reversal` - Inbound Wire Drawdown Payment Reversal: details will be under the `inbound_wire_drawdown_payment_reversal` object. + - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will + be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_reversal` - Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. - `inbound_wire_transfer` - Inbound Wire Transfer: details will be under the diff --git a/src/increase/types/simulations/interest_payment_simulation_result.py b/src/increase/types/simulations/interest_payment_simulation_result.py index 0bdebbc4c..4ff0d961a 100644 --- a/src/increase/types/simulations/interest_payment_simulation_result.py +++ b/src/increase/types/simulations/interest_payment_simulation_result.py @@ -2394,8 +2394,8 @@ class TransactionSource(BaseModel): "ach_transfer_return", "card_dispute_acceptance", "card_refund", - "card_revenue_payment", "card_settlement", + "card_revenue_payment", "check_deposit_acceptance", "check_deposit_return", "check_transfer_deposit", @@ -2407,8 +2407,8 @@ class TransactionSource(BaseModel): "inbound_check", "inbound_international_ach_transfer", "inbound_real_time_payments_transfer_confirmation", - "inbound_wire_drawdown_payment", "inbound_wire_drawdown_payment_reversal", + "inbound_wire_drawdown_payment", "inbound_wire_reversal", "inbound_wire_transfer", "interest_payment", @@ -2435,10 +2435,10 @@ class TransactionSource(BaseModel): - `card_dispute_acceptance` - Card Dispute Acceptance: details will be under the `card_dispute_acceptance` object. - `card_refund` - Card Refund: details will be under the `card_refund` object. - - `card_revenue_payment` - Card Revenue Payment: details will be under the - `card_revenue_payment` object. - `card_settlement` - Card Settlement: details will be under the `card_settlement` object. + - `card_revenue_payment` - Card Revenue Payment: details will be under the + `card_revenue_payment` object. - `check_deposit_acceptance` - Check Deposit Acceptance: details will be under the `check_deposit_acceptance` object. - `check_deposit_return` - Check Deposit Return: details will be under the @@ -2462,11 +2462,11 @@ class TransactionSource(BaseModel): - `inbound_real_time_payments_transfer_confirmation` - Inbound Real-Time Payments Transfer Confirmation: details will be under the `inbound_real_time_payments_transfer_confirmation` object. - - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will - be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_drawdown_payment_reversal` - Inbound Wire Drawdown Payment Reversal: details will be under the `inbound_wire_drawdown_payment_reversal` object. + - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will + be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_reversal` - Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. - `inbound_wire_transfer` - Inbound Wire Transfer: details will be under the diff --git a/src/increase/types/simulations/physical_card_shipment_advance_params.py b/src/increase/types/simulations/physical_card_shipment_advance_params.py new file mode 100644 index 000000000..91b365340 --- /dev/null +++ b/src/increase/types/simulations/physical_card_shipment_advance_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["PhysicalCardShipmentAdvanceParams"] + + +class PhysicalCardShipmentAdvanceParams(TypedDict, total=False): + shipment_status: Required[ + Literal["pending", "canceled", "submitted", "acknowledged", "rejected", "shipped", "returned"] + ] + """The shipment status to move the Physical Card to. + + - `pending` - The physical card has not yet been shipped. + - `canceled` - The physical card shipment was canceled prior to submission. + - `submitted` - The physical card shipment has been submitted to the card + fulfillment provider. + - `acknowledged` - The physical card shipment has been acknowledged by the card + fulfillment provider and will be processed in their next batch. + - `rejected` - The physical card shipment was rejected by the card printer due + to an error. + - `shipped` - The physical card has been shipped. + - `returned` - The physical card shipment was returned to the sender and + destroyed by the production facility. + """ diff --git a/src/increase/types/simulations/wire_transfer_simulation.py b/src/increase/types/simulations/wire_transfer_simulation.py index 202368883..be2b6876a 100644 --- a/src/increase/types/simulations/wire_transfer_simulation.py +++ b/src/increase/types/simulations/wire_transfer_simulation.py @@ -2394,8 +2394,8 @@ class TransactionSource(BaseModel): "ach_transfer_return", "card_dispute_acceptance", "card_refund", - "card_revenue_payment", "card_settlement", + "card_revenue_payment", "check_deposit_acceptance", "check_deposit_return", "check_transfer_deposit", @@ -2407,8 +2407,8 @@ class TransactionSource(BaseModel): "inbound_check", "inbound_international_ach_transfer", "inbound_real_time_payments_transfer_confirmation", - "inbound_wire_drawdown_payment", "inbound_wire_drawdown_payment_reversal", + "inbound_wire_drawdown_payment", "inbound_wire_reversal", "inbound_wire_transfer", "interest_payment", @@ -2435,10 +2435,10 @@ class TransactionSource(BaseModel): - `card_dispute_acceptance` - Card Dispute Acceptance: details will be under the `card_dispute_acceptance` object. - `card_refund` - Card Refund: details will be under the `card_refund` object. - - `card_revenue_payment` - Card Revenue Payment: details will be under the - `card_revenue_payment` object. - `card_settlement` - Card Settlement: details will be under the `card_settlement` object. + - `card_revenue_payment` - Card Revenue Payment: details will be under the + `card_revenue_payment` object. - `check_deposit_acceptance` - Check Deposit Acceptance: details will be under the `check_deposit_acceptance` object. - `check_deposit_return` - Check Deposit Return: details will be under the @@ -2462,11 +2462,11 @@ class TransactionSource(BaseModel): - `inbound_real_time_payments_transfer_confirmation` - Inbound Real-Time Payments Transfer Confirmation: details will be under the `inbound_real_time_payments_transfer_confirmation` object. - - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will - be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_drawdown_payment_reversal` - Inbound Wire Drawdown Payment Reversal: details will be under the `inbound_wire_drawdown_payment_reversal` object. + - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will + be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_reversal` - Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. - `inbound_wire_transfer` - Inbound Wire Transfer: details will be under the diff --git a/src/increase/types/transaction.py b/src/increase/types/transaction.py index 7a52577f6..066cde438 100644 --- a/src/increase/types/transaction.py +++ b/src/increase/types/transaction.py @@ -2393,8 +2393,8 @@ class Source(BaseModel): "ach_transfer_return", "card_dispute_acceptance", "card_refund", - "card_revenue_payment", "card_settlement", + "card_revenue_payment", "check_deposit_acceptance", "check_deposit_return", "check_transfer_deposit", @@ -2406,8 +2406,8 @@ class Source(BaseModel): "inbound_check", "inbound_international_ach_transfer", "inbound_real_time_payments_transfer_confirmation", - "inbound_wire_drawdown_payment", "inbound_wire_drawdown_payment_reversal", + "inbound_wire_drawdown_payment", "inbound_wire_reversal", "inbound_wire_transfer", "interest_payment", @@ -2434,10 +2434,10 @@ class Source(BaseModel): - `card_dispute_acceptance` - Card Dispute Acceptance: details will be under the `card_dispute_acceptance` object. - `card_refund` - Card Refund: details will be under the `card_refund` object. - - `card_revenue_payment` - Card Revenue Payment: details will be under the - `card_revenue_payment` object. - `card_settlement` - Card Settlement: details will be under the `card_settlement` object. + - `card_revenue_payment` - Card Revenue Payment: details will be under the + `card_revenue_payment` object. - `check_deposit_acceptance` - Check Deposit Acceptance: details will be under the `check_deposit_acceptance` object. - `check_deposit_return` - Check Deposit Return: details will be under the @@ -2461,11 +2461,11 @@ class Source(BaseModel): - `inbound_real_time_payments_transfer_confirmation` - Inbound Real-Time Payments Transfer Confirmation: details will be under the `inbound_real_time_payments_transfer_confirmation` object. - - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will - be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_drawdown_payment_reversal` - Inbound Wire Drawdown Payment Reversal: details will be under the `inbound_wire_drawdown_payment_reversal` object. + - `inbound_wire_drawdown_payment` - Inbound Wire Drawdown Payment: details will + be under the `inbound_wire_drawdown_payment` object. - `inbound_wire_reversal` - Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. - `inbound_wire_transfer` - Inbound Wire Transfer: details will be under the diff --git a/src/increase/types/transaction_list_params.py b/src/increase/types/transaction_list_params.py index 8daa51639..7a01031fa 100644 --- a/src/increase/types/transaction_list_params.py +++ b/src/increase/types/transaction_list_params.py @@ -46,8 +46,8 @@ class TransactionListParams(TypedDict, total=False): "ach_transfer_return", "card_dispute_acceptance", "card_refund", - "card_revenue_payment", "card_settlement", + "card_revenue_payment", "check_deposit_acceptance", "check_deposit_return", "check_transfer_deposit", @@ -59,8 +59,8 @@ class TransactionListParams(TypedDict, total=False): "inbound_check", "inbound_international_ach_transfer", "inbound_real_time_payments_transfer_confirmation", - "inbound_wire_drawdown_payment", "inbound_wire_drawdown_payment_reversal", + "inbound_wire_drawdown_payment", "inbound_wire_reversal", "inbound_wire_transfer", "interest_payment", diff --git a/tests/api_resources/simulations/test_physical_cards.py b/tests/api_resources/simulations/test_physical_cards.py new file mode 100644 index 000000000..2c1de7c58 --- /dev/null +++ b/tests/api_resources/simulations/test_physical_cards.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +import os + +import pytest + +from increase import Increase, AsyncIncrease +from tests.utils import assert_matches_type +from increase.types import PhysicalCard + +base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +api_key = os.environ.get("API_KEY", "something1234") + + +class TestPhysicalCards: + strict_client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) + loose_client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=False) + parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + + @parametrize + def test_method_shipment_advance(self, client: Increase) -> None: + physical_card = client.simulations.physical_cards.shipment_advance( + "string", + shipment_status="pending", + ) + assert_matches_type(PhysicalCard, physical_card, path=["response"]) + + +class TestAsyncPhysicalCards: + strict_client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) + loose_client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=False) + parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + + @parametrize + async def test_method_shipment_advance(self, client: AsyncIncrease) -> None: + physical_card = await client.simulations.physical_cards.shipment_advance( + "string", + shipment_status="pending", + ) + assert_matches_type(PhysicalCard, physical_card, path=["response"]) diff --git a/tests/api_resources/test_physical_cards.py b/tests/api_resources/test_physical_cards.py new file mode 100644 index 000000000..bf10c76cd --- /dev/null +++ b/tests/api_resources/test_physical_cards.py @@ -0,0 +1,142 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +import os + +import pytest + +from increase import Increase, AsyncIncrease +from tests.utils import assert_matches_type +from increase.types import PhysicalCard +from increase._utils import parse_datetime +from increase.pagination import SyncPage, AsyncPage + +base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +api_key = os.environ.get("API_KEY", "something1234") + + +class TestPhysicalCards: + strict_client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=True) + loose_client = Increase(base_url=base_url, api_key=api_key, _strict_response_validation=False) + parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + + @parametrize + def test_method_create(self, client: Increase) -> None: + physical_card = client.physical_cards.create( + card_id="string", + card_profile_id="string", + cardholder={ + "first_name": "x", + "last_name": "x", + }, + shipment={ + "method": "usps", + "address": { + "name": "x", + "line1": "x", + "city": "x", + "state": "x", + "postal_code": "x", + }, + }, + ) + assert_matches_type(PhysicalCard, physical_card, path=["response"]) + + @parametrize + def test_method_retrieve(self, client: Increase) -> None: + physical_card = client.physical_cards.retrieve( + "string", + ) + assert_matches_type(PhysicalCard, physical_card, path=["response"]) + + @parametrize + def test_method_update(self, client: Increase) -> None: + physical_card = client.physical_cards.update( + "string", + status="active", + ) + assert_matches_type(PhysicalCard, physical_card, path=["response"]) + + @parametrize + def test_method_list(self, client: Increase) -> None: + physical_card = client.physical_cards.list() + assert_matches_type(SyncPage[PhysicalCard], physical_card, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Increase) -> None: + physical_card = client.physical_cards.list( + card_id="string", + 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="string", + limit=0, + ) + assert_matches_type(SyncPage[PhysicalCard], physical_card, path=["response"]) + + +class TestAsyncPhysicalCards: + strict_client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=True) + loose_client = AsyncIncrease(base_url=base_url, api_key=api_key, _strict_response_validation=False) + parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + + @parametrize + async def test_method_create(self, client: AsyncIncrease) -> None: + physical_card = await client.physical_cards.create( + card_id="string", + card_profile_id="string", + cardholder={ + "first_name": "x", + "last_name": "x", + }, + shipment={ + "method": "usps", + "address": { + "name": "x", + "line1": "x", + "city": "x", + "state": "x", + "postal_code": "x", + }, + }, + ) + assert_matches_type(PhysicalCard, physical_card, path=["response"]) + + @parametrize + async def test_method_retrieve(self, client: AsyncIncrease) -> None: + physical_card = await client.physical_cards.retrieve( + "string", + ) + assert_matches_type(PhysicalCard, physical_card, path=["response"]) + + @parametrize + async def test_method_update(self, client: AsyncIncrease) -> None: + physical_card = await client.physical_cards.update( + "string", + status="active", + ) + assert_matches_type(PhysicalCard, physical_card, path=["response"]) + + @parametrize + async def test_method_list(self, client: AsyncIncrease) -> None: + physical_card = await client.physical_cards.list() + assert_matches_type(AsyncPage[PhysicalCard], physical_card, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, client: AsyncIncrease) -> None: + physical_card = await client.physical_cards.list( + card_id="string", + 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="string", + limit=0, + ) + assert_matches_type(AsyncPage[PhysicalCard], physical_card, path=["response"])