Skip to content

feat(api): api update #532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 39
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-c7c3b67aee7f77702be22b17af22bdf799b8c95be8028f20ac406af8b5ec0439.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-2526a31a361274411e6cfc64858b1b084a22ffb491a9490374b717534827b3e1.yml
24 changes: 12 additions & 12 deletions src/finch/resources/jobs/automated.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def create(
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
per connection.

`w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
identified by `individual_id`. This feature is currently in beta.
`w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular
individual, identified by `individual_id`. This feature is currently in beta.

This endpoint is available for _Scale_ tier customers as an add-on. To request
access to this endpoint, please contact your Finch account manager.
Expand All @@ -91,7 +91,7 @@ def create(
self,
*,
individual_id: str,
type: Literal["w4_data_sync"],
type: Literal["w4_form_employee_sync"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -109,8 +109,8 @@ def create(
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
per connection.

`w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
identified by `individual_id`. This feature is currently in beta.
`w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular
individual, identified by `individual_id`. This feature is currently in beta.

This endpoint is available for _Scale_ tier customers as an add-on. To request
access to this endpoint, please contact your Finch account manager.
Expand All @@ -134,7 +134,7 @@ def create(
def create(
self,
*,
type: Literal["data_sync_all"] | Literal["w4_data_sync"],
type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"],
individual_id: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -284,8 +284,8 @@ async def create(
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
per connection.

`w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
identified by `individual_id`. This feature is currently in beta.
`w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular
individual, identified by `individual_id`. This feature is currently in beta.

This endpoint is available for _Scale_ tier customers as an add-on. To request
access to this endpoint, please contact your Finch account manager.
Expand All @@ -308,7 +308,7 @@ async def create(
self,
*,
individual_id: str,
type: Literal["w4_data_sync"],
type: Literal["w4_form_employee_sync"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -326,8 +326,8 @@ async def create(
progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
per connection.

`w4_data_sync`: Enqueues a job for sync W-4 data for a particular individual,
identified by `individual_id`. This feature is currently in beta.
`w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular
individual, identified by `individual_id`. This feature is currently in beta.

This endpoint is available for _Scale_ tier customers as an add-on. To request
access to this endpoint, please contact your Finch account manager.
Expand All @@ -351,7 +351,7 @@ async def create(
async def create(
self,
*,
type: Literal["data_sync_all"] | Literal["w4_data_sync"],
type: Literal["data_sync_all"] | Literal["w4_form_employee_sync"],
individual_id: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down
8 changes: 4 additions & 4 deletions src/finch/types/jobs/automated_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
from typing import Union
from typing_extensions import Literal, Required, TypeAlias, TypedDict

__all__ = ["AutomatedCreateParams", "DataSyncAll", "W4DataSync"]
__all__ = ["AutomatedCreateParams", "DataSyncAll", "W4FormEmployeeSync"]


class DataSyncAll(TypedDict, total=False):
type: Required[Literal["data_sync_all"]]
"""The type of job to start."""


class W4DataSync(TypedDict, total=False):
class W4FormEmployeeSync(TypedDict, total=False):
individual_id: Required[str]
"""The unique ID of the individual for W-4 data sync."""

type: Required[Literal["w4_data_sync"]]
type: Required[Literal["w4_form_employee_sync"]]
"""The type of job to start."""


AutomatedCreateParams: TypeAlias = Union[DataSyncAll, W4DataSync]
AutomatedCreateParams: TypeAlias = Union[DataSyncAll, W4FormEmployeeSync]
12 changes: 6 additions & 6 deletions tests/api_resources/jobs/test_automated.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def test_streaming_response_create_overload_1(self, client: Finch) -> None:
def test_method_create_overload_2(self, client: Finch) -> None:
automated = client.jobs.automated.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
)
assert_matches_type(AutomatedCreateResponse, automated, path=["response"])

@parametrize
def test_raw_response_create_overload_2(self, client: Finch) -> None:
response = client.jobs.automated.with_raw_response.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
)

assert response.is_closed is True
Expand All @@ -73,7 +73,7 @@ def test_raw_response_create_overload_2(self, client: Finch) -> None:
def test_streaming_response_create_overload_2(self, client: Finch) -> None:
with client.jobs.automated.with_streaming_response.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down Expand Up @@ -193,15 +193,15 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncFin
async def test_method_create_overload_2(self, async_client: AsyncFinch) -> None:
automated = await async_client.jobs.automated.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
)
assert_matches_type(AutomatedCreateResponse, automated, path=["response"])

@parametrize
async def test_raw_response_create_overload_2(self, async_client: AsyncFinch) -> None:
response = await async_client.jobs.automated.with_raw_response.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
)

assert response.is_closed is True
Expand All @@ -213,7 +213,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncFinch) ->
async def test_streaming_response_create_overload_2(self, async_client: AsyncFinch) -> None:
async with async_client.jobs.automated.with_streaming_response.create(
individual_id="individual_id",
type="w4_data_sync",
type="w4_form_employee_sync",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down