diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 098de4c09..e6115961d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.247.0" + ".": "0.248.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index b6b5d3758..51cb36719 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 197 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-075bbbfbc34a6e34519bb157c21f280d0ba941ce2ddf834eafbbde3dbd3b52b9.yml -openapi_spec_hash: e0f7bef65d2cb1f3332b969254dee00a -config_hash: 85850cd9055db4b9e43bcc4aa1a2dcea +configured_endpoints: 199 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-75fe352618195712049f1cde5a80bfab2510a7a1e52f792ab0ca560d9d40a4b9.yml +openapi_spec_hash: c8cc277c248d9527fa442d11ce958132 +config_hash: 0c284b69f3dccb22b24877f61d0d8a9a diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d1a270c5..0f1e20aaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.248.0 (2025-06-05) + +Full Changelog: [v0.247.0...v0.248.0](https://github.com/Increase/increase-python/compare/v0.247.0...v0.248.0) + +### Features + +* **api:** api update ([5b82f0d](https://github.com/Increase/increase-python/commit/5b82f0d040519670b40df828522470b9fc0cd481)) + + +### Chores + +* fix idempotency ([f374872](https://github.com/Increase/increase-python/commit/f3748723a0384bb7272af9fee0a898c2f7a81c24)) + ## 0.247.0 (2025-06-03) Full Changelog: [v0.246.0...v0.247.0](https://github.com/Increase/increase-python/compare/v0.246.0...v0.247.0) diff --git a/api.md b/api.md index 80ca6056e..90805a762 100644 --- a/api.md +++ b/api.md @@ -349,6 +349,8 @@ Methods: - client.real_time_payments_transfers.create(\*\*params) -> RealTimePaymentsTransfer - client.real_time_payments_transfers.retrieve(real_time_payments_transfer_id) -> RealTimePaymentsTransfer - client.real_time_payments_transfers.list(\*\*params) -> SyncPage[RealTimePaymentsTransfer] +- client.real_time_payments_transfers.approve(real_time_payments_transfer_id) -> RealTimePaymentsTransfer +- client.real_time_payments_transfers.cancel(real_time_payments_transfer_id) -> RealTimePaymentsTransfer # InboundRealTimePaymentsTransfers diff --git a/pyproject.toml b/pyproject.toml index 2840a695e..d951d837c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.247.0" +version = "0.248.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 88b5f51c8..421a3d457 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.247.0" # x-release-please-version +__version__ = "0.248.0" # x-release-please-version diff --git a/src/increase/resources/real_time_payments_transfers.py b/src/increase/resources/real_time_payments_transfers.py index f92206ff3..9e77acc15 100644 --- a/src/increase/resources/real_time_payments_transfers.py +++ b/src/increase/resources/real_time_payments_transfers.py @@ -240,6 +240,94 @@ def list( model=RealTimePaymentsTransfer, ) + def approve( + self, + real_time_payments_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> RealTimePaymentsTransfer: + """ + Approves an Real-Time Payments Transfer in a pending_approval state. + + Args: + real_time_payments_transfer_id: The identifier of the Real-Time Payments Transfer to approve. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not real_time_payments_transfer_id: + raise ValueError( + f"Expected a non-empty value for `real_time_payments_transfer_id` but received {real_time_payments_transfer_id!r}" + ) + return self._post( + f"/real_time_payments_transfers/{real_time_payments_transfer_id}/approve", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=RealTimePaymentsTransfer, + ) + + def cancel( + self, + real_time_payments_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> RealTimePaymentsTransfer: + """ + Cancels an Real-Time Payments Transfer in a pending_approval state. + + Args: + real_time_payments_transfer_id: The identifier of the pending Real-Time Payments Transfer to cancel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not real_time_payments_transfer_id: + raise ValueError( + f"Expected a non-empty value for `real_time_payments_transfer_id` but received {real_time_payments_transfer_id!r}" + ) + return self._post( + f"/real_time_payments_transfers/{real_time_payments_transfer_id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=RealTimePaymentsTransfer, + ) + class AsyncRealTimePaymentsTransfersResource(AsyncAPIResource): @cached_property @@ -459,6 +547,94 @@ def list( model=RealTimePaymentsTransfer, ) + async def approve( + self, + real_time_payments_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> RealTimePaymentsTransfer: + """ + Approves an Real-Time Payments Transfer in a pending_approval state. + + Args: + real_time_payments_transfer_id: The identifier of the Real-Time Payments Transfer to approve. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not real_time_payments_transfer_id: + raise ValueError( + f"Expected a non-empty value for `real_time_payments_transfer_id` but received {real_time_payments_transfer_id!r}" + ) + return await self._post( + f"/real_time_payments_transfers/{real_time_payments_transfer_id}/approve", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=RealTimePaymentsTransfer, + ) + + async def cancel( + self, + real_time_payments_transfer_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> RealTimePaymentsTransfer: + """ + Cancels an Real-Time Payments Transfer in a pending_approval state. + + Args: + real_time_payments_transfer_id: The identifier of the pending Real-Time Payments Transfer to cancel. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not real_time_payments_transfer_id: + raise ValueError( + f"Expected a non-empty value for `real_time_payments_transfer_id` but received {real_time_payments_transfer_id!r}" + ) + return await self._post( + f"/real_time_payments_transfers/{real_time_payments_transfer_id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=RealTimePaymentsTransfer, + ) + class RealTimePaymentsTransfersResourceWithRawResponse: def __init__(self, real_time_payments_transfers: RealTimePaymentsTransfersResource) -> None: @@ -473,6 +649,12 @@ def __init__(self, real_time_payments_transfers: RealTimePaymentsTransfersResour self.list = to_raw_response_wrapper( real_time_payments_transfers.list, ) + self.approve = to_raw_response_wrapper( + real_time_payments_transfers.approve, + ) + self.cancel = to_raw_response_wrapper( + real_time_payments_transfers.cancel, + ) class AsyncRealTimePaymentsTransfersResourceWithRawResponse: @@ -488,6 +670,12 @@ def __init__(self, real_time_payments_transfers: AsyncRealTimePaymentsTransfersR self.list = async_to_raw_response_wrapper( real_time_payments_transfers.list, ) + self.approve = async_to_raw_response_wrapper( + real_time_payments_transfers.approve, + ) + self.cancel = async_to_raw_response_wrapper( + real_time_payments_transfers.cancel, + ) class RealTimePaymentsTransfersResourceWithStreamingResponse: @@ -503,6 +691,12 @@ def __init__(self, real_time_payments_transfers: RealTimePaymentsTransfersResour self.list = to_streamed_response_wrapper( real_time_payments_transfers.list, ) + self.approve = to_streamed_response_wrapper( + real_time_payments_transfers.approve, + ) + self.cancel = to_streamed_response_wrapper( + real_time_payments_transfers.cancel, + ) class AsyncRealTimePaymentsTransfersResourceWithStreamingResponse: @@ -518,3 +712,9 @@ def __init__(self, real_time_payments_transfers: AsyncRealTimePaymentsTransfersR self.list = async_to_streamed_response_wrapper( real_time_payments_transfers.list, ) + self.approve = async_to_streamed_response_wrapper( + real_time_payments_transfers.approve, + ) + self.cancel = async_to_streamed_response_wrapper( + real_time_payments_transfers.cancel, + ) diff --git a/tests/api_resources/test_real_time_payments_transfers.py b/tests/api_resources/test_real_time_payments_transfers.py index 68f5f75b7..636ed4c4b 100644 --- a/tests/api_resources/test_real_time_payments_transfers.py +++ b/tests/api_resources/test_real_time_payments_transfers.py @@ -161,6 +161,86 @@ def test_streaming_response_list(self, client: Increase) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_approve(self, client: Increase) -> None: + real_time_payments_transfer = client.real_time_payments_transfers.approve( + "real_time_payments_transfer_id", + ) + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + @parametrize + def test_raw_response_approve(self, client: Increase) -> None: + response = client.real_time_payments_transfers.with_raw_response.approve( + "real_time_payments_transfer_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + real_time_payments_transfer = response.parse() + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + @parametrize + def test_streaming_response_approve(self, client: Increase) -> None: + with client.real_time_payments_transfers.with_streaming_response.approve( + "real_time_payments_transfer_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + real_time_payments_transfer = response.parse() + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_approve(self, client: Increase) -> None: + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `real_time_payments_transfer_id` but received ''" + ): + client.real_time_payments_transfers.with_raw_response.approve( + "", + ) + + @parametrize + def test_method_cancel(self, client: Increase) -> None: + real_time_payments_transfer = client.real_time_payments_transfers.cancel( + "real_time_payments_transfer_id", + ) + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + @parametrize + def test_raw_response_cancel(self, client: Increase) -> None: + response = client.real_time_payments_transfers.with_raw_response.cancel( + "real_time_payments_transfer_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + real_time_payments_transfer = response.parse() + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + @parametrize + def test_streaming_response_cancel(self, client: Increase) -> None: + with client.real_time_payments_transfers.with_streaming_response.cancel( + "real_time_payments_transfer_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + real_time_payments_transfer = response.parse() + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_cancel(self, client: Increase) -> None: + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `real_time_payments_transfer_id` but received ''" + ): + client.real_time_payments_transfers.with_raw_response.cancel( + "", + ) + class TestAsyncRealTimePaymentsTransfers: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -304,3 +384,83 @@ async def test_streaming_response_list(self, async_client: AsyncIncrease) -> Non assert_matches_type(AsyncPage[RealTimePaymentsTransfer], real_time_payments_transfer, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_approve(self, async_client: AsyncIncrease) -> None: + real_time_payments_transfer = await async_client.real_time_payments_transfers.approve( + "real_time_payments_transfer_id", + ) + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + @parametrize + async def test_raw_response_approve(self, async_client: AsyncIncrease) -> None: + response = await async_client.real_time_payments_transfers.with_raw_response.approve( + "real_time_payments_transfer_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + real_time_payments_transfer = await response.parse() + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_approve(self, async_client: AsyncIncrease) -> None: + async with async_client.real_time_payments_transfers.with_streaming_response.approve( + "real_time_payments_transfer_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + real_time_payments_transfer = await response.parse() + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_approve(self, async_client: AsyncIncrease) -> None: + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `real_time_payments_transfer_id` but received ''" + ): + await async_client.real_time_payments_transfers.with_raw_response.approve( + "", + ) + + @parametrize + async def test_method_cancel(self, async_client: AsyncIncrease) -> None: + real_time_payments_transfer = await async_client.real_time_payments_transfers.cancel( + "real_time_payments_transfer_id", + ) + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + @parametrize + async def test_raw_response_cancel(self, async_client: AsyncIncrease) -> None: + response = await async_client.real_time_payments_transfers.with_raw_response.cancel( + "real_time_payments_transfer_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + real_time_payments_transfer = await response.parse() + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + @parametrize + async def test_streaming_response_cancel(self, async_client: AsyncIncrease) -> None: + async with async_client.real_time_payments_transfers.with_streaming_response.cancel( + "real_time_payments_transfer_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + real_time_payments_transfer = await response.parse() + assert_matches_type(RealTimePaymentsTransfer, real_time_payments_transfer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_cancel(self, async_client: AsyncIncrease) -> None: + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `real_time_payments_transfer_id` but received ''" + ): + await async_client.real_time_payments_transfers.with_raw_response.cancel( + "", + )