Skip to content

Commit 7c454f8

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#487)
1 parent a5337a6 commit 7c454f8

11 files changed

+88
-13
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 37
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-60f88b9ae0cedc03dd888b63ca8dec25658c87e6cc3493170114144ca9e070c9.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-82f59232f8a0981c05494d0697c69182e5f36f2d355953c6098c1d4baf52341b.yml

src/finch/resources/sandbox/connections/accounts.py

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def create(
5252
Create a new account for an existing connection (company/provider pair)
5353
5454
Args:
55+
provider_id: The provider associated with the `access_token`
56+
5557
products: Optional, defaults to Organization products (`company`, `directory`,
5658
`employment`, `individual`)
5759
@@ -142,6 +144,8 @@ async def create(
142144
Create a new account for an existing connection (company/provider pair)
143145
144146
Args:
147+
provider_id: The provider associated with the `access_token`
148+
145149
products: Optional, defaults to Organization products (`company`, `directory`,
146150
`employment`, `individual`)
147151

src/finch/resources/sandbox/connections/connections.py

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def create(
6262
Create a new connection (new company/provider pair) with a new account
6363
6464
Args:
65+
provider_id: The provider associated with the connection
66+
6567
employee_size: Optional: the size of the employer to be created with this connection. Defaults
6668
to 20. Note that if this is higher than 100, historical payroll data will not be
6769
generated, and instead only one pay period will be created.
@@ -123,6 +125,8 @@ async def create(
123125
Create a new connection (new company/provider pair) with a new account
124126
125127
Args:
128+
provider_id: The provider associated with the connection
129+
126130
employee_size: Optional: the size of the employer to be created with this connection. Defaults
127131
to 20. Note that if this is higher than 100, historical payroll data will not be
128132
generated, and instead only one pay period will be created.

src/finch/types/base_webhook_event.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
3+
from typing import Optional
44

55
from .._models import BaseModel
66

@@ -9,7 +9,18 @@
99

1010
class BaseWebhookEvent(BaseModel):
1111
account_id: str
12-
"""Unique Finch id of the employer account that was used to make this connection."""
12+
"""
13+
[DEPRECATED] Unique Finch ID of the employer account used to make this
14+
connection. Use `connection_id` instead to identify the connection associated
15+
with this event.
16+
"""
1317

1418
company_id: str
15-
"""Unique Finch id of the company for which data has been updated."""
19+
"""[DEPRECATED] Unique Finch ID of the company for which data has been updated.
20+
21+
Use `connection_id` instead to identify the connection associated with this
22+
event.
23+
"""
24+
25+
connection_id: Optional[str] = None
26+
"""Unique Finch ID of the connection associated with the webhook event."""

src/finch/types/create_access_token_response.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,25 @@
1010

1111
class CreateAccessTokenResponse(BaseModel):
1212
access_token: str
13+
"""The access token for the connection."""
1314

1415
account_id: str
15-
"""The Finch uuid of the account used to connect this company."""
16+
"""
17+
[DEPRECATED] Use `connection_id` to identify the connection instead of this
18+
account ID.
19+
"""
1620

1721
client_type: Literal["production", "development", "sandbox"]
1822
"""The type of application associated with a token."""
1923

2024
company_id: str
21-
"""The Finch uuid of the company associated with the `access_token`."""
25+
"""
26+
[DEPRECATED] Use `connection_id` to identify the connection instead of this
27+
company ID.
28+
"""
29+
30+
connection_id: str
31+
"""The Finch UUID of the connection associated with the `access_token`."""
2232

2333
connection_type: Literal["provider", "finch"]
2434
"""The type of the connection associated with the token.
@@ -31,4 +41,4 @@ class CreateAccessTokenResponse(BaseModel):
3141
"""An array of the authorized products associated with the `access_token`."""
3242

3343
provider_id: str
34-
"""The payroll provider associated with the `access_token`."""
44+
"""The ID of the provider associated with the `access_token`."""

src/finch/types/introspection.py

+31-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from .._models import BaseModel
77
from .shared.connection_status_type import ConnectionStatusType
88

9-
__all__ = ["Introspection", "AuthenticationMethod", "AuthenticationMethodConnectionStatus"]
9+
__all__ = ["Introspection", "AuthenticationMethod", "AuthenticationMethodConnectionStatus", "ConnectionStatus"]
1010

1111

1212
class AuthenticationMethodConnectionStatus(BaseModel):
@@ -18,24 +18,44 @@ class AuthenticationMethodConnectionStatus(BaseModel):
1818
class AuthenticationMethod(BaseModel):
1919
connection_status: Optional[AuthenticationMethodConnectionStatus] = None
2020

21+
products: Optional[List[str]] = None
22+
"""An array of the authorized products associated with the `access_token`."""
23+
2124
type: Optional[Literal["assisted", "credential", "api_token", "api_credential", "oauth"]] = None
2225
"""The type of authentication method."""
2326

2427

28+
class ConnectionStatus(BaseModel):
29+
message: Optional[str] = None
30+
31+
status: Optional[ConnectionStatusType] = None
32+
33+
2534
class Introspection(BaseModel):
2635
account_id: str
27-
"""The Finch uuid of the account used to connect this company."""
36+
"""
37+
[DEPRECATED] Use `connection_id` to associate tokens with a Finch connection
38+
instead of this account ID.
39+
"""
2840

2941
authentication_methods: List[AuthenticationMethod]
3042

3143
client_id: str
32-
"""The client id of the application associated with the `access_token`."""
44+
"""The client ID of the application associated with the `access_token`."""
3345

3446
client_type: Literal["production", "development", "sandbox"]
3547
"""The type of application associated with a token."""
3648

3749
company_id: str
38-
"""The Finch uuid of the company associated with the `access_token`."""
50+
"""
51+
[DEPRECATED] Use `connection_id` to associate tokens with a Finch connection
52+
instead of this company ID.
53+
"""
54+
55+
connection_id: str
56+
"""The Finch UUID of the connection associated with the `access_token`."""
57+
58+
connection_status: ConnectionStatus
3959

4060
connection_type: Literal["provider", "finch"]
4161
"""The type of the connection associated with the token.
@@ -52,10 +72,16 @@ class Introspection(BaseModel):
5272
"""
5373

5474
payroll_provider_id: str
55-
"""The payroll provider associated with the `access_token`."""
75+
"""
76+
[DEPRECATED] Use `provider_id` to identify the provider instead of this payroll
77+
provider ID.
78+
"""
5679

5780
products: List[str]
5881
"""An array of the authorized products associated with the `access_token`."""
5982

83+
provider_id: str
84+
"""The ID of the provider associated with the `access_token`."""
85+
6086
username: str
6187
"""The account username used for login associated with the `access_token`."""

src/finch/types/sandbox/connection_create_params.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
class ConnectionCreateParams(TypedDict, total=False):
1212
provider_id: Required[str]
13+
"""The provider associated with the connection"""
1314

1415
authentication_type: Literal["credential", "api_token", "oauth", "assisted"]
1516

src/finch/types/sandbox/connection_create_response.py

+6
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ class ConnectionCreateResponse(BaseModel):
1212
access_token: str
1313

1414
account_id: str
15+
"""[DEPRECATED] Use `connection_id` to associate a connection with an access token"""
1516

1617
authentication_type: Literal["credential", "api_token", "oauth", "assisted"]
1718

1819
company_id: str
20+
"""[DEPRECATED] Use `connection_id` to associate a connection with an access token"""
21+
22+
connection_id: str
23+
"""The ID of the new connection"""
1924

2025
products: List[str]
2126

2227
provider_id: str
28+
"""The ID of the provider associated with the `access_token`."""

src/finch/types/sandbox/connections/account_create_params.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class AccountCreateParams(TypedDict, total=False):
1212
company_id: Required[str]
1313

1414
provider_id: Required[str]
15+
"""The provider associated with the `access_token`"""
1516

1617
authentication_type: Literal["credential", "api_token", "oauth", "assisted"]
1718

src/finch/types/sandbox/connections/account_create_response.py

+6
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ class AccountCreateResponse(BaseModel):
1212
access_token: str
1313

1414
account_id: str
15+
"""[DEPRECATED] Use `connection_id` to associate a connection with an access token"""
1516

1617
authentication_type: Literal["credential", "api_token", "oauth", "assisted"]
1718

1819
company_id: str
20+
"""[DEPRECATED] Use `connection_id` to associate a connection with an access token"""
21+
22+
connection_id: str
23+
"""The ID of the new connection"""
1924

2025
products: List[str]
2126

2227
provider_id: str
28+
"""The ID of the provider associated with the `access_token`"""

src/finch/types/sandbox/connections/account_update_response.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List
3+
from typing import List, Optional
44
from typing_extensions import Literal
55

66
from ...._models import BaseModel
@@ -10,11 +10,17 @@
1010

1111
class AccountUpdateResponse(BaseModel):
1212
account_id: str
13+
"""[DEPRECATED] Use `connection_id` to associate a connection with an access token"""
1314

1415
authentication_type: Literal["credential", "api_token", "oauth", "assisted"]
1516

1617
company_id: str
18+
"""[DEPRECATED] Use `connection_id` to associate a connection with an access token"""
1719

1820
products: List[str]
1921

2022
provider_id: str
23+
"""The ID of the provider associated with the `access_token`"""
24+
25+
connection_id: Optional[str] = None
26+
"""The ID of the new connection"""

0 commit comments

Comments
 (0)