Skip to content

Commit 79bb13f

Browse files
feat(api): api update (#584)
1 parent a26a626 commit 79bb13f

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 41
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-9c0b41ca8713a9440c624b0d08de0e6cbd9486978188afab2286ae67d8a97817.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-33c66e078bce0755ba6ffea89b65cd065f406dae750be8a23dd0315b736f1c9f.yml

src/finch/resources/jobs/automated.py

+8-12
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def create(
9090
def create(
9191
self,
9292
*,
93-
individual_id: str,
93+
params: automated_create_params.W4FormEmployeeSyncParams,
9494
type: Literal["w4_form_employee_sync"],
9595
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9696
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -116,8 +116,6 @@ def create(
116116
access to this endpoint, please contact your Finch account manager.
117117
118118
Args:
119-
individual_id: The unique ID of the individual for W-4 data sync.
120-
121119
type: The type of job to start.
122120
123121
extra_headers: Send extra headers
@@ -130,12 +128,12 @@ def create(
130128
"""
131129
...
132130

133-
@required_args(["type"], ["individual_id", "type"])
131+
@required_args(["type"], ["params", "type"])
134132
def create(
135133
self,
136134
*,
137135
type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"],
138-
individual_id: str | NotGiven = NOT_GIVEN,
136+
params: automated_create_params.W4FormEmployeeSyncParams | NotGiven = NOT_GIVEN,
139137
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
140138
# The extra values given here take precedence over values defined on the client or passed to this method.
141139
extra_headers: Headers | None = None,
@@ -148,7 +146,7 @@ def create(
148146
body=maybe_transform(
149147
{
150148
"type": type,
151-
"individual_id": individual_id,
149+
"params": params,
152150
},
153151
automated_create_params.AutomatedCreateParams,
154152
),
@@ -307,7 +305,7 @@ async def create(
307305
async def create(
308306
self,
309307
*,
310-
individual_id: str,
308+
params: automated_create_params.W4FormEmployeeSyncParams,
311309
type: Literal["w4_form_employee_sync"],
312310
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
313311
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -333,8 +331,6 @@ async def create(
333331
access to this endpoint, please contact your Finch account manager.
334332
335333
Args:
336-
individual_id: The unique ID of the individual for W-4 data sync.
337-
338334
type: The type of job to start.
339335
340336
extra_headers: Send extra headers
@@ -347,12 +343,12 @@ async def create(
347343
"""
348344
...
349345

350-
@required_args(["type"], ["individual_id", "type"])
346+
@required_args(["type"], ["params", "type"])
351347
async def create(
352348
self,
353349
*,
354350
type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"],
355-
individual_id: str | NotGiven = NOT_GIVEN,
351+
params: automated_create_params.W4FormEmployeeSyncParams | NotGiven = NOT_GIVEN,
356352
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
357353
# The extra values given here take precedence over values defined on the client or passed to this method.
358354
extra_headers: Headers | None = None,
@@ -365,7 +361,7 @@ async def create(
365361
body=await async_maybe_transform(
366362
{
367363
"type": type,
368-
"individual_id": individual_id,
364+
"params": params,
369365
},
370366
automated_create_params.AutomatedCreateParams,
371367
),

src/finch/types/jobs/automated_create_params.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Union
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8-
__all__ = ["AutomatedCreateParams", "DataSyncAll", "W4FormEmployeeSync"]
8+
__all__ = ["AutomatedCreateParams", "DataSyncAll", "W4FormEmployeeSync", "W4FormEmployeeSyncParams"]
99

1010

1111
class DataSyncAll(TypedDict, total=False):
@@ -14,11 +14,15 @@ class DataSyncAll(TypedDict, total=False):
1414

1515

1616
class W4FormEmployeeSync(TypedDict, total=False):
17-
individual_id: Required[str]
18-
"""The unique ID of the individual for W-4 data sync."""
17+
params: Required[W4FormEmployeeSyncParams]
1918

2019
type: Required[Literal["w4_form_employee_sync"]]
2120
"""The type of job to start."""
2221

2322

23+
class W4FormEmployeeSyncParams(TypedDict, total=False):
24+
individual_id: Required[str]
25+
"""The unique ID of the individual for W-4 data sync."""
26+
27+
2428
AutomatedCreateParams: TypeAlias = Union[DataSyncAll, W4FormEmployeeSync]

tests/api_resources/jobs/test_automated.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ def test_streaming_response_create_overload_1(self, client: Finch) -> None:
5252
@parametrize
5353
def test_method_create_overload_2(self, client: Finch) -> None:
5454
automated = client.jobs.automated.create(
55-
individual_id="individual_id",
55+
params={"individual_id": "individual_id"},
5656
type="w4_form_employee_sync",
5757
)
5858
assert_matches_type(AutomatedCreateResponse, automated, path=["response"])
5959

6060
@parametrize
6161
def test_raw_response_create_overload_2(self, client: Finch) -> None:
6262
response = client.jobs.automated.with_raw_response.create(
63-
individual_id="individual_id",
63+
params={"individual_id": "individual_id"},
6464
type="w4_form_employee_sync",
6565
)
6666

@@ -72,7 +72,7 @@ def test_raw_response_create_overload_2(self, client: Finch) -> None:
7272
@parametrize
7373
def test_streaming_response_create_overload_2(self, client: Finch) -> None:
7474
with client.jobs.automated.with_streaming_response.create(
75-
individual_id="individual_id",
75+
params={"individual_id": "individual_id"},
7676
type="w4_form_employee_sync",
7777
) as response:
7878
assert not response.is_closed
@@ -192,15 +192,15 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncFin
192192
@parametrize
193193
async def test_method_create_overload_2(self, async_client: AsyncFinch) -> None:
194194
automated = await async_client.jobs.automated.create(
195-
individual_id="individual_id",
195+
params={"individual_id": "individual_id"},
196196
type="w4_form_employee_sync",
197197
)
198198
assert_matches_type(AutomatedCreateResponse, automated, path=["response"])
199199

200200
@parametrize
201201
async def test_raw_response_create_overload_2(self, async_client: AsyncFinch) -> None:
202202
response = await async_client.jobs.automated.with_raw_response.create(
203-
individual_id="individual_id",
203+
params={"individual_id": "individual_id"},
204204
type="w4_form_employee_sync",
205205
)
206206

@@ -212,7 +212,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncFinch) ->
212212
@parametrize
213213
async def test_streaming_response_create_overload_2(self, async_client: AsyncFinch) -> None:
214214
async with async_client.jobs.automated.with_streaming_response.create(
215-
individual_id="individual_id",
215+
params={"individual_id": "individual_id"},
216216
type="w4_form_employee_sync",
217217
) as response:
218218
assert not response.is_closed

0 commit comments

Comments
 (0)