diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ed8d4027..3ceb3aa4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.499.0" + ".": "0.500.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 42d30901..1ed7125c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 236 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-47752267c48d299a01c906499bb7d584228ea8801b7d83e34ae4100d5dec3434.yml -openapi_spec_hash: ae1e2ef832ba2b284a54b8c9f9ddacdc -config_hash: 026e2baa580c7f5f2447c24332081ba8 +configured_endpoints: 237 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-221230f0f67bf00e91103e7694232ddb876751035ddb381c30c10dbb5197b06f.yml +openapi_spec_hash: c8dcac8573c2931a496ae40613d377c4 +config_hash: 9dd89544e7c0403ccb0e0827de6a9cbf diff --git a/CHANGELOG.md b/CHANGELOG.md index 313a7ebf..608862df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.500.0 (2026-04-28) + +Full Changelog: [v0.499.0...v0.500.0](https://github.com/Increase/increase-python/compare/v0.499.0...v0.500.0) + +### Features + +* **api:** api update ([77e1c0b](https://github.com/Increase/increase-python/commit/77e1c0b3dae0ec5790eeb85f06322e86e46b9465)) + ## 0.499.0 (2026-04-28) Full Changelog: [v0.498.0...v0.499.0](https://github.com/Increase/increase-python/compare/v0.498.0...v0.499.0) diff --git a/api.md b/api.md index 7f0e4d64..91300db9 100644 --- a/api.md +++ b/api.md @@ -812,6 +812,12 @@ Methods: - client.simulations.interest_payments.create(\*\*params) -> Transaction +## AccountRevenuePayments + +Methods: + +- client.simulations.account_revenue_payments.create(\*\*params) -> Transaction + ## CardAuthorizations Types: diff --git a/pyproject.toml b/pyproject.toml index b577fe8e..8270a5bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.499.0" +version = "0.500.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_version.py b/src/increase/_version.py index e4323f44..58486df6 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.499.0" # x-release-please-version +__version__ = "0.500.0" # x-release-please-version diff --git a/src/increase/resources/simulations/__init__.py b/src/increase/resources/simulations/__init__.py index bf08974a..c50416e6 100644 --- a/src/increase/resources/simulations/__init__.py +++ b/src/increase/resources/simulations/__init__.py @@ -208,6 +208,14 @@ CardFuelConfirmationsResourceWithStreamingResponse, AsyncCardFuelConfirmationsResourceWithStreamingResponse, ) +from .account_revenue_payments import ( + AccountRevenuePaymentsResource, + AsyncAccountRevenuePaymentsResource, + AccountRevenuePaymentsResourceWithRawResponse, + AsyncAccountRevenuePaymentsResourceWithRawResponse, + AccountRevenuePaymentsResourceWithStreamingResponse, + AsyncAccountRevenuePaymentsResourceWithStreamingResponse, +) from .inbound_fednow_transfers import ( InboundFednowTransfersResource, AsyncInboundFednowTransfersResource, @@ -280,6 +288,12 @@ "AsyncInterestPaymentsResourceWithRawResponse", "InterestPaymentsResourceWithStreamingResponse", "AsyncInterestPaymentsResourceWithStreamingResponse", + "AccountRevenuePaymentsResource", + "AsyncAccountRevenuePaymentsResource", + "AccountRevenuePaymentsResourceWithRawResponse", + "AsyncAccountRevenuePaymentsResourceWithRawResponse", + "AccountRevenuePaymentsResourceWithStreamingResponse", + "AsyncAccountRevenuePaymentsResourceWithStreamingResponse", "CardAuthorizationsResource", "AsyncCardAuthorizationsResource", "CardAuthorizationsResourceWithRawResponse", diff --git a/src/increase/resources/simulations/account_revenue_payments.py b/src/increase/resources/simulations/account_revenue_payments.py new file mode 100644 index 00000000..53be7ae0 --- /dev/null +++ b/src/increase/resources/simulations/account_revenue_payments.py @@ -0,0 +1,236 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.simulations import account_revenue_payment_create_params +from ...types.transaction import Transaction + +__all__ = ["AccountRevenuePaymentsResource", "AsyncAccountRevenuePaymentsResource"] + + +class AccountRevenuePaymentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AccountRevenuePaymentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers + """ + return AccountRevenuePaymentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AccountRevenuePaymentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/Increase/increase-python#with_streaming_response + """ + return AccountRevenuePaymentsResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + amount: int, + accrued_on_account_id: str | Omit = omit, + period_end: Union[str, datetime] | Omit = omit, + period_start: Union[str, datetime] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Transaction: + """Simulates an account revenue payment to your account. + + In production, this + happens automatically on the first of each month. + + Args: + account_id: The identifier of the Account the Account Revenue Payment should be paid to. + + amount: The account revenue amount in cents. Must be positive. + + accrued_on_account_id: The identifier of the Account the account revenue accrued on. Defaults to + `account_id`. + + period_end: The end of the account revenue period. If not provided, defaults to the current + time. + + period_start: The start of the account revenue period. If not provided, defaults to the + current time. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/simulations/account_revenue_payments", + body=maybe_transform( + { + "account_id": account_id, + "amount": amount, + "accrued_on_account_id": accrued_on_account_id, + "period_end": period_end, + "period_start": period_start, + }, + account_revenue_payment_create_params.AccountRevenuePaymentCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=Transaction, + ) + + +class AsyncAccountRevenuePaymentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAccountRevenuePaymentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/Increase/increase-python#accessing-raw-response-data-eg-headers + """ + return AsyncAccountRevenuePaymentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAccountRevenuePaymentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/Increase/increase-python#with_streaming_response + """ + return AsyncAccountRevenuePaymentsResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + amount: int, + accrued_on_account_id: str | Omit = omit, + period_end: Union[str, datetime] | Omit = omit, + period_start: Union[str, datetime] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> Transaction: + """Simulates an account revenue payment to your account. + + In production, this + happens automatically on the first of each month. + + Args: + account_id: The identifier of the Account the Account Revenue Payment should be paid to. + + amount: The account revenue amount in cents. Must be positive. + + accrued_on_account_id: The identifier of the Account the account revenue accrued on. Defaults to + `account_id`. + + period_end: The end of the account revenue period. If not provided, defaults to the current + time. + + period_start: The start of the account revenue period. If not provided, defaults to the + current time. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/simulations/account_revenue_payments", + body=await async_maybe_transform( + { + "account_id": account_id, + "amount": amount, + "accrued_on_account_id": accrued_on_account_id, + "period_end": period_end, + "period_start": period_start, + }, + account_revenue_payment_create_params.AccountRevenuePaymentCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=Transaction, + ) + + +class AccountRevenuePaymentsResourceWithRawResponse: + def __init__(self, account_revenue_payments: AccountRevenuePaymentsResource) -> None: + self._account_revenue_payments = account_revenue_payments + + self.create = to_raw_response_wrapper( + account_revenue_payments.create, + ) + + +class AsyncAccountRevenuePaymentsResourceWithRawResponse: + def __init__(self, account_revenue_payments: AsyncAccountRevenuePaymentsResource) -> None: + self._account_revenue_payments = account_revenue_payments + + self.create = async_to_raw_response_wrapper( + account_revenue_payments.create, + ) + + +class AccountRevenuePaymentsResourceWithStreamingResponse: + def __init__(self, account_revenue_payments: AccountRevenuePaymentsResource) -> None: + self._account_revenue_payments = account_revenue_payments + + self.create = to_streamed_response_wrapper( + account_revenue_payments.create, + ) + + +class AsyncAccountRevenuePaymentsResourceWithStreamingResponse: + def __init__(self, account_revenue_payments: AsyncAccountRevenuePaymentsResource) -> None: + self._account_revenue_payments = account_revenue_payments + + self.create = async_to_streamed_response_wrapper( + account_revenue_payments.create, + ) diff --git a/src/increase/resources/simulations/simulations.py b/src/increase/resources/simulations/simulations.py index d567464f..3a2a9b76 100644 --- a/src/increase/resources/simulations/simulations.py +++ b/src/increase/resources/simulations/simulations.py @@ -204,6 +204,14 @@ CardFuelConfirmationsResourceWithStreamingResponse, AsyncCardFuelConfirmationsResourceWithStreamingResponse, ) +from .account_revenue_payments import ( + AccountRevenuePaymentsResource, + AsyncAccountRevenuePaymentsResource, + AccountRevenuePaymentsResourceWithRawResponse, + AsyncAccountRevenuePaymentsResourceWithRawResponse, + AccountRevenuePaymentsResourceWithStreamingResponse, + AsyncAccountRevenuePaymentsResourceWithStreamingResponse, +) from .inbound_fednow_transfers import ( InboundFednowTransfersResource, AsyncInboundFednowTransfersResource, @@ -277,6 +285,10 @@ class SimulationsResource(SyncAPIResource): def interest_payments(self) -> InterestPaymentsResource: return InterestPaymentsResource(self._client) + @cached_property + def account_revenue_payments(self) -> AccountRevenuePaymentsResource: + return AccountRevenuePaymentsResource(self._client) + @cached_property def card_authorizations(self) -> CardAuthorizationsResource: return CardAuthorizationsResource(self._client) @@ -430,6 +442,10 @@ class AsyncSimulationsResource(AsyncAPIResource): def interest_payments(self) -> AsyncInterestPaymentsResource: return AsyncInterestPaymentsResource(self._client) + @cached_property + def account_revenue_payments(self) -> AsyncAccountRevenuePaymentsResource: + return AsyncAccountRevenuePaymentsResource(self._client) + @cached_property def card_authorizations(self) -> AsyncCardAuthorizationsResource: return AsyncCardAuthorizationsResource(self._client) @@ -586,6 +602,10 @@ def __init__(self, simulations: SimulationsResource) -> None: def interest_payments(self) -> InterestPaymentsResourceWithRawResponse: return InterestPaymentsResourceWithRawResponse(self._simulations.interest_payments) + @cached_property + def account_revenue_payments(self) -> AccountRevenuePaymentsResourceWithRawResponse: + return AccountRevenuePaymentsResourceWithRawResponse(self._simulations.account_revenue_payments) + @cached_property def card_authorizations(self) -> CardAuthorizationsResourceWithRawResponse: return CardAuthorizationsResourceWithRawResponse(self._simulations.card_authorizations) @@ -725,6 +745,10 @@ def __init__(self, simulations: AsyncSimulationsResource) -> None: def interest_payments(self) -> AsyncInterestPaymentsResourceWithRawResponse: return AsyncInterestPaymentsResourceWithRawResponse(self._simulations.interest_payments) + @cached_property + def account_revenue_payments(self) -> AsyncAccountRevenuePaymentsResourceWithRawResponse: + return AsyncAccountRevenuePaymentsResourceWithRawResponse(self._simulations.account_revenue_payments) + @cached_property def card_authorizations(self) -> AsyncCardAuthorizationsResourceWithRawResponse: return AsyncCardAuthorizationsResourceWithRawResponse(self._simulations.card_authorizations) @@ -866,6 +890,10 @@ def __init__(self, simulations: SimulationsResource) -> None: def interest_payments(self) -> InterestPaymentsResourceWithStreamingResponse: return InterestPaymentsResourceWithStreamingResponse(self._simulations.interest_payments) + @cached_property + def account_revenue_payments(self) -> AccountRevenuePaymentsResourceWithStreamingResponse: + return AccountRevenuePaymentsResourceWithStreamingResponse(self._simulations.account_revenue_payments) + @cached_property def card_authorizations(self) -> CardAuthorizationsResourceWithStreamingResponse: return CardAuthorizationsResourceWithStreamingResponse(self._simulations.card_authorizations) @@ -1009,6 +1037,10 @@ def __init__(self, simulations: AsyncSimulationsResource) -> None: def interest_payments(self) -> AsyncInterestPaymentsResourceWithStreamingResponse: return AsyncInterestPaymentsResourceWithStreamingResponse(self._simulations.interest_payments) + @cached_property + def account_revenue_payments(self) -> AsyncAccountRevenuePaymentsResourceWithStreamingResponse: + return AsyncAccountRevenuePaymentsResourceWithStreamingResponse(self._simulations.account_revenue_payments) + @cached_property def card_authorizations(self) -> AsyncCardAuthorizationsResourceWithStreamingResponse: return AsyncCardAuthorizationsResourceWithStreamingResponse(self._simulations.card_authorizations) diff --git a/src/increase/types/simulations/__init__.py b/src/increase/types/simulations/__init__.py index ad904b26..f1188796 100644 --- a/src/increase/types/simulations/__init__.py +++ b/src/increase/types/simulations/__init__.py @@ -26,6 +26,9 @@ from .inbound_check_deposit_create_params import InboundCheckDepositCreateParams as InboundCheckDepositCreateParams from .inbound_wire_transfer_create_params import InboundWireTransferCreateParams as InboundWireTransferCreateParams from .card_fuel_confirmation_create_params import CardFuelConfirmationCreateParams as CardFuelConfirmationCreateParams +from .account_revenue_payment_create_params import ( + AccountRevenuePaymentCreateParams as AccountRevenuePaymentCreateParams, +) from .inbound_fednow_transfer_create_params import ( InboundFednowTransferCreateParams as InboundFednowTransferCreateParams, ) diff --git a/src/increase/types/simulations/account_revenue_payment_create_params.py b/src/increase/types/simulations/account_revenue_payment_create_params.py new file mode 100644 index 00000000..5da2d4c0 --- /dev/null +++ b/src/increase/types/simulations/account_revenue_payment_create_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["AccountRevenuePaymentCreateParams"] + + +class AccountRevenuePaymentCreateParams(TypedDict, total=False): + account_id: Required[str] + """The identifier of the Account the Account Revenue Payment should be paid to.""" + + amount: Required[int] + """The account revenue amount in cents. Must be positive.""" + + accrued_on_account_id: str + """The identifier of the Account the account revenue accrued on. + + Defaults to `account_id`. + """ + + period_end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """The end of the account revenue period. + + If not provided, defaults to the current time. + """ + + period_start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """The start of the account revenue period. + + If not provided, defaults to the current time. + """ diff --git a/tests/api_resources/simulations/test_account_revenue_payments.py b/tests/api_resources/simulations/test_account_revenue_payments.py new file mode 100644 index 00000000..de244fa7 --- /dev/null +++ b/tests/api_resources/simulations/test_account_revenue_payments.py @@ -0,0 +1,115 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from increase import Increase, AsyncIncrease +from tests.utils import assert_matches_type +from increase.types import Transaction +from increase._utils import parse_datetime + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAccountRevenuePayments: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Increase) -> None: + account_revenue_payment = client.simulations.account_revenue_payments.create( + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + ) + assert_matches_type(Transaction, account_revenue_payment, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Increase) -> None: + account_revenue_payment = client.simulations.account_revenue_payments.create( + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + accrued_on_account_id="accrued_on_account_id", + period_end=parse_datetime("2019-12-27T18:11:19.117Z"), + period_start=parse_datetime("2019-12-27T18:11:19.117Z"), + ) + assert_matches_type(Transaction, account_revenue_payment, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Increase) -> None: + response = client.simulations.account_revenue_payments.with_raw_response.create( + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_revenue_payment = response.parse() + assert_matches_type(Transaction, account_revenue_payment, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Increase) -> None: + with client.simulations.account_revenue_payments.with_streaming_response.create( + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_revenue_payment = response.parse() + assert_matches_type(Transaction, account_revenue_payment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncAccountRevenuePayments: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncIncrease) -> None: + account_revenue_payment = await async_client.simulations.account_revenue_payments.create( + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + ) + assert_matches_type(Transaction, account_revenue_payment, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncIncrease) -> None: + account_revenue_payment = await async_client.simulations.account_revenue_payments.create( + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + accrued_on_account_id="accrued_on_account_id", + period_end=parse_datetime("2019-12-27T18:11:19.117Z"), + period_start=parse_datetime("2019-12-27T18:11:19.117Z"), + ) + assert_matches_type(Transaction, account_revenue_payment, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncIncrease) -> None: + response = await async_client.simulations.account_revenue_payments.with_raw_response.create( + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_revenue_payment = await response.parse() + assert_matches_type(Transaction, account_revenue_payment, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncIncrease) -> None: + async with async_client.simulations.account_revenue_payments.with_streaming_response.create( + account_id="account_in71c4amph0vgo2qllky", + amount=1000, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_revenue_payment = await response.parse() + assert_matches_type(Transaction, account_revenue_payment, path=["response"]) + + assert cast(Any, response.is_closed) is True