Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Aug 30, 2024
1 parent b7e9e69 commit c421edc
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions src/finch/resources/sandbox/connections/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down Expand Up @@ -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`)
Expand Down
4 changes: 4 additions & 0 deletions src/finch/resources/sandbox/connections/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
17 changes: 14 additions & 3 deletions src/finch/types/base_webhook_event.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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."""
16 changes: 13 additions & 3 deletions src/finch/types/create_access_token_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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`."""
36 changes: 31 additions & 5 deletions src/finch/types/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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.
Expand All @@ -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`."""
1 change: 1 addition & 0 deletions src/finch/types/sandbox/connection_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
6 changes: 6 additions & 0 deletions src/finch/types/sandbox/connection_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`."""
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`"""
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"""

0 comments on commit c421edc

Please sign in to comment.