From 2e947bc6d5917242e878e9863cfcd777059bf345 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 16:14:01 +0000 Subject: [PATCH 1/3] chore(internal): grammar fix (it's -> its) --- src/finch/_utils/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finch/_utils/_utils.py b/src/finch/_utils/_utils.py index 50d59269..eec7f4a1 100644 --- a/src/finch/_utils/_utils.py +++ b/src/finch/_utils/_utils.py @@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: # Type safe methods for narrowing types with TypeVars. # The default narrowing for isinstance(obj, dict) is dict[unknown, unknown], # however this cause Pyright to rightfully report errors. As we know we don't -# care about the contained types we can safely use `object` in it's place. +# care about the contained types we can safely use `object` in its place. # # There are two separate functions defined, `is_*` and `is_*_t` for different use cases. # `is_*` is for when you're dealing with an unknown input From 08974d35364590545c1cb9865f9cde672dac4a45 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 17:37:22 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 +- src/finch/resources/connect/sessions.py | 64 +++++++------ src/finch/types/connect/session_new_params.py | 42 ++++---- .../connect/session_reauthenticate_params.py | 32 +++---- tests/api_resources/connect/test_sessions.py | 96 ++++++++----------- 5 files changed, 113 insertions(+), 125 deletions(-) diff --git a/.stats.yml b/.stats.yml index 906bc775..6dc87a14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 46 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0105d239fcaf84750c886dfa6c2cfbf2b2087f89a48f8827c4cbe28479ebfb13.yml -openapi_spec_hash: 34895c3d3c137fb9f5a019ac5370afbb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-b817e7a30a6366c063a8c9a334d5be281eb8d93e21acc8c8219d3bdc95043deb.yml +openapi_spec_hash: d4cc4a5cba9f13986e38d148d330aa00 config_hash: 5c64f384746e7570c10f19fe241062a7 diff --git a/src/finch/resources/connect/sessions.py b/src/finch/resources/connect/sessions.py index 66663aff..f402a565 100644 --- a/src/finch/resources/connect/sessions.py +++ b/src/finch/resources/connect/sessions.py @@ -8,7 +8,7 @@ import httpx from ... import _legacy_response -from ..._types import Body, Query, Headers, NotGiven, not_given +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 @@ -44,12 +44,8 @@ def with_streaming_response(self) -> SessionsWithStreamingResponse: def new( self, *, - customer_email: Optional[str], customer_id: str, customer_name: str, - integration: Optional[session_new_params.Integration], - manual: Optional[bool], - minutes_to_expire: Optional[float], products: List[ Literal[ "benefits", @@ -64,8 +60,12 @@ def new( "ssn", ] ], - redirect_uri: Optional[str], - sandbox: Optional[Literal["finch", "provider"]], + customer_email: Optional[str] | Omit = omit, + integration: Optional[session_new_params.Integration] | Omit = omit, + manual: Optional[bool] | Omit = omit, + minutes_to_expire: Optional[float] | Omit = omit, + redirect_uri: Optional[str] | Omit = omit, + sandbox: Optional[Literal["finch", "provider"]] | 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, @@ -77,12 +77,14 @@ def new( Create a new connect session for an employer Args: - customer_email: Email address of the customer - customer_id: Unique identifier for the customer customer_name: Name of the customer + products: The Finch products to request access to + + customer_email: Email address of the customer + integration: Integration configuration for the connect session manual: Enable manual authentication mode @@ -90,8 +92,6 @@ def new( minutes_to_expire: The number of minutes until the session expires (defaults to 129,600, which is 90 days) - products: The Finch products to request access to - redirect_uri: The URI to redirect to after the Connect flow is completed sandbox: Sandbox mode for testing @@ -108,13 +108,13 @@ def new( "/connect/sessions", body=maybe_transform( { - "customer_email": customer_email, "customer_id": customer_id, "customer_name": customer_name, + "products": products, + "customer_email": customer_email, "integration": integration, "manual": manual, "minutes_to_expire": minutes_to_expire, - "products": products, "redirect_uri": redirect_uri, "sandbox": sandbox, }, @@ -130,7 +130,7 @@ def reauthenticate( self, *, connection_id: str, - minutes_to_expire: int, + minutes_to_expire: int | Omit = omit, products: Optional[ List[ Literal[ @@ -146,8 +146,9 @@ def reauthenticate( "ssn", ] ] - ], - redirect_uri: Optional[str], + ] + | Omit = omit, + redirect_uri: Optional[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, @@ -217,12 +218,8 @@ def with_streaming_response(self) -> AsyncSessionsWithStreamingResponse: async def new( self, *, - customer_email: Optional[str], customer_id: str, customer_name: str, - integration: Optional[session_new_params.Integration], - manual: Optional[bool], - minutes_to_expire: Optional[float], products: List[ Literal[ "benefits", @@ -237,8 +234,12 @@ async def new( "ssn", ] ], - redirect_uri: Optional[str], - sandbox: Optional[Literal["finch", "provider"]], + customer_email: Optional[str] | Omit = omit, + integration: Optional[session_new_params.Integration] | Omit = omit, + manual: Optional[bool] | Omit = omit, + minutes_to_expire: Optional[float] | Omit = omit, + redirect_uri: Optional[str] | Omit = omit, + sandbox: Optional[Literal["finch", "provider"]] | 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, @@ -250,12 +251,14 @@ async def new( Create a new connect session for an employer Args: - customer_email: Email address of the customer - customer_id: Unique identifier for the customer customer_name: Name of the customer + products: The Finch products to request access to + + customer_email: Email address of the customer + integration: Integration configuration for the connect session manual: Enable manual authentication mode @@ -263,8 +266,6 @@ async def new( minutes_to_expire: The number of minutes until the session expires (defaults to 129,600, which is 90 days) - products: The Finch products to request access to - redirect_uri: The URI to redirect to after the Connect flow is completed sandbox: Sandbox mode for testing @@ -281,13 +282,13 @@ async def new( "/connect/sessions", body=await async_maybe_transform( { - "customer_email": customer_email, "customer_id": customer_id, "customer_name": customer_name, + "products": products, + "customer_email": customer_email, "integration": integration, "manual": manual, "minutes_to_expire": minutes_to_expire, - "products": products, "redirect_uri": redirect_uri, "sandbox": sandbox, }, @@ -303,7 +304,7 @@ async def reauthenticate( self, *, connection_id: str, - minutes_to_expire: int, + minutes_to_expire: int | Omit = omit, products: Optional[ List[ Literal[ @@ -319,8 +320,9 @@ async def reauthenticate( "ssn", ] ] - ], - redirect_uri: Optional[str], + ] + | Omit = omit, + redirect_uri: Optional[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, diff --git a/src/finch/types/connect/session_new_params.py b/src/finch/types/connect/session_new_params.py index f62c3f1d..b78da76a 100644 --- a/src/finch/types/connect/session_new_params.py +++ b/src/finch/types/connect/session_new_params.py @@ -9,27 +9,12 @@ class SessionNewParams(TypedDict, total=False): - customer_email: Required[Optional[str]] - """Email address of the customer""" - customer_id: Required[str] """Unique identifier for the customer""" customer_name: Required[str] """Name of the customer""" - integration: Required[Optional[Integration]] - """Integration configuration for the connect session""" - - manual: Required[Optional[bool]] - """Enable manual authentication mode""" - - minutes_to_expire: Required[Optional[float]] - """ - The number of minutes until the session expires (defaults to 129,600, which is - 90 days) - """ - products: Required[ List[ Literal[ @@ -48,16 +33,31 @@ class SessionNewParams(TypedDict, total=False): ] """The Finch products to request access to""" - redirect_uri: Required[Optional[str]] + customer_email: Optional[str] + """Email address of the customer""" + + integration: Optional[Integration] + """Integration configuration for the connect session""" + + manual: Optional[bool] + """Enable manual authentication mode""" + + minutes_to_expire: Optional[float] + """ + The number of minutes until the session expires (defaults to 129,600, which is + 90 days) + """ + + redirect_uri: Optional[str] """The URI to redirect to after the Connect flow is completed""" - sandbox: Required[Optional[Literal["finch", "provider"]]] + sandbox: Optional[Literal["finch", "provider"]] """Sandbox mode for testing""" class Integration(TypedDict, total=False): - auth_method: Required[Optional[Literal["assisted", "credential", "oauth", "api_token"]]] - """The authentication method to use""" - - provider: Required[Optional[str]] + provider: Required[str] """The provider to integrate with""" + + auth_method: Optional[Literal["assisted", "credential", "oauth", "api_token"]] + """The authentication method to use""" diff --git a/src/finch/types/connect/session_reauthenticate_params.py b/src/finch/types/connect/session_reauthenticate_params.py index 2e7023ce..291bb69f 100644 --- a/src/finch/types/connect/session_reauthenticate_params.py +++ b/src/finch/types/connect/session_reauthenticate_params.py @@ -12,31 +12,29 @@ class SessionReauthenticateParams(TypedDict, total=False): connection_id: Required[str] """The ID of the existing connection to reauthenticate""" - minutes_to_expire: Required[int] + minutes_to_expire: int """ The number of minutes until the session expires (defaults to 43,200, which is 30 days) """ - products: Required[ - Optional[ - List[ - Literal[ - "benefits", - "company", - "deduction", - "directory", - "documents", - "employment", - "individual", - "payment", - "pay_statement", - "ssn", - ] + products: Optional[ + List[ + Literal[ + "benefits", + "company", + "deduction", + "directory", + "documents", + "employment", + "individual", + "payment", + "pay_statement", + "ssn", ] ] ] """The products to request access to (optional for reauthentication)""" - redirect_uri: Required[Optional[str]] + redirect_uri: Optional[str] """The URI to redirect to after the Connect flow is completed""" diff --git a/tests/api_resources/connect/test_sessions.py b/tests/api_resources/connect/test_sessions.py index 1728d397..a6ece5bc 100644 --- a/tests/api_resources/connect/test_sessions.py +++ b/tests/api_resources/connect/test_sessions.py @@ -24,16 +24,26 @@ class TestSessions: @parametrize def test_method_new(self, client: Finch) -> None: session = client.connect.sessions.new( - customer_email="dev@stainless.com", customer_id="x", customer_name="x", + products=["benefits"], + ) + assert_matches_type(SessionNewResponse, session, path=["response"]) + + @pytest.mark.skip(reason="prism tests are broken") + @parametrize + def test_method_new_with_all_params(self, client: Finch) -> None: + session = client.connect.sessions.new( + customer_id="x", + customer_name="x", + products=["benefits"], + customer_email="dev@stainless.com", integration={ - "auth_method": "assisted", "provider": "provider", + "auth_method": "assisted", }, manual=True, minutes_to_expire=1, - products=["benefits"], redirect_uri="redirect_uri", sandbox="finch", ) @@ -43,18 +53,9 @@ def test_method_new(self, client: Finch) -> None: @parametrize def test_raw_response_new(self, client: Finch) -> None: response = client.connect.sessions.with_raw_response.new( - customer_email="dev@stainless.com", customer_id="x", customer_name="x", - integration={ - "auth_method": "assisted", - "provider": "provider", - }, - manual=True, - minutes_to_expire=1, products=["benefits"], - redirect_uri="redirect_uri", - sandbox="finch", ) assert response.is_closed is True @@ -66,18 +67,9 @@ def test_raw_response_new(self, client: Finch) -> None: @parametrize def test_streaming_response_new(self, client: Finch) -> None: with client.connect.sessions.with_streaming_response.new( - customer_email="dev@stainless.com", customer_id="x", customer_name="x", - integration={ - "auth_method": "assisted", - "provider": "provider", - }, - manual=True, - minutes_to_expire=1, products=["benefits"], - redirect_uri="redirect_uri", - sandbox="finch", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -90,6 +82,14 @@ def test_streaming_response_new(self, client: Finch) -> None: @pytest.mark.skip(reason="prism tests are broken") @parametrize def test_method_reauthenticate(self, client: Finch) -> None: + session = client.connect.sessions.reauthenticate( + connection_id="connection_id", + ) + assert_matches_type(SessionReauthenticateResponse, session, path=["response"]) + + @pytest.mark.skip(reason="prism tests are broken") + @parametrize + def test_method_reauthenticate_with_all_params(self, client: Finch) -> None: session = client.connect.sessions.reauthenticate( connection_id="connection_id", minutes_to_expire=0, @@ -103,9 +103,6 @@ def test_method_reauthenticate(self, client: Finch) -> None: def test_raw_response_reauthenticate(self, client: Finch) -> None: response = client.connect.sessions.with_raw_response.reauthenticate( connection_id="connection_id", - minutes_to_expire=0, - products=["benefits"], - redirect_uri="https://example.com", ) assert response.is_closed is True @@ -118,9 +115,6 @@ def test_raw_response_reauthenticate(self, client: Finch) -> None: def test_streaming_response_reauthenticate(self, client: Finch) -> None: with client.connect.sessions.with_streaming_response.reauthenticate( connection_id="connection_id", - minutes_to_expire=0, - products=["benefits"], - redirect_uri="https://example.com", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -140,16 +134,26 @@ class TestAsyncSessions: @parametrize async def test_method_new(self, async_client: AsyncFinch) -> None: session = await async_client.connect.sessions.new( - customer_email="dev@stainless.com", customer_id="x", customer_name="x", + products=["benefits"], + ) + assert_matches_type(SessionNewResponse, session, path=["response"]) + + @pytest.mark.skip(reason="prism tests are broken") + @parametrize + async def test_method_new_with_all_params(self, async_client: AsyncFinch) -> None: + session = await async_client.connect.sessions.new( + customer_id="x", + customer_name="x", + products=["benefits"], + customer_email="dev@stainless.com", integration={ - "auth_method": "assisted", "provider": "provider", + "auth_method": "assisted", }, manual=True, minutes_to_expire=1, - products=["benefits"], redirect_uri="redirect_uri", sandbox="finch", ) @@ -159,18 +163,9 @@ async def test_method_new(self, async_client: AsyncFinch) -> None: @parametrize async def test_raw_response_new(self, async_client: AsyncFinch) -> None: response = await async_client.connect.sessions.with_raw_response.new( - customer_email="dev@stainless.com", customer_id="x", customer_name="x", - integration={ - "auth_method": "assisted", - "provider": "provider", - }, - manual=True, - minutes_to_expire=1, products=["benefits"], - redirect_uri="redirect_uri", - sandbox="finch", ) assert response.is_closed is True @@ -182,18 +177,9 @@ async def test_raw_response_new(self, async_client: AsyncFinch) -> None: @parametrize async def test_streaming_response_new(self, async_client: AsyncFinch) -> None: async with async_client.connect.sessions.with_streaming_response.new( - customer_email="dev@stainless.com", customer_id="x", customer_name="x", - integration={ - "auth_method": "assisted", - "provider": "provider", - }, - manual=True, - minutes_to_expire=1, products=["benefits"], - redirect_uri="redirect_uri", - sandbox="finch", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -206,6 +192,14 @@ async def test_streaming_response_new(self, async_client: AsyncFinch) -> None: @pytest.mark.skip(reason="prism tests are broken") @parametrize async def test_method_reauthenticate(self, async_client: AsyncFinch) -> None: + session = await async_client.connect.sessions.reauthenticate( + connection_id="connection_id", + ) + assert_matches_type(SessionReauthenticateResponse, session, path=["response"]) + + @pytest.mark.skip(reason="prism tests are broken") + @parametrize + async def test_method_reauthenticate_with_all_params(self, async_client: AsyncFinch) -> None: session = await async_client.connect.sessions.reauthenticate( connection_id="connection_id", minutes_to_expire=0, @@ -219,9 +213,6 @@ async def test_method_reauthenticate(self, async_client: AsyncFinch) -> None: async def test_raw_response_reauthenticate(self, async_client: AsyncFinch) -> None: response = await async_client.connect.sessions.with_raw_response.reauthenticate( connection_id="connection_id", - minutes_to_expire=0, - products=["benefits"], - redirect_uri="https://example.com", ) assert response.is_closed is True @@ -234,9 +225,6 @@ async def test_raw_response_reauthenticate(self, async_client: AsyncFinch) -> No async def test_streaming_response_reauthenticate(self, async_client: AsyncFinch) -> None: async with async_client.connect.sessions.with_streaming_response.reauthenticate( connection_id="connection_id", - minutes_to_expire=0, - products=["benefits"], - redirect_uri="https://example.com", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" From 25b350cd049f847dfcb08928fd2e998c3745b5ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 17:38:00 +0000 Subject: [PATCH 3/3] release: 1.38.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ pyproject.toml | 2 +- src/finch/_version.py | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6fc89ad7..b90a705e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.37.1" + ".": "1.38.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f2487ca2..31426a3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 1.38.0 (2025-11-03) + +Full Changelog: [v1.37.1...v1.38.0](https://github.com/Finch-API/finch-api-python/compare/v1.37.1...v1.38.0) + +### Features + +* **api:** api update ([08974d3](https://github.com/Finch-API/finch-api-python/commit/08974d35364590545c1cb9865f9cde672dac4a45)) + + +### Chores + +* **internal:** grammar fix (it's -> its) ([2e947bc](https://github.com/Finch-API/finch-api-python/commit/2e947bc6d5917242e878e9863cfcd777059bf345)) + ## 1.37.1 (2025-10-31) Full Changelog: [v1.37.0...v1.37.1](https://github.com/Finch-API/finch-api-python/compare/v1.37.0...v1.37.1) diff --git a/pyproject.toml b/pyproject.toml index 89c934f1..a61a6c37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "finch-api" -version = "1.37.1" +version = "1.38.0" description = "The official Python library for the Finch API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/finch/_version.py b/src/finch/_version.py index 972a739a..dbe998ce 100644 --- a/src/finch/_version.py +++ b/src/finch/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "finch" -__version__ = "1.37.1" # x-release-please-version +__version__ = "1.38.0" # x-release-please-version