Skip to content

fix(types): correct items type for individuals arg in enroll_many #15

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
Jun 2, 2023
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
26 changes: 24 additions & 2 deletions src/finch/resources/ats/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ def retrieve(
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
) -> Application:
"""Gets an application from an organization."""
"""
Gets an application from an organization.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
f"/ats/applications/{application_id}",
options=make_request_options(
Expand Down Expand Up @@ -93,7 +104,18 @@ async def retrieve(
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
) -> Application:
"""Gets an application from an organization."""
"""
Gets an application from an organization.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
f"/ats/applications/{application_id}",
options=make_request_options(
Expand Down
18 changes: 18 additions & 0 deletions src/finch/resources/ats/candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ def retrieve(

A candidate represents an individual
associated with one or more applications.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
f"/ats/candidates/{candidate_id}",
Expand Down Expand Up @@ -103,6 +112,15 @@ async def retrieve(

A candidate represents an individual
associated with one or more applications.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
f"/ats/candidates/{candidate_id}",
Expand Down
26 changes: 24 additions & 2 deletions src/finch/resources/ats/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ def retrieve(
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
) -> Job:
"""Gets a job from an organization."""
"""
Gets a job from an organization.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
f"/ats/jobs/{job_id}",
options=make_request_options(
Expand Down Expand Up @@ -93,7 +104,18 @@ async def retrieve(
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
) -> Job:
"""Gets a job from an organization."""
"""
Gets a job from an organization.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
f"/ats/jobs/{job_id}",
options=make_request_options(
Expand Down
26 changes: 24 additions & 2 deletions src/finch/resources/ats/offers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ def retrieve(
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
) -> Offer:
"""Get a single offer from an organization."""
"""
Get a single offer from an organization.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
f"/ats/offers/{offer_id}",
options=make_request_options(
Expand Down Expand Up @@ -93,7 +104,18 @@ async def retrieve(
extra_body: Body | None = None,
timeout: float | None | NotGiven = NOT_GIVEN,
) -> Offer:
"""Get a single offer from an organization."""
"""
Get a single offer from an organization.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
f"/ats/offers/{offer_id}",
options=make_request_options(
Expand Down
22 changes: 20 additions & 2 deletions src/finch/resources/hris/benefits/benefits.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def create(
"/employer/benefits",
body=maybe_transform(
{
"type": type,
"description": description,
"frequency": frequency,
"type": type,
},
benefit_create_params.BenefitCreateParams,
),
Expand All @@ -95,6 +95,15 @@ def retrieve(
**Availability: Automated Benefits providers only**

Lists benefit information for a given benefit

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
f"/employer/benefits/{benefit_id}",
Expand Down Expand Up @@ -232,9 +241,9 @@ async def create(
"/employer/benefits",
body=maybe_transform(
{
"type": type,
"description": description,
"frequency": frequency,
"type": type,
},
benefit_create_params.BenefitCreateParams,
),
Expand All @@ -259,6 +268,15 @@ async def retrieve(
**Availability: Automated Benefits providers only**

Lists benefit information for a given benefit

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
f"/employer/benefits/{benefit_id}",
Expand Down
22 changes: 20 additions & 2 deletions src/finch/resources/hris/benefits/individuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def enroll_many(
self,
benefit_id: str,
*,
individuals: List[individual_enroll_many_params.IndividualEnrollManyParam],
individuals: List[individual_enroll_many_params.Individual],
# 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 Down Expand Up @@ -84,6 +84,15 @@ def enrolled_ids(
**Availability: Automated Benefits providers only**

Lists individuals currently enrolled in a given benefit.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
f"/employer/benefits/{benefit_id}/enrolled",
Expand Down Expand Up @@ -185,7 +194,7 @@ def enroll_many(
self,
benefit_id: str,
*,
individuals: List[individual_enroll_many_params.IndividualEnrollManyParam],
individuals: List[individual_enroll_many_params.Individual],
# 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 Down Expand Up @@ -242,6 +251,15 @@ async def enrolled_ids(
**Availability: Automated Benefits providers only**

Lists individuals currently enrolled in a given benefit.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
f"/employer/benefits/{benefit_id}/enrolled",
Expand Down
4 changes: 2 additions & 2 deletions src/finch/resources/hris/individuals/individuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def retrieve_many(
page=SyncResponsesPage[IndividualResponse],
body=maybe_transform(
{
"requests": requests,
"options": options,
"requests": requests,
},
individual_retrieve_many_params.IndividualRetrieveManyParams,
),
Expand Down Expand Up @@ -103,8 +103,8 @@ def retrieve_many(
page=AsyncResponsesPage[IndividualResponse],
body=maybe_transform(
{
"requests": requests,
"options": options,
"requests": requests,
},
individual_retrieve_many_params.IndividualRetrieveManyParams,
),
Expand Down
4 changes: 2 additions & 2 deletions src/finch/resources/hris/payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def list(
timeout=timeout,
query=maybe_transform(
{
"start_date": start_date,
"end_date": end_date,
"start_date": start_date,
},
payment_list_params.PaymentListParams,
),
Expand Down Expand Up @@ -107,8 +107,8 @@ def list(
timeout=timeout,
query=maybe_transform(
{
"start_date": start_date,
"end_date": end_date,
"start_date": start_date,
},
payment_list_params.PaymentListParams,
),
Expand Down
14 changes: 8 additions & 6 deletions src/finch/types/hris/benefits/individual_enroll_many_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
from __future__ import annotations

from typing import List
from typing_extensions import TypedDict
from typing_extensions import Required, TypedDict

__all__ = ["IndividualEnrollManyParam"]
__all__ = ["IndividualEnrollManyParams", "Individual"]


class IndividualEnrollManyParam(TypedDict, total=False):
class IndividualEnrollManyParams(TypedDict, total=False):
individuals: Required[List[Individual]]
"""Array of the individual_id to enroll and a configuration object."""


class Individual(TypedDict, total=False):
configuration: object

individual_id: str
"""Finch id (uuidv4) for the individual to enroll"""


IndividualEnrollManyParams = List[IndividualEnrollManyParam]
14 changes: 7 additions & 7 deletions src/finch/types/hris/individual_retrieve_many_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
from typing import List, Optional
from typing_extensions import TypedDict

__all__ = ["IndividualRetrieveManyParams", "Request", "Options"]
__all__ = ["IndividualRetrieveManyParams", "Options", "Request"]


class Request(TypedDict, total=False):
individual_id: str
class IndividualRetrieveManyParams(TypedDict, total=False):
options: Optional[Options]

requests: List[Request]


class Options(TypedDict, total=False):
include: List[str]


class IndividualRetrieveManyParams(TypedDict, total=False):
options: Optional[Options]

requests: List[Request]
class Request(TypedDict, total=False):
individual_id: str
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
__all__ = ["EmploymentDataRetrieveManyParams", "Request"]


class EmploymentDataRetrieveManyParams(TypedDict, total=False):
requests: Required[List[Request]]
"""The array of batch requests."""


class Request(TypedDict, total=False):
individual_id: Required[str]
"""A stable Finch `id` (UUID v4) for an individual in the company.
Expand All @@ -16,8 +21,3 @@ class Request(TypedDict, total=False):
preferantial to send all ids in a single request for Finch to optimize provider
rate-limits.
"""


class EmploymentDataRetrieveManyParams(TypedDict, total=False):
requests: Required[List[Request]]
"""The array of batch requests."""
10 changes: 5 additions & 5 deletions src/finch/types/hris/pay_statement_retrieve_many_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
__all__ = ["PayStatementRetrieveManyParams", "Request"]


class PayStatementRetrieveManyParams(TypedDict, total=False):
requests: Required[List[Request]]
"""The array of batch requests."""


class Request(TypedDict, total=False):
payment_id: Required[str]
"""A stable Finch `id` (UUID v4) for a payment."""
Expand All @@ -17,8 +22,3 @@ class Request(TypedDict, total=False):

offset: int
"""Index to start from."""


class PayStatementRetrieveManyParams(TypedDict, total=False):
requests: Required[List[Request]]
"""The array of batch requests."""
Loading