Skip to content

Commit d47842a

Browse files
feat(api): api update
1 parent 24da06a commit d47842a

File tree

4 files changed

+59
-38
lines changed

4 files changed

+59
-38
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-e5ab676f0996530fe4c702d8cbb88862ab8382792d01197a9576e06f5a359d00.yml
3-
openapi_spec_hash: 5c0dec3d2e1fea26d5f99560b226aedd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-9810fd8ae1eed14c34c83de1ac110dbfb8cc23d2ac930b641cb0ad40f327ecb8.yml
3+
openapi_spec_hash: e0d44a94626fd6208a0d585ce93d7e89
44
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6
Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
4-
from typing_extensions import Literal
3+
from typing import List, Union, Optional
4+
from typing_extensions import Literal, TypeAlias
55

66
from ..income import Income
77
from ..._models import BaseModel
88
from ..location import Location
99

10-
__all__ = ["EmploymentData", "CustomField", "Department", "Employment", "Manager"]
10+
__all__ = [
11+
"EmploymentData",
12+
"UnionMember0",
13+
"UnionMember0CustomField",
14+
"UnionMember0Department",
15+
"UnionMember0Employment",
16+
"UnionMember0Manager",
17+
"BatchError",
18+
]
1119

1220

13-
class CustomField(BaseModel):
21+
class UnionMember0CustomField(BaseModel):
1422
name: Optional[str] = None
1523

16-
value: Optional[object] = None
24+
value: Union[str, List[object], float, bool, object, None] = None
1725

1826

19-
class Department(BaseModel):
27+
class UnionMember0Department(BaseModel):
2028
name: Optional[str] = None
2129
"""The name of the department associated with the individual."""
2230

2331

24-
class Employment(BaseModel):
32+
class UnionMember0Employment(BaseModel):
2533
subtype: Optional[Literal["full_time", "intern", "part_time", "temp", "seasonal", "individual_contractor"]] = None
2634
"""The secondary employment type of the individual.
2735
@@ -33,28 +41,28 @@ class Employment(BaseModel):
3341
"""The main employment type of the individual."""
3442

3543

36-
class Manager(BaseModel):
37-
id: Optional[str] = None
44+
class UnionMember0Manager(BaseModel):
45+
id: str
3846
"""A stable Finch `id` (UUID v4) for an individual in the company."""
3947

4048

41-
class EmploymentData(BaseModel):
42-
id: Optional[str] = None
49+
class UnionMember0(BaseModel):
50+
id: str
4351
"""A stable Finch `id` (UUID v4) for an individual in the company."""
4452

4553
class_code: Optional[str] = None
4654
"""Worker's compensation classification code for this employee"""
4755

48-
custom_fields: Optional[List[CustomField]] = None
56+
custom_fields: Optional[List[UnionMember0CustomField]] = None
4957
"""Custom fields for the individual.
5058
5159
These are fields which are defined by the employer in the system.
5260
"""
5361

54-
department: Optional[Department] = None
62+
department: Optional[UnionMember0Department] = None
5563
"""The department object."""
5664

57-
employment: Optional[Employment] = None
65+
employment: Optional[UnionMember0Employment] = None
5866
"""The employment object."""
5967

6068
employment_status: Optional[
@@ -71,16 +79,6 @@ class EmploymentData(BaseModel):
7179
first_name: Optional[str] = None
7280
"""The legal first name of the individual."""
7381

74-
income_history: Optional[List[Optional[Income]]] = None
75-
"""The array of income history."""
76-
77-
income: Optional[Income] = None
78-
"""The employee's income as reported by the provider.
79-
80-
This may not always be annualized income, but may be in units of bi-weekly,
81-
semi-monthly, daily, etc, depending on what information the provider returns.
82-
"""
83-
8482
is_active: Optional[bool] = None
8583
"""`true` if the individual an an active employee or contractor at the company."""
8684

@@ -91,7 +89,7 @@ class EmploymentData(BaseModel):
9189

9290
location: Optional[Location] = None
9391

94-
manager: Optional[Manager] = None
92+
manager: Optional[UnionMember0Manager] = None
9593
"""The manager object representing the manager of the individual within the org."""
9694

9795
middle_name: Optional[str] = None
@@ -107,3 +105,26 @@ class EmploymentData(BaseModel):
107105

108106
work_id: Optional[str] = None
109107
"""This field is deprecated in favour of `source_id`"""
108+
109+
income_history: Optional[List[Optional[Income]]] = None
110+
"""The array of income history."""
111+
112+
income: Optional[Income] = None
113+
"""The employee's income as reported by the provider.
114+
115+
This may not always be annualized income, but may be in units of bi-weekly,
116+
semi-monthly, daily, etc, depending on what information the provider returns.
117+
"""
118+
119+
120+
class BatchError(BaseModel):
121+
code: float
122+
123+
message: str
124+
125+
name: str
126+
127+
finch_code: Optional[str] = None
128+
129+
130+
EmploymentData: TypeAlias = Union[UnionMember0, BatchError]
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
4-
53
from ..._models import BaseModel
64
from .employment_data import EmploymentData
75

86
__all__ = ["EmploymentDataResponse"]
97

108

119
class EmploymentDataResponse(BaseModel):
12-
body: Optional[EmploymentData] = None
10+
body: EmploymentData
1311

14-
code: Optional[int] = None
12+
code: int
1513

16-
individual_id: Optional[str] = None
14+
individual_id: str
1715
"""A stable Finch `id` (UUID v4) for an individual in the company."""

src/finch/types/income_param.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@
33
from __future__ import annotations
44

55
from typing import Optional
6-
from typing_extensions import Literal, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = ["IncomeParam"]
99

1010

1111
class IncomeParam(TypedDict, total=False):
12-
amount: Optional[int]
12+
amount: Required[Optional[int]]
1313
"""The income amount in cents."""
1414

15-
currency: Optional[str]
15+
currency: Required[Optional[str]]
1616
"""The currency code."""
1717

18-
effective_date: Optional[str]
18+
effective_date: Required[Optional[str]]
1919
"""The date the income amount went into effect."""
2020

21-
unit: Optional[
22-
Literal["yearly", "quarterly", "monthly", "semi_monthly", "bi_weekly", "weekly", "daily", "hourly", "fixed"]
21+
unit: Required[
22+
Optional[
23+
Literal["yearly", "quarterly", "monthly", "semi_monthly", "bi_weekly", "weekly", "daily", "hourly", "fixed"]
24+
]
2325
]
2426
"""The income unit of payment.
2527

0 commit comments

Comments
 (0)