Skip to content

Commit 1dd1ffa

Browse files
feat(api): api update
1 parent d14c906 commit 1dd1ffa

File tree

7 files changed

+45
-32
lines changed

7 files changed

+45
-32
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-71150944bd4857b4e440c82129013be70c3493cf844b70b8f3e61ef963d04297.yml
3-
openapi_spec_hash: 258a53bb485ab17eef5736d88f4d8259
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-73c284d36c1ed2d9963fc733e421005fad76e559de8efe9baa6511a43dd72668.yml
3+
openapi_spec_hash: 1e58c4445919b71c77e5c7f16bd6fa7d
44
config_hash: 5146b12344dae76238940989dac1e8a0

src/finch/types/hris/benefit_create_params.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

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

88
from .benefit_type import BenefitType
99
from .benefit_frequency import BenefitFrequency
@@ -30,12 +30,12 @@ class BenefitCreateParams(TypedDict, total=False):
3030

3131

3232
class CompanyContributionTier(TypedDict, total=False):
33-
match: int
33+
match: Required[int]
3434

35-
threshold: int
35+
threshold: Required[int]
3636

3737

3838
class CompanyContribution(TypedDict, total=False):
39-
tiers: Iterable[CompanyContributionTier]
39+
tiers: Required[Iterable[CompanyContributionTier]]
4040

41-
type: Literal["match"]
41+
type: Required[Literal["match"]]

src/finch/types/hris/benefit_frequency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
__all__ = ["BenefitFrequency"]
77

8-
BenefitFrequency: TypeAlias = Optional[Literal["one_time", "every_paycheck", "monthly"]]
8+
BenefitFrequency: TypeAlias = Optional[Literal["every_paycheck", "monthly", "one_time"]]

src/finch/types/hris/benefits/individual_benefit.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

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

66
from ...._models import BaseModel
77
from ..benefit_contribution import BenefitContribution
88

9-
__all__ = ["IndividualBenefit", "Body"]
9+
__all__ = ["IndividualBenefit", "Body", "BodyUnionMember0", "BodyBatchError"]
1010

1111

12-
class Body(BaseModel):
12+
class BodyUnionMember0(BaseModel):
1313
annual_maximum: Optional[int] = None
1414
"""
1515
If the benefit supports annual maximum, the amount in cents for this individual.
@@ -29,9 +29,22 @@ class Body(BaseModel):
2929
"""Type for HSA contribution limit if the benefit is a HSA."""
3030

3131

32+
class BodyBatchError(BaseModel):
33+
code: float
34+
35+
message: str
36+
37+
name: str
38+
39+
finch_code: Optional[str] = None
40+
41+
42+
Body: TypeAlias = Union[BodyUnionMember0, BodyBatchError]
43+
44+
3245
class IndividualBenefit(BaseModel):
33-
body: Optional[Body] = None
46+
body: Body
3447

35-
code: Optional[int] = None
48+
code: int
3649

37-
individual_id: Optional[str] = None
50+
individual_id: str

src/finch/types/hris/company_benefit.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@
1111

1212

1313
class CompanyContributionTier(BaseModel):
14-
match: Optional[int] = None
14+
match: int
1515

16-
threshold: Optional[int] = None
16+
threshold: int
1717

1818

1919
class CompanyContribution(BaseModel):
20-
tiers: Optional[List[CompanyContributionTier]] = None
20+
tiers: List[CompanyContributionTier]
2121

22-
type: Optional[Literal["match"]] = None
22+
type: Literal["match"]
2323

2424

2525
class CompanyBenefit(BaseModel):
2626
benefit_id: str
2727
"""The id of the benefit."""
2828

29-
company_contribution: Optional[CompanyContribution] = None
30-
"""The company match for this benefit."""
31-
3229
description: Optional[str] = None
3330

3431
frequency: Optional[BenefitFrequency] = None
3532
"""The frequency of the benefit deduction/contribution."""
3633

3734
type: Optional[BenefitType] = None
3835
"""Type of benefit."""
36+
37+
company_contribution: Optional[CompanyContribution] = None
38+
"""The company match for this benefit."""

src/finch/types/hris/supported_benefit.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ class SupportedBenefit(BaseModel):
1313
annual_maximum: Optional[bool] = None
1414
"""Whether the provider supports an annual maximum for this benefit."""
1515

16-
catch_up: Optional[bool] = None
17-
"""Whether the provider supports catch up for this benefit.
18-
19-
This field will only be true for retirement benefits.
20-
"""
21-
2216
company_contribution: Optional[List[Optional[Literal["fixed", "percent"]]]] = None
2317
"""Supported contribution types.
2418
@@ -33,10 +27,16 @@ class SupportedBenefit(BaseModel):
3327
An empty array indicates deductions are not supported.
3428
"""
3529

36-
frequencies: Optional[List[Optional[BenefitFrequency]]] = None
30+
frequencies: List[Optional[BenefitFrequency]]
3731
"""The list of frequencies supported by the provider for this benefit"""
3832

39-
hsa_contribution_limit: Optional[List[Optional[Literal["individual", "family"]]]] = None
33+
catch_up: Optional[bool] = None
34+
"""Whether the provider supports catch up for this benefit.
35+
36+
This field will only be true for retirement benefits.
37+
"""
38+
39+
hsa_contribution_limit: Optional[List[Optional[Literal["family", "individual"]]]] = None
4040
"""Whether the provider supports HSA contribution limits.
4141
4242
Empty if this feature is not supported for the benefit. This array only has

tests/api_resources/hris/test_benefits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Finch) -> None:
4141
"type": "match",
4242
},
4343
description="description",
44-
frequency="one_time",
44+
frequency="every_paycheck",
4545
type="457",
4646
)
4747
assert_matches_type(CreateCompanyBenefitsResponse, benefit, path=["response"])
@@ -224,7 +224,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncFinch) ->
224224
"type": "match",
225225
},
226226
description="description",
227-
frequency="one_time",
227+
frequency="every_paycheck",
228228
type="457",
229229
)
230230
assert_matches_type(CreateCompanyBenefitsResponse, benefit, path=["response"])

0 commit comments

Comments
 (0)