Skip to content

fix(types): loosen most List params types to Iterable #288

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
Feb 6, 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
6 changes: 3 additions & 3 deletions src/finch/resources/hris/benefits/individuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List
from typing import List, Iterable

import httpx

Expand Down Expand Up @@ -43,7 +43,7 @@ def enroll_many(
self,
benefit_id: str,
*,
individuals: List[individual_enroll_many_params.Individual],
individuals: Iterable[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 @@ -226,7 +226,7 @@ def enroll_many(
self,
benefit_id: str,
*,
individuals: List[individual_enroll_many_params.Individual],
individuals: Iterable[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
6 changes: 3 additions & 3 deletions src/finch/resources/hris/employments.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List
from typing import Iterable

import httpx

Expand Down Expand Up @@ -34,7 +34,7 @@ def with_streaming_response(self) -> EmploymentsWithStreamingResponse:
def retrieve_many(
self,
*,
requests: List[employment_retrieve_many_params.Request],
requests: Iterable[employment_retrieve_many_params.Request],
# 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,7 +84,7 @@ def with_streaming_response(self) -> AsyncEmploymentsWithStreamingResponse:
def retrieve_many(
self,
*,
requests: List[employment_retrieve_many_params.Request],
requests: Iterable[employment_retrieve_many_params.Request],
# 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
6 changes: 3 additions & 3 deletions src/finch/resources/hris/individuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Optional
from typing import Iterable, Optional

import httpx

Expand Down Expand Up @@ -35,7 +35,7 @@ def retrieve_many(
self,
*,
options: Optional[individual_retrieve_many_params.Options] | NotGiven = NOT_GIVEN,
requests: List[individual_retrieve_many_params.Request] | NotGiven = NOT_GIVEN,
requests: Iterable[individual_retrieve_many_params.Request] | 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.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -86,7 +86,7 @@ def retrieve_many(
self,
*,
options: Optional[individual_retrieve_many_params.Options] | NotGiven = NOT_GIVEN,
requests: List[individual_retrieve_many_params.Request] | NotGiven = NOT_GIVEN,
requests: Iterable[individual_retrieve_many_params.Request] | 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.
extra_headers: Headers | None = None,
Expand Down
6 changes: 3 additions & 3 deletions src/finch/resources/hris/pay_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List
from typing import Iterable

import httpx

Expand Down Expand Up @@ -34,7 +34,7 @@ def with_streaming_response(self) -> PayStatementsWithStreamingResponse:
def retrieve_many(
self,
*,
requests: List[pay_statement_retrieve_many_params.Request],
requests: Iterable[pay_statement_retrieve_many_params.Request],
# 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 @@ -85,7 +85,7 @@ def with_streaming_response(self) -> AsyncPayStatementsWithStreamingResponse:
def retrieve_many(
self,
*,
requests: List[pay_statement_retrieve_many_params.Request],
requests: Iterable[pay_statement_retrieve_many_params.Request],
# 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
14 changes: 7 additions & 7 deletions src/finch/resources/sandbox/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Optional
from typing import Iterable, Optional

import httpx

Expand Down Expand Up @@ -33,12 +33,12 @@ def with_streaming_response(self) -> CompanyWithStreamingResponse:
def update(
self,
*,
accounts: Optional[List[company_update_params.Account]],
departments: Optional[List[Optional[company_update_params.Department]]],
accounts: Optional[Iterable[company_update_params.Account]],
departments: Optional[Iterable[Optional[company_update_params.Department]]],
ein: Optional[str],
entity: Optional[company_update_params.Entity],
legal_name: Optional[str],
locations: Optional[List[Optional[LocationParam]]],
locations: Optional[Iterable[Optional[LocationParam]]],
primary_email: Optional[str],
primary_phone_number: Optional[str],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -108,12 +108,12 @@ def with_streaming_response(self) -> AsyncCompanyWithStreamingResponse:
async def update(
self,
*,
accounts: Optional[List[company_update_params.Account]],
departments: Optional[List[Optional[company_update_params.Department]]],
accounts: Optional[Iterable[company_update_params.Account]],
departments: Optional[Iterable[Optional[company_update_params.Department]]],
ein: Optional[str],
entity: Optional[company_update_params.Entity],
legal_name: Optional[str],
locations: Optional[List[Optional[LocationParam]]],
locations: Optional[Iterable[Optional[LocationParam]]],
primary_email: Optional[str],
primary_phone_number: Optional[str],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down
6 changes: 3 additions & 3 deletions src/finch/resources/sandbox/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List
from typing import Iterable

import httpx

Expand Down Expand Up @@ -32,7 +32,7 @@ def with_streaming_response(self) -> DirectoryWithStreamingResponse:
def create(
self,
*,
body: List[directory_create_params.Body],
body: Iterable[directory_create_params.Body],
# 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 @@ -77,7 +77,7 @@ def with_streaming_response(self) -> AsyncDirectoryWithStreamingResponse:
async def create(
self,
*,
body: List[directory_create_params.Body],
body: Iterable[directory_create_params.Body],
# 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
10 changes: 5 additions & 5 deletions src/finch/resources/sandbox/employment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Optional
from typing import Iterable, Optional

import httpx

Expand Down Expand Up @@ -35,13 +35,13 @@ def update(
individual_id: str,
*,
class_code: Optional[str] | NotGiven = NOT_GIVEN,
custom_fields: List[employment_update_params.CustomField] | NotGiven = NOT_GIVEN,
custom_fields: Iterable[employment_update_params.CustomField] | NotGiven = NOT_GIVEN,
department: Optional[employment_update_params.Department] | NotGiven = NOT_GIVEN,
employment: Optional[employment_update_params.Employment] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
first_name: Optional[str] | NotGiven = NOT_GIVEN,
income: Optional[IncomeParam] | NotGiven = NOT_GIVEN,
income_history: Optional[List[Optional[IncomeParam]]] | NotGiven = NOT_GIVEN,
income_history: Optional[Iterable[Optional[IncomeParam]]] | NotGiven = NOT_GIVEN,
is_active: Optional[bool] | NotGiven = NOT_GIVEN,
last_name: Optional[str] | NotGiven = NOT_GIVEN,
location: Optional[LocationParam] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -147,13 +147,13 @@ async def update(
individual_id: str,
*,
class_code: Optional[str] | NotGiven = NOT_GIVEN,
custom_fields: List[employment_update_params.CustomField] | NotGiven = NOT_GIVEN,
custom_fields: Iterable[employment_update_params.CustomField] | NotGiven = NOT_GIVEN,
department: Optional[employment_update_params.Department] | NotGiven = NOT_GIVEN,
employment: Optional[employment_update_params.Employment] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
first_name: Optional[str] | NotGiven = NOT_GIVEN,
income: Optional[IncomeParam] | NotGiven = NOT_GIVEN,
income_history: Optional[List[Optional[IncomeParam]]] | NotGiven = NOT_GIVEN,
income_history: Optional[Iterable[Optional[IncomeParam]]] | NotGiven = NOT_GIVEN,
is_active: Optional[bool] | NotGiven = NOT_GIVEN,
last_name: Optional[str] | NotGiven = NOT_GIVEN,
location: Optional[LocationParam] | NotGiven = NOT_GIVEN,
Expand Down
10 changes: 5 additions & 5 deletions src/finch/resources/sandbox/individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Optional
from typing import Iterable, Optional
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -36,7 +36,7 @@ def update(
individual_id: str,
*,
dob: Optional[str] | NotGiven = NOT_GIVEN,
emails: Optional[List[individual_update_params.Email]] | NotGiven = NOT_GIVEN,
emails: Optional[Iterable[individual_update_params.Email]] | NotGiven = NOT_GIVEN,
encrypted_ssn: Optional[str] | NotGiven = NOT_GIVEN,
ethnicity: Optional[
Literal[
Expand All @@ -55,7 +55,7 @@ def update(
gender: Optional[Literal["female", "male", "other", "decline_to_specify"]] | NotGiven = NOT_GIVEN,
last_name: Optional[str] | NotGiven = NOT_GIVEN,
middle_name: Optional[str] | NotGiven = NOT_GIVEN,
phone_numbers: Optional[List[Optional[individual_update_params.PhoneNumber]]] | NotGiven = NOT_GIVEN,
phone_numbers: Optional[Iterable[Optional[individual_update_params.PhoneNumber]]] | NotGiven = NOT_GIVEN,
preferred_name: Optional[str] | NotGiven = NOT_GIVEN,
residence: Optional[LocationParam] | NotGiven = NOT_GIVEN,
ssn: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -142,7 +142,7 @@ async def update(
individual_id: str,
*,
dob: Optional[str] | NotGiven = NOT_GIVEN,
emails: Optional[List[individual_update_params.Email]] | NotGiven = NOT_GIVEN,
emails: Optional[Iterable[individual_update_params.Email]] | NotGiven = NOT_GIVEN,
encrypted_ssn: Optional[str] | NotGiven = NOT_GIVEN,
ethnicity: Optional[
Literal[
Expand All @@ -161,7 +161,7 @@ async def update(
gender: Optional[Literal["female", "male", "other", "decline_to_specify"]] | NotGiven = NOT_GIVEN,
last_name: Optional[str] | NotGiven = NOT_GIVEN,
middle_name: Optional[str] | NotGiven = NOT_GIVEN,
phone_numbers: Optional[List[Optional[individual_update_params.PhoneNumber]]] | NotGiven = NOT_GIVEN,
phone_numbers: Optional[Iterable[Optional[individual_update_params.PhoneNumber]]] | NotGiven = NOT_GIVEN,
preferred_name: Optional[str] | NotGiven = NOT_GIVEN,
residence: Optional[LocationParam] | NotGiven = NOT_GIVEN,
ssn: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down
6 changes: 3 additions & 3 deletions src/finch/resources/sandbox/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List
from typing import Iterable

import httpx

Expand Down Expand Up @@ -33,7 +33,7 @@ def create(
self,
*,
end_date: str | NotGiven = NOT_GIVEN,
pay_statements: List[payment_create_params.PayStatement] | NotGiven = NOT_GIVEN,
pay_statements: Iterable[payment_create_params.PayStatement] | NotGiven = NOT_GIVEN,
start_date: 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 @@ -84,7 +84,7 @@ async def create(
self,
*,
end_date: str | NotGiven = NOT_GIVEN,
pay_statements: List[payment_create_params.PayStatement] | NotGiven = NOT_GIVEN,
pay_statements: Iterable[payment_create_params.PayStatement] | NotGiven = NOT_GIVEN,
start_date: 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from __future__ import annotations

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

__all__ = ["IndividualEnrollManyParams", "Individual"]


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


Expand Down
4 changes: 2 additions & 2 deletions src/finch/types/hris/employment_retrieve_many_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from __future__ import annotations

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

__all__ = ["EmploymentRetrieveManyParams", "Request"]


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


Expand Down
4 changes: 2 additions & 2 deletions src/finch/types/hris/individual_retrieve_many_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Optional
from typing import List, Iterable, Optional
from typing_extensions import TypedDict

__all__ = ["IndividualRetrieveManyParams", "Options", "Request"]
Expand All @@ -11,7 +11,7 @@
class IndividualRetrieveManyParams(TypedDict, total=False):
options: Optional[Options]

requests: List[Request]
requests: Iterable[Request]


class Options(TypedDict, total=False):
Expand Down
4 changes: 2 additions & 2 deletions src/finch/types/hris/pay_statement_retrieve_many_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from __future__ import annotations

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

__all__ = ["PayStatementRetrieveManyParams", "Request"]


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


Expand Down
8 changes: 4 additions & 4 deletions src/finch/types/sandbox/company_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import List, Optional
from typing import Iterable, Optional
from typing_extensions import Literal, Required, TypedDict

from ..location_param import LocationParam
Expand All @@ -11,10 +11,10 @@


class CompanyUpdateParams(TypedDict, total=False):
accounts: Required[Optional[List[Account]]]
accounts: Required[Optional[Iterable[Account]]]
"""An array of bank account objects associated with the payroll/HRIS system."""

departments: Required[Optional[List[Optional[Department]]]]
departments: Required[Optional[Iterable[Optional[Department]]]]
"""The array of company departments."""

ein: Required[Optional[str]]
Expand All @@ -26,7 +26,7 @@ class CompanyUpdateParams(TypedDict, total=False):
legal_name: Required[Optional[str]]
"""The legal name of the company."""

locations: Required[Optional[List[Optional[LocationParam]]]]
locations: Required[Optional[Iterable[Optional[LocationParam]]]]

primary_email: Required[Optional[str]]
"""The email of the main administrator on the account."""
Expand Down
Loading