Skip to content

Commit 1fbf21e

Browse files
feat(api): updates (#184)
1 parent ca48726 commit 1fbf21e

20 files changed

+691
-18
lines changed

api.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Shared Types
2+
3+
```python
4+
from finch.types import OperationSupport, OperationSupportMatrix
5+
```
6+
17
# Finch
28

39
Methods:
@@ -96,11 +102,14 @@ Types:
96102
```python
97103
from finch.types.hris import (
98104
BenefitContribution,
105+
BenefitFeaturesAndOperations,
99106
BenefitFrequency,
100107
BenefitType,
108+
BenefitsSupport,
101109
BenfitContribution,
102110
CompanyBenefit,
103111
CreateCompanyBenefitsResponse,
112+
SupportPerBenefitType,
104113
SupportedBenefit,
105114
UpdateCompanyBenefitResponse,
106115
)

src/finch/resources/request_forwarding.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@ def forward(
4141
extra_body: Body | None = None,
4242
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
4343
) -> RequestForwardingForwardResponse:
44-
"""
45-
The Forward API allows you to make direct requests to an employment system.
44+
"""The Forward API allows you to make direct requests to an employment system.
45+
46+
If
47+
Finch’s unified API doesn’t have a data model that cleanly fits your needs, then
48+
Forward allows you to push or pull data models directly against an integration’s
49+
API.
4650
4751
Args:
48-
method: The HTTP method for the forwarded request. Valid values include: `GET`, `POST`,
49-
`PUT`, `DELETE`, and `PATCH`.
52+
method: The HTTP method for the forwarded request. Valid values include: `GET` , `POST`
53+
, `PUT` , `DELETE` , and `PATCH`.
5054
5155
route: The URL route path for the forwarded request. This value must begin with a
5256
forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and
@@ -111,12 +115,16 @@ async def forward(
111115
extra_body: Body | None = None,
112116
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
113117
) -> RequestForwardingForwardResponse:
114-
"""
115-
The Forward API allows you to make direct requests to an employment system.
118+
"""The Forward API allows you to make direct requests to an employment system.
119+
120+
If
121+
Finch’s unified API doesn’t have a data model that cleanly fits your needs, then
122+
Forward allows you to push or pull data models directly against an integration’s
123+
API.
116124
117125
Args:
118-
method: The HTTP method for the forwarded request. Valid values include: `GET`, `POST`,
119-
`PUT`, `DELETE`, and `PATCH`.
126+
method: The HTTP method for the forwarded request. Valid values include: `GET` , `POST`
127+
, `PUT` , `DELETE` , and `PATCH`.
120128
121129
route: The URL route path for the forwarded request. This value must begin with a
122130
forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and

src/finch/types/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from .money import Money as Money
66
from .income import Income as Income
77
from .paging import Paging as Paging
8+
from .shared import OperationSupport as OperationSupport
9+
from .shared import OperationSupportMatrix as OperationSupportMatrix
810
from .location import Location as Location
911
from .provider import Provider as Provider
1012
from .introspection import Introspection as Introspection

src/finch/types/hris/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .pay_statement import PayStatement as PayStatement
1010
from .company_benefit import CompanyBenefit as CompanyBenefit
1111
from .employment_data import EmploymentData as EmploymentData
12+
from .benefits_support import BenefitsSupport as BenefitsSupport
1213
from .benefit_frequency import BenefitFrequency as BenefitFrequency
1314
from .supported_benefit import SupportedBenefit as SupportedBenefit
1415
from .benfit_contribution import BenfitContribution as BenfitContribution
@@ -21,9 +22,13 @@
2122
from .pay_statement_response import PayStatementResponse as PayStatementResponse
2223
from .individual_in_directory import IndividualInDirectory as IndividualInDirectory
2324
from .employment_data_response import EmploymentDataResponse as EmploymentDataResponse
25+
from .support_per_benefit_type import SupportPerBenefitType as SupportPerBenefitType
2426
from .pay_statement_response_body import (
2527
PayStatementResponseBody as PayStatementResponseBody,
2628
)
29+
from .benefit_features_and_operations import (
30+
BenefitFeaturesAndOperations as BenefitFeaturesAndOperations,
31+
)
2732
from .employment_retrieve_many_params import (
2833
EmploymentRetrieveManyParams as EmploymentRetrieveManyParams,
2934
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# File generated from our OpenAPI spec by Stainless.
2+
3+
from typing import List, Optional
4+
from typing_extensions import Literal
5+
6+
from ..._models import BaseModel
7+
from .benefit_frequency import BenefitFrequency
8+
from .support_per_benefit_type import SupportPerBenefitType
9+
10+
__all__ = ["BenefitFeaturesAndOperations", "SupportedFeatures"]
11+
12+
13+
class SupportedFeatures(BaseModel):
14+
annual_maximum: Optional[bool] = None
15+
"""Whether the provider supports an annual maximum for this benefit."""
16+
17+
catch_up: Optional[bool] = None
18+
"""Whether the provider supports catch up for this benefit.
19+
20+
This field will only be true for retirement benefits.
21+
"""
22+
23+
company_contribution: Optional[List[Literal["fixed", "percent"]]] = None
24+
"""Supported contribution types.
25+
26+
An empty array indicates contributions are not supported.
27+
"""
28+
29+
description: Optional[str] = None
30+
31+
employee_deduction: Optional[List[Literal["fixed", "percent"]]] = None
32+
"""Supported deduction types.
33+
34+
An empty array indicates deductions are not supported.
35+
"""
36+
37+
frequencies: Optional[List[Optional[BenefitFrequency]]] = None
38+
"""The list of frequencies supported by the provider for this benefit"""
39+
40+
hsa_contribution_limit: Optional[List[Literal["individual", "family"]]] = None
41+
"""Whether the provider supports HSA contribution limits.
42+
43+
Empty if this feature is not supported for the benefit. This array only has
44+
values for HSA benefits.
45+
"""
46+
47+
48+
class BenefitFeaturesAndOperations(BaseModel):
49+
supported_features: Optional[SupportedFeatures] = None
50+
51+
supported_operations: Optional[SupportPerBenefitType] = None

src/finch/types/hris/benefit_frequency.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
__all__ = ["BenefitFrequency"]
77

8-
BenefitFrequency = Optional[Literal["one_time", "every_paycheck"]]
8+
BenefitFrequency = Optional[Literal["one_time", "every_paycheck", "monthly"]]
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# File generated from our OpenAPI spec by Stainless.
2+
3+
from typing import TYPE_CHECKING, Optional
4+
5+
from ..._models import BaseModel
6+
from .benefit_features_and_operations import BenefitFeaturesAndOperations
7+
8+
__all__ = ["BenefitsSupport"]
9+
10+
11+
class BenefitsSupport(BaseModel):
12+
commuter: Optional[BenefitFeaturesAndOperations] = None
13+
14+
custom_post_tax: Optional[BenefitFeaturesAndOperations] = None
15+
16+
custom_pre_tax: Optional[BenefitFeaturesAndOperations] = None
17+
18+
fsa_dependent_care: Optional[BenefitFeaturesAndOperations] = None
19+
20+
fsa_medical: Optional[BenefitFeaturesAndOperations] = None
21+
22+
hsa_post: Optional[BenefitFeaturesAndOperations] = None
23+
24+
hsa_pre: Optional[BenefitFeaturesAndOperations] = None
25+
26+
s125_dental: Optional[BenefitFeaturesAndOperations] = None
27+
28+
s125_medical: Optional[BenefitFeaturesAndOperations] = None
29+
30+
s125_vision: Optional[BenefitFeaturesAndOperations] = None
31+
32+
simple: Optional[BenefitFeaturesAndOperations] = None
33+
34+
simple_ira: Optional[BenefitFeaturesAndOperations] = None
35+
36+
if TYPE_CHECKING:
37+
# Stub to indicate that arbitrary properties are accepted.
38+
# To access properties that are not valid identifiers you can use `getattr`, e.g.
39+
# `getattr(obj, '$type')`
40+
def __getattr__(self, attr: str) -> Optional[BenefitFeaturesAndOperations]:
41+
...

src/finch/types/hris/employment_data.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
from typing import List, Optional
44
from typing_extensions import Literal
55

6-
from pydantic import Field as FieldInfo
7-
86
from ..income import Income
97
from ..._models import BaseModel
108
from ..location import Location
119

12-
__all__ = ["EmploymentData", "Department", "Employment", "Manager"]
10+
__all__ = ["EmploymentData", "CustomField", "Department", "Employment", "Manager"]
11+
12+
13+
class CustomField(BaseModel):
14+
name: Optional[str] = None
15+
16+
value: Optional[object] = None
1317

1418

1519
class Department(BaseModel):
@@ -41,6 +45,12 @@ class EmploymentData(BaseModel):
4145
class_code: Optional[str] = None
4246
"""Worker's compensation classification code for this employee"""
4347

48+
custom_fields: Optional[List[CustomField]] = None
49+
"""Custom fields for the individual.
50+
51+
These are fields which are defined by the employer in the system.
52+
"""
53+
4454
department: Optional[Department] = None
4555
"""The department object."""
4656

@@ -96,7 +106,7 @@ class EmploymentData(BaseModel):
96106
Please reach out to your Finch representative if you would like access.
97107
"""
98108

99-
work_id2: Optional[str] = FieldInfo(alias="work_id_2", default=None)
109+
work_id_2: Optional[str] = None
100110
"""Note: This property is only available if enabled for your account.
101111
102112
Please reach out to your Finch representative if you would like access.

src/finch/types/hris/individual.py

+14
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ class Individual(BaseModel):
2929

3030
emails: Optional[List[Email]] = None
3131

32+
ethnicity: Optional[
33+
Literal[
34+
"asian",
35+
"white",
36+
"black_or_african_american",
37+
"native_hawaiian_or_pacific_islander",
38+
"american_indian_or_alaska_native",
39+
"hispanic_or_latino",
40+
"two_or_more_races",
41+
"decline_to_specify",
42+
]
43+
] = None
44+
"""The EEOC-defined ethnicity of the individual."""
45+
3246
first_name: Optional[str] = None
3347
"""The legal first name of the individual."""
3448

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# File generated from our OpenAPI spec by Stainless.
2+
3+
from typing import Optional
4+
5+
from ..shared import OperationSupportMatrix
6+
from ..._models import BaseModel
7+
8+
__all__ = ["SupportPerBenefitType"]
9+
10+
11+
class SupportPerBenefitType(BaseModel):
12+
company_benefits: Optional[OperationSupportMatrix] = None
13+
14+
individual_benefits: Optional[OperationSupportMatrix] = None

src/finch/types/introspection.py

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99

1010
class Introspection(BaseModel):
11+
account_id: str
12+
"""The Finch uuid of the account used to connect this company."""
13+
1114
client_id: str
1215
"""The client id of the application associated with the `access_token`."""
1316

0 commit comments

Comments
 (0)