Skip to content

Commit f4f6ed4

Browse files
feat(api): api update
1 parent 4cd4be9 commit f4f6ed4

File tree

5 files changed

+48
-7
lines changed

5 files changed

+48
-7
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-639dd4ab9ac2acad21a6764fda369a1d189a3e64bf71a65db36daf0f32d98242.yml
3-
openapi_spec_hash: c148f859bdd0b723c856bd472f115f1f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0583a6e86a80bc62551727b12c37e02a9b4e4ac5bce822b2e2c1cade3588a6f4.yml
3+
openapi_spec_hash: 53783b6cc1f63d9fb5d3a4dba7b0a806
44
config_hash: 53778a0b839c4f6ad34fbba051f5e8a6

src/finch/resources/hris/benefits/benefits.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def with_streaming_response(self) -> BenefitsWithStreamingResponse:
6060
def create(
6161
self,
6262
*,
63+
company_contribution: Optional[benefit_create_params.CompanyContribution] | NotGiven = NOT_GIVEN,
6364
description: str | NotGiven = NOT_GIVEN,
6465
frequency: Optional[BenefitFrequency] | NotGiven = NOT_GIVEN,
6566
type: Optional[BenefitType] | NotGiven = NOT_GIVEN,
@@ -76,6 +77,8 @@ def create(
7677
`/providers` endpoint to view available types for each provider.
7778
7879
Args:
80+
company_contribution: The company match for this benefit.
81+
7982
description: Name of the benefit as it appears in the provider and pay statements. Recommend
8083
limiting this to <30 characters due to limitations in specific providers (e.g.
8184
Justworks).
@@ -96,6 +99,7 @@ def create(
9699
"/employer/benefits",
97100
body=maybe_transform(
98101
{
102+
"company_contribution": company_contribution,
99103
"description": description,
100104
"frequency": frequency,
101105
"type": type,
@@ -246,6 +250,7 @@ def with_streaming_response(self) -> AsyncBenefitsWithStreamingResponse:
246250
async def create(
247251
self,
248252
*,
253+
company_contribution: Optional[benefit_create_params.CompanyContribution] | NotGiven = NOT_GIVEN,
249254
description: str | NotGiven = NOT_GIVEN,
250255
frequency: Optional[BenefitFrequency] | NotGiven = NOT_GIVEN,
251256
type: Optional[BenefitType] | NotGiven = NOT_GIVEN,
@@ -262,6 +267,8 @@ async def create(
262267
`/providers` endpoint to view available types for each provider.
263268
264269
Args:
270+
company_contribution: The company match for this benefit.
271+
265272
description: Name of the benefit as it appears in the provider and pay statements. Recommend
266273
limiting this to <30 characters due to limitations in specific providers (e.g.
267274
Justworks).
@@ -282,6 +289,7 @@ async def create(
282289
"/employer/benefits",
283290
body=await async_maybe_transform(
284291
{
292+
"company_contribution": company_contribution,
285293
"description": description,
286294
"frequency": frequency,
287295
"type": type,

src/finch/types/hris/benefit_create_params.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22

33
from __future__ import annotations
44

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

88
from .benefit_type import BenefitType
99
from .benefit_frequency import BenefitFrequency
1010

11-
__all__ = ["BenefitCreateParams"]
11+
__all__ = ["BenefitCreateParams", "CompanyContribution", "CompanyContributionTier"]
1212

1313

1414
class BenefitCreateParams(TypedDict, total=False):
15+
company_contribution: Optional[CompanyContribution]
16+
"""The company match for this benefit."""
17+
1518
description: str
1619
"""Name of the benefit as it appears in the provider and pay statements.
1720
@@ -24,3 +27,15 @@ class BenefitCreateParams(TypedDict, total=False):
2427

2528
type: Optional[BenefitType]
2629
"""Type of benefit."""
30+
31+
32+
class CompanyContributionTier(TypedDict, total=False):
33+
match: int
34+
35+
threshold: int
36+
37+
38+
class CompanyContribution(TypedDict, total=False):
39+
tiers: Iterable[CompanyContributionTier]
40+
41+
type: Literal["match"]

src/finch/types/hris/company_benefit.py

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

1212

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

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

1818

1919
class CompanyContribution(BaseModel):

tests/api_resources/hris/test_benefits.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ def test_method_create(self, client: Finch) -> None:
3131
@parametrize
3232
def test_method_create_with_all_params(self, client: Finch) -> None:
3333
benefit = client.hris.benefits.create(
34+
company_contribution={
35+
"tiers": [
36+
{
37+
"match": 1,
38+
"threshold": 1,
39+
}
40+
],
41+
"type": "match",
42+
},
3443
description="description",
3544
frequency="one_time",
3645
type="401k",
@@ -203,6 +212,15 @@ async def test_method_create(self, async_client: AsyncFinch) -> None:
203212
@parametrize
204213
async def test_method_create_with_all_params(self, async_client: AsyncFinch) -> None:
205214
benefit = await async_client.hris.benefits.create(
215+
company_contribution={
216+
"tiers": [
217+
{
218+
"match": 1,
219+
"threshold": 1,
220+
}
221+
],
222+
"type": "match",
223+
},
206224
description="description",
207225
frequency="one_time",
208226
type="401k",

0 commit comments

Comments
 (0)