diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 820b5c1a..939bb175 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.112.0" + ".": "0.113.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0e130cdf..49aee1eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml -openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f -config_hash: f4b1d2f464e80527f970de61cba0c52f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-854de7cc8f79e150ffe98f038ce9f39367010b2bdfffc9992be2738697dc4880.yml +openapi_spec_hash: fd471b20f3eda1e00cdebf028cbfe867 +config_hash: 9dddee5f7af579864599849cb28a0770 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f8eb077..ccfedc5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## 0.113.0 (2025-12-23) + +Full Changelog: [v0.112.0...v0.113.0](https://github.com/lithic-com/lithic-python/compare/v0.112.0...v0.113.0) + +### Features + +* **api:** add external_id to payment_event ([b87046c](https://github.com/lithic-com/lithic-python/commit/b87046c51cb5d332ea53959ac3892ce2ba29cec3)) +* **api:** add get /v1/transfer_limits endpoint ([b87046c](https://github.com/lithic-com/lithic-python/commit/b87046c51cb5d332ea53959ac3892ce2ba29cec3)) +* **api:** add post /v1/book_transfers/{book_transfer_token}/retry endpoint ([b87046c](https://github.com/lithic-com/lithic-python/commit/b87046c51cb5d332ea53959ac3892ce2ba29cec3)) +* **api:** add WIRE_DRAWDOWN_REQUEST transfer type ([97f0128](https://github.com/lithic-com/lithic-python/commit/97f012830440e7bd5071bf58d88b47b87b8b2025)) +* **api:** remove unnecessary X-Lithic-Pagination header ([97f0128](https://github.com/lithic-com/lithic-python/commit/97f012830440e7bd5071bf58d88b47b87b8b2025)) +* **api:** remove v1/aggregate_balances and related models ([f3e089e](https://github.com/lithic-com/lithic-python/commit/f3e089e78535d88553bd60681bce6e75f0c29ece)) + + +### Bug Fixes + +* use async_to_httpx_files in patch method ([783d8ff](https://github.com/lithic-com/lithic-python/commit/783d8ff3f2119f1ff7c89e65864107fa13afe9b4)) + + +### Chores + +* **internal:** add `--fix` argument to lint script ([8e0a11c](https://github.com/lithic-com/lithic-python/commit/8e0a11ca6969fe5956ad244a7222525ff16c11b9)) +* **internal:** add missing files argument to base client ([52f441e](https://github.com/lithic-com/lithic-python/commit/52f441ece2827bf2b57bc2840d226121becbbff4)) + + +### Documentation + +* **api:** clarify description of token / retry_token when it serves as idempotency key ([97f0128](https://github.com/lithic-com/lithic-python/commit/97f012830440e7bd5071bf58d88b47b87b8b2025)) + ## 0.112.0 (2025-12-10) Full Changelog: [v0.111.0...v0.112.0](https://github.com/lithic-com/lithic-python/compare/v0.111.0...v0.112.0) diff --git a/README.md b/README.md index f9a17781..0aaa73df 100644 --- a/README.md +++ b/README.md @@ -338,20 +338,6 @@ On timeout, an `APITimeoutError` is thrown. Note that requests that time out are [retried twice by default](#retries). -## Default Headers - -We automatically send the `X-Lithic-Pagination` header set to `cursor`. - -If you need to, you can override it by setting default headers per-request or on the client object. - -```python -from lithic import Lithic - -client = Lithic( - default_headers={"X-Lithic-Pagination": "My-Custom-Value"}, -) -``` - ## Advanced ### Logging diff --git a/api.md b/api.md index c07d4f4d..568d0761 100644 --- a/api.md +++ b/api.md @@ -214,18 +214,6 @@ Methods: - client.cards.get_embed_html(\*args) -> str - client.cards.get_embed_url(\*args) -> URL -## AggregateBalances - -Types: - -```python -from lithic.types.cards import AggregateBalanceListResponse -``` - -Methods: - -- client.cards.aggregate_balances.list(\*\*params) -> SyncSinglePage[AggregateBalanceListResponse] - ## Balances Methods: @@ -266,18 +254,6 @@ Methods: - client.balances.list(\*\*params) -> SyncSinglePage[Balance] -# AggregateBalances - -Types: - -```python -from lithic.types import AggregateBalance -``` - -Methods: - -- client.aggregate_balances.list(\*\*params) -> SyncSinglePage[AggregateBalance] - # Disputes Types: @@ -694,6 +670,7 @@ Methods: - client.book_transfers.create(\*\*params) -> BookTransferResponse - client.book_transfers.retrieve(book_transfer_token) -> BookTransferResponse - client.book_transfers.list(\*\*params) -> SyncCursorPage[BookTransferResponse] +- client.book_transfers.retry(book_transfer_token, \*\*params) -> BookTransferResponse - client.book_transfers.reverse(book_transfer_token, \*\*params) -> BookTransferResponse # CreditProducts @@ -823,6 +800,18 @@ Methods: - client.account_activity.list(\*\*params) -> SyncCursorPage[AccountActivityListResponse] - client.account_activity.retrieve_transaction(transaction_token) -> AccountActivityRetrieveTransactionResponse +# TransferLimits + +Types: + +```python +from lithic.types import TransferLimitsResponse +``` + +Methods: + +- client.transfer_limits.list(\*\*params) -> SyncSinglePage[Data] + # Webhooks Types: diff --git a/pyproject.toml b/pyproject.toml index ba050cec..787f4c8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lithic" -version = "0.112.0" +version = "0.113.0" description = "The official Python library for the lithic API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/scripts/lint b/scripts/lint index c997f8ca..570fee87 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,13 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running lints" -rye run lint +if [ "$1" = "--fix" ]; then + echo "==> Running lints with --fix" + rye run fix:ruff +else + echo "==> Running lints" + rye run lint +fi echo "==> Making sure it imports" rye run python -c 'import lithic' diff --git a/src/lithic/_base_client.py b/src/lithic/_base_client.py index ddcf4528..e8b7c42d 100644 --- a/src/lithic/_base_client.py +++ b/src/lithic/_base_client.py @@ -1262,9 +1262,12 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1796,9 +1799,12 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options + ) return await self.request(cast_to, opts) async def put( diff --git a/src/lithic/_client.py b/src/lithic/_client.py index 363745a1..3dd30033 100644 --- a/src/lithic/_client.py +++ b/src/lithic/_client.py @@ -56,12 +56,12 @@ funding_events, account_holders, credit_products, + transfer_limits, account_activity, card_bulk_orders, digital_card_art, network_programs, external_payments, - aggregate_balances, financial_accounts, responder_endpoints, management_operations, @@ -84,46 +84,22 @@ from .resources.funding_events import FundingEvents, AsyncFundingEvents from .resources.account_holders import AccountHolders, AsyncAccountHolders from .resources.reports.reports import Reports, AsyncReports + from .resources.transfer_limits import TransferLimits, AsyncTransferLimits from .resources.account_activity import AccountActivity, AsyncAccountActivity from .resources.card_bulk_orders import CardBulkOrders, AsyncCardBulkOrders - from .resources.digital_card_art import ( - DigitalCardArtResource, - AsyncDigitalCardArtResource, - ) + from .resources.digital_card_art import DigitalCardArtResource, AsyncDigitalCardArtResource from .resources.network_programs import NetworkPrograms, AsyncNetworkPrograms from .resources.external_payments import ExternalPayments, AsyncExternalPayments from .resources.three_ds.three_ds import ThreeDS, AsyncThreeDS - from .resources.aggregate_balances import AggregateBalances, AsyncAggregateBalances - from .resources.responder_endpoints import ( - ResponderEndpoints, - AsyncResponderEndpoints, - ) + from .resources.responder_endpoints import ResponderEndpoints, AsyncResponderEndpoints from .resources.auth_rules.auth_rules import AuthRules, AsyncAuthRules - from .resources.management_operations import ( - ManagementOperations, - AsyncManagementOperations, - ) - from .resources.auth_stream_enrollment import ( - AuthStreamEnrollment, - AsyncAuthStreamEnrollment, - ) - from .resources.tokenization_decisioning import ( - TokenizationDecisioning, - AsyncTokenizationDecisioning, - ) + from .resources.management_operations import ManagementOperations, AsyncManagementOperations + from .resources.auth_stream_enrollment import AuthStreamEnrollment, AsyncAuthStreamEnrollment + from .resources.tokenization_decisioning import TokenizationDecisioning, AsyncTokenizationDecisioning from .resources.transactions.transactions import Transactions, AsyncTransactions - from .resources.credit_products.credit_products import ( - CreditProducts, - AsyncCreditProducts, - ) - from .resources.financial_accounts.financial_accounts import ( - FinancialAccounts, - AsyncFinancialAccounts, - ) - from .resources.external_bank_accounts.external_bank_accounts import ( - ExternalBankAccounts, - AsyncExternalBankAccounts, - ) + from .resources.credit_products.credit_products import CreditProducts, AsyncCreditProducts + from .resources.financial_accounts.financial_accounts import FinancialAccounts, AsyncFinancialAccounts + from .resources.external_bank_accounts.external_bank_accounts import ExternalBankAccounts, AsyncExternalBankAccounts __all__ = [ "ENVIRONMENTS", @@ -284,12 +260,6 @@ def balances(self) -> Balances: return Balances(self) - @cached_property - def aggregate_balances(self) -> AggregateBalances: - from .resources.aggregate_balances import AggregateBalances - - return AggregateBalances(self) - @cached_property def disputes(self) -> Disputes: from .resources.disputes import Disputes @@ -410,6 +380,12 @@ def account_activity(self) -> AccountActivity: return AccountActivity(self) + @cached_property + def transfer_limits(self) -> TransferLimits: + from .resources.transfer_limits import TransferLimits + + return TransferLimits(self) + @cached_property def webhooks(self) -> Webhooks: from .resources.webhooks import Webhooks @@ -441,7 +417,6 @@ def default_headers(self) -> dict[str, str | Omit]: return { **super().default_headers, "X-Stainless-Async": "false", - "X-Lithic-Pagination": "cursor", **self._custom_headers, } @@ -514,10 +489,7 @@ def api_status( return self.get( "/v1/status", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=APIStatus, ) @@ -697,12 +669,6 @@ def balances(self) -> AsyncBalances: return AsyncBalances(self) - @cached_property - def aggregate_balances(self) -> AsyncAggregateBalances: - from .resources.aggregate_balances import AsyncAggregateBalances - - return AsyncAggregateBalances(self) - @cached_property def disputes(self) -> AsyncDisputes: from .resources.disputes import AsyncDisputes @@ -823,6 +789,12 @@ def account_activity(self) -> AsyncAccountActivity: return AsyncAccountActivity(self) + @cached_property + def transfer_limits(self) -> AsyncTransferLimits: + from .resources.transfer_limits import AsyncTransferLimits + + return AsyncTransferLimits(self) + @cached_property def webhooks(self) -> AsyncWebhooks: from .resources.webhooks import AsyncWebhooks @@ -854,7 +826,6 @@ def default_headers(self) -> dict[str, str | Omit]: return { **super().default_headers, "X-Stainless-Async": f"async:{get_async_library()}", - "X-Lithic-Pagination": "cursor", **self._custom_headers, } @@ -927,10 +898,7 @@ async def api_status( return await self.get( "/v1/status", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=APIStatus, ) @@ -998,22 +966,14 @@ def auth_rules(self) -> auth_rules.AuthRulesWithRawResponse: return AuthRulesWithRawResponse(self._client.auth_rules) @cached_property - def auth_stream_enrollment( - self, - ) -> auth_stream_enrollment.AuthStreamEnrollmentWithRawResponse: - from .resources.auth_stream_enrollment import ( - AuthStreamEnrollmentWithRawResponse, - ) + def auth_stream_enrollment(self) -> auth_stream_enrollment.AuthStreamEnrollmentWithRawResponse: + from .resources.auth_stream_enrollment import AuthStreamEnrollmentWithRawResponse return AuthStreamEnrollmentWithRawResponse(self._client.auth_stream_enrollment) @cached_property - def tokenization_decisioning( - self, - ) -> tokenization_decisioning.TokenizationDecisioningWithRawResponse: - from .resources.tokenization_decisioning import ( - TokenizationDecisioningWithRawResponse, - ) + def tokenization_decisioning(self) -> tokenization_decisioning.TokenizationDecisioningWithRawResponse: + from .resources.tokenization_decisioning import TokenizationDecisioningWithRawResponse return TokenizationDecisioningWithRawResponse(self._client.tokenization_decisioning) @@ -1041,12 +1001,6 @@ def balances(self) -> balances.BalancesWithRawResponse: return BalancesWithRawResponse(self._client.balances) - @cached_property - def aggregate_balances(self) -> aggregate_balances.AggregateBalancesWithRawResponse: - from .resources.aggregate_balances import AggregateBalancesWithRawResponse - - return AggregateBalancesWithRawResponse(self._client.aggregate_balances) - @cached_property def disputes(self) -> disputes.DisputesWithRawResponse: from .resources.disputes import DisputesWithRawResponse @@ -1078,20 +1032,14 @@ def transactions(self) -> transactions.TransactionsWithRawResponse: return TransactionsWithRawResponse(self._client.transactions) @cached_property - def responder_endpoints( - self, - ) -> responder_endpoints.ResponderEndpointsWithRawResponse: + def responder_endpoints(self) -> responder_endpoints.ResponderEndpointsWithRawResponse: from .resources.responder_endpoints import ResponderEndpointsWithRawResponse return ResponderEndpointsWithRawResponse(self._client.responder_endpoints) @cached_property - def external_bank_accounts( - self, - ) -> external_bank_accounts.ExternalBankAccountsWithRawResponse: - from .resources.external_bank_accounts import ( - ExternalBankAccountsWithRawResponse, - ) + def external_bank_accounts(self) -> external_bank_accounts.ExternalBankAccountsWithRawResponse: + from .resources.external_bank_accounts import ExternalBankAccountsWithRawResponse return ExternalBankAccountsWithRawResponse(self._client.external_bank_accounts) @@ -1120,9 +1068,7 @@ def card_programs(self) -> card_programs.CardProgramsWithRawResponse: return CardProgramsWithRawResponse(self._client.card_programs) @cached_property - def digital_card_art( - self, - ) -> digital_card_art.DigitalCardArtResourceWithRawResponse: + def digital_card_art(self) -> digital_card_art.DigitalCardArtResourceWithRawResponse: from .resources.digital_card_art import DigitalCardArtResourceWithRawResponse return DigitalCardArtResourceWithRawResponse(self._client.digital_card_art) @@ -1146,9 +1092,7 @@ def external_payments(self) -> external_payments.ExternalPaymentsWithRawResponse return ExternalPaymentsWithRawResponse(self._client.external_payments) @cached_property - def management_operations( - self, - ) -> management_operations.ManagementOperationsWithRawResponse: + def management_operations(self) -> management_operations.ManagementOperationsWithRawResponse: from .resources.management_operations import ManagementOperationsWithRawResponse return ManagementOperationsWithRawResponse(self._client.management_operations) @@ -1177,6 +1121,12 @@ def account_activity(self) -> account_activity.AccountActivityWithRawResponse: return AccountActivityWithRawResponse(self._client.account_activity) + @cached_property + def transfer_limits(self) -> transfer_limits.TransferLimitsWithRawResponse: + from .resources.transfer_limits import TransferLimitsWithRawResponse + + return TransferLimitsWithRawResponse(self._client.transfer_limits) + class AsyncLithicWithRawResponse: _client: AsyncLithic @@ -1207,22 +1157,14 @@ def auth_rules(self) -> auth_rules.AsyncAuthRulesWithRawResponse: return AsyncAuthRulesWithRawResponse(self._client.auth_rules) @cached_property - def auth_stream_enrollment( - self, - ) -> auth_stream_enrollment.AsyncAuthStreamEnrollmentWithRawResponse: - from .resources.auth_stream_enrollment import ( - AsyncAuthStreamEnrollmentWithRawResponse, - ) + def auth_stream_enrollment(self) -> auth_stream_enrollment.AsyncAuthStreamEnrollmentWithRawResponse: + from .resources.auth_stream_enrollment import AsyncAuthStreamEnrollmentWithRawResponse return AsyncAuthStreamEnrollmentWithRawResponse(self._client.auth_stream_enrollment) @cached_property - def tokenization_decisioning( - self, - ) -> tokenization_decisioning.AsyncTokenizationDecisioningWithRawResponse: - from .resources.tokenization_decisioning import ( - AsyncTokenizationDecisioningWithRawResponse, - ) + def tokenization_decisioning(self) -> tokenization_decisioning.AsyncTokenizationDecisioningWithRawResponse: + from .resources.tokenization_decisioning import AsyncTokenizationDecisioningWithRawResponse return AsyncTokenizationDecisioningWithRawResponse(self._client.tokenization_decisioning) @@ -1250,14 +1192,6 @@ def balances(self) -> balances.AsyncBalancesWithRawResponse: return AsyncBalancesWithRawResponse(self._client.balances) - @cached_property - def aggregate_balances( - self, - ) -> aggregate_balances.AsyncAggregateBalancesWithRawResponse: - from .resources.aggregate_balances import AsyncAggregateBalancesWithRawResponse - - return AsyncAggregateBalancesWithRawResponse(self._client.aggregate_balances) - @cached_property def disputes(self) -> disputes.AsyncDisputesWithRawResponse: from .resources.disputes import AsyncDisputesWithRawResponse @@ -1277,9 +1211,7 @@ def events(self) -> events.AsyncEventsWithRawResponse: return AsyncEventsWithRawResponse(self._client.events) @cached_property - def financial_accounts( - self, - ) -> financial_accounts.AsyncFinancialAccountsWithRawResponse: + def financial_accounts(self) -> financial_accounts.AsyncFinancialAccountsWithRawResponse: from .resources.financial_accounts import AsyncFinancialAccountsWithRawResponse return AsyncFinancialAccountsWithRawResponse(self._client.financial_accounts) @@ -1291,22 +1223,14 @@ def transactions(self) -> transactions.AsyncTransactionsWithRawResponse: return AsyncTransactionsWithRawResponse(self._client.transactions) @cached_property - def responder_endpoints( - self, - ) -> responder_endpoints.AsyncResponderEndpointsWithRawResponse: - from .resources.responder_endpoints import ( - AsyncResponderEndpointsWithRawResponse, - ) + def responder_endpoints(self) -> responder_endpoints.AsyncResponderEndpointsWithRawResponse: + from .resources.responder_endpoints import AsyncResponderEndpointsWithRawResponse return AsyncResponderEndpointsWithRawResponse(self._client.responder_endpoints) @cached_property - def external_bank_accounts( - self, - ) -> external_bank_accounts.AsyncExternalBankAccountsWithRawResponse: - from .resources.external_bank_accounts import ( - AsyncExternalBankAccountsWithRawResponse, - ) + def external_bank_accounts(self) -> external_bank_accounts.AsyncExternalBankAccountsWithRawResponse: + from .resources.external_bank_accounts import AsyncExternalBankAccountsWithRawResponse return AsyncExternalBankAccountsWithRawResponse(self._client.external_bank_accounts) @@ -1335,12 +1259,8 @@ def card_programs(self) -> card_programs.AsyncCardProgramsWithRawResponse: return AsyncCardProgramsWithRawResponse(self._client.card_programs) @cached_property - def digital_card_art( - self, - ) -> digital_card_art.AsyncDigitalCardArtResourceWithRawResponse: - from .resources.digital_card_art import ( - AsyncDigitalCardArtResourceWithRawResponse, - ) + def digital_card_art(self) -> digital_card_art.AsyncDigitalCardArtResourceWithRawResponse: + from .resources.digital_card_art import AsyncDigitalCardArtResourceWithRawResponse return AsyncDigitalCardArtResourceWithRawResponse(self._client.digital_card_art) @@ -1357,20 +1277,14 @@ def credit_products(self) -> credit_products.AsyncCreditProductsWithRawResponse: return AsyncCreditProductsWithRawResponse(self._client.credit_products) @cached_property - def external_payments( - self, - ) -> external_payments.AsyncExternalPaymentsWithRawResponse: + def external_payments(self) -> external_payments.AsyncExternalPaymentsWithRawResponse: from .resources.external_payments import AsyncExternalPaymentsWithRawResponse return AsyncExternalPaymentsWithRawResponse(self._client.external_payments) @cached_property - def management_operations( - self, - ) -> management_operations.AsyncManagementOperationsWithRawResponse: - from .resources.management_operations import ( - AsyncManagementOperationsWithRawResponse, - ) + def management_operations(self) -> management_operations.AsyncManagementOperationsWithRawResponse: + from .resources.management_operations import AsyncManagementOperationsWithRawResponse return AsyncManagementOperationsWithRawResponse(self._client.management_operations) @@ -1398,6 +1312,12 @@ def account_activity(self) -> account_activity.AsyncAccountActivityWithRawRespon return AsyncAccountActivityWithRawResponse(self._client.account_activity) + @cached_property + def transfer_limits(self) -> transfer_limits.AsyncTransferLimitsWithRawResponse: + from .resources.transfer_limits import AsyncTransferLimitsWithRawResponse + + return AsyncTransferLimitsWithRawResponse(self._client.transfer_limits) + class LithicWithStreamedResponse: _client: Lithic @@ -1428,22 +1348,14 @@ def auth_rules(self) -> auth_rules.AuthRulesWithStreamingResponse: return AuthRulesWithStreamingResponse(self._client.auth_rules) @cached_property - def auth_stream_enrollment( - self, - ) -> auth_stream_enrollment.AuthStreamEnrollmentWithStreamingResponse: - from .resources.auth_stream_enrollment import ( - AuthStreamEnrollmentWithStreamingResponse, - ) + def auth_stream_enrollment(self) -> auth_stream_enrollment.AuthStreamEnrollmentWithStreamingResponse: + from .resources.auth_stream_enrollment import AuthStreamEnrollmentWithStreamingResponse return AuthStreamEnrollmentWithStreamingResponse(self._client.auth_stream_enrollment) @cached_property - def tokenization_decisioning( - self, - ) -> tokenization_decisioning.TokenizationDecisioningWithStreamingResponse: - from .resources.tokenization_decisioning import ( - TokenizationDecisioningWithStreamingResponse, - ) + def tokenization_decisioning(self) -> tokenization_decisioning.TokenizationDecisioningWithStreamingResponse: + from .resources.tokenization_decisioning import TokenizationDecisioningWithStreamingResponse return TokenizationDecisioningWithStreamingResponse(self._client.tokenization_decisioning) @@ -1471,14 +1383,6 @@ def balances(self) -> balances.BalancesWithStreamingResponse: return BalancesWithStreamingResponse(self._client.balances) - @cached_property - def aggregate_balances( - self, - ) -> aggregate_balances.AggregateBalancesWithStreamingResponse: - from .resources.aggregate_balances import AggregateBalancesWithStreamingResponse - - return AggregateBalancesWithStreamingResponse(self._client.aggregate_balances) - @cached_property def disputes(self) -> disputes.DisputesWithStreamingResponse: from .resources.disputes import DisputesWithStreamingResponse @@ -1498,9 +1402,7 @@ def events(self) -> events.EventsWithStreamingResponse: return EventsWithStreamingResponse(self._client.events) @cached_property - def financial_accounts( - self, - ) -> financial_accounts.FinancialAccountsWithStreamingResponse: + def financial_accounts(self) -> financial_accounts.FinancialAccountsWithStreamingResponse: from .resources.financial_accounts import FinancialAccountsWithStreamingResponse return FinancialAccountsWithStreamingResponse(self._client.financial_accounts) @@ -1512,22 +1414,14 @@ def transactions(self) -> transactions.TransactionsWithStreamingResponse: return TransactionsWithStreamingResponse(self._client.transactions) @cached_property - def responder_endpoints( - self, - ) -> responder_endpoints.ResponderEndpointsWithStreamingResponse: - from .resources.responder_endpoints import ( - ResponderEndpointsWithStreamingResponse, - ) + def responder_endpoints(self) -> responder_endpoints.ResponderEndpointsWithStreamingResponse: + from .resources.responder_endpoints import ResponderEndpointsWithStreamingResponse return ResponderEndpointsWithStreamingResponse(self._client.responder_endpoints) @cached_property - def external_bank_accounts( - self, - ) -> external_bank_accounts.ExternalBankAccountsWithStreamingResponse: - from .resources.external_bank_accounts import ( - ExternalBankAccountsWithStreamingResponse, - ) + def external_bank_accounts(self) -> external_bank_accounts.ExternalBankAccountsWithStreamingResponse: + from .resources.external_bank_accounts import ExternalBankAccountsWithStreamingResponse return ExternalBankAccountsWithStreamingResponse(self._client.external_bank_accounts) @@ -1556,12 +1450,8 @@ def card_programs(self) -> card_programs.CardProgramsWithStreamingResponse: return CardProgramsWithStreamingResponse(self._client.card_programs) @cached_property - def digital_card_art( - self, - ) -> digital_card_art.DigitalCardArtResourceWithStreamingResponse: - from .resources.digital_card_art import ( - DigitalCardArtResourceWithStreamingResponse, - ) + def digital_card_art(self) -> digital_card_art.DigitalCardArtResourceWithStreamingResponse: + from .resources.digital_card_art import DigitalCardArtResourceWithStreamingResponse return DigitalCardArtResourceWithStreamingResponse(self._client.digital_card_art) @@ -1578,20 +1468,14 @@ def credit_products(self) -> credit_products.CreditProductsWithStreamingResponse return CreditProductsWithStreamingResponse(self._client.credit_products) @cached_property - def external_payments( - self, - ) -> external_payments.ExternalPaymentsWithStreamingResponse: + def external_payments(self) -> external_payments.ExternalPaymentsWithStreamingResponse: from .resources.external_payments import ExternalPaymentsWithStreamingResponse return ExternalPaymentsWithStreamingResponse(self._client.external_payments) @cached_property - def management_operations( - self, - ) -> management_operations.ManagementOperationsWithStreamingResponse: - from .resources.management_operations import ( - ManagementOperationsWithStreamingResponse, - ) + def management_operations(self) -> management_operations.ManagementOperationsWithStreamingResponse: + from .resources.management_operations import ManagementOperationsWithStreamingResponse return ManagementOperationsWithStreamingResponse(self._client.management_operations) @@ -1619,6 +1503,12 @@ def account_activity(self) -> account_activity.AccountActivityWithStreamingRespo return AccountActivityWithStreamingResponse(self._client.account_activity) + @cached_property + def transfer_limits(self) -> transfer_limits.TransferLimitsWithStreamingResponse: + from .resources.transfer_limits import TransferLimitsWithStreamingResponse + + return TransferLimitsWithStreamingResponse(self._client.transfer_limits) + class AsyncLithicWithStreamedResponse: _client: AsyncLithic @@ -1637,9 +1527,7 @@ def accounts(self) -> accounts.AsyncAccountsWithStreamingResponse: return AsyncAccountsWithStreamingResponse(self._client.accounts) @cached_property - def account_holders( - self, - ) -> account_holders.AsyncAccountHoldersWithStreamingResponse: + def account_holders(self) -> account_holders.AsyncAccountHoldersWithStreamingResponse: from .resources.account_holders import AsyncAccountHoldersWithStreamingResponse return AsyncAccountHoldersWithStreamingResponse(self._client.account_holders) @@ -1651,22 +1539,14 @@ def auth_rules(self) -> auth_rules.AsyncAuthRulesWithStreamingResponse: return AsyncAuthRulesWithStreamingResponse(self._client.auth_rules) @cached_property - def auth_stream_enrollment( - self, - ) -> auth_stream_enrollment.AsyncAuthStreamEnrollmentWithStreamingResponse: - from .resources.auth_stream_enrollment import ( - AsyncAuthStreamEnrollmentWithStreamingResponse, - ) + def auth_stream_enrollment(self) -> auth_stream_enrollment.AsyncAuthStreamEnrollmentWithStreamingResponse: + from .resources.auth_stream_enrollment import AsyncAuthStreamEnrollmentWithStreamingResponse return AsyncAuthStreamEnrollmentWithStreamingResponse(self._client.auth_stream_enrollment) @cached_property - def tokenization_decisioning( - self, - ) -> tokenization_decisioning.AsyncTokenizationDecisioningWithStreamingResponse: - from .resources.tokenization_decisioning import ( - AsyncTokenizationDecisioningWithStreamingResponse, - ) + def tokenization_decisioning(self) -> tokenization_decisioning.AsyncTokenizationDecisioningWithStreamingResponse: + from .resources.tokenization_decisioning import AsyncTokenizationDecisioningWithStreamingResponse return AsyncTokenizationDecisioningWithStreamingResponse(self._client.tokenization_decisioning) @@ -1683,9 +1563,7 @@ def cards(self) -> cards.AsyncCardsWithStreamingResponse: return AsyncCardsWithStreamingResponse(self._client.cards) @cached_property - def card_bulk_orders( - self, - ) -> card_bulk_orders.AsyncCardBulkOrdersWithStreamingResponse: + def card_bulk_orders(self) -> card_bulk_orders.AsyncCardBulkOrdersWithStreamingResponse: from .resources.card_bulk_orders import AsyncCardBulkOrdersWithStreamingResponse return AsyncCardBulkOrdersWithStreamingResponse(self._client.card_bulk_orders) @@ -1696,16 +1574,6 @@ def balances(self) -> balances.AsyncBalancesWithStreamingResponse: return AsyncBalancesWithStreamingResponse(self._client.balances) - @cached_property - def aggregate_balances( - self, - ) -> aggregate_balances.AsyncAggregateBalancesWithStreamingResponse: - from .resources.aggregate_balances import ( - AsyncAggregateBalancesWithStreamingResponse, - ) - - return AsyncAggregateBalancesWithStreamingResponse(self._client.aggregate_balances) - @cached_property def disputes(self) -> disputes.AsyncDisputesWithStreamingResponse: from .resources.disputes import AsyncDisputesWithStreamingResponse @@ -1725,12 +1593,8 @@ def events(self) -> events.AsyncEventsWithStreamingResponse: return AsyncEventsWithStreamingResponse(self._client.events) @cached_property - def financial_accounts( - self, - ) -> financial_accounts.AsyncFinancialAccountsWithStreamingResponse: - from .resources.financial_accounts import ( - AsyncFinancialAccountsWithStreamingResponse, - ) + def financial_accounts(self) -> financial_accounts.AsyncFinancialAccountsWithStreamingResponse: + from .resources.financial_accounts import AsyncFinancialAccountsWithStreamingResponse return AsyncFinancialAccountsWithStreamingResponse(self._client.financial_accounts) @@ -1741,22 +1605,14 @@ def transactions(self) -> transactions.AsyncTransactionsWithStreamingResponse: return AsyncTransactionsWithStreamingResponse(self._client.transactions) @cached_property - def responder_endpoints( - self, - ) -> responder_endpoints.AsyncResponderEndpointsWithStreamingResponse: - from .resources.responder_endpoints import ( - AsyncResponderEndpointsWithStreamingResponse, - ) + def responder_endpoints(self) -> responder_endpoints.AsyncResponderEndpointsWithStreamingResponse: + from .resources.responder_endpoints import AsyncResponderEndpointsWithStreamingResponse return AsyncResponderEndpointsWithStreamingResponse(self._client.responder_endpoints) @cached_property - def external_bank_accounts( - self, - ) -> external_bank_accounts.AsyncExternalBankAccountsWithStreamingResponse: - from .resources.external_bank_accounts import ( - AsyncExternalBankAccountsWithStreamingResponse, - ) + def external_bank_accounts(self) -> external_bank_accounts.AsyncExternalBankAccountsWithStreamingResponse: + from .resources.external_bank_accounts import AsyncExternalBankAccountsWithStreamingResponse return AsyncExternalBankAccountsWithStreamingResponse(self._client.external_bank_accounts) @@ -1785,12 +1641,8 @@ def card_programs(self) -> card_programs.AsyncCardProgramsWithStreamingResponse: return AsyncCardProgramsWithStreamingResponse(self._client.card_programs) @cached_property - def digital_card_art( - self, - ) -> digital_card_art.AsyncDigitalCardArtResourceWithStreamingResponse: - from .resources.digital_card_art import ( - AsyncDigitalCardArtResourceWithStreamingResponse, - ) + def digital_card_art(self) -> digital_card_art.AsyncDigitalCardArtResourceWithStreamingResponse: + from .resources.digital_card_art import AsyncDigitalCardArtResourceWithStreamingResponse return AsyncDigitalCardArtResourceWithStreamingResponse(self._client.digital_card_art) @@ -1801,30 +1653,20 @@ def book_transfers(self) -> book_transfers.AsyncBookTransfersWithStreamingRespon return AsyncBookTransfersWithStreamingResponse(self._client.book_transfers) @cached_property - def credit_products( - self, - ) -> credit_products.AsyncCreditProductsWithStreamingResponse: + def credit_products(self) -> credit_products.AsyncCreditProductsWithStreamingResponse: from .resources.credit_products import AsyncCreditProductsWithStreamingResponse return AsyncCreditProductsWithStreamingResponse(self._client.credit_products) @cached_property - def external_payments( - self, - ) -> external_payments.AsyncExternalPaymentsWithStreamingResponse: - from .resources.external_payments import ( - AsyncExternalPaymentsWithStreamingResponse, - ) + def external_payments(self) -> external_payments.AsyncExternalPaymentsWithStreamingResponse: + from .resources.external_payments import AsyncExternalPaymentsWithStreamingResponse return AsyncExternalPaymentsWithStreamingResponse(self._client.external_payments) @cached_property - def management_operations( - self, - ) -> management_operations.AsyncManagementOperationsWithStreamingResponse: - from .resources.management_operations import ( - AsyncManagementOperationsWithStreamingResponse, - ) + def management_operations(self) -> management_operations.AsyncManagementOperationsWithStreamingResponse: + from .resources.management_operations import AsyncManagementOperationsWithStreamingResponse return AsyncManagementOperationsWithStreamingResponse(self._client.management_operations) @@ -1841,25 +1683,23 @@ def fraud(self) -> fraud.AsyncFraudWithStreamingResponse: return AsyncFraudWithStreamingResponse(self._client.fraud) @cached_property - def network_programs( - self, - ) -> network_programs.AsyncNetworkProgramsWithStreamingResponse: - from .resources.network_programs import ( - AsyncNetworkProgramsWithStreamingResponse, - ) + def network_programs(self) -> network_programs.AsyncNetworkProgramsWithStreamingResponse: + from .resources.network_programs import AsyncNetworkProgramsWithStreamingResponse return AsyncNetworkProgramsWithStreamingResponse(self._client.network_programs) @cached_property - def account_activity( - self, - ) -> account_activity.AsyncAccountActivityWithStreamingResponse: - from .resources.account_activity import ( - AsyncAccountActivityWithStreamingResponse, - ) + def account_activity(self) -> account_activity.AsyncAccountActivityWithStreamingResponse: + from .resources.account_activity import AsyncAccountActivityWithStreamingResponse return AsyncAccountActivityWithStreamingResponse(self._client.account_activity) + @cached_property + def transfer_limits(self) -> transfer_limits.AsyncTransferLimitsWithStreamingResponse: + from .resources.transfer_limits import AsyncTransferLimitsWithStreamingResponse + + return AsyncTransferLimitsWithStreamingResponse(self._client.transfer_limits) + Client = Lithic diff --git a/src/lithic/_version.py b/src/lithic/_version.py index 768e4d15..00d68453 100644 --- a/src/lithic/_version.py +++ b/src/lithic/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "lithic" -__version__ = "0.112.0" # x-release-please-version +__version__ = "0.113.0" # x-release-please-version diff --git a/src/lithic/resources/__init__.py b/src/lithic/resources/__init__.py index face2018..07be719f 100644 --- a/src/lithic/resources/__init__.py +++ b/src/lithic/resources/__init__.py @@ -145,6 +145,14 @@ CreditProductsWithStreamingResponse, AsyncCreditProductsWithStreamingResponse, ) +from .transfer_limits import ( + TransferLimits, + AsyncTransferLimits, + TransferLimitsWithRawResponse, + AsyncTransferLimitsWithRawResponse, + TransferLimitsWithStreamingResponse, + AsyncTransferLimitsWithStreamingResponse, +) from .account_activity import ( AccountActivity, AsyncAccountActivity, @@ -185,14 +193,6 @@ ExternalPaymentsWithStreamingResponse, AsyncExternalPaymentsWithStreamingResponse, ) -from .aggregate_balances import ( - AggregateBalances, - AsyncAggregateBalances, - AggregateBalancesWithRawResponse, - AsyncAggregateBalancesWithRawResponse, - AggregateBalancesWithStreamingResponse, - AsyncAggregateBalancesWithStreamingResponse, -) from .financial_accounts import ( FinancialAccounts, AsyncFinancialAccounts, @@ -297,12 +297,6 @@ "AsyncBalancesWithRawResponse", "BalancesWithStreamingResponse", "AsyncBalancesWithStreamingResponse", - "AggregateBalances", - "AsyncAggregateBalances", - "AggregateBalancesWithRawResponse", - "AsyncAggregateBalancesWithRawResponse", - "AggregateBalancesWithStreamingResponse", - "AsyncAggregateBalancesWithStreamingResponse", "Disputes", "AsyncDisputes", "DisputesWithRawResponse", @@ -423,6 +417,12 @@ "AsyncAccountActivityWithRawResponse", "AccountActivityWithStreamingResponse", "AsyncAccountActivityWithStreamingResponse", + "TransferLimits", + "AsyncTransferLimits", + "TransferLimitsWithRawResponse", + "AsyncTransferLimitsWithRawResponse", + "TransferLimitsWithStreamingResponse", + "AsyncTransferLimitsWithStreamingResponse", "Webhooks", "AsyncWebhooks", ] diff --git a/src/lithic/resources/book_transfers.py b/src/lithic/resources/book_transfers.py index f2eb20ef..1fbef4bf 100644 --- a/src/lithic/resources/book_transfers.py +++ b/src/lithic/resources/book_transfers.py @@ -9,7 +9,12 @@ import httpx from .. import _legacy_response -from ..types import book_transfer_list_params, book_transfer_create_params, book_transfer_reverse_params +from ..types import ( + book_transfer_list_params, + book_transfer_retry_params, + book_transfer_create_params, + book_transfer_reverse_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 @@ -297,6 +302,46 @@ def list( model=BookTransferResponse, ) + def retry( + self, + book_transfer_token: str, + *, + retry_token: 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, + ) -> BookTransferResponse: + """ + Retry a book transfer that has been declined + + Args: + retry_token: Customer-provided token that will serve as an idempotency token. This token will + become the transaction token. + + 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 book_transfer_token: + raise ValueError( + f"Expected a non-empty value for `book_transfer_token` but received {book_transfer_token!r}" + ) + return self._post( + f"/v1/book_transfers/{book_transfer_token}/retry", + body=maybe_transform({"retry_token": retry_token}, book_transfer_retry_params.BookTransferRetryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BookTransferResponse, + ) + def reverse( self, book_transfer_token: str, @@ -612,6 +657,48 @@ def list( model=BookTransferResponse, ) + async def retry( + self, + book_transfer_token: str, + *, + retry_token: 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, + ) -> BookTransferResponse: + """ + Retry a book transfer that has been declined + + Args: + retry_token: Customer-provided token that will serve as an idempotency token. This token will + become the transaction token. + + 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 book_transfer_token: + raise ValueError( + f"Expected a non-empty value for `book_transfer_token` but received {book_transfer_token!r}" + ) + return await self._post( + f"/v1/book_transfers/{book_transfer_token}/retry", + body=await async_maybe_transform( + {"retry_token": retry_token}, book_transfer_retry_params.BookTransferRetryParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BookTransferResponse, + ) + async def reverse( self, book_transfer_token: str, @@ -665,6 +752,9 @@ def __init__(self, book_transfers: BookTransfers) -> None: self.list = _legacy_response.to_raw_response_wrapper( book_transfers.list, ) + self.retry = _legacy_response.to_raw_response_wrapper( + book_transfers.retry, + ) self.reverse = _legacy_response.to_raw_response_wrapper( book_transfers.reverse, ) @@ -683,6 +773,9 @@ def __init__(self, book_transfers: AsyncBookTransfers) -> None: self.list = _legacy_response.async_to_raw_response_wrapper( book_transfers.list, ) + self.retry = _legacy_response.async_to_raw_response_wrapper( + book_transfers.retry, + ) self.reverse = _legacy_response.async_to_raw_response_wrapper( book_transfers.reverse, ) @@ -701,6 +794,9 @@ def __init__(self, book_transfers: BookTransfers) -> None: self.list = to_streamed_response_wrapper( book_transfers.list, ) + self.retry = to_streamed_response_wrapper( + book_transfers.retry, + ) self.reverse = to_streamed_response_wrapper( book_transfers.reverse, ) @@ -719,6 +815,9 @@ def __init__(self, book_transfers: AsyncBookTransfers) -> None: self.list = async_to_streamed_response_wrapper( book_transfers.list, ) + self.retry = async_to_streamed_response_wrapper( + book_transfers.retry, + ) self.reverse = async_to_streamed_response_wrapper( book_transfers.reverse, ) diff --git a/src/lithic/resources/cards/__init__.py b/src/lithic/resources/cards/__init__.py index 790baf59..71ca7811 100644 --- a/src/lithic/resources/cards/__init__.py +++ b/src/lithic/resources/cards/__init__.py @@ -16,14 +16,6 @@ BalancesWithStreamingResponse, AsyncBalancesWithStreamingResponse, ) -from .aggregate_balances import ( - AggregateBalances, - AsyncAggregateBalances, - AggregateBalancesWithRawResponse, - AsyncAggregateBalancesWithRawResponse, - AggregateBalancesWithStreamingResponse, - AsyncAggregateBalancesWithStreamingResponse, -) from .financial_transactions import ( FinancialTransactions, AsyncFinancialTransactions, @@ -34,12 +26,6 @@ ) __all__ = [ - "AggregateBalances", - "AsyncAggregateBalances", - "AggregateBalancesWithRawResponse", - "AsyncAggregateBalancesWithRawResponse", - "AggregateBalancesWithStreamingResponse", - "AsyncAggregateBalancesWithStreamingResponse", "Balances", "AsyncBalances", "BalancesWithRawResponse", diff --git a/src/lithic/resources/cards/aggregate_balances.py b/src/lithic/resources/cards/aggregate_balances.py deleted file mode 100644 index 97db711d..00000000 --- a/src/lithic/resources/cards/aggregate_balances.py +++ /dev/null @@ -1,190 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ... import _legacy_response -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_streamed_response_wrapper, async_to_streamed_response_wrapper -from ...pagination import SyncSinglePage, AsyncSinglePage -from ...types.cards import aggregate_balance_list_params -from ..._base_client import AsyncPaginator, make_request_options -from ...types.cards.aggregate_balance_list_response import AggregateBalanceListResponse - -__all__ = ["AggregateBalances", "AsyncAggregateBalances"] - - -class AggregateBalances(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AggregateBalancesWithRawResponse: - """ - 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/lithic-com/lithic-python#accessing-raw-response-data-eg-headers - """ - return AggregateBalancesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AggregateBalancesWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response - """ - return AggregateBalancesWithStreamingResponse(self) - - def list( - self, - *, - account_token: str | Omit = omit, - business_account_token: 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, - ) -> SyncSinglePage[AggregateBalanceListResponse]: - """ - Get the aggregated card balance across all end-user accounts. - - Args: - account_token: Cardholder to retrieve aggregate balances for. - - business_account_token: Business to retrieve aggregate balances 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 - """ - return self._get_api_list( - "/v1/cards/aggregate_balances", - page=SyncSinglePage[AggregateBalanceListResponse], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "account_token": account_token, - "business_account_token": business_account_token, - }, - aggregate_balance_list_params.AggregateBalanceListParams, - ), - ), - model=AggregateBalanceListResponse, - ) - - -class AsyncAggregateBalances(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAggregateBalancesWithRawResponse: - """ - 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/lithic-com/lithic-python#accessing-raw-response-data-eg-headers - """ - return AsyncAggregateBalancesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAggregateBalancesWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response - """ - return AsyncAggregateBalancesWithStreamingResponse(self) - - def list( - self, - *, - account_token: str | Omit = omit, - business_account_token: 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, - ) -> AsyncPaginator[AggregateBalanceListResponse, AsyncSinglePage[AggregateBalanceListResponse]]: - """ - Get the aggregated card balance across all end-user accounts. - - Args: - account_token: Cardholder to retrieve aggregate balances for. - - business_account_token: Business to retrieve aggregate balances 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 - """ - return self._get_api_list( - "/v1/cards/aggregate_balances", - page=AsyncSinglePage[AggregateBalanceListResponse], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "account_token": account_token, - "business_account_token": business_account_token, - }, - aggregate_balance_list_params.AggregateBalanceListParams, - ), - ), - model=AggregateBalanceListResponse, - ) - - -class AggregateBalancesWithRawResponse: - def __init__(self, aggregate_balances: AggregateBalances) -> None: - self._aggregate_balances = aggregate_balances - - self.list = _legacy_response.to_raw_response_wrapper( - aggregate_balances.list, - ) - - -class AsyncAggregateBalancesWithRawResponse: - def __init__(self, aggregate_balances: AsyncAggregateBalances) -> None: - self._aggregate_balances = aggregate_balances - - self.list = _legacy_response.async_to_raw_response_wrapper( - aggregate_balances.list, - ) - - -class AggregateBalancesWithStreamingResponse: - def __init__(self, aggregate_balances: AggregateBalances) -> None: - self._aggregate_balances = aggregate_balances - - self.list = to_streamed_response_wrapper( - aggregate_balances.list, - ) - - -class AsyncAggregateBalancesWithStreamingResponse: - def __init__(self, aggregate_balances: AsyncAggregateBalances) -> None: - self._aggregate_balances = aggregate_balances - - self.list = async_to_streamed_response_wrapper( - aggregate_balances.list, - ) diff --git a/src/lithic/resources/cards/cards.py b/src/lithic/resources/cards/cards.py index 5325041a..5a4da996 100644 --- a/src/lithic/resources/cards/cards.py +++ b/src/lithic/resources/cards/cards.py @@ -44,14 +44,6 @@ from ...pagination import SyncCursorPage, AsyncCursorPage from ...types.card import Card from ..._base_client import AsyncPaginator, _merge_mappings, make_request_options -from .aggregate_balances import ( - AggregateBalances, - AsyncAggregateBalances, - AggregateBalancesWithRawResponse, - AsyncAggregateBalancesWithRawResponse, - AggregateBalancesWithStreamingResponse, - AsyncAggregateBalancesWithStreamingResponse, -) from ...types.non_pci_card import NonPCICard from .financial_transactions import ( FinancialTransactions, @@ -72,10 +64,6 @@ class Cards(SyncAPIResource): - @cached_property - def aggregate_balances(self) -> AggregateBalances: - return AggregateBalances(self._client) - @cached_property def balances(self) -> Balances: return Balances(self._client) @@ -1258,10 +1246,6 @@ def web_provision( class AsyncCards(AsyncAPIResource): - @cached_property - def aggregate_balances(self) -> AsyncAggregateBalances: - return AsyncAggregateBalances(self._client) - @cached_property def balances(self) -> AsyncBalances: return AsyncBalances(self._client) @@ -2484,10 +2468,6 @@ def __init__(self, cards: Cards) -> None: cards.web_provision, ) - @cached_property - def aggregate_balances(self) -> AggregateBalancesWithRawResponse: - return AggregateBalancesWithRawResponse(self._cards.aggregate_balances) - @cached_property def balances(self) -> BalancesWithRawResponse: return BalancesWithRawResponse(self._cards.balances) @@ -2538,10 +2518,6 @@ def __init__(self, cards: AsyncCards) -> None: cards.web_provision, ) - @cached_property - def aggregate_balances(self) -> AsyncAggregateBalancesWithRawResponse: - return AsyncAggregateBalancesWithRawResponse(self._cards.aggregate_balances) - @cached_property def balances(self) -> AsyncBalancesWithRawResponse: return AsyncBalancesWithRawResponse(self._cards.balances) @@ -2592,10 +2568,6 @@ def __init__(self, cards: Cards) -> None: cards.web_provision, ) - @cached_property - def aggregate_balances(self) -> AggregateBalancesWithStreamingResponse: - return AggregateBalancesWithStreamingResponse(self._cards.aggregate_balances) - @cached_property def balances(self) -> BalancesWithStreamingResponse: return BalancesWithStreamingResponse(self._cards.balances) @@ -2646,10 +2618,6 @@ def __init__(self, cards: AsyncCards) -> None: cards.web_provision, ) - @cached_property - def aggregate_balances(self) -> AsyncAggregateBalancesWithStreamingResponse: - return AsyncAggregateBalancesWithStreamingResponse(self._cards.aggregate_balances) - @cached_property def balances(self) -> AsyncBalancesWithStreamingResponse: return AsyncBalancesWithStreamingResponse(self._cards.balances) diff --git a/src/lithic/resources/external_payments.py b/src/lithic/resources/external_payments.py index 07c51674..fd4cf371 100644 --- a/src/lithic/resources/external_payments.py +++ b/src/lithic/resources/external_payments.py @@ -74,6 +74,9 @@ def create( Create external payment Args: + token: Customer-provided token that will serve as an idempotency token. This token will + become the transaction token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -449,6 +452,9 @@ async def create( Create external payment Args: + token: Customer-provided token that will serve as an idempotency token. This token will + become the transaction token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/lithic/resources/management_operations.py b/src/lithic/resources/management_operations.py index 641599fb..ac148f05 100644 --- a/src/lithic/resources/management_operations.py +++ b/src/lithic/resources/management_operations.py @@ -103,6 +103,9 @@ def create( Create management operation Args: + token: Customer-provided token that will serve as an idempotency token. This token will + become the transaction token. + on_closed_account: What to do if the financial account is closed when posting an operation extra_headers: Send extra headers @@ -380,6 +383,9 @@ async def create( Create management operation Args: + token: Customer-provided token that will serve as an idempotency token. This token will + become the transaction token. + on_closed_account: What to do if the financial account is closed when posting an operation extra_headers: Send extra headers diff --git a/src/lithic/resources/aggregate_balances.py b/src/lithic/resources/transfer_limits.py similarity index 57% rename from src/lithic/resources/aggregate_balances.py rename to src/lithic/resources/transfer_limits.py index 5d35dc36..790e899c 100644 --- a/src/lithic/resources/aggregate_balances.py +++ b/src/lithic/resources/transfer_limits.py @@ -2,12 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal +from typing import Union +from datetime import date import httpx from .. import _legacy_response -from ..types import aggregate_balance_list_params +from ..types import transfer_limit_list_params from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform from .._compat import cached_property @@ -15,48 +16,47 @@ from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..pagination import SyncSinglePage, AsyncSinglePage from .._base_client import AsyncPaginator, make_request_options -from ..types.aggregate_balance import AggregateBalance +from ..types.transfer_limits_response import Data -__all__ = ["AggregateBalances", "AsyncAggregateBalances"] +__all__ = ["TransferLimits", "AsyncTransferLimits"] -class AggregateBalances(SyncAPIResource): +class TransferLimits(SyncAPIResource): @cached_property - def with_raw_response(self) -> AggregateBalancesWithRawResponse: + def with_raw_response(self) -> TransferLimitsWithRawResponse: """ 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/lithic-com/lithic-python#accessing-raw-response-data-eg-headers """ - return AggregateBalancesWithRawResponse(self) + return TransferLimitsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AggregateBalancesWithStreamingResponse: + def with_streaming_response(self) -> TransferLimitsWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response """ - return AggregateBalancesWithStreamingResponse(self) + return TransferLimitsWithStreamingResponse(self) def list( self, *, - financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] | Omit = omit, + date: Union[str, date] | 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, - ) -> SyncSinglePage[AggregateBalance]: + ) -> SyncSinglePage[Data]: """ - Get the aggregated balance across all end-user accounts by financial account - type + Get transfer limits for a specified date Args: - financial_account_type: Get the aggregate balance for a given Financial Account type. + date: Date for which to retrieve transfer limits (ISO 8601 format) extra_headers: Send extra headers @@ -67,59 +67,55 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( - "/v1/aggregate_balances", - page=SyncSinglePage[AggregateBalance], + "/v1/transfer_limits", + page=SyncSinglePage[Data], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( - {"financial_account_type": financial_account_type}, - aggregate_balance_list_params.AggregateBalanceListParams, - ), + query=maybe_transform({"date": date}, transfer_limit_list_params.TransferLimitListParams), ), - model=AggregateBalance, + model=Data, ) -class AsyncAggregateBalances(AsyncAPIResource): +class AsyncTransferLimits(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncAggregateBalancesWithRawResponse: + def with_raw_response(self) -> AsyncTransferLimitsWithRawResponse: """ 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/lithic-com/lithic-python#accessing-raw-response-data-eg-headers """ - return AsyncAggregateBalancesWithRawResponse(self) + return AsyncTransferLimitsWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncAggregateBalancesWithStreamingResponse: + def with_streaming_response(self) -> AsyncTransferLimitsWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response """ - return AsyncAggregateBalancesWithStreamingResponse(self) + return AsyncTransferLimitsWithStreamingResponse(self) def list( self, *, - financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] | Omit = omit, + date: Union[str, date] | 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[AggregateBalance, AsyncSinglePage[AggregateBalance]]: + ) -> AsyncPaginator[Data, AsyncSinglePage[Data]]: """ - Get the aggregated balance across all end-user accounts by financial account - type + Get transfer limits for a specified date Args: - financial_account_type: Get the aggregate balance for a given Financial Account type. + date: Date for which to retrieve transfer limits (ISO 8601 format) extra_headers: Send extra headers @@ -130,53 +126,50 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( - "/v1/aggregate_balances", - page=AsyncSinglePage[AggregateBalance], + "/v1/transfer_limits", + page=AsyncSinglePage[Data], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( - {"financial_account_type": financial_account_type}, - aggregate_balance_list_params.AggregateBalanceListParams, - ), + query=maybe_transform({"date": date}, transfer_limit_list_params.TransferLimitListParams), ), - model=AggregateBalance, + model=Data, ) -class AggregateBalancesWithRawResponse: - def __init__(self, aggregate_balances: AggregateBalances) -> None: - self._aggregate_balances = aggregate_balances +class TransferLimitsWithRawResponse: + def __init__(self, transfer_limits: TransferLimits) -> None: + self._transfer_limits = transfer_limits self.list = _legacy_response.to_raw_response_wrapper( - aggregate_balances.list, + transfer_limits.list, ) -class AsyncAggregateBalancesWithRawResponse: - def __init__(self, aggregate_balances: AsyncAggregateBalances) -> None: - self._aggregate_balances = aggregate_balances +class AsyncTransferLimitsWithRawResponse: + def __init__(self, transfer_limits: AsyncTransferLimits) -> None: + self._transfer_limits = transfer_limits self.list = _legacy_response.async_to_raw_response_wrapper( - aggregate_balances.list, + transfer_limits.list, ) -class AggregateBalancesWithStreamingResponse: - def __init__(self, aggregate_balances: AggregateBalances) -> None: - self._aggregate_balances = aggregate_balances +class TransferLimitsWithStreamingResponse: + def __init__(self, transfer_limits: TransferLimits) -> None: + self._transfer_limits = transfer_limits self.list = to_streamed_response_wrapper( - aggregate_balances.list, + transfer_limits.list, ) -class AsyncAggregateBalancesWithStreamingResponse: - def __init__(self, aggregate_balances: AsyncAggregateBalances) -> None: - self._aggregate_balances = aggregate_balances +class AsyncTransferLimitsWithStreamingResponse: + def __init__(self, transfer_limits: AsyncTransferLimits) -> None: + self._transfer_limits = transfer_limits self.list = async_to_streamed_response_wrapper( - aggregate_balances.list, + transfer_limits.list, ) diff --git a/src/lithic/types/__init__.py b/src/lithic/types/__init__.py index 89961e91..9cb0fdcd 100644 --- a/src/lithic/types/__init__.py +++ b/src/lithic/types/__init__.py @@ -43,7 +43,6 @@ from .external_payment import ExternalPayment as ExternalPayment from .kyc_exempt_param import KYCExemptParam as KYCExemptParam from .statement_totals import StatementTotals as StatementTotals -from .aggregate_balance import AggregateBalance as AggregateBalance from .card_embed_params import CardEmbedParams as CardEmbedParams from .card_renew_params import CardRenewParams as CardRenewParams from .card_spend_limits import CardSpendLimits as CardSpendLimits @@ -95,247 +94,93 @@ from .card_program_list_params import CardProgramListParams as CardProgramListParams from .tokenization_list_params import TokenizationListParams as TokenizationListParams from .tokenization_rule_result import TokenizationRuleResult as TokenizationRuleResult +from .transfer_limits_response import TransferLimitsResponse as TransferLimitsResponse from .asa_request_webhook_event import AsaRequestWebhookEvent as AsaRequestWebhookEvent from .book_transfer_list_params import BookTransferListParams as BookTransferListParams from .card_get_embed_url_params import CardGetEmbedURLParams as CardGetEmbedURLParams from .card_search_by_pan_params import CardSearchByPanParams as CardSearchByPanParams from .card_web_provision_params import CardWebProvisionParams as CardWebProvisionParams -from .cardholder_authentication import ( - CardholderAuthentication as CardholderAuthentication, -) -from .financial_account_balance import ( - FinancialAccountBalance as FinancialAccountBalance, -) +from .cardholder_authentication import CardholderAuthentication as CardholderAuthentication +from .financial_account_balance import FinancialAccountBalance as FinancialAccountBalance from .funding_event_list_params import FundingEventListParams as FundingEventListParams -from .responder_endpoint_status import ( - ResponderEndpointStatus as ResponderEndpointStatus, -) -from .account_holder_list_params import ( - AccountHolderListParams as AccountHolderListParams, -) -from .card_created_webhook_event import ( - CardCreatedWebhookEvent as CardCreatedWebhookEvent, -) +from .responder_endpoint_status import ResponderEndpointStatus as ResponderEndpointStatus +from .account_holder_list_params import AccountHolderListParams as AccountHolderListParams +from .book_transfer_retry_params import BookTransferRetryParams as BookTransferRetryParams +from .card_created_webhook_event import CardCreatedWebhookEvent as CardCreatedWebhookEvent from .card_get_embed_html_params import CardGetEmbedHTMLParams as CardGetEmbedHTMLParams -from .card_renewed_webhook_event import ( - CardRenewedWebhookEvent as CardRenewedWebhookEvent, -) -from .card_shipped_webhook_event import ( - CardShippedWebhookEvent as CardShippedWebhookEvent, -) -from .event_list_attempts_params import ( - EventListAttemptsParams as EventListAttemptsParams, -) -from .settlement_summary_details import ( - SettlementSummaryDetails as SettlementSummaryDetails, -) -from .book_transfer_create_params import ( - BookTransferCreateParams as BookTransferCreateParams, -) -from .card_bulk_order_list_params import ( - CardBulkOrderListParams as CardBulkOrderListParams, -) -from .card_reissued_webhook_event import ( - CardReissuedWebhookEvent as CardReissuedWebhookEvent, -) -from .card_web_provision_response import ( - CardWebProvisionResponse as CardWebProvisionResponse, -) -from .network_program_list_params import ( - NetworkProgramListParams as NetworkProgramListParams, -) -from .tokenization_decline_reason import ( - TokenizationDeclineReason as TokenizationDeclineReason, -) -from .account_activity_list_params import ( - AccountActivityListParams as AccountActivityListParams, -) -from .account_holder_create_params import ( - AccountHolderCreateParams as AccountHolderCreateParams, -) -from .account_holder_update_params import ( - AccountHolderUpdateParams as AccountHolderUpdateParams, -) -from .book_transfer_reverse_params import ( - BookTransferReverseParams as BookTransferReverseParams, -) -from .card_convert_physical_params import ( - CardConvertPhysicalParams as CardConvertPhysicalParams, -) -from .card_converted_webhook_event import ( - CardConvertedWebhookEvent as CardConvertedWebhookEvent, -) -from .digital_card_art_list_params import ( - DigitalCardArtListParams as DigitalCardArtListParams, -) -from .external_payment_list_params import ( - ExternalPaymentListParams as ExternalPaymentListParams, -) -from .tokenization_simulate_params import ( - TokenizationSimulateParams as TokenizationSimulateParams, -) -from .aggregate_balance_list_params import ( - AggregateBalanceListParams as AggregateBalanceListParams, -) -from .balance_updated_webhook_event import ( - BalanceUpdatedWebhookEvent as BalanceUpdatedWebhookEvent, -) -from .card_bulk_order_create_params import ( - CardBulkOrderCreateParams as CardBulkOrderCreateParams, -) -from .card_bulk_order_update_params import ( - CardBulkOrderUpdateParams as CardBulkOrderUpdateParams, -) -from .digital_wallet_token_metadata import ( - DigitalWalletTokenMetadata as DigitalWalletTokenMetadata, -) -from .dispute_list_evidences_params import ( - DisputeListEvidencesParams as DisputeListEvidencesParams, -) -from .dispute_updated_webhook_event import ( - DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent, -) -from .external_bank_account_address import ( - ExternalBankAccountAddress as ExternalBankAccountAddress, -) -from .financial_account_list_params import ( - FinancialAccountListParams as FinancialAccountListParams, -) -from .account_activity_list_response import ( - AccountActivityListResponse as AccountActivityListResponse, -) -from .account_holder_create_response import ( - AccountHolderCreateResponse as AccountHolderCreateResponse, -) -from .account_holder_update_response import ( - AccountHolderUpdateResponse as AccountHolderUpdateResponse, -) -from .external_payment_cancel_params import ( - ExternalPaymentCancelParams as ExternalPaymentCancelParams, -) -from .external_payment_create_params import ( - ExternalPaymentCreateParams as ExternalPaymentCreateParams, -) -from .external_payment_settle_params import ( - ExternalPaymentSettleParams as ExternalPaymentSettleParams, -) -from .payment_simulate_action_params import ( - PaymentSimulateActionParams as PaymentSimulateActionParams, -) -from .payment_simulate_return_params import ( - PaymentSimulateReturnParams as PaymentSimulateReturnParams, -) -from .external_payment_release_params import ( - ExternalPaymentReleaseParams as ExternalPaymentReleaseParams, -) -from .external_payment_reverse_params import ( - ExternalPaymentReverseParams as ExternalPaymentReverseParams, -) -from .financial_account_create_params import ( - FinancialAccountCreateParams as FinancialAccountCreateParams, -) -from .financial_account_update_params import ( - FinancialAccountUpdateParams as FinancialAccountUpdateParams, -) -from .loan_tape_created_webhook_event import ( - LoanTapeCreatedWebhookEvent as LoanTapeCreatedWebhookEvent, -) -from .loan_tape_updated_webhook_event import ( - LoanTapeUpdatedWebhookEvent as LoanTapeUpdatedWebhookEvent, -) -from .payment_simulate_receipt_params import ( - PaymentSimulateReceiptParams as PaymentSimulateReceiptParams, -) -from .payment_simulate_release_params import ( - PaymentSimulateReleaseParams as PaymentSimulateReleaseParams, -) -from .management_operation_list_params import ( - ManagementOperationListParams as ManagementOperationListParams, -) -from .management_operation_transaction import ( - ManagementOperationTransaction as ManagementOperationTransaction, -) -from .payment_simulate_action_response import ( - PaymentSimulateActionResponse as PaymentSimulateActionResponse, -) -from .payment_simulate_return_response import ( - PaymentSimulateReturnResponse as PaymentSimulateReturnResponse, -) -from .responder_endpoint_create_params import ( - ResponderEndpointCreateParams as ResponderEndpointCreateParams, -) -from .responder_endpoint_delete_params import ( - ResponderEndpointDeleteParams as ResponderEndpointDeleteParams, -) -from .statements_created_webhook_event import ( - StatementsCreatedWebhookEvent as StatementsCreatedWebhookEvent, -) -from .transaction_simulate_void_params import ( - TransactionSimulateVoidParams as TransactionSimulateVoidParams, -) -from .external_bank_account_list_params import ( - ExternalBankAccountListParams as ExternalBankAccountListParams, -) -from .payment_simulate_receipt_response import ( - PaymentSimulateReceiptResponse as PaymentSimulateReceiptResponse, -) -from .payment_simulate_release_response import ( - PaymentSimulateReleaseResponse as PaymentSimulateReleaseResponse, -) -from .tokenization_result_webhook_event import ( - TokenizationResultWebhookEvent as TokenizationResultWebhookEvent, -) -from .management_operation_create_params import ( - ManagementOperationCreateParams as ManagementOperationCreateParams, -) -from .responder_endpoint_create_response import ( - ResponderEndpointCreateResponse as ResponderEndpointCreateResponse, -) -from .tokenization_updated_webhook_event import ( - TokenizationUpdatedWebhookEvent as TokenizationUpdatedWebhookEvent, -) -from .transaction_simulate_return_params import ( - TransactionSimulateReturnParams as TransactionSimulateReturnParams, -) -from .transaction_simulate_void_response import ( - TransactionSimulateVoidResponse as TransactionSimulateVoidResponse, -) -from .external_bank_account_address_param import ( - ExternalBankAccountAddressParam as ExternalBankAccountAddressParam, -) -from .external_bank_account_create_params import ( - ExternalBankAccountCreateParams as ExternalBankAccountCreateParams, -) -from .external_bank_account_list_response import ( - ExternalBankAccountListResponse as ExternalBankAccountListResponse, -) -from .external_bank_account_update_params import ( - ExternalBankAccountUpdateParams as ExternalBankAccountUpdateParams, -) -from .funding_event_created_webhook_event import ( - FundingEventCreatedWebhookEvent as FundingEventCreatedWebhookEvent, -) -from .management_operation_reverse_params import ( - ManagementOperationReverseParams as ManagementOperationReverseParams, -) -from .network_total_created_webhook_event import ( - NetworkTotalCreatedWebhookEvent as NetworkTotalCreatedWebhookEvent, -) -from .network_total_updated_webhook_event import ( - NetworkTotalUpdatedWebhookEvent as NetworkTotalUpdatedWebhookEvent, -) -from .account_holder_created_webhook_event import ( - AccountHolderCreatedWebhookEvent as AccountHolderCreatedWebhookEvent, -) -from .account_holder_updated_webhook_event import ( - AccountHolderUpdatedWebhookEvent as AccountHolderUpdatedWebhookEvent, -) -from .transaction_simulate_clearing_params import ( - TransactionSimulateClearingParams as TransactionSimulateClearingParams, -) -from .transaction_simulate_return_response import ( - TransactionSimulateReturnResponse as TransactionSimulateReturnResponse, -) +from .card_renewed_webhook_event import CardRenewedWebhookEvent as CardRenewedWebhookEvent +from .card_shipped_webhook_event import CardShippedWebhookEvent as CardShippedWebhookEvent +from .event_list_attempts_params import EventListAttemptsParams as EventListAttemptsParams +from .settlement_summary_details import SettlementSummaryDetails as SettlementSummaryDetails +from .transfer_limit_list_params import TransferLimitListParams as TransferLimitListParams +from .book_transfer_create_params import BookTransferCreateParams as BookTransferCreateParams +from .card_bulk_order_list_params import CardBulkOrderListParams as CardBulkOrderListParams +from .card_reissued_webhook_event import CardReissuedWebhookEvent as CardReissuedWebhookEvent +from .card_web_provision_response import CardWebProvisionResponse as CardWebProvisionResponse +from .network_program_list_params import NetworkProgramListParams as NetworkProgramListParams +from .tokenization_decline_reason import TokenizationDeclineReason as TokenizationDeclineReason +from .account_activity_list_params import AccountActivityListParams as AccountActivityListParams +from .account_holder_create_params import AccountHolderCreateParams as AccountHolderCreateParams +from .account_holder_update_params import AccountHolderUpdateParams as AccountHolderUpdateParams +from .book_transfer_reverse_params import BookTransferReverseParams as BookTransferReverseParams +from .card_convert_physical_params import CardConvertPhysicalParams as CardConvertPhysicalParams +from .card_converted_webhook_event import CardConvertedWebhookEvent as CardConvertedWebhookEvent +from .digital_card_art_list_params import DigitalCardArtListParams as DigitalCardArtListParams +from .external_payment_list_params import ExternalPaymentListParams as ExternalPaymentListParams +from .tokenization_simulate_params import TokenizationSimulateParams as TokenizationSimulateParams +from .balance_updated_webhook_event import BalanceUpdatedWebhookEvent as BalanceUpdatedWebhookEvent +from .card_bulk_order_create_params import CardBulkOrderCreateParams as CardBulkOrderCreateParams +from .card_bulk_order_update_params import CardBulkOrderUpdateParams as CardBulkOrderUpdateParams +from .digital_wallet_token_metadata import DigitalWalletTokenMetadata as DigitalWalletTokenMetadata +from .dispute_list_evidences_params import DisputeListEvidencesParams as DisputeListEvidencesParams +from .dispute_updated_webhook_event import DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent +from .external_bank_account_address import ExternalBankAccountAddress as ExternalBankAccountAddress +from .financial_account_list_params import FinancialAccountListParams as FinancialAccountListParams +from .account_activity_list_response import AccountActivityListResponse as AccountActivityListResponse +from .account_holder_create_response import AccountHolderCreateResponse as AccountHolderCreateResponse +from .account_holder_update_response import AccountHolderUpdateResponse as AccountHolderUpdateResponse +from .external_payment_cancel_params import ExternalPaymentCancelParams as ExternalPaymentCancelParams +from .external_payment_create_params import ExternalPaymentCreateParams as ExternalPaymentCreateParams +from .external_payment_settle_params import ExternalPaymentSettleParams as ExternalPaymentSettleParams +from .payment_simulate_action_params import PaymentSimulateActionParams as PaymentSimulateActionParams +from .payment_simulate_return_params import PaymentSimulateReturnParams as PaymentSimulateReturnParams +from .external_payment_release_params import ExternalPaymentReleaseParams as ExternalPaymentReleaseParams +from .external_payment_reverse_params import ExternalPaymentReverseParams as ExternalPaymentReverseParams +from .financial_account_create_params import FinancialAccountCreateParams as FinancialAccountCreateParams +from .financial_account_update_params import FinancialAccountUpdateParams as FinancialAccountUpdateParams +from .loan_tape_created_webhook_event import LoanTapeCreatedWebhookEvent as LoanTapeCreatedWebhookEvent +from .loan_tape_updated_webhook_event import LoanTapeUpdatedWebhookEvent as LoanTapeUpdatedWebhookEvent +from .payment_simulate_receipt_params import PaymentSimulateReceiptParams as PaymentSimulateReceiptParams +from .payment_simulate_release_params import PaymentSimulateReleaseParams as PaymentSimulateReleaseParams +from .management_operation_list_params import ManagementOperationListParams as ManagementOperationListParams +from .management_operation_transaction import ManagementOperationTransaction as ManagementOperationTransaction +from .payment_simulate_action_response import PaymentSimulateActionResponse as PaymentSimulateActionResponse +from .payment_simulate_return_response import PaymentSimulateReturnResponse as PaymentSimulateReturnResponse +from .responder_endpoint_create_params import ResponderEndpointCreateParams as ResponderEndpointCreateParams +from .responder_endpoint_delete_params import ResponderEndpointDeleteParams as ResponderEndpointDeleteParams +from .statements_created_webhook_event import StatementsCreatedWebhookEvent as StatementsCreatedWebhookEvent +from .transaction_simulate_void_params import TransactionSimulateVoidParams as TransactionSimulateVoidParams +from .external_bank_account_list_params import ExternalBankAccountListParams as ExternalBankAccountListParams +from .payment_simulate_receipt_response import PaymentSimulateReceiptResponse as PaymentSimulateReceiptResponse +from .payment_simulate_release_response import PaymentSimulateReleaseResponse as PaymentSimulateReleaseResponse +from .tokenization_result_webhook_event import TokenizationResultWebhookEvent as TokenizationResultWebhookEvent +from .management_operation_create_params import ManagementOperationCreateParams as ManagementOperationCreateParams +from .responder_endpoint_create_response import ResponderEndpointCreateResponse as ResponderEndpointCreateResponse +from .tokenization_updated_webhook_event import TokenizationUpdatedWebhookEvent as TokenizationUpdatedWebhookEvent +from .transaction_simulate_return_params import TransactionSimulateReturnParams as TransactionSimulateReturnParams +from .transaction_simulate_void_response import TransactionSimulateVoidResponse as TransactionSimulateVoidResponse +from .external_bank_account_address_param import ExternalBankAccountAddressParam as ExternalBankAccountAddressParam +from .external_bank_account_create_params import ExternalBankAccountCreateParams as ExternalBankAccountCreateParams +from .external_bank_account_list_response import ExternalBankAccountListResponse as ExternalBankAccountListResponse +from .external_bank_account_update_params import ExternalBankAccountUpdateParams as ExternalBankAccountUpdateParams +from .funding_event_created_webhook_event import FundingEventCreatedWebhookEvent as FundingEventCreatedWebhookEvent +from .management_operation_reverse_params import ManagementOperationReverseParams as ManagementOperationReverseParams +from .network_total_created_webhook_event import NetworkTotalCreatedWebhookEvent as NetworkTotalCreatedWebhookEvent +from .network_total_updated_webhook_event import NetworkTotalUpdatedWebhookEvent as NetworkTotalUpdatedWebhookEvent +from .account_holder_created_webhook_event import AccountHolderCreatedWebhookEvent as AccountHolderCreatedWebhookEvent +from .account_holder_updated_webhook_event import AccountHolderUpdatedWebhookEvent as AccountHolderUpdatedWebhookEvent +from .transaction_simulate_clearing_params import TransactionSimulateClearingParams as TransactionSimulateClearingParams +from .transaction_simulate_return_response import TransactionSimulateReturnResponse as TransactionSimulateReturnResponse from .account_holder_upload_document_params import ( AccountHolderUploadDocumentParams as AccountHolderUploadDocumentParams, ) diff --git a/src/lithic/types/aggregate_balance.py b/src/lithic/types/aggregate_balance.py deleted file mode 100644 index d74f4cee..00000000 --- a/src/lithic/types/aggregate_balance.py +++ /dev/null @@ -1,54 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from datetime import datetime -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["AggregateBalance"] - - -class AggregateBalance(BaseModel): - """Aggregate Balance across all end-user accounts""" - - available_amount: int - """Funds available for spend in the currency's smallest unit (e.g., cents for USD)""" - - created: datetime - """Date and time for when the balance was first created.""" - - currency: str - """3-character alphabetic ISO 4217 code for the local currency of the balance.""" - - financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] - """Type of financial account""" - - last_financial_account_token: str - """ - Globally unique identifier for the financial account that had its balance - updated most recently - """ - - last_transaction_event_token: str - """ - Globally unique identifier for the last transaction event that impacted this - balance - """ - - last_transaction_token: str - """Globally unique identifier for the last transaction that impacted this balance""" - - pending_amount: int - """Funds not available for spend due to card authorizations or pending ACH release. - - Shown in the currency's smallest unit (e.g., cents for USD) - """ - - total_amount: int - """ - The sum of available and pending balance in the currency's smallest unit (e.g., - cents for USD) - """ - - updated: datetime - """Date and time for when the balance was last updated.""" diff --git a/src/lithic/types/aggregate_balance_list_params.py b/src/lithic/types/aggregate_balance_list_params.py deleted file mode 100644 index 519ad11d..00000000 --- a/src/lithic/types/aggregate_balance_list_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, TypedDict - -__all__ = ["AggregateBalanceListParams"] - - -class AggregateBalanceListParams(TypedDict, total=False): - financial_account_type: Literal["ISSUING", "OPERATING", "RESERVE", "SECURITY"] - """Get the aggregate balance for a given Financial Account type.""" diff --git a/src/lithic/types/book_transfer_retry_params.py b/src/lithic/types/book_transfer_retry_params.py new file mode 100644 index 00000000..305e43a4 --- /dev/null +++ b/src/lithic/types/book_transfer_retry_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BookTransferRetryParams"] + + +class BookTransferRetryParams(TypedDict, total=False): + retry_token: Required[str] + """Customer-provided token that will serve as an idempotency token. + + This token will become the transaction token. + """ diff --git a/src/lithic/types/cards/__init__.py b/src/lithic/types/cards/__init__.py index 63dfd5cb..3f28d3d0 100644 --- a/src/lithic/types/cards/__init__.py +++ b/src/lithic/types/cards/__init__.py @@ -3,6 +3,4 @@ from __future__ import annotations from .balance_list_params import BalanceListParams as BalanceListParams -from .aggregate_balance_list_params import AggregateBalanceListParams as AggregateBalanceListParams -from .aggregate_balance_list_response import AggregateBalanceListResponse as AggregateBalanceListResponse from .financial_transaction_list_params import FinancialTransactionListParams as FinancialTransactionListParams diff --git a/src/lithic/types/cards/aggregate_balance_list_params.py b/src/lithic/types/cards/aggregate_balance_list_params.py deleted file mode 100644 index 51b927dc..00000000 --- a/src/lithic/types/cards/aggregate_balance_list_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["AggregateBalanceListParams"] - - -class AggregateBalanceListParams(TypedDict, total=False): - account_token: str - """Cardholder to retrieve aggregate balances for.""" - - business_account_token: str - """Business to retrieve aggregate balances for.""" diff --git a/src/lithic/types/cards/aggregate_balance_list_response.py b/src/lithic/types/cards/aggregate_balance_list_response.py deleted file mode 100644 index 0075a93e..00000000 --- a/src/lithic/types/cards/aggregate_balance_list_response.py +++ /dev/null @@ -1,50 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["AggregateBalanceListResponse"] - - -class AggregateBalanceListResponse(BaseModel): - """Card Aggregate Balance across all end-user accounts""" - - available_amount: int - """Funds available for spend in the currency's smallest unit (e.g., cents for USD)""" - - created: datetime - """Date and time for when the balance was first created.""" - - currency: str - """3-character alphabetic ISO 4217 code for the local currency of the balance.""" - - last_card_token: str - """ - Globally unique identifier for the card that had its balance updated most - recently - """ - - last_transaction_event_token: str - """ - Globally unique identifier for the last transaction event that impacted this - balance - """ - - last_transaction_token: str - """Globally unique identifier for the last transaction that impacted this balance""" - - pending_amount: int - """Funds not available for spend due to card authorizations or pending ACH release. - - Shown in the currency's smallest unit (e.g., cents for USD) - """ - - total_amount: int - """ - The sum of available and pending balance in the currency's smallest unit (e.g., - cents for USD) - """ - - updated: datetime - """Date and time for when the balance was last updated.""" diff --git a/src/lithic/types/external_payment_create_params.py b/src/lithic/types/external_payment_create_params.py index 0977186c..294244e9 100644 --- a/src/lithic/types/external_payment_create_params.py +++ b/src/lithic/types/external_payment_create_params.py @@ -27,6 +27,10 @@ class ExternalPaymentCreateParams(TypedDict, total=False): payment_type: Required[Literal["DEPOSIT", "WITHDRAWAL"]] token: str + """Customer-provided token that will serve as an idempotency token. + + This token will become the transaction token. + """ memo: str diff --git a/src/lithic/types/management_operation_create_params.py b/src/lithic/types/management_operation_create_params.py index 47d2dada..2c1cdbc1 100644 --- a/src/lithic/types/management_operation_create_params.py +++ b/src/lithic/types/management_operation_create_params.py @@ -61,6 +61,10 @@ class ManagementOperationCreateParams(TypedDict, total=False): financial_account_token: Required[str] token: str + """Customer-provided token that will serve as an idempotency token. + + This token will become the transaction token. + """ memo: str diff --git a/src/lithic/types/payment.py b/src/lithic/types/payment.py index 3b32efaa..0be3425f 100644 --- a/src/lithic/types/payment.py +++ b/src/lithic/types/payment.py @@ -95,6 +95,9 @@ class Event(BaseModel): ] = None """More detailed reasons for the event""" + external_id: Optional[str] = None + """Payment event external ID, for example, ACH trace number.""" + class MethodAttributesACHMethodAttributes(BaseModel): sec_code: Literal["CCD", "PPD", "WEB", "TEL", "CIE", "CTX"] @@ -250,6 +253,7 @@ class Payment(BaseModel): "WIRE_INBOUND_ADMIN", "WIRE_OUTBOUND_PAYMENT", "WIRE_OUTBOUND_ADMIN", + "WIRE_DRAWDOWN_REQUEST", ] ] = None diff --git a/src/lithic/types/transfer_limit_list_params.py b/src/lithic/types/transfer_limit_list_params.py new file mode 100644 index 00000000..841f0447 --- /dev/null +++ b/src/lithic/types/transfer_limit_list_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import datetime +from typing import Union +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["TransferLimitListParams"] + + +class TransferLimitListParams(TypedDict, total=False): + date: Annotated[Union[str, datetime.date], PropertyInfo(format="iso8601")] + """Date for which to retrieve transfer limits (ISO 8601 format)""" diff --git a/src/lithic/types/transfer_limits_response.py b/src/lithic/types/transfer_limits_response.py new file mode 100644 index 00000000..6ff5a3e0 --- /dev/null +++ b/src/lithic/types/transfer_limits_response.py @@ -0,0 +1,138 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import datetime +from typing import List, Optional + +from .._models import BaseModel + +__all__ = [ + "TransferLimitsResponse", + "Data", + "DataDailyLimit", + "DataDailyLimitCredit", + "DataDailyLimitDebit", + "DataMonthlyLimit", + "DataMonthlyLimitCredit", + "DataMonthlyLimitDebit", + "DataProgramLimitPerTransaction", + "DataProgramLimitPerTransactionCredit", + "DataProgramLimitPerTransactionDebit", +] + + +class DataDailyLimitCredit(BaseModel): + """Credit limits""" + + limit: int + """The limit amount""" + + amount_originated: Optional[int] = None + """Amount originated towards limit""" + + +class DataDailyLimitDebit(BaseModel): + """Debit limits""" + + limit: int + """The limit amount""" + + amount_originated: Optional[int] = None + """Amount originated towards limit""" + + +class DataDailyLimit(BaseModel): + """Daily limits with progress""" + + credit: DataDailyLimitCredit + """Credit limits""" + + debit: DataDailyLimitDebit + """Debit limits""" + + +class DataMonthlyLimitCredit(BaseModel): + """Credit limits""" + + limit: int + """The limit amount""" + + amount_originated: Optional[int] = None + """Amount originated towards limit""" + + +class DataMonthlyLimitDebit(BaseModel): + """Debit limits""" + + limit: int + """The limit amount""" + + amount_originated: Optional[int] = None + """Amount originated towards limit""" + + +class DataMonthlyLimit(BaseModel): + """Monthly limits with progress""" + + credit: DataMonthlyLimitCredit + """Credit limits""" + + debit: DataMonthlyLimitDebit + """Debit limits""" + + +class DataProgramLimitPerTransactionCredit(BaseModel): + """Credit limits""" + + limit: int + """The limit amount""" + + amount_originated: Optional[int] = None + """Amount originated towards limit""" + + +class DataProgramLimitPerTransactionDebit(BaseModel): + """Debit limits""" + + limit: int + """The limit amount""" + + amount_originated: Optional[int] = None + """Amount originated towards limit""" + + +class DataProgramLimitPerTransaction(BaseModel): + """Program transaction limits""" + + credit: DataProgramLimitPerTransactionCredit + """Credit limits""" + + debit: DataProgramLimitPerTransactionDebit + """Debit limits""" + + +class Data(BaseModel): + company_id: str + """Company ID""" + + daily_limit: DataDailyLimit + """Daily limits with progress""" + + date: datetime.date + """The date for the limit view (ISO format)""" + + is_fbo: bool + """Whether the company is a FBO; based on the company ID prefix""" + + monthly_limit: DataMonthlyLimit + """Monthly limits with progress""" + + program_limit_per_transaction: DataProgramLimitPerTransaction + """Program transaction limits""" + + +class TransferLimitsResponse(BaseModel): + data: List[Data] + """List of transfer limits""" + + has_more: bool + """Whether there are more transfer limits""" diff --git a/tests/api_resources/cards/test_aggregate_balances.py b/tests/api_resources/cards/test_aggregate_balances.py deleted file mode 100644 index 745e313d..00000000 --- a/tests/api_resources/cards/test_aggregate_balances.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 lithic import Lithic, AsyncLithic -from tests.utils import assert_matches_type -from lithic.pagination import SyncSinglePage, AsyncSinglePage -from lithic.types.cards import AggregateBalanceListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestAggregateBalances: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Lithic) -> None: - aggregate_balance = client.cards.aggregate_balances.list() - assert_matches_type(SyncSinglePage[AggregateBalanceListResponse], aggregate_balance, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Lithic) -> None: - aggregate_balance = client.cards.aggregate_balances.list( - account_token="account_token", - business_account_token="business_account_token", - ) - assert_matches_type(SyncSinglePage[AggregateBalanceListResponse], aggregate_balance, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Lithic) -> None: - response = client.cards.aggregate_balances.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - aggregate_balance = response.parse() - assert_matches_type(SyncSinglePage[AggregateBalanceListResponse], aggregate_balance, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Lithic) -> None: - with client.cards.aggregate_balances.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - aggregate_balance = response.parse() - assert_matches_type(SyncSinglePage[AggregateBalanceListResponse], aggregate_balance, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncAggregateBalances: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @parametrize - async def test_method_list(self, async_client: AsyncLithic) -> None: - aggregate_balance = await async_client.cards.aggregate_balances.list() - assert_matches_type(AsyncSinglePage[AggregateBalanceListResponse], aggregate_balance, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> None: - aggregate_balance = await async_client.cards.aggregate_balances.list( - account_token="account_token", - business_account_token="business_account_token", - ) - assert_matches_type(AsyncSinglePage[AggregateBalanceListResponse], aggregate_balance, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncLithic) -> None: - response = await async_client.cards.aggregate_balances.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - aggregate_balance = response.parse() - assert_matches_type(AsyncSinglePage[AggregateBalanceListResponse], aggregate_balance, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncLithic) -> None: - async with async_client.cards.aggregate_balances.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - aggregate_balance = await response.parse() - assert_matches_type(AsyncSinglePage[AggregateBalanceListResponse], aggregate_balance, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_book_transfers.py b/tests/api_resources/test_book_transfers.py index 38aa6510..690dc830 100644 --- a/tests/api_resources/test_book_transfers.py +++ b/tests/api_resources/test_book_transfers.py @@ -163,6 +163,48 @@ def test_streaming_response_list(self, client: Lithic) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_retry(self, client: Lithic) -> None: + book_transfer = client.book_transfers.retry( + book_transfer_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + retry_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) + + @parametrize + def test_raw_response_retry(self, client: Lithic) -> None: + response = client.book_transfers.with_raw_response.retry( + book_transfer_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + retry_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + book_transfer = response.parse() + assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) + + @parametrize + def test_streaming_response_retry(self, client: Lithic) -> None: + with client.book_transfers.with_streaming_response.retry( + book_transfer_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + retry_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + book_transfer = response.parse() + assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retry(self, client: Lithic) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `book_transfer_token` but received ''"): + client.book_transfers.with_raw_response.retry( + book_transfer_token="", + retry_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + @parametrize def test_method_reverse(self, client: Lithic) -> None: book_transfer = client.book_transfers.reverse( @@ -357,6 +399,48 @@ async def test_streaming_response_list(self, async_client: AsyncLithic) -> None: assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_retry(self, async_client: AsyncLithic) -> None: + book_transfer = await async_client.book_transfers.retry( + book_transfer_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + retry_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) + + @parametrize + async def test_raw_response_retry(self, async_client: AsyncLithic) -> None: + response = await async_client.book_transfers.with_raw_response.retry( + book_transfer_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + retry_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + book_transfer = response.parse() + assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_retry(self, async_client: AsyncLithic) -> None: + async with async_client.book_transfers.with_streaming_response.retry( + book_transfer_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + retry_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + book_transfer = await response.parse() + assert_matches_type(BookTransferResponse, book_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retry(self, async_client: AsyncLithic) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `book_transfer_token` but received ''"): + await async_client.book_transfers.with_raw_response.retry( + book_transfer_token="", + retry_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + @parametrize async def test_method_reverse(self, async_client: AsyncLithic) -> None: book_transfer = await async_client.book_transfers.reverse( diff --git a/tests/api_resources/test_aggregate_balances.py b/tests/api_resources/test_transfer_limits.py similarity index 53% rename from tests/api_resources/test_aggregate_balances.py rename to tests/api_resources/test_transfer_limits.py index 485f951f..bd9c10c2 100644 --- a/tests/api_resources/test_aggregate_balances.py +++ b/tests/api_resources/test_transfer_limits.py @@ -9,81 +9,82 @@ from lithic import Lithic, AsyncLithic from tests.utils import assert_matches_type -from lithic.types import AggregateBalance +from lithic._utils import parse_date from lithic.pagination import SyncSinglePage, AsyncSinglePage +from lithic.types.transfer_limits_response import Data base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestAggregateBalances: +class TestTransferLimits: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_list(self, client: Lithic) -> None: - aggregate_balance = client.aggregate_balances.list() - assert_matches_type(SyncSinglePage[AggregateBalance], aggregate_balance, path=["response"]) + transfer_limit = client.transfer_limits.list() + assert_matches_type(SyncSinglePage[Data], transfer_limit, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Lithic) -> None: - aggregate_balance = client.aggregate_balances.list( - financial_account_type="ISSUING", + transfer_limit = client.transfer_limits.list( + date=parse_date("2019-12-27"), ) - assert_matches_type(SyncSinglePage[AggregateBalance], aggregate_balance, path=["response"]) + assert_matches_type(SyncSinglePage[Data], transfer_limit, path=["response"]) @parametrize def test_raw_response_list(self, client: Lithic) -> None: - response = client.aggregate_balances.with_raw_response.list() + response = client.transfer_limits.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - aggregate_balance = response.parse() - assert_matches_type(SyncSinglePage[AggregateBalance], aggregate_balance, path=["response"]) + transfer_limit = response.parse() + assert_matches_type(SyncSinglePage[Data], transfer_limit, path=["response"]) @parametrize def test_streaming_response_list(self, client: Lithic) -> None: - with client.aggregate_balances.with_streaming_response.list() as response: + with client.transfer_limits.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - aggregate_balance = response.parse() - assert_matches_type(SyncSinglePage[AggregateBalance], aggregate_balance, path=["response"]) + transfer_limit = response.parse() + assert_matches_type(SyncSinglePage[Data], transfer_limit, path=["response"]) assert cast(Any, response.is_closed) is True -class TestAsyncAggregateBalances: +class TestAsyncTransferLimits: parametrize = pytest.mark.parametrize( "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) @parametrize async def test_method_list(self, async_client: AsyncLithic) -> None: - aggregate_balance = await async_client.aggregate_balances.list() - assert_matches_type(AsyncSinglePage[AggregateBalance], aggregate_balance, path=["response"]) + transfer_limit = await async_client.transfer_limits.list() + assert_matches_type(AsyncSinglePage[Data], transfer_limit, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncLithic) -> None: - aggregate_balance = await async_client.aggregate_balances.list( - financial_account_type="ISSUING", + transfer_limit = await async_client.transfer_limits.list( + date=parse_date("2019-12-27"), ) - assert_matches_type(AsyncSinglePage[AggregateBalance], aggregate_balance, path=["response"]) + assert_matches_type(AsyncSinglePage[Data], transfer_limit, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncLithic) -> None: - response = await async_client.aggregate_balances.with_raw_response.list() + response = await async_client.transfer_limits.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - aggregate_balance = response.parse() - assert_matches_type(AsyncSinglePage[AggregateBalance], aggregate_balance, path=["response"]) + transfer_limit = response.parse() + assert_matches_type(AsyncSinglePage[Data], transfer_limit, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncLithic) -> None: - async with async_client.aggregate_balances.with_streaming_response.list() as response: + async with async_client.transfer_limits.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - aggregate_balance = await response.parse() - assert_matches_type(AsyncSinglePage[AggregateBalance], aggregate_balance, path=["response"]) + transfer_limit = await response.parse() + assert_matches_type(AsyncSinglePage[Data], transfer_limit, path=["response"]) assert cast(Any, response.is_closed) is True