From da21209f9c88bcc9874f8c63ab7385c644c946a0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:12:47 +0000 Subject: [PATCH 1/3] fix(client): don't send Content-Type header on GET requests --- pyproject.toml | 2 +- src/increase/_base_client.py | 11 +++++++++-- tests/test_client.py | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c7a8b12cd..0205453de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/Increase/increase-python" Repository = "https://github.com/Increase/increase-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] [tool.rye] managed = true diff --git a/src/increase/_base_client.py b/src/increase/_base_client.py index d8d9adcc7..a488ab79b 100644 --- a/src/increase/_base_client.py +++ b/src/increase/_base_client.py @@ -529,6 +529,15 @@ def _build_request( # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + is_body_allowed = options.method.lower() != "get" + + if is_body_allowed: + kwargs["json"] = json_data if is_given(json_data) else None + kwargs["files"] = files + else: + headers.pop("Content-Type", None) + kwargs.pop("data", None) + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, @@ -540,8 +549,6 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data if is_given(json_data) else None, - files=files, **kwargs, ) diff --git a/tests/test_client.py b/tests/test_client.py index 1f7074e67..215eb9497 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -464,7 +464,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, client: Increase) -> None: request = client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, @@ -1310,7 +1310,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, async_client: AsyncIncrease) -> None: request = async_client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, From be16bbced78ed0b436c24b7ccd50196c1c0fbf45 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 13:53:13 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 +-- .../resources/simulations/programs.py | 28 +++++++++++++++++++ .../simulations/program_create_params.py | 12 +++++++- .../simulations/test_programs.py | 2 ++ 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 083e8155e..076aae75a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 202 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-f0b14ed0b6857930b2bbb80a8a0580dff2aad5510240f608ea9385a8b1d1b66b.yml -openapi_spec_hash: ea869bb98167424f60f8ef006da70945 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-c9d527ceb849bd9a01edc968016381f25fcc375a1409eb113d7e876ae0f2f529.yml +openapi_spec_hash: c7820089282fc6db267d08eaa465075f config_hash: a185e9a72778cc4658ea73fb3a7f1354 diff --git a/src/increase/resources/simulations/programs.py b/src/increase/resources/simulations/programs.py index 330ea4bd2..c965a47d4 100644 --- a/src/increase/resources/simulations/programs.py +++ b/src/increase/resources/simulations/programs.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -45,6 +47,10 @@ def create( self, *, name: str, + bank: Literal[ + "blue_ridge_bank", "core_bank", "first_internet_bank", "global_innovations_bank", "grasshopper_bank" + ] + | NotGiven = NOT_GIVEN, reserve_account_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -64,6 +70,14 @@ def create( Args: name: The name of the program being added. + bank: The bank for the program's accounts, defaults to First Internet Bank. + + - `blue_ridge_bank` - Blue Ridge Bank, N.A. + - `core_bank` - Core Bank + - `first_internet_bank` - First Internet Bank of Indiana + - `global_innovations_bank` - Global Innovations Bank + - `grasshopper_bank` - Grasshopper Bank + reserve_account_id: The identifier of the Account the Program should be added to is for. extra_headers: Send extra headers @@ -81,6 +95,7 @@ def create( body=maybe_transform( { "name": name, + "bank": bank, "reserve_account_id": reserve_account_id, }, program_create_params.ProgramCreateParams, @@ -120,6 +135,10 @@ async def create( self, *, name: str, + bank: Literal[ + "blue_ridge_bank", "core_bank", "first_internet_bank", "global_innovations_bank", "grasshopper_bank" + ] + | NotGiven = NOT_GIVEN, reserve_account_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -139,6 +158,14 @@ async def create( Args: name: The name of the program being added. + bank: The bank for the program's accounts, defaults to First Internet Bank. + + - `blue_ridge_bank` - Blue Ridge Bank, N.A. + - `core_bank` - Core Bank + - `first_internet_bank` - First Internet Bank of Indiana + - `global_innovations_bank` - Global Innovations Bank + - `grasshopper_bank` - Grasshopper Bank + reserve_account_id: The identifier of the Account the Program should be added to is for. extra_headers: Send extra headers @@ -156,6 +183,7 @@ async def create( body=await async_maybe_transform( { "name": name, + "bank": bank, "reserve_account_id": reserve_account_id, }, program_create_params.ProgramCreateParams, diff --git a/src/increase/types/simulations/program_create_params.py b/src/increase/types/simulations/program_create_params.py index 141606abb..d8718d60d 100644 --- a/src/increase/types/simulations/program_create_params.py +++ b/src/increase/types/simulations/program_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ProgramCreateParams"] @@ -11,5 +11,15 @@ class ProgramCreateParams(TypedDict, total=False): name: Required[str] """The name of the program being added.""" + bank: Literal["blue_ridge_bank", "core_bank", "first_internet_bank", "global_innovations_bank", "grasshopper_bank"] + """The bank for the program's accounts, defaults to First Internet Bank. + + - `blue_ridge_bank` - Blue Ridge Bank, N.A. + - `core_bank` - Core Bank + - `first_internet_bank` - First Internet Bank of Indiana + - `global_innovations_bank` - Global Innovations Bank + - `grasshopper_bank` - Grasshopper Bank + """ + reserve_account_id: str """The identifier of the Account the Program should be added to is for.""" diff --git a/tests/api_resources/simulations/test_programs.py b/tests/api_resources/simulations/test_programs.py index 68a7e9de7..1439c6bcf 100644 --- a/tests/api_resources/simulations/test_programs.py +++ b/tests/api_resources/simulations/test_programs.py @@ -28,6 +28,7 @@ def test_method_create(self, client: Increase) -> None: def test_method_create_with_all_params(self, client: Increase) -> None: program = client.simulations.programs.create( name="For Benefit Of", + bank="blue_ridge_bank", reserve_account_id="reserve_account_id", ) assert_matches_type(Program, program, path=["response"]) @@ -73,6 +74,7 @@ async def test_method_create(self, async_client: AsyncIncrease) -> None: async def test_method_create_with_all_params(self, async_client: AsyncIncrease) -> None: program = await async_client.simulations.programs.create( name="For Benefit Of", + bank="blue_ridge_bank", reserve_account_id="reserve_account_id", ) assert_matches_type(Program, program, path=["response"]) From 025cd19c0536be2781431126cf7fd441b2bd9166 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 13:53:39 +0000 Subject: [PATCH 3/3] release: 0.265.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7f4bdc4f6..c8ed07941 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.264.0" + ".": "0.265.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 57c7a660a..7c5604f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.265.0 (2025-07-11) + +Full Changelog: [v0.264.0...v0.265.0](https://github.com/Increase/increase-python/compare/v0.264.0...v0.265.0) + +### Features + +* **api:** api update ([be16bbc](https://github.com/Increase/increase-python/commit/be16bbced78ed0b436c24b7ccd50196c1c0fbf45)) + + +### Bug Fixes + +* **client:** don't send Content-Type header on GET requests ([da21209](https://github.com/Increase/increase-python/commit/da21209f9c88bcc9874f8c63ab7385c644c946a0)) + ## 0.264.0 (2025-07-10) Full Changelog: [v0.263.0...v0.264.0](https://github.com/Increase/increase-python/compare/v0.263.0...v0.264.0) diff --git a/pyproject.toml b/pyproject.toml index 0205453de..3df61dac1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.264.0" +version = "0.265.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 9df4fef3e..478d15b2e 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.264.0" # x-release-please-version +__version__ = "0.265.0" # x-release-please-version