From 7c454f82cd9dda072cea9c8e350cf23318d68e8e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 22:28:47 +0000 Subject: [PATCH 1/2] feat(api): OpenAPI spec update via Stainless API (#487) --- .stats.yml | 2 +- .../resources/sandbox/connections/accounts.py | 4 +++ .../sandbox/connections/connections.py | 4 +++ src/finch/types/base_webhook_event.py | 17 +++++++-- .../types/create_access_token_response.py | 16 +++++++-- src/finch/types/introspection.py | 36 ++++++++++++++++--- .../types/sandbox/connection_create_params.py | 1 + .../sandbox/connection_create_response.py | 6 ++++ .../connections/account_create_params.py | 1 + .../connections/account_create_response.py | 6 ++++ .../connections/account_update_response.py | 8 ++++- 11 files changed, 88 insertions(+), 13 deletions(-) diff --git a/.stats.yml b/.stats.yml index f2c7ec71..8af8892f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 37 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-60f88b9ae0cedc03dd888b63ca8dec25658c87e6cc3493170114144ca9e070c9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-82f59232f8a0981c05494d0697c69182e5f36f2d355953c6098c1d4baf52341b.yml diff --git a/src/finch/resources/sandbox/connections/accounts.py b/src/finch/resources/sandbox/connections/accounts.py index bc13bec8..d7be2e90 100644 --- a/src/finch/resources/sandbox/connections/accounts.py +++ b/src/finch/resources/sandbox/connections/accounts.py @@ -52,6 +52,8 @@ def create( Create a new account for an existing connection (company/provider pair) Args: + provider_id: The provider associated with the `access_token` + products: Optional, defaults to Organization products (`company`, `directory`, `employment`, `individual`) @@ -142,6 +144,8 @@ async def create( Create a new account for an existing connection (company/provider pair) Args: + provider_id: The provider associated with the `access_token` + products: Optional, defaults to Organization products (`company`, `directory`, `employment`, `individual`) diff --git a/src/finch/resources/sandbox/connections/connections.py b/src/finch/resources/sandbox/connections/connections.py index 8e658d01..9baae475 100644 --- a/src/finch/resources/sandbox/connections/connections.py +++ b/src/finch/resources/sandbox/connections/connections.py @@ -62,6 +62,8 @@ def create( Create a new connection (new company/provider pair) with a new account Args: + provider_id: The provider associated with the connection + employee_size: Optional: the size of the employer to be created with this connection. Defaults to 20. Note that if this is higher than 100, historical payroll data will not be generated, and instead only one pay period will be created. @@ -123,6 +125,8 @@ async def create( Create a new connection (new company/provider pair) with a new account Args: + provider_id: The provider associated with the connection + employee_size: Optional: the size of the employer to be created with this connection. Defaults to 20. Note that if this is higher than 100, historical payroll data will not be generated, and instead only one pay period will be created. diff --git a/src/finch/types/base_webhook_event.py b/src/finch/types/base_webhook_event.py index 87bd216a..2d7ab337 100644 --- a/src/finch/types/base_webhook_event.py +++ b/src/finch/types/base_webhook_event.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - +from typing import Optional from .._models import BaseModel @@ -9,7 +9,18 @@ class BaseWebhookEvent(BaseModel): account_id: str - """Unique Finch id of the employer account that was used to make this connection.""" + """ + [DEPRECATED] Unique Finch ID of the employer account used to make this + connection. Use `connection_id` instead to identify the connection associated + with this event. + """ company_id: str - """Unique Finch id of the company for which data has been updated.""" + """[DEPRECATED] Unique Finch ID of the company for which data has been updated. + + Use `connection_id` instead to identify the connection associated with this + event. + """ + + connection_id: Optional[str] = None + """Unique Finch ID of the connection associated with the webhook event.""" diff --git a/src/finch/types/create_access_token_response.py b/src/finch/types/create_access_token_response.py index 8788d25a..221ea4e8 100644 --- a/src/finch/types/create_access_token_response.py +++ b/src/finch/types/create_access_token_response.py @@ -10,15 +10,25 @@ class CreateAccessTokenResponse(BaseModel): access_token: str + """The access token for the connection.""" account_id: str - """The Finch uuid of the account used to connect this company.""" + """ + [DEPRECATED] Use `connection_id` to identify the connection instead of this + account ID. + """ client_type: Literal["production", "development", "sandbox"] """The type of application associated with a token.""" company_id: str - """The Finch uuid of the company associated with the `access_token`.""" + """ + [DEPRECATED] Use `connection_id` to identify the connection instead of this + company ID. + """ + + connection_id: str + """The Finch UUID of the connection associated with the `access_token`.""" connection_type: Literal["provider", "finch"] """The type of the connection associated with the token. @@ -31,4 +41,4 @@ class CreateAccessTokenResponse(BaseModel): """An array of the authorized products associated with the `access_token`.""" provider_id: str - """The payroll provider associated with the `access_token`.""" + """The ID of the provider associated with the `access_token`.""" diff --git a/src/finch/types/introspection.py b/src/finch/types/introspection.py index b4c3cc9a..c5f7f860 100644 --- a/src/finch/types/introspection.py +++ b/src/finch/types/introspection.py @@ -6,7 +6,7 @@ from .._models import BaseModel from .shared.connection_status_type import ConnectionStatusType -__all__ = ["Introspection", "AuthenticationMethod", "AuthenticationMethodConnectionStatus"] +__all__ = ["Introspection", "AuthenticationMethod", "AuthenticationMethodConnectionStatus", "ConnectionStatus"] class AuthenticationMethodConnectionStatus(BaseModel): @@ -18,24 +18,44 @@ class AuthenticationMethodConnectionStatus(BaseModel): class AuthenticationMethod(BaseModel): connection_status: Optional[AuthenticationMethodConnectionStatus] = None + products: Optional[List[str]] = None + """An array of the authorized products associated with the `access_token`.""" + type: Optional[Literal["assisted", "credential", "api_token", "api_credential", "oauth"]] = None """The type of authentication method.""" +class ConnectionStatus(BaseModel): + message: Optional[str] = None + + status: Optional[ConnectionStatusType] = None + + class Introspection(BaseModel): account_id: str - """The Finch uuid of the account used to connect this company.""" + """ + [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection + instead of this account ID. + """ authentication_methods: List[AuthenticationMethod] client_id: str - """The client id of the application associated with the `access_token`.""" + """The client ID of the application associated with the `access_token`.""" client_type: Literal["production", "development", "sandbox"] """The type of application associated with a token.""" company_id: str - """The Finch uuid of the company associated with the `access_token`.""" + """ + [DEPRECATED] Use `connection_id` to associate tokens with a Finch connection + instead of this company ID. + """ + + connection_id: str + """The Finch UUID of the connection associated with the `access_token`.""" + + connection_status: ConnectionStatus connection_type: Literal["provider", "finch"] """The type of the connection associated with the token. @@ -52,10 +72,16 @@ class Introspection(BaseModel): """ payroll_provider_id: str - """The payroll provider associated with the `access_token`.""" + """ + [DEPRECATED] Use `provider_id` to identify the provider instead of this payroll + provider ID. + """ products: List[str] """An array of the authorized products associated with the `access_token`.""" + provider_id: str + """The ID of the provider associated with the `access_token`.""" + username: str """The account username used for login associated with the `access_token`.""" diff --git a/src/finch/types/sandbox/connection_create_params.py b/src/finch/types/sandbox/connection_create_params.py index 3c287302..61d4321e 100644 --- a/src/finch/types/sandbox/connection_create_params.py +++ b/src/finch/types/sandbox/connection_create_params.py @@ -10,6 +10,7 @@ class ConnectionCreateParams(TypedDict, total=False): provider_id: Required[str] + """The provider associated with the connection""" authentication_type: Literal["credential", "api_token", "oauth", "assisted"] diff --git a/src/finch/types/sandbox/connection_create_response.py b/src/finch/types/sandbox/connection_create_response.py index 26ff6764..1eac9e87 100644 --- a/src/finch/types/sandbox/connection_create_response.py +++ b/src/finch/types/sandbox/connection_create_response.py @@ -12,11 +12,17 @@ class ConnectionCreateResponse(BaseModel): access_token: str account_id: str + """[DEPRECATED] Use `connection_id` to associate a connection with an access token""" authentication_type: Literal["credential", "api_token", "oauth", "assisted"] company_id: str + """[DEPRECATED] Use `connection_id` to associate a connection with an access token""" + + connection_id: str + """The ID of the new connection""" products: List[str] provider_id: str + """The ID of the provider associated with the `access_token`.""" diff --git a/src/finch/types/sandbox/connections/account_create_params.py b/src/finch/types/sandbox/connections/account_create_params.py index 233e79d0..1cdb24eb 100644 --- a/src/finch/types/sandbox/connections/account_create_params.py +++ b/src/finch/types/sandbox/connections/account_create_params.py @@ -12,6 +12,7 @@ class AccountCreateParams(TypedDict, total=False): company_id: Required[str] provider_id: Required[str] + """The provider associated with the `access_token`""" authentication_type: Literal["credential", "api_token", "oauth", "assisted"] diff --git a/src/finch/types/sandbox/connections/account_create_response.py b/src/finch/types/sandbox/connections/account_create_response.py index 8c3467eb..17264bef 100644 --- a/src/finch/types/sandbox/connections/account_create_response.py +++ b/src/finch/types/sandbox/connections/account_create_response.py @@ -12,11 +12,17 @@ class AccountCreateResponse(BaseModel): access_token: str account_id: str + """[DEPRECATED] Use `connection_id` to associate a connection with an access token""" authentication_type: Literal["credential", "api_token", "oauth", "assisted"] company_id: str + """[DEPRECATED] Use `connection_id` to associate a connection with an access token""" + + connection_id: str + """The ID of the new connection""" products: List[str] provider_id: str + """The ID of the provider associated with the `access_token`""" diff --git a/src/finch/types/sandbox/connections/account_update_response.py b/src/finch/types/sandbox/connections/account_update_response.py index ab4d3465..28d6c6f7 100644 --- a/src/finch/types/sandbox/connections/account_update_response.py +++ b/src/finch/types/sandbox/connections/account_update_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from typing_extensions import Literal from ...._models import BaseModel @@ -10,11 +10,17 @@ class AccountUpdateResponse(BaseModel): account_id: str + """[DEPRECATED] Use `connection_id` to associate a connection with an access token""" authentication_type: Literal["credential", "api_token", "oauth", "assisted"] company_id: str + """[DEPRECATED] Use `connection_id` to associate a connection with an access token""" products: List[str] provider_id: str + """The ID of the provider associated with the `access_token`""" + + connection_id: Optional[str] = None + """The ID of the new connection""" From 61263f84c6252d3f41d8ec511416f6b2a52541dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 22:29:07 +0000 Subject: [PATCH 2/2] release: 1.4.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/finch/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2a8f4ffd..3e9af1b3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.3.0" + ".": "1.4.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 61ce2aee..c082f977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.4.0 (2024-08-30) + +Full Changelog: [v1.3.0...v1.4.0](https://github.com/Finch-API/finch-api-python/compare/v1.3.0...v1.4.0) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#487](https://github.com/Finch-API/finch-api-python/issues/487)) ([7c454f8](https://github.com/Finch-API/finch-api-python/commit/7c454f82cd9dda072cea9c8e350cf23318d68e8e)) + ## 1.3.0 (2024-08-28) Full Changelog: [v1.2.2...v1.3.0](https://github.com/Finch-API/finch-api-python/compare/v1.2.2...v1.3.0) diff --git a/pyproject.toml b/pyproject.toml index ba77ebd9..b1d4ac52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "finch-api" -version = "1.3.0" +version = "1.4.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 ad703d8e..9f19bb66 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.3.0" # x-release-please-version +__version__ = "1.4.0" # x-release-please-version